summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2020-07-08 21:16:23 +0800
committerIru Cai <mytbk920423@gmail.com>2021-03-30 13:08:45 +0800
commit2c36b395ceac26b56872baba3fd86ac17acc43e3 (patch)
tree4492a7f2f0730e453e678b673aa1ab8925ffdc18
parentcf412741681b69a382c4f49481b367195837e2ec (diff)
downloadliveusb-builder-2c36b395ceac26b56872baba3fd86ac17acc43e3.tar.xz
unset INITRD before output GRUB and syslinux entry
Because now the bootloader config generation script is sourced instead of executed, global INITRD variable will be reset more than once, and setting it as a string will only set the first element of the INITRD array. So we need to unset it first.
-rw-r--r--functions.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/functions.sh b/functions.sh
index 452cabb..8f9db5f 100644
--- a/functions.sh
+++ b/functions.sh
@@ -108,6 +108,8 @@ gen_grubcfg() {
fi
for entry in "${allentries[@]}"
do
+ unset INITRD # because it can be an array or just a string
+
source "$entry"
UUID="$UUID" ISOFILE="$ISOFILE" output_grub_entry
done
@@ -124,6 +126,8 @@ meta_gen_grubcfg() {
fi
for entry in "${entries[@]}"
do
+ unset INITRD # because it can be an array or just a string
+
"$entry"
UUID="$UUID" ISOFILE="$ISOFILE" output_grub_entry
done
@@ -139,6 +143,8 @@ meta_gen_syslinux() {
count=0
for entry in "${entries[@]}"
do
+ unset INITRD # because it can be an array or just a string
+
"$entry"
UUID="$UUID" ISOFILE="$ISOFILE" LABEL="${name}_${count}" \
output_syslinux_entry
@@ -153,6 +159,8 @@ gen_syslinux() {
count=0
for entry in "${allentries[@]}"
do
+ unset INITRD # because it can be an array or just a string
+
source "$entry"
UUID="$UUID" ISOFILE="$ISOFILE" LABEL="${name}_${count}" \
output_syslinux_entry