diff options
author | Adrian Gibanel Lopez <adrian.gibanel@btactic.com> | 2016-01-18 03:07:48 +0000 |
---|---|---|
committer | Adrian Gibanel Lopez <adrian.gibanel@btactic.com> | 2016-07-31 15:08:11 +0200 |
commit | 9d1a983cc8fe12966d1a2c24a6ee0cfb419b3ce5 (patch) | |
tree | 1c11f9966417b1d915baf8b264fb497dd82d4666 /scripts/build/binary_hdd | |
parent | 0624064d44ed811aec5c43fabfd7b928688ed8e1 (diff) | |
download | vyos-live-build-9d1a983cc8fe12966d1a2c24a6ee0cfb419b3ce5.tar.gz vyos-live-build-9d1a983cc8fe12966d1a2c24a6ee0cfb419b3ce5.zip |
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.
Diffstat (limited to 'scripts/build/binary_hdd')
-rwxr-xr-x | scripts/build/binary_hdd | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd index b45b2a900..400403c0a 100755 --- a/scripts/build/binary_hdd +++ b/scripts/build/binary_hdd @@ -67,7 +67,7 @@ do esac done -case ${LB_PRIMARY_BOOTLOADER} in +case ${LB_FIRST_BOOTLOADER} in syslinux) case ${LB_BINARY_FILESYSTEM} in fat*|ntfs) @@ -182,7 +182,7 @@ case "${LB_BUILD_WITH_CHROOT}" in Chroot chroot "parted -s ${FREELO} set 1 boot on" || true Chroot chroot "parted -s ${FREELO} set 1 lba off" || true - if [ "${LB_PRIMARY_BOOTLOADER}" = "syslinux" ] + if [ "${LB_FIRST_BOOTLOADER}" = "syslinux" ] then dd if=chroot/usr/lib/$(echo ${_BOOTLOADER} | tr [a-z] [A-Z])/mbr.bin of=${FREELO} bs=440 count=1 fi @@ -202,7 +202,7 @@ case "${LB_BUILD_WITH_CHROOT}" in parted -s "${FREELO}" set 1 boot on || true parted -s "${FREELO}" set 1 lba off || true - if [ "${LB_PRIMARY_BOOTLOADER}" = "syslinux" ] + if [ "${LB_FIRST_BOOTLOADER}" = "syslinux" ] then dd if=/usr/lib/$(echo ${_BOOTLOADER} | tr [a-z] [A-Z])/mbr.bin of=${FREELO} bs=440 count=1 fi @@ -268,7 +268,7 @@ cp -T ${CP_OPTIONS} binary/ chroot/binary.tmp FIXME() { -if [ "${LB_PRIMARY_BOOTLOADER}" = "grub" ] +if [ "${LB_FIRST_BOOTLOADER}" = "grub" ] then cat > chroot/grub.sh << EOF |