2 if [[ $# -ne 1 ]]; then
3 echo "Usage: $0 <image>" >&2
8 # Create and format floppy image
9 dd if=/dev/zero of="$IMGNAME" bs=512 count=2880
10 mformat -i "$IMGNAME" ::/ -f 1440 -v Acess
11 # Copy grub's stage1 (ignoring the FAT area)
12 dd if=$DIR/stage1 bs=1 seek=0 count=3 "of=$IMGNAME" conv=notrunc
13 dd if=$DIR/stage1 bs=1 skip=$((0x3E)) seek=$((0x3E)) "of=$IMGNAME" conv=notrunc
14 # Copy grub images to ::/boot
15 mmd -i "$IMGNAME" ::/boot
16 mcopy $DIR/stage1 $DIR/stage2 -i "$IMGNAME" ::/boot/
17 # Patch stage2 location
18 /bin/echo -ne '\x23' | dd seek=$((0x44)) bs=1 count=1 "of=$IMGNAME" conv=notrunc
19 # Copy grub config file
20 mcopy $DIR/menu.lst -i "$IMGNAME" ::/boot/