Include downloading of LiveISO too

This commit is contained in:
Joshua Boniface 2019-06-14 13:08:43 -04:00
parent 724be9df5c
commit ae6b851f5b
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
# 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 mksquashfs &>/dev/null || fail "This script requires squashfs."
@ -29,10 +30,16 @@ fail() {
}
prepare_iso() {
echo -n "Creating directories... "
echo -n "Creating temporary directories... "
mkdir ${tempdir}/rootfs/ ${tempdir}/installer/ || fail "Error creating temporary directories."
echo "done."
if [[ ! -f ${liveisofile} ]]; then
echo -n "Downloading Debian LiveISO... "
wget -O ${liveisofile} ${liveisourl}
echo "done."
fi
echo -n "Extracting Debian LiveISO files... "
iso_tempdir=$( mktemp -d )
sudo mount ${liveisofile} ${iso_tempdir} &>/dev/null || fail "Error mounting LiveISO file."