summaryrefslogtreecommitdiff
path: root/scripts/build/binary_grub-pc
diff options
context:
space:
mode:
authorAdrian Gibanel Lopez <adrian.gibanel@btactic.com>2015-08-21 23:54:46 +0200
committerAdrian Gibanel Lopez <adrian.gibanel@btactic.com>2015-08-29 23:56:41 +0200
commitd515ae56842f9420ff4c629eac18904f7beef2e8 (patch)
tree54303ab985d71ee280562b7ed75413c56a63ee93 /scripts/build/binary_grub-pc
parentd43874c405ca468fc72158da6280c6b11755a3e6 (diff)
downloadvyos-live-build-d515ae56842f9420ff4c629eac18904f7beef2e8.tar.gz
vyos-live-build-d515ae56842f9420ff4c629eac18904f7beef2e8.zip
Multi bootloader support
Note: OLDIFS use makes IFS to be reset to "" instead to it being unset. Either we need to detect if old IFS was unset to unset it or we need a proper way of setting it as a local variable. Even more IFS it's not currently used in Check_package (which it's called from: binary_hdd). we should have a clean way of resetting/unsetting IFS when calling Check_package. The other approach it's to explicitly define IFS with its default value in the places inside live-build code where we implicitly suppose that it's going to have its default value.
Diffstat (limited to 'scripts/build/binary_grub-pc')
-rwxr-xr-xscripts/build/binary_grub-pc20
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc
index de2683c79..1eae93a2a 100755
--- a/scripts/build/binary_grub-pc
+++ b/scripts/build/binary_grub-pc
@@ -24,9 +24,23 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
-if [ "${LB_BOOTLOADER}" != "grub-pc" ]
-then
- exit 0
+FOUND_MYSELF=""
+OLDIFS="$IFS"
+IFS=","
+for BOOTLOADER in ${LB_BOOTLOADERS}
+do
+
+ case ${BOOTLOADER} in
+ "grub-pc" )
+ FOUND_MYSELF="True"
+ break ;;
+ esac
+
+done
+IFS="$OLDIFS"
+
+if [ -z ${FOUND_MYSELF} ] ; then
+ exit 0
fi
Echo_message "Begin installing grub-pc..."