summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Gibanel Lopez <adrian.gibanel@btactic.com>2016-07-30 18:47:56 +0200
committerAdrian Gibanel Lopez <adrian.gibanel@btactic.com>2016-07-31 15:09:13 +0200
commit9cebad25f98976d9bb0a42fcbf76392a26503d6a (patch)
treed4bc517acbfa33ff84dd89376e8f4a35ccbdff92
parent58a97219c91183a1ee387cb3e450f911c5b5f183 (diff)
downloadvyos-live-build-9cebad25f98976d9bb0a42fcbf76392a26503d6a.tar.gz
vyos-live-build-9cebad25f98976d9bb0a42fcbf76392a26503d6a.zip
Handle multiple bootloaders properly in binary_iso . Force mkisofs to add an additional eltorito entry if we have more than one bootloader.
-rwxr-xr-xscripts/build/binary_iso86
1 files changed, 52 insertions, 34 deletions
diff --git a/scripts/build/binary_iso b/scripts/build/binary_iso
index a390f61a4..c063c703a 100755
--- a/scripts/build/binary_iso
+++ b/scripts/build/binary_iso
@@ -107,42 +107,60 @@ then
XORRISO_OPTIONS="${XORRISO_OPTIONS} -V \"${LB_ISO_VOLUME}\""
fi
-# Handle xorriso architecture specific options
-case "${LB_PRIMARY_BOOTLOADER}" in
- grub)
- XORRISO_OPTIONS="${XORRISO_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
- XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/grub/stage2_eltorito"
- XORRISO_EXCLUDE="boot/grub/stage2_eltorito"
- ;;
-
- grub-pc)
- XORRISO_OPTIONS="${XORRISO_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
- XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/grub/grub_eltorito -J"
- XORRISO_EXCLUDE="boot/grub/grub_eltorito"
- ;;
-
- syslinux)
- case "${LB_MODE}" in
- progress-linux)
- XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/boot.bin -c boot/boot.cat"
- XORRISO_EXCLUDE="boot/boot.bin"
- ;;
-
- *)
- XORRISO_OPTIONS="${XORRISO_OPTIONS} -b isolinux/isolinux.bin -c isolinux/boot.cat"
- XORRISO_EXCLUDE="isolinux/isolinux.bin"
- ;;
- esac
+OLDIFS="$IFS"
+IFS=","
+BOOTLOADER_NUMBER=0
+for BOOTLOADER in ${LB_BOOTLOADERS}
+do
+ BOOTLOADER_NUMBER=$(expr ${BOOTLOADER_NUMBER} + 1)
+ # Handle xorriso architecture specific options
- XORRISO_OPTIONS="${XORRISO_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
- ;;
+ # If the bootloader number is greater or equal than 2 it means
+ # we are not the first bootloader and thus we need to tell
+ # mkisosfs to add an additional eltorito entry
+ if [ ${BOOTLOADER_NUMBER} -ge 2 ]
+ then
+ XORRISO_OPTIONS="${XORRISO_OPTIONS} -eltorito-alt-boot "
+ fi
+ case "${BOOTLOADER}" in
+ grub)
+ XORRISO_OPTIONS="${XORRISO_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
+ XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/grub/stage2_eltorito"
+ XORRISO_EXCLUDE="boot/grub/stage2_eltorito"
+ ;;
+
+ grub-pc)
+ XORRISO_OPTIONS="${XORRISO_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
+ XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/grub/grub_eltorito -J"
+ XORRISO_EXCLUDE="boot/grub/grub_eltorito"
+ ;;
+
+ syslinux)
+ case "${LB_MODE}" in
+ progress-linux)
+ XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/boot.bin -c boot/boot.cat"
+ XORRISO_EXCLUDE="boot/boot.bin"
+ ;;
+
+ *)
+ XORRISO_OPTIONS="${XORRISO_OPTIONS} -b isolinux/isolinux.bin -c isolinux/boot.cat"
+ XORRISO_EXCLUDE="isolinux/isolinux.bin"
+ ;;
+ esac
+
+ XORRISO_OPTIONS="${XORRISO_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
+ ;;
+
+
+ *)
+ Echo_warning "Bootloader on your architecture not yet supported by live-build."
+ Echo_warning "This will produce a most likely not bootable image (Continuing in 5 seconds)."
+ sleep 5
+ ;;
+ esac
- *)
- Echo_warning "Bootloader on your architecture not yet supported by live-build."
- Echo_warning "This will produce a most likely not bootable image (Continuing in 5 seconds)."
- sleep 5
- ;;
-esac
+done
+IFS="$OLDIFS"
#if [ "${LB_DEBIAN_INSTALLER}" != "live" ]
#then