Merge branch 'Teaman-ND' into Teaman-RT
[tomato.git] / release / src / router / busybox / examples / bootfloppy / mksyslinux.sh
blobe254173535069468ecd05d199c719e313bd4eeb3
1 #!/bin/bash
3 # Formats a floppy to use Syslinux
5 dummy=""
8 # need to have mtools installed
9 if [ -z `which mformat` -o -z `which mcopy` ]; then
10 echo "You must have the mtools package installed to run this script"
11 exit 1
15 # need an arg for the location of the kernel
16 if [ -z "$1" ]; then
17 echo "usage: `basename $0` path/to/linux/kernel"
18 exit 1
22 # need to have a root file system built
23 if [ ! -f rootfs.gz ]; then
24 echo "You need to have a rootfs built first."
25 echo "Hit RETURN to make one now or Control-C to quit."
26 read dummy
27 ./mkrootfs.sh
31 # prepare the floppy
32 echo "Please insert a blank floppy in the drive and press RETURN to format"
33 echo "(WARNING: All data will be erased! Hit Control-C to abort)"
34 read dummy
36 echo "Formatting the floppy..."
37 mformat a:
38 echo "Making it bootable with Syslinux..."
39 syslinux -s /dev/fd0
40 echo "Copying Syslinux configuration files..."
41 mcopy syslinux.cfg display.txt a:
42 echo "Copying root filesystem file..."
43 mcopy rootfs.gz a:
44 # XXX: maybe check for "no space on device" errors here
45 echo "Copying linux kernel..."
46 mcopy $1 a:linux
47 # XXX: maybe check for "no space on device" errors here too
48 echo "Finished: boot floppy created"