From 7c3d186a1990335ac5d174859a0271a2cfca8196 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 24 Jan 2021 12:15:20 +0000 Subject: [build] Check that mkisofs equivalent supports the required options The "-e" option required for creating EFI boot images is supported only by widely used patched versions of genisoimage. Check that the required options are supported when selecting a mkisofs equivalent, thereby allowing a fallback to the use of xorrisofs when building a UEFI ISO image on a system with an unpatched version of genisoimage. Continue to prefer the use of genisoimage over xorrisofs, since there is apparently no way to inhibit the irritatingly useless startup banner message printed by xorrisofs even when the "-quiet" option is specified. Signed-off-by: Michael Brown --- src/util/genfsimg | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/util/genfsimg b/src/util/genfsimg index b9d5b3f..9fc9b68 100755 --- a/src/util/genfsimg +++ b/src/util/genfsimg @@ -171,23 +171,6 @@ case "${OUTFILE}" in SYSLINUXCFG="${FATDIR}/syslinux.cfg" ;; esac -ISOARGS= - -# Locate required tools -# -if [ -n "${ISOIMG}" ] ; then - MKISOFS= - for CMD in genisoimage mkisofs xorrisofs ; do - if ${CMD} --version >/dev/null 2>/dev/null ; then - MKISOFS="${CMD}" - break - fi - done - if [ -z "${MKISOFS}" ] ; then - echo "${0}: cannot find mkisofs or equivalent" >&2 - exit 1 - fi -fi # Copy files to temporary working directory # @@ -240,6 +223,7 @@ done # since isohybrid will refuse to work without them. # if [ -n "${ISOIMG}" ] ; then + ISOARGS="-J -R" copy_syslinux_file "isolinux.bin" "${ISODIR}" copy_syslinux_file "ldlinux.c32" "${ISODIR}" || true ISOARGS="${ISOARGS} -no-emul-boot -eltorito-boot isolinux.bin" @@ -276,11 +260,22 @@ fi # Create ISO filesystem image, if applicable # if [ -n "${ISOIMG}" ] ; then + MKISOFS= + for CMD in genisoimage mkisofs xorrisofs ; do + if "${CMD}" ${ISOARGS} --version "${ISODIR}" >/dev/null 2>&1 ; then + MKISOFS="${CMD}" + break + fi + done + if [ -z "${MKISOFS}" ] ; then + echo "${0}: cannot find a suitable mkisofs or equivalent" >&2 + exit 1 + fi "${MKISOFS}" -quiet -volid "iPXE" -preparer "iPXE build system" \ -appid "iPXE - Open Source Network Boot Firmware" \ - -publisher "ipxe.org" -sysid "iPXE" -J -R -o "${ISOIMG}" \ + -publisher "ipxe.org" -sysid "iPXE" -o "${ISOIMG}" \ ${ISOARGS} "${ISODIR}" - if isohybrid --version >/dev/null 2>/dev/null ; then + if isohybrid --version >/dev/null 2>&1 ; then isohybrid "${ISOIMG}" fi fi -- cgit v1.1