From ae6b851f5b4b21215c17d59db86556495c1ee1c4 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 14 Jun 2019 13:08:43 -0400 Subject: [PATCH] Include downloading of LiveISO too --- buildiso.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/buildiso.sh b/buildiso.sh index e7c9042..90aa53b 100755 --- a/buildiso.sh +++ b/buildiso.sh @@ -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."