+# efi boot {{{
+ # default, independent of UEFI support
+ BOOT_ARGS="-no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat"
+ UEFI_ENABLE=false
+
+ case "$MKISOFS" in
+ xorriso*)
+ echo "Using xorriso for ISO generation."
+ if ! dpkg --compare-versions $(dpkg-query -W -f='${Version}\n' xorriso 2>/dev/null) gt-nl 1.1.6-1 ; then
+ echo "Disabling (U)EFI boot support since xorriso version is not recent enough."
+ else
+ echo "xorriso with -eltorito-alt-boot support present"
+ UEFI_ENABLE=true
+
+ if ! [ -r "${WRKDIR}/cddir/boot/efi.img" ] ; then
+ echo "Warning: File /boot/efi.img not found, not extending boot arguments for (U)EFI boot."
+ UEFI_ENABLE=false
+ else
+ echo "/boot/efi.img found, extending boot arguments for (U)EFI boot."
+ if ! [ -r /usr/lib/ISOLINUX/isohdpfx.bin ] ; then
+ echo "Error: /usr/lib/ISOLINUX/isohdpfx.bin not available, required for xorriso/isohybrid though." >&2
+ echo "Hint: make sure isolinux is installed." >&2
+ exit 1
+ else
+ BOOT_ARGS+=" -boot-info-table -eltorito-alt-boot -e boot/efi.img -no-emul-boot"
+ BOOT_ARGS+=" -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -eltorito-alt-boot -e boot/efi.img -no-emul-boot -isohybrid-gpt-basdat -no-pad"
+ fi
+ fi
+ fi
+ ;;
+ *)
+ echo "Using $MKISOFS for ISO generation (lacking UEFI option), disabling (U)EFI boot support."
+ ;;
+ esac
+# }}}
+
+# adjust ISO for small output if necessary {{{