#!/bin/bash
#
#	cramon [blocks]
#
#	Set the boot parameters on a floppy kernel image.  This sets the
#	size of the ramdisk, the root device, sets the video mode to ask,
#	root flags to read-only, and the start of the cramdisk to the block
#	following the kernel image.
#
#	The optional argument `blocks' specifies the size of the ramdisk to
#	create on boot.  The default is 4Mb.
#

kernel=/usr/src/linux/arch/i386/boot/zImage

start=`ls -s $kernel | awk '{print $1}'`
rdev -r /dev/fd0 ${1:-4096} && {
	rdev -R /dev/fd0 0
	rdev /dev/fd0 /dev/fd0
	echo $start | awk '{printf"%c%c",$1%256,$1/256}' | dd of=/dev/fd0 bs=1 count=2 seek=502
}
