#!/bin/bash

. bk_functions

yesno "Create boot diskette?"

if [ "$?" != 0 ]
then
	exit
fi

yesno "$DISKETTEDEV will be destroyed! Continue?"

if [ "$?" != 0 ]
then
	exit
fi

msgbox "Insert diskette in $DISKETTEDEV"

infobox "Installing Linux Kernel"

dd if=$KERNELPATH of=$DISKETTEDEV > /tmp/bootkit.log 2>&1

if [ "$?" != 0 ]
then
	msgbox "Kernel install failed!"
	bkViewLog /tmp/bootkit.log
	exit
fi

rdev $DISKETTEDEV $DISKETTEDEV >>/tmp/bootkit.log 2>&1

# Handle RAMDISK (if enabled)
if [ "$RAMDISK" = "ON" ]
then
	infobox "Tweaking ramdisk in kernel"
	sleep 1
	rdev -r $DISKETTEDEV 1440
fi

if [ "$?" != 0 ]
then
	msgbox "Unable to change Kernel Root!"
	bkViewLog /tmp/bootkit.log
	exit
fi

msgbox "Boot diskette creation completed"

# Give the user a chance to view the log file
bkViewLog /tmp/bootkit.log

