aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2021-01-24 12:15:20 +0000
committerMichael Brown <mcb30@ipxe.org>2021-01-24 12:19:48 +0000
commit7c3d186a1990335ac5d174859a0271a2cfca8196 (patch)
treee7da5a0268d7fe015a5d7f35c6222149e5949cb8
parent8ef22d819b688e17d7e20380631caed29acc9d63 (diff)
downloadipxe-7c3d186a1990335ac5d174859a0271a2cfca8196.zip
ipxe-7c3d186a1990335ac5d174859a0271a2cfca8196.tar.gz
ipxe-7c3d186a1990335ac5d174859a0271a2cfca8196.tar.bz2
[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 <mcb30@ipxe.org>
-rwxr-xr-xsrc/util/genfsimg33
1 files 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