don't hardcode packages and actions, move them to defaults

This commit is contained in:
Tobias Powalowski 2022-05-11 14:23:31 +02:00
parent dc0ca7eed6
commit caa6a31042
2 changed files with 13 additions and 10 deletions

View file

@ -1,11 +1,16 @@
# defaults for archboot # defaults for archboot
# packages to install (eg. firmware, kernel packages) # packages to install (eg. firmware, kernel packages)
_PACKAGES="base linux linux-firmware linux-firmware-marvell" _PACKAGES="base linux linux-firmware linux-firmware-marvell"
# Download packages for pacman cache directory
_DOWNLOAD_PACKAGES="xorg chromium xfce4 tigervnc breeze-icons gvfs gvfs-smb thunar-archive-plugin thunar-volman file-roller gparted gnome-keyring nss-mdns mousepad ristretto"
# grub setup # grub setup
_GRUB_CONFIG="/usr/share/archboot/grub/archboot-main-grub.cfg" _GRUB_CONFIG="/usr/share/archboot/grub/archboot-main-grub.cfg"
_GRUB_BACKGROUND="/usr/share/archboot/grub/archboot-background.png" _GRUB_BACKGROUND="/usr/share/archboot/grub/archboot-background.png"
### XFCE defaults
# needed full installed packages in environment for X
_FULL_PACKAGES="llvm-libs gcc-libs perl glibc libtiff glib2 libcups harfbuzz avahi nss p11-kit libp11-kit fuse tpm2-tss libsecret smbclient libcap tevent libbsd libldap tdb ldb libmd jansson libsasl"
# X packages
_X_PACKAGES="xorg chromium xfce4 tigervnc breeze-icons gvfs gvfs-smb thunar-archive-plugin thunar-volman file-roller gparted gnome-keyring nss-mdns mousepad ristretto"
# packages to remove from cache before X startup happens
_X_RM_PACKAGES="xorg xfce4 chromium llvm-libs mesa ffmpeg"
### zram setup ### zram setup
_ZRAM_ALGORITHM="zstd" _ZRAM_ALGORITHM="zstd"
# size for --latest and --latest-install option # size for --latest and --latest-install option

View file

@ -239,16 +239,15 @@ _cleanup_xfce() {
_launch_xfce() { _launch_xfce() {
# fix libs first, then install packages from defaults # fix libs first, then install packages from defaults
X_PACKAGES="llvm-libs gcc-libs perl glibc libtiff glib2 libcups harfbuzz \ _XORG="${_FULL_PACKAGES} ${_X_PACKAGES}"
avahi nss p11-kit libp11-kit fuse tpm2-tss libsecret smbclient libcap tevent libbsd libldap tdb ldb \ # saving RAM by calling always cleanup hook and installing each package alone
libmd jansson libsasl ${_DOWNLOAD_PACKAGES}"
# try to save RAM by calling the cleanup hook and installing each package alone
if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then if [[ -e /var/cache/pacman/pkg/archboot.db ]]; then
echo "Install packages ..." echo "Install packages ..."
_INSTALL_SOURCE="file:///var/cache/pacman/pkg" _INSTALL_SOURCE="file:///var/cache/pacman/pkg"
_create_pacman_conf _create_pacman_conf
#shellcheck disable=SC2086
pacman -Sy --config ${_PACMAN_CONF} pacman -Sy --config ${_PACMAN_CONF}
for i in ${X_PACKAGES}; do for i in ${_XORG}; do
#shellcheck disable=SC2086 #shellcheck disable=SC2086
pacman -S ${i} --config ${_PACMAN_CONF} --noconfirm || exit 1 pacman -S ${i} --config ${_PACMAN_CONF} --noconfirm || exit 1
_cleanup_xfce _cleanup_xfce
@ -258,15 +257,14 @@ _launch_xfce() {
pacman -Syu --ignore linux --ignore linux-firmware --ignore linux-firmware-marvell --noconfirm || exit 1 pacman -Syu --ignore linux --ignore linux-firmware --ignore linux-firmware-marvell --noconfirm || exit 1
_cleanup_xfce _cleanup_xfce
echo "Install packages ..." echo "Install packages ..."
for i in ${X_PACKAGES}; do for i in ${_XORG}; do
#shellcheck disable=SC2086 #shellcheck disable=SC2086
pacman -S ${i} --noconfirm || exit 1 pacman -S ${i} --noconfirm || exit 1
_cleanup_xfce _cleanup_xfce
done done
fi fi
# remove installed packages # remove installed packages
_RM_PACKAGE="xorg xfce4 chromium llvm-libs mesa ffmpeg" for i in ${_X_RM_PACKAGES}; do
for i in ${_RM_PACKAGE}; do
rm -f /var/cache/pacman/pkg/"${i}"-* rm -f /var/cache/pacman/pkg/"${i}"-*
done done
# remove firmware # remove firmware