Use local archives dir for debootstrapping

This commit is contained in:
Joshua Boniface 2020-08-16 21:36:39 -04:00 committed by Joshua Boniface
parent ba92f6c569
commit 643375a5d3
1 changed files with 3 additions and 1 deletions

View File

@ -109,12 +109,14 @@ prepare_rootfs() {
echo -n "Preparing Debian live installation via debootstrap... " echo -n "Preparing Debian live installation via debootstrap... "
SQUASHFS_PKGLIST="mdadm,lvm2,parted,gdisk,debootstrap,grub-pc,grub-efi-amd64,linux-image-amd64,sipcalc,live-boot,dosfstools,vim,ca-certificates" SQUASHFS_PKGLIST="mdadm,lvm2,parted,gdisk,debootstrap,grub-pc,grub-efi-amd64,linux-image-amd64,sipcalc,live-boot,dosfstools,vim,ca-certificates"
if [[ ! -d artifacts/debootstrap ]]; then if [[ ! -d artifacts/debootstrap ]]; then
sudo mkdir -p artifacts/debootstrap/var/cache/apt/archives &>/dev/null
sudo mount --bind /var/cache/apt/archives artifacts/debootstrap/var/cache/apt/archives &>/dev/null
sudo /usr/sbin/debootstrap \ sudo /usr/sbin/debootstrap \
--include=${SQUASHFS_PKGLIST} \ --include=${SQUASHFS_PKGLIST} \
buster \ buster \
artifacts/debootstrap/ \ artifacts/debootstrap/ \
http://ftp.ca.debian.org/debian &>debootstrap.log || fail "Error performing debootstrap." http://ftp.ca.debian.org/debian &>debootstrap.log || fail "Error performing debootstrap."
sudo chroot artifacts/debootstrap/ apt clean &>/dev/null || fail "Error cleaning apt cache in debootstrap." sudo umount artifacts/debootstrap/var/cache/apt/archives &>/dev/null
fi fi
sudo rsync -au artifacts/debootstrap/ ${tempdir}/rootfs/ &>/dev/null || fail "Error copying debootstrap to tempdir." sudo rsync -au artifacts/debootstrap/ ${tempdir}/rootfs/ &>/dev/null || fail "Error copying debootstrap to tempdir."
echo "done." echo "done."