[e1000e] Add e1000e driver
[gpxe.git] / src / util / gensdsk
bloba8661586f7c9e9e3e02dfc3ce5a5e5a847243e9e
1 #!/bin/bash
3 # Generate a syslinux floppy that loads a gPXE image
5 # gensdsk foo.sdsk foo.lkrn
7 # the floppy image is the first argument
8 # followed by list of .lkrn images
11 case $# in
12 0|1)
13 echo Usage: $0 foo.sdsk foo.lkrn ...
14 exit 1
16 esac
17 case "`mtools -V`" in
18 Mtools\ version\ 3.9.9*|Mtools\ version\ 3.9.1[0-9]*|[mM]tools\ *\ [4-9].*)
21 echo Mtools version 3.9.9 or later is required
22 exit 1
24 esac
25 img=$1
26 shift
27 dir=`mktemp -d bin/sdsk.dir.XXXXXX`
29 mformat -f 1440 -C -i $img ::
30 cfg=$dir/syslinux.cfg
31 cat > $cfg <<EOF
33 # These default options can be changed in the gensdsk script
34 TIMEOUT 30
35 EOF
36 first=
37 for f
39 if [ ! -r $f ]
40 then
41 echo $f does not exist, skipping 1>&2
42 continue
44 # shorten name for 8.3 filesystem
45 b=$(basename $f)
46 g=${b%.lkrn}
47 g=${g//[^a-z0-9]}
48 g=${g:0:8}.krn
49 case "$first" in
50 "")
51 echo DEFAULT $g
53 esac
54 first=$g
55 echo LABEL $b
56 echo "" KERNEL $g
57 mcopy -m -i $img $f ::$g
58 done >> $cfg
59 mcopy -i $img $cfg ::syslinux.cfg
60 if ! syslinux $img
61 then
62 exit 1
65 rm -fr $dir