[e1000] Use PCI_BASE_ADDRESS_* symbols instead of integers
[gpxe.git] / src / util / genliso
blob0a67eb3ccf4cb205da77ce86bdca85200ca76ec7
1 #!/bin/bash
3 # Generate a legacy floppy emulation ISO boot image
5 # genliso foo.liso foo.lkrn
7 # the ISO image is the first argument so that a list of .lkrn images
8 # to include can be specified
10 case $0 in
11 *genliso)
13 *genfdimg)
14 genfdimg=1
16 esac
17 case $# in
18 0|1)
19 echo Usage: $0 foo.liso foo.lkrn ...
20 exit 1
22 esac
23 case "`mtools -V`" in
24 Mtools\ version\ 3.9.9*|Mtools\ version\ 3.9.1[0-9]*|Mtools\ version\ 4.*)
27 echo Mtools version 3.9.9 or later is required
28 exit 1
30 esac
31 out=$1
32 shift
33 dir=bin/liso.dir
34 mkdir -p $dir
35 case "$genfdimg" in
37 img=$out
40 img=$dir/boot.img
42 esac
43 mformat -f 1440 -C -i $img ::
44 cfg=bin/syslinux.cfg
45 cat > $cfg <<EOF
46 # These default options can be changed in the genliso script
47 SAY Etherboot ISO boot image generated by genliso
48 TIMEOUT 30
49 EOF
50 first=
51 for f
53 if [ ! -r $f ]
54 then
55 echo $f does not exist, skipping 1>&2
56 continue
58 # shorten name for 8.3 filesystem
59 b=$(basename $f)
60 g=${b%.lkrn}
61 g=${g//[^a-z0-9]}
62 g=${g:0:8}.krn
63 case "$first" in
64 "")
65 echo DEFAULT $g
67 esac
68 first=$g
69 echo LABEL $b
70 echo "" KERNEL $g
71 mcopy -m -i $img $f ::$g
72 done >> $cfg
73 mcopy -i $img $cfg ::syslinux.cfg
74 if ! syslinux $img
75 then
76 exit 1
78 case "$genfdimg" in
82 mkisofs -o $out -c boot.cat -b boot.img $dir
84 esac
85 rm -fr $dir