'genisoimage and UEFI

How can I create UEFI ISO image on Debian Jessie machine?

When I use follow command on my Kubuntu everything is OK

genisoimage -quiet -V "my-amd64" -J -R -r -l -cache-inodes -c isolinux/boot.cat  -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -o my-amd64.iso my-amd64/

isohybrid --uefi my-amd64.iso

But when I run this command on Debian Jessie I get follow error:

genisoimage: option '-e' is ambiguous; possibilities: '--eltorito-boot' '--exchange' '--ethershare' '--exclude-list' '--exclude' '--eltorito-catalog' '--eltorito-alt-boot'
Usage: genisoimage [options] -o file directory ...

It seems as genisoimage on Kubuntu (15.04) and Debian Jessie does not have same options. On Debian genisomage does not support UEFI.

Version on both system is same: genisoimage 1.1.11

But I must create ISO image on Debian Jessie. Any workaround for this?



Solution 1:[1]

Apparently there was an incompatible change in Mondo or genisoimage. The problem was reported, but the provided wrapper-workaround got a bit mangled by the wiki. Using a wrapper solves the problem for everything depending on that syntax.

Here's what I did:

Prepare the wrapper:

mv /usr/bin/genisoimage /usr/bin/genisoimage.dist
YourFavoriteTextEditor /usr/bin/genisoimage

Copy/paste the wrapper:

#!/bin/bash

options=() # the buffer array for the parameters

while [[ $1 ]]
do
  case "$1" in
   -e)
     options+=("--eltorito-boot")
     shift
     ;;
   *)
     options+=("$1")
     shift
     ;;
  esac
done

echo Calling genisoimage.dist "${options[@]}"
eval exec /usr/bin/genisoimage.dist "${options[@]}"

Make wrapper executable:

chmod 755 /usr/bin/genisoimage

Live happily ever after. :-)

Solution 2:[2]

If you do an apt source genisoimage on an Ubuntu machine and look in the diff you'll find that they have a significant patch set added to cdrkit to get this capability. You could try to backport the changes. Or you could use xorriso which seems to have this capability if you have syslinux-utils installed for the files. The command would then be.

xorriso -as mkisofs \
  -o <output> \
  -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \
  -c isolinux/boot.cat \
  -b isolinux/isolinux.bin \
   -no-emul-boot -boot-load-size 4 -boot-info-table \
  -eltorito-alt-boot \
  -e isolinux/efiboot.img \
   -no-emul-boot \
   -isohybrid-gpt-basdat \
   -r -J \
   <CD_root>

Solution 3:[3]

You can install xorriso and replace genisoimage with xorrisofs in your script. It'll accept the same command line parameters.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 davolfman
Solution 3 Karsten