diff options
author | Iru Cai <mytbk920423@gmail.com> | 2020-07-08 21:16:23 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2021-03-30 13:08:45 +0800 |
commit | 2c36b395ceac26b56872baba3fd86ac17acc43e3 (patch) | |
tree | 4492a7f2f0730e453e678b673aa1ab8925ffdc18 | |
parent | cf412741681b69a382c4f49481b367195837e2ec (diff) | |
download | liveusb-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.sh | 8 |
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 |