2005-03-08 18:53:11 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Generate a isolinux ISO boot image
|
|
|
|
#
|
2007-07-06 12:04:06 +00:00
|
|
|
# geniso foo.iso foo.lkrn
|
2005-03-08 18:53:11 +00:00
|
|
|
#
|
2007-07-06 12:04:06 +00:00
|
|
|
# the ISO image is the first argument so that a list of .lkrn images
|
2005-03-08 18:53:11 +00:00
|
|
|
# to include can be specified
|
|
|
|
#
|
|
|
|
case $# in
|
|
|
|
0|1)
|
2007-07-06 12:04:06 +00:00
|
|
|
echo Usage: $0 foo.iso foo.lkrn ...
|
2005-03-08 18:53:11 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
# This should be the default location of the isolinux.bin file
|
|
|
|
isolinux_bin=${ISOLINUX_BIN:-util/isolinux.bin}
|
|
|
|
if [ ! -r $isolinux_bin ]
|
|
|
|
then
|
|
|
|
echo $0: $isolinux_bin not found, please install, or set ISOLINUX_BIN in arch/i386/config correctly
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
out=$1
|
|
|
|
shift
|
|
|
|
dir=bin/iso.dir
|
|
|
|
mkdir -p $dir
|
|
|
|
cfg=$dir/isolinux.cfg
|
|
|
|
cp -p $isolinux_bin $dir
|
|
|
|
cat > $cfg <<EOF
|
|
|
|
# These default options can be changed in the geniso script
|
|
|
|
SAY Etherboot ISO boot image generated by geniso
|
|
|
|
TIMEOUT 30
|
|
|
|
EOF
|
|
|
|
first=
|
|
|
|
for f
|
|
|
|
do
|
|
|
|
if [ ! -r $f ]
|
|
|
|
then
|
|
|
|
echo $f does not exist, skipping 1>&2
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
b=$(basename $f)
|
2007-07-06 12:04:06 +00:00
|
|
|
g=${b%.lkrn}
|
|
|
|
g=${g//[^a-z0-9]}.krn
|
2005-03-08 18:53:11 +00:00
|
|
|
case "$first" in
|
|
|
|
"")
|
|
|
|
echo DEFAULT $g
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
first=$g
|
|
|
|
echo LABEL $b
|
|
|
|
echo "" KERNEL $g
|
|
|
|
cp -p $f $dir/$g
|
|
|
|
done >> $cfg
|
|
|
|
mkisofs -l -o $out -c boot.cat -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table $dir
|
|
|
|
rm -fr $dir
|