From 9d1a983cc8fe12966d1a2c24a6ee0cfb419b3ce5 Mon Sep 17 00:00:00 2001 From: Adrian Gibanel Lopez Date: Mon, 18 Jan 2016 03:07:48 +0000 Subject: Added new multi bootloader helper functions * Added: functions/bootloaders.sh . This file adds bootloader functions that are heavily used in efi scenarios where a bootloader can act as a first or an extra bootloader. Since the introduction of the new switch: --bootloaders you can setup it like this: --bootloaders=syslinux,grub-efi . This means that syslinux is the first bootloader and grub-efi is the extra bootloader. * Added new bootloader functions: Check_Non_First_Bootloader and Check_Non_Extra_Bootloader. These functions let each one of the bootloaders abort the build because they cannot perform a role either as a first bootloader or as an extra bootloader. * Added bootloader functions: Check_First_Bootloader_Role, Check_Extra_Bootloader_Role and Check_Any_Bootloader_Role These functions let bootloaders to force their default role in a single line. At the same time many binary bootloaders were rewritten to make use of the new bootloader role functions explained above. These roles were enforced: binary_grub-legacy : First bootloader binary_grub-pc : Either first or extra bootloader binary_syslinux : Either first or extra bootloader If a bootloader is tried to be used in a role that it's not meant to be used then the build fails because that might lead to a non-bootable system. --- scripts/build/binary_grub-pc | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'scripts/build/binary_grub-pc') diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc index 1eae93a2a..9252f7acf 100755 --- a/scripts/build/binary_grub-pc +++ b/scripts/build/binary_grub-pc @@ -24,24 +24,7 @@ Arguments "${@}" Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source Set_defaults -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 +Check_Any_Bootloader_Role "grub-pc" Echo_message "Begin installing grub-pc..." -- cgit v1.2.3