aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2021-02-12 12:13:18 +0000
committerMichael Brown <mcb30@ipxe.org>2021-02-12 12:16:48 +0000
commitdf16df2c857a8f7ab5cc3e76656e4f85c15d4a7a (patch)
tree3e0cb5178a42eccfd89b7ddd13d21c3d16cbe900
parentd79f504c0c390d40de3d27546ab27bc44b03516c (diff)
downloadipxe-df16df2c857a8f7ab5cc3e76656e4f85c15d4a7a.zip
ipxe-df16df2c857a8f7ab5cc3e76656e4f85c15d4a7a.tar.gz
ipxe-df16df2c857a8f7ab5cc3e76656e4f85c15d4a7a.tar.bz2
[build] Report detailed errors when unable to find a usable mkisofs
As of commit 7c3d186 ("[build] Check that mkisofs equivalent supports the required options"), we may refuse to use a mkisofs equivalent if it does not support the options required to produce the requested output file. This can result in confusing error messages since the user is unaware of the reason for which the installed mkisofs or genisoimage has been rejected. Fix by explicitly reporting the reason why each possible mkisofs equivalent could not be used. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rwxr-xr-xsrc/util/genfsimg20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/util/genfsimg b/src/util/genfsimg
index 419c3f8..c3123f3 100755
--- a/src/util/genfsimg
+++ b/src/util/genfsimg
@@ -268,13 +268,27 @@ fi
#
if [ -n "${ISOIMG}" ] ; then
MKISOFS=
+ MKISOFS_MISSING=
+ MKISOFS_NOTSUP=
for CMD in genisoimage mkisofs xorrisofs ; do
- if "${CMD}" ${ISOARGS} --version "${ISODIR}" >/dev/null 2>&1 ; then
- MKISOFS="${CMD}"
- break
+ if ! "${CMD}" --version >/dev/null 2>&1 ; then
+ MKISOFS_MISSING="${MKISOFS_MISSING} ${CMD}"
+ continue
fi
+ if ! "${CMD}" ${ISOARGS} --version "${ISODIR}" >/dev/null 2>&1 ; then
+ MKISOFS_NOTSUP="${MKISOFS_NOTSUP} ${CMD}"
+ continue
+ fi
+ MKISOFS="${CMD}"
+ break
done
if [ -z "${MKISOFS}" ] ; then
+ if [ -n "${MKISOFS_MISSING}" ] ; then
+ echo "${0}:${MKISOFS_MISSING}: not installed" >&2
+ fi
+ if [ -n "${MKISOFS_NOTSUP}" ] ; then
+ echo "${0}:${MKISOFS_NOTSUP}: cannot handle ${ISOARGS}" >&2
+ fi
echo "${0}: cannot find a suitable mkisofs or equivalent" >&2
exit 1
fi