summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2016-09-15 09:47:19 +0800
committerIru Cai <mytbk920423@gmail.com>2016-09-20 09:33:07 +0800
commita62477a2853138b16a15a3b6ccc34c92ce37c29c (patch)
tree93fb4c05548c70ca35c0a1e9a8ff6ce5cd7c1e3c
parent3c50c02d4349bffe5b0ea031b6c30dc2293aa388 (diff)
downloadliveusb-builder-a62477a2853138b16a15a3b6ccc34c92ce37c29c.tar.xz
submenu for ISOs that have multiple entries
-rwxr-xr-xbuildlive2
-rw-r--r--functions.sh15
2 files changed, 15 insertions, 2 deletions
diff --git a/buildlive b/buildlive
index e07663c..e75f2e9 100755
--- a/buildlive
+++ b/buildlive
@@ -86,6 +86,7 @@ for i in ${DISTROLIST[@]}
do
process_isoinfo "$i"
ISOLIST=("${ISOLIST[@]}" "$ISOFILE")
+ ISONAMELIST=("${ISONAMELIST[@]}" "$ISONAME")
if [ -f "isofiles/$ISOFILE" ] && checksum_verify; then
true
@@ -115,6 +116,7 @@ fi
for i in `seq 1 ${#DISTROLIST[@]}`
do
ISOFILE="${ISOLIST[$i-1]}"
+ ISONAME="${ISONAMELIST[$i-1]}"
DISTRO="${DISTROLIST[$i-1]}"
process_distro "$DISTRO"
diff --git a/functions.sh b/functions.sh
index 664aa24..c533e07 100644
--- a/functions.sh
+++ b/functions.sh
@@ -23,8 +23,12 @@ checksum_verify() {
fi
}
+# process_isoinfo <iso, e.g. mint/64/xfce>
+# loads $DISTRONAME $ISONAME $ISOFILE $ISOURL
process_isoinfo() {
unset MD5 SHA1 SHA256 SHA512
+ _distrobase="distro/$(cut -d'/' -f1 <<< "$1")"
+ source "$_distrobase/distroinfo"
source "distro/$1/isoinfo"
ISOFILE="$(basename $ISOURL)"
}
@@ -38,11 +42,18 @@ process_distro() {
}
gen_grubcfg() {
- local entry
- for entry in "distro/$1/entry"*
+ local entry allentries
+ allentries=("distro/$1/entry"*)
+ if [ ${#allentries[@]} -gt 1 ]; then
+ echo "submenu '$ISONAME' {"
+ fi
+ for entry in "${allentries[@]}"
do
UUID="$UUID" ISOFILE="$ISOFILE" ./mkgrubcfg.sh "$entry"
done
+ if [ ${#allentries[@]} -gt 1 ]; then
+ echo '}'
+ fi
}
download_iso() {