summaryrefslogtreecommitdiff
path: root/examples/bootfloppy/mksyslinux.sh
diff options
context:
space:
mode:
authorMark Whitley2001-05-04 21:46:00 +0000
committerMark Whitley2001-05-04 21:46:00 +0000
commita0ba9f45fb0c9f3e34d5a2b25e45b7e5d5cac9a4 (patch)
tree4f000c6356ba330d7cf5ade9d79a4167fb90e69f /examples/bootfloppy/mksyslinux.sh
parentd24f878546806aa8fd50dc95fe3cc111ad10f92f (diff)
downloadbusybox-a0ba9f45fb0c9f3e34d5a2b25e45b7e5d5cac9a4.zip
busybox-a0ba9f45fb0c9f3e34d5a2b25e45b7e5d5cac9a4.tar.gz
Wrote documentation and scripts for creating a busybox boot floppy. Initial revision.
Diffstat (limited to 'examples/bootfloppy/mksyslinux.sh')
-rwxr-xr-xexamples/bootfloppy/mksyslinux.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/examples/bootfloppy/mksyslinux.sh b/examples/bootfloppy/mksyslinux.sh
new file mode 100755
index 0000000..e254173
--- /dev/null
+++ b/examples/bootfloppy/mksyslinux.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+#
+# Formats a floppy to use Syslinux
+
+dummy=""
+
+
+# need to have mtools installed
+if [ -z `which mformat` -o -z `which mcopy` ]; then
+ echo "You must have the mtools package installed to run this script"
+ exit 1
+fi
+
+
+# need an arg for the location of the kernel
+if [ -z "$1" ]; then
+ echo "usage: `basename $0` path/to/linux/kernel"
+ exit 1
+fi
+
+
+# need to have a root file system built
+if [ ! -f rootfs.gz ]; then
+ echo "You need to have a rootfs built first."
+ echo "Hit RETURN to make one now or Control-C to quit."
+ read dummy
+ ./mkrootfs.sh
+fi
+
+
+# prepare the floppy
+echo "Please insert a blank floppy in the drive and press RETURN to format"
+echo "(WARNING: All data will be erased! Hit Control-C to abort)"
+read dummy
+
+echo "Formatting the floppy..."
+mformat a:
+echo "Making it bootable with Syslinux..."
+syslinux -s /dev/fd0
+echo "Copying Syslinux configuration files..."
+mcopy syslinux.cfg display.txt a:
+echo "Copying root filesystem file..."
+mcopy rootfs.gz a:
+# XXX: maybe check for "no space on device" errors here
+echo "Copying linux kernel..."
+mcopy $1 a:linux
+# XXX: maybe check for "no space on device" errors here too
+echo "Finished: boot floppy created"