Include downloading of LiveISO too

This commit is contained in:
Joshua Boniface 2023-09-01 15:41:53 -04:00
parent 422fb3cdcd
commit c7b3dfff4c
1 changed files with 9 additions and 2 deletions

View File

@ -7,7 +7,8 @@
# using a standard Debian intaller ISO. The end system is suitable # using a standard Debian intaller ISO. The end system is suitable
# for immediate bootstrapping with the PVC Ansible roles. # for immediate bootstrapping with the PVC Ansible roles.
liveisofile="$( pwd )/debian-live-buster-DI-rc1-amd64-standard.iso" liveisofile="debian-live-buster-DI-rc1-amd64-standard.iso"
liveisourl="https://cdimage.debian.org/mirror/cdimage/buster_di_rc1-live/amd64/iso-hybrid/${liveisofile}"
which debootstrap &>/dev/null || fail "This script requires debootstrap." which debootstrap &>/dev/null || fail "This script requires debootstrap."
which mksquashfs &>/dev/null || fail "This script requires squashfs." which mksquashfs &>/dev/null || fail "This script requires squashfs."
@ -29,10 +30,16 @@ fail() {
} }
prepare_iso() { prepare_iso() {
echo -n "Creating directories... " echo -n "Creating temporary directories... "
mkdir ${tempdir}/rootfs/ ${tempdir}/installer/ || fail "Error creating temporary directories." mkdir ${tempdir}/rootfs/ ${tempdir}/installer/ || fail "Error creating temporary directories."
echo "done." echo "done."
if [[ ! -f ${liveisofile} ]]; then
echo -n "Downloading Debian LiveISO... "
wget -O ${liveisofile} ${liveisourl}
echo "done."
fi
echo -n "Extracting Debian LiveISO files... " echo -n "Extracting Debian LiveISO files... "
iso_tempdir=$( mktemp -d ) iso_tempdir=$( mktemp -d )
sudo mount ${liveisofile} ${iso_tempdir} &>/dev/null || fail "Error mounting LiveISO file." sudo mount ${liveisofile} ${iso_tempdir} &>/dev/null || fail "Error mounting LiveISO file."