summaryrefslogtreecommitdiff
path: root/scripts/build/binary_hdd
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-05-04 16:12:45 +0100
committerLyndon Brown <jnqnfe@gmail.com>2020-05-04 21:40:13 +0100
commitd7883ec32b2bb907fce17fb759c08c5cd9851fc3 (patch)
tree94b2294140e7c902a33e0262aa6adf5a1d07b98e /scripts/build/binary_hdd
parent3f840aeeba982a858a881271a3bb48bca5b50dd8 (diff)
downloadvyos-live-build-d7883ec32b2bb907fce17fb759c08c5cd9851fc3.tar.gz
vyos-live-build-d7883ec32b2bb907fce17fb759c08c5cd9851fc3.zip
config: improve BIOS/EFI bootloader selection handling
the design choice from when EFI support was introduced was to change `--bootloader` to `--bootloaders`, with users specifying their selection of BIOS and EFI bootloaders together. at this time there were not even any decent validation checks being performed, and invalid combinations could cause some chaos. since then proper validation was put in place, including checking that only a single instance of each of BIOS and EFI bootloaders exists in the selection. here we tweak things such that we stick with the same option, but we split the selection up such that we store the BIOS and EFI selections separately within the saved config file, and offer it up to scripts to help simplify those scripts. we must however retain support for splitting from the combined option, both because we still use it in the combined option, and for backwards compatibility with older saved configs. Gbp-Dch: Short
Diffstat (limited to 'scripts/build/binary_hdd')
-rwxr-xr-xscripts/build/binary_hdd21
1 files changed, 7 insertions, 14 deletions
diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd
index beaff873d..c6aeedb15 100755
--- a/scripts/build/binary_hdd
+++ b/scripts/build/binary_hdd
@@ -52,15 +52,11 @@ Check_package chroot /sbin/parted parted
Check_package host /sbin/fdisk fdisk
Check_package host /sbin/losetup mount
-for BOOTLOADER in ${LB_BOOTLOADERS}; do
- case "${BOOTLOADER}" in
- grub-legacy)
- Check_package chroot /usr/sbin/grub grub
- ;;
- esac
-done
+case "${LB_BOOTLOADER_BIOS}" in
+ grub-legacy)
+ Check_package chroot /usr/sbin/grub grub
+ ;;
-case ${LB_FIRST_BOOTLOADER} in
syslinux)
case ${LB_BINARY_FILESYSTEM} in
fat*|ntfs)
@@ -189,8 +185,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_FIRST_BOOTLOADER}" = "syslinux" ]
- then
+ if [ "${LB_BOOTLOADER_BIOS}" = "syslinux" ]; then
dd if=chroot/usr/lib/$(echo ${_BOOTLOADER} | tr [a-z] [A-Z])/mbr.bin of=${FREELO} bs=440 count=1
fi
;;
@@ -209,8 +204,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_FIRST_BOOTLOADER}" = "syslinux" ]
- then
+ if [ "${LB_BOOTLOADER_BIOS}" = "syslinux" ]; then
dd if=/usr/lib/$(echo ${_BOOTLOADER} | tr [a-z] [A-Z])/mbr.bin of=${FREELO} bs=440 count=1
fi
;;
@@ -275,8 +269,7 @@ cp -T ${CP_OPTIONS} binary/ chroot/binary.tmp
FIXME()
{
-if [ "${LB_FIRST_BOOTLOADER}" = "grub-legacy" ]
-then
+if [ "${LB_BOOTLOADER_BIOS}" = "grub-legacy" ]; then
cat > chroot/grub.sh << EOF
#!/bin/sh