#!/bin/sh

echo -n "Path to your keymap (e.g. /usr/lib/kbd/keytables/de-latin1.map): "
read keymap
cp "$keymap" rootdisk/etc/key.map

echo "generating rootfs"
dd if=/dev/zero of=/dev/ram bs=1k count=4096
mke2fs -m 0 -i 8192 /dev/ram
mount -t ext2 /dev/ram /mnt
cp -a rootdisk/* /mnt/
umount /mnt
dd if=/dev/ram bs=1k count=4096| gzip -v9 > rootfs.gz

echo "generating utilfs"
dd if=/dev/zero of=/dev/ram bs=1k count=4096
mke2fs -m 0 -i 8192 /dev/ram
mount -t ext2 /dev/ram /mnt
cp -a utildisk/* /mnt/
umount /mnt
dd if=/dev/ram bs=1k count=4096| gzip -v9 > utilfs.gz

echo -n "insert general bootdisk and press return>"
read shit
cp kernelimage /dev/fd0
rdev /dev/fd0 /dev/fd0
rdev -r /dev/fd0 49152

echo -n "insert rootdisk and press return>"
read shit
cp rootfs.gz /dev/fd0

echo -n "insert utility disk and press return>"
read shit
cp utilfs.gz /dev/fd0

echo -n "path to your actual kernel (should contain floppy+ramdisk driver):"
read KERNELPATH
echo -n "insert special boot disk and press return>"
read shit
cp "$KERNELPATH" /dev/fd0
rdev /dev/fd0 /dev/fd0
rdev -r /dev/fd0 49152
