aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/util/genliso
diff options
context:
space:
mode:
Diffstat (limited to 'gpxe/src/util/genliso')
-rwxr-xr-xgpxe/src/util/genliso51
1 files changed, 20 insertions, 31 deletions
diff --git a/gpxe/src/util/genliso b/gpxe/src/util/genliso
index 0a67eb3c..1f1c1168 100755
--- a/gpxe/src/util/genliso
+++ b/gpxe/src/util/genliso
@@ -2,51 +2,42 @@
#
# Generate a legacy floppy emulation ISO boot image
#
-# genliso foo.liso foo.lkrn
+# genliso foo.liso foo.lkrn bar.lkrn ...
#
-# the ISO image is the first argument so that a list of .lkrn images
-# to include can be specified
-#
-case $0 in
-*genliso)
- ;;
-*genfdimg)
- genfdimg=1
- ;;
-esac
+# The .liso image filename is the first argument followed by
+# a list of .lkrn images include in .liso image
+
case $# in
0|1)
echo Usage: $0 foo.liso foo.lkrn ...
exit 1
;;
esac
+
case "`mtools -V`" in
-Mtools\ version\ 3.9.9*|Mtools\ version\ 3.9.1[0-9]*|Mtools\ version\ 4.*)
+Mtools\ version\ 3.9.9*|Mtools\ version\ 3.9.1[0-9]*|[mM]tools\ *\ [4-9].*)
;;
*)
echo Mtools version 3.9.9 or later is required
exit 1
;;
esac
+
out=$1
shift
-dir=bin/liso.dir
-mkdir -p $dir
-case "$genfdimg" in
-1)
- img=$out
- ;;
-*)
- img=$dir/boot.img
- ;;
-esac
+
+dir=`mktemp -d bin/liso.dir.XXXXXX`
+
+img=$dir/boot.img
mformat -f 1440 -C -i $img ::
-cfg=bin/syslinux.cfg
+
+cfg=$dir/syslinux.cfg
cat > $cfg <<EOF
# These default options can be changed in the genliso script
-SAY Etherboot ISO boot image generated by genliso
+SAY gPXE ISO boot image generated by genliso
TIMEOUT 30
EOF
+
first=
for f
do
@@ -70,16 +61,14 @@ do
echo "" KERNEL $g
mcopy -m -i $img $f ::$g
done >> $cfg
+
mcopy -i $img $cfg ::syslinux.cfg
+
if ! syslinux $img
then
exit 1
fi
-case "$genfdimg" in
-1)
- ;;
-*)
- mkisofs -o $out -c boot.cat -b boot.img $dir
- ;;
-esac
+
+mkisofs -q -o $out -c boot.cat -b boot.img $dir
+
rm -fr $dir