Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[build] Add syslinux floppy image type .sdsk
We add a syslinux floppy disk type using parts of the genliso script. This floppy image cat be dd'ed to a physical floppy or used in instances where a virtual floppy with an mountable DOS filesystem is useful. We also modify the genliso script to only generate .liso images rather than creating images depending on how it is called. Signed-off-by: Michael Brown <mcb30@etherboot.org>
- Loading branch information
Marty Connor
authored and
Michael Brown
committed
Aug 2, 2009
1 parent
14ae602
commit 96f4f96
Showing
3 changed files
with
89 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
# | ||
# Generate a syslinux floppy that loads a gPXE image | ||
# | ||
# gensdsk foo.sdsk foo.lkrn | ||
# | ||
# the floppy image is the first argument | ||
# followed by list of .lkrn images | ||
# | ||
|
||
case $# in | ||
0|1) | ||
echo Usage: $0 foo.sdsk foo.lkrn ... | ||
exit 1 | ||
;; | ||
esac | ||
case "`mtools -V`" in | ||
Mtools\ version\ 3.9.9*|Mtools\ version\ 3.9.1[0-9]*|Mtools\ version\ 4.*) | ||
;; | ||
*) | ||
echo Mtools version 3.9.9 or later is required | ||
exit 1 | ||
;; | ||
esac | ||
img=$1 | ||
shift | ||
dir=bin/sdsk.dir | ||
mkdir -p $dir | ||
|
||
mformat -f 1440 -C -i $img :: | ||
cfg=bin/syslinux.cfg | ||
cat > $cfg <<EOF | ||
# These default options can be changed in the gensdsk script | ||
TIMEOUT 30 | ||
EOF | ||
first= | ||
for f | ||
do | ||
if [ ! -r $f ] | ||
then | ||
echo $f does not exist, skipping 1>&2 | ||
continue | ||
fi | ||
# shorten name for 8.3 filesystem | ||
b=$(basename $f) | ||
g=${b%.lkrn} | ||
g=${g//[^a-z0-9]} | ||
g=${g:0:8}.krn | ||
case "$first" in | ||
"") | ||
echo DEFAULT $g | ||
;; | ||
esac | ||
first=$g | ||
echo LABEL $b | ||
echo "" KERNEL $g | ||
mcopy -m -i $img $f ::$g | ||
done >> $cfg | ||
mcopy -i $img $cfg ::syslinux.cfg | ||
if ! syslinux $img | ||
then | ||
exit 1 | ||
fi | ||
|
||
rm -fr $dir |