From 2c36b395ceac26b56872baba3fd86ac17acc43e3 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Wed, 8 Jul 2020 21:16:23 +0800 Subject: 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. --- functions.sh | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.2.3