Handle multiple bootloaders properly in binary_iso . Force mkisofs to add an additional eltorito entry if we have more than one bootloader.

This commit is contained in:
Adrian Gibanel Lopez 2016-07-30 18:47:56 +02:00
parent 58a97219c9
commit 9cebad25f9
1 changed files with 49 additions and 31 deletions

View File

@ -107,42 +107,60 @@ then
XORRISO_OPTIONS="${XORRISO_OPTIONS} -V \"${LB_ISO_VOLUME}\"" XORRISO_OPTIONS="${XORRISO_OPTIONS} -V \"${LB_ISO_VOLUME}\""
fi fi
# Handle xorriso architecture specific options OLDIFS="$IFS"
case "${LB_PRIMARY_BOOTLOADER}" in IFS=","
grub) BOOTLOADER_NUMBER=0
XORRISO_OPTIONS="${XORRISO_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table" for BOOTLOADER in ${LB_BOOTLOADERS}
XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/grub/stage2_eltorito" do
XORRISO_EXCLUDE="boot/grub/stage2_eltorito" BOOTLOADER_NUMBER=$(expr ${BOOTLOADER_NUMBER} + 1)
;; # Handle xorriso architecture specific options
grub-pc) # If the bootloader number is greater or equal than 2 it means
XORRISO_OPTIONS="${XORRISO_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table" # we are not the first bootloader and thus we need to tell
XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/grub/grub_eltorito -J" # mkisosfs to add an additional eltorito entry
XORRISO_EXCLUDE="boot/grub/grub_eltorito" 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"
;;
syslinux) grub-pc)
case "${LB_MODE}" in XORRISO_OPTIONS="${XORRISO_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
progress-linux) XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/grub/grub_eltorito -J"
XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/boot.bin -c boot/boot.cat" XORRISO_EXCLUDE="boot/grub/grub_eltorito"
XORRISO_EXCLUDE="boot/boot.bin" ;;
;;
*) syslinux)
XORRISO_OPTIONS="${XORRISO_OPTIONS} -b isolinux/isolinux.bin -c isolinux/boot.cat" case "${LB_MODE}" in
XORRISO_EXCLUDE="isolinux/isolinux.bin" progress-linux)
;; XORRISO_OPTIONS="${XORRISO_OPTIONS} -b boot/boot.bin -c boot/boot.cat"
esac XORRISO_EXCLUDE="boot/boot.bin"
;;
XORRISO_OPTIONS="${XORRISO_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table" *)
;; 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" ] #if [ "${LB_DEBIAN_INSTALLER}" != "live" ]
#then #then