[ipxe-devel] [PATCH 1/1] allow to build ISO image with EFI support (ipxe.eiso)

Christian Nilsson nikize at gmail.com
Sun Apr 19 11:34:39 UTC 2015


On Sun, Apr 19, 2015 at 1:17 PM, Christian Hesse <list at eworm.de> wrote:
> From: Christian Hesse <mail at eworm.de>
>
> Signed-off-by: Christian Hesse <mail at eworm.de>
> ---
>  src/util/geniso               | 52 +++++++++++++++++++++++++++++++++----------
> -# There should either be mkisofs or the compatible genisoimage program
> -for command in genisoimage mkisofs; do
> -       if ${command} --version >/dev/null 2>/dev/null; then
> -               mkisofs=(${command})
> -               break
> -       fi
> -done
> -
> -if [ -z "${mkisofs}" ]; then
> -       echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2
> +# We need xorriso (from libisoburn) for EFI support, so try that first.
> +if xorriso --version >/dev/null 2>/dev/null; then
> +       mkisofs=(xorriso -as mkisofs)
> +elif [ ${EFI} -eq 1 ]; then
> +       echo "${0}: xorriso not found, but required for EFI support. Please install." >&2
>         exit 1
> +else
> +       # fall back to mkisofs or the compatible genisoimage program
> +       for command in genisoimage mkisofs; do
> +               if ${command} --version >/dev/null 2>/dev/null; then
> +                       mkisofs=(${command})
> +                       break
> +               fi
> +       done
> +
> +       if [ -z "${mkisofs}" ]; then
> +               echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2
> +               exit 1
> +       fi
>  fi
>
>  dir=$(mktemp -d bin/iso.dir.XXXXXX)
> @@ -122,6 +135,21 @@ case "${LEGACY}" in
>                 # copy isolinux bootloader
>                 cp ${ISOLINUX_BIN} ${dir}
>
> +               mkisofs+=(-b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table)
> +
> +               if [ "${EFI}" -eq 1 ]; then
> +                       # generate EFI image
> +                       img=${dir}/efiboot.img
> +
> +                       mformat -f 2880 -C -i ${img} ::
> +                       mmd -i ${img} "::/EFI"
> +                       mmd -i ${img} "::/EFI/BOOT"
> +                       mcopy -m -i ${img} bin-x86_64-efi/ipxe.efi "::EFI/BOOT/BOOTX64.EFI"
> +                       mcopy -m -i ${img} bin-i386-efi/ipxe.efi "::EFI/BOOT/BOOTIA32.EFI"
> +
> +                       mkisofs+=(-eltorito-alt-boot -e efiboot.img -isohybrid-gpt-basdat -no-emul-boot)
> +               fi
> +
>                 # syslinux 6.x needs a file called ldlinux.c32
>                 LDLINUX_C32=$(dirname ${ISOLINUX_BIN})/ldlinux.c32
>                 if [ -s ${LDLINUX_C32} ]; then
> @@ -129,7 +157,7 @@ case "${LEGACY}" in
>                 fi
>
>                 # generate the iso image
> -               "${mkisofs[@]}" -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -output ${OUT} ${dir}
> +               "${mkisofs[@]}" -output ${OUT} ${dir}
>
>                 # isohybrid will be used if available
>                 if isohybrid --version >/dev/null 2>/dev/null; then
> --
> 2.3.5
>

Why is it not possible for mkisofs to be used to create an EFI compatible iso?
It should be enough to have EFI/Boot/boot(ia32|x64).efi in the iso.
If i read it correctly this patch adds the efi files to an emulated
floppy instead of the iso itself?

Regards
Christian Nilsson



More information about the ipxe-devel mailing list