don't cache all archboot depends to safe space for -latest-install

This commit is contained in:
Tobias Powalowski 2022-02-02 23:55:52 +01:00
parent a5de88f6a1
commit f77c05cf16
2 changed files with 9 additions and 2 deletions

View file

@ -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

View file

@ -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"