Annotation of qemu/roms/ipxe/src/util/geniso, revision 1.1.1.1

1.1       root        1: #!/bin/bash
                      2: #
                      3: # Generate a isolinux ISO boot image
                      4: #
                      5: # geniso foo.iso foo.lkrn
                      6: #
                      7: # the ISO image is the first argument so that a list of .lkrn images
                      8: # to include can be specified
                      9: #
                     10: case $# in
                     11: 0|1)
                     12:        echo Usage: $0 foo.iso foo.lkrn ...
                     13:        exit 1
                     14:        ;;
                     15: esac
                     16: 
                     17: # This should be the default location of the isolinux.bin file
                     18: isolinux_bin=${ISOLINUX_BIN:-util/isolinux.bin}
                     19: if [ ! -r $isolinux_bin ]
                     20: then
                     21:        echo $0: $isolinux_bin not found, please install, or set ISOLINUX_BIN in arch/i386/Makefile correctly
                     22:        exit 1
                     23: fi
                     24: 
                     25: # There should either be mkisofs or the compatible genisoimage program
                     26: mkisofs=`which mkisofs genisoimage 2>/dev/null | head -n1`
                     27: if [ -z $mkisofs ]
                     28: then
                     29:        echo $0: mkisofs or genisoimage not found, please install or set PATH
                     30:        exit 1
                     31: fi
                     32: 
                     33: # isohybrid will be used if available
                     34: isohybrid=`which isohybrid 2>/dev/null`
                     35: 
                     36: out=$1
                     37: shift
                     38: dir=`mktemp -d bin/iso.dir.XXXXXX`
                     39: cfg=$dir/isolinux.cfg
                     40: cp -p $isolinux_bin $dir
                     41: cat > $cfg <<EOF
                     42: # These default options can be changed in the geniso script
                     43: SAY iPXE ISO boot image
                     44: TIMEOUT 30
                     45: EOF
                     46: first=
                     47: for f
                     48: do
                     49:        if [ ! -r $f ]
                     50:        then
                     51:                echo $f does not exist, skipping 1>&2
                     52:                continue
                     53:        fi
                     54:        b=$(basename $f)
                     55:        g=${b%.lkrn}
                     56:        g=${g//[^a-z0-9]}.krn
                     57:        case "$first" in
                     58:        "")
                     59:                echo DEFAULT $g
                     60:                ;;
                     61:        esac
                     62:        first=$g
                     63:        echo LABEL $b
                     64:        echo "" KERNEL $g
                     65:        cp -p $f $dir/$g
                     66: done >> $cfg
                     67: $mkisofs -quiet -l -o $out -c boot.cat -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table $dir
                     68: rm -fr $dir
                     69: if [ -n "$isohybrid" ]
                     70: then
                     71:     $isohybrid $out >/dev/null
                     72: fi

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.