summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2016-08-08 17:37:16 +0800
committerIru Cai <mytbk920423@gmail.com>2016-08-08 18:03:28 +0800
commitec71a228059e65c7c4675485d94540c448f0542c (patch)
tree0ab65f0882abe1b9c826f1a9905cd3b9ac089630
parentdec03d35c56d641778658937d64114df468347bd (diff)
downloadliveusb-builder-ec71a228059e65c7c4675485d94540c448f0542c.tar.xz
buildlive: download all needed iso files before building the live USB
-rwxr-xr-xbuildlive14
-rw-r--r--functions.sh14
2 files changed, 22 insertions, 6 deletions
diff --git a/buildlive b/buildlive
index d5743ed..12eb89e 100755
--- a/buildlive
+++ b/buildlive
@@ -3,6 +3,7 @@
set -e
DISTROLIST=()
+ISOLIST=()
ROOTPATH=
DEVNAME=
KERNELDIR=
@@ -70,15 +71,24 @@ echo "uuid=$UUID" > "$GRUBCFG"
for i in ${DISTROLIST[@]}
do
- process_distro "$i"
+ process_isoinfo "$i"
+ ISOLIST=("${ISOLIST[@]}" "$ISOFILE")
+
if [ -f "isofiles/$ISOFILE" ] && checksum_verify; then
true
else
download_iso
fi
+done
+
+for i in `seq 1 ${#DISTROLIST[@]}`
+do
+ ISOFILE="${ISOLIST[$i-1]}"
+ DISTRO="${DISTROLIST[$i-1]}"
+ process_distro "$DISTRO"
install_live
- cat "distro/$i/grub.cfg" >> "$GRUBCFG"
+ cat "distro/$DISTRO/grub.cfg" >> "$GRUBCFG"
done
if [ "$INSTALL_GRUB" == 1 ]; then
diff --git a/functions.sh b/functions.sh
index 07e3c15..4e97511 100644
--- a/functions.sh
+++ b/functions.sh
@@ -20,17 +20,23 @@ checksum_verify() {
fi
}
-process_distro() {
+process_isoinfo() {
unset MD5 SHA1 SHA256
- source "distro/$1/install.sh"
+ source "distro/$1/isoinfo"
ISOFILE="$(basename $ISOURL)"
+}
+
+process_distro() {
+ source "distro/$1/install.sh"
+ # FIXME
+ # As a workaround, now we set $ISOFILE before using this function.
+ # Maybe we have a better solution for this.
ISOMNT="/media/$ISOFILE"
- MIRRORLIST=(`cat "distro/$1/mirrorlist"`)
}
download_iso() {
mkdir -p isofiles
- for url in ${MIRRORLIST[@]}
+ for url in ${mirrorlist[@]}
do
wget -c -O "isofiles/$ISOFILE" "$url/$ISOURL"
if checksum_verify; then