From f77c05cf164d5f2e867cd0d10095dbb3ef3f3290 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Wed, 2 Feb 2022 23:55:52 +0100 Subject: [PATCH] don't cache all archboot depends to safe space for -latest-install --- usr/bin/archboot-update-installer.sh | 2 +- usr/bin/archboot-x86_64-create-container.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/usr/bin/archboot-update-installer.sh b/usr/bin/archboot-update-installer.sh index 8cf3e55bd..1135a22b5 100755 --- a/usr/bin/archboot-update-installer.sh +++ b/usr/bin/archboot-update-installer.sh @@ -91,7 +91,7 @@ if [[ "${_L_COMPLETE}" == "1" || "${_L_INSTALL_COMPLETE}" == "1" ]]; then cp "${_W_DIR}"/usr/lib/initcpio/functions "${_W_DIR}"/usr/lib/initcpio/functions.old cp "${_W_DIR}"/usr/share/archboot/patches/31-initcpio.functions.fixed "${_W_DIR}"/usr/lib/initcpio/functions # switch compression - systemd-nspawn -D "${_W_DIR}" /bin/bash -c "rm /var/cache/pacman/pkg/archboot-*; umount /tmp;sed -i -e 's#zstd#lzma#g' ${_CONFIG}; mkinitcpio -c ${_CONFIG} -g /tmp/initrd.img; mv /tmp/initrd.img /" >/dev/tty7 2>&1 || exit 1 + systemd-nspawn -D "${_W_DIR}" /bin/bash -c "rm /var/cache/pacman/pkg/archboot-*; umount /tmp; mkinitcpio -c ${_CONFIG} -g /tmp/initrd.img; mv /tmp/initrd.img /" >/dev/tty7 2>&1 || exit 1 mv "${_W_DIR}"/usr/lib/initcpio/functions.old "${_W_DIR}"/usr/lib/initcpio/functions echo "Step 4/6: Moving initramfs files from ${_W_DIR} to / ..." mv "${_W_DIR}"/initrd.img / || exit 1 diff --git a/usr/bin/archboot-x86_64-create-container.sh b/usr/bin/archboot-x86_64-create-container.sh index 9d073f77b..5109986c1 100755 --- a/usr/bin/archboot-x86_64-create-container.sh +++ b/usr/bin/archboot-x86_64-create-container.sh @@ -58,7 +58,14 @@ mount devpts "${_DIR}/dev/pts" -t devpts -o mode=0620,gid=5,nosuid,noexec mount shm "${_DIR}/dev/shm" -t tmpfs -o mode=1777,nosuid,nodev # install archboot echo "Installing packages base firmware and archboot to ${_DIR} ..." -pacman --root "${_DIR}" -Sy base archboot "${_LINUX_FIRMWARE}" --ignore systemd-resolvconf --noconfirm --cachedir "${_PWD}"/"${_CACHEDIR}" >/dev/null 2>&1 +pacman --root "${_DIR}" -Sy base linux "${_LINUX_FIRMWARE}" --ignore systemd-resolvconf --noconfirm --cachedir "${_PWD}"/"${_CACHEDIR}" >/dev/null 2>&1 +echo "Installing archboot to ${_DIR} ..." +pacman --root "${_DIR}" -Sy archboot --ignore systemd-resolvconf --noconfirm >/dev/null 2>&1 +# Clean cache on archboot environment +if [[ "$(cat /etc/hostname)" == "archboot" ]]; then + echo "Cleaning /var/cache/pacman/pkg ..." + rm -r /var/cache/pacman/pkg +fi # umount special filesystems echo "Umount special filesystems in to ${_DIR} ..." umount -R "${_DIR}/proc"