diff options
author | Adrian Gibanel Lopez <adrian.gibanel@btactic.com> | 2016-07-30 18:47:56 +0200 |
---|---|---|
committer | Adrian Gibanel Lopez <adrian.gibanel@btactic.com> | 2016-07-31 15:09:13 +0200 |
commit | 9cebad25f98976d9bb0a42fcbf76392a26503d6a (patch) | |
tree | d4bc517acbfa33ff84dd89376e8f4a35ccbdff92 /scripts | |
parent | 58a97219c91183a1ee387cb3e450f911c5b5f183 (diff) | |
download | vyos-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.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/binary_iso | 86 |
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 |