1994-02-21 21:52:00 +00:00
|
|
|
# $Id$
|
1993-08-10 12:20:12 +00:00
|
|
|
#
|
|
|
|
# rc for kernel distribution floppy
|
|
|
|
|
|
|
|
PATH=/bin:/sbin
|
|
|
|
export PATH
|
|
|
|
|
|
|
|
reboot_it() {
|
|
|
|
echo ""
|
|
|
|
echo "halting the machine..."
|
1993-09-21 10:24:42 +00:00
|
|
|
halt
|
|
|
|
echo "Halt failed! Try power-cycling the machine..."
|
|
|
|
exit 1
|
1993-08-10 12:20:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bail_out() {
|
|
|
|
echo ""
|
|
|
|
echo "Time to reboot the machine!"
|
|
|
|
echo "Once the machine has halted (it'll tell you when),"
|
|
|
|
echo "remove the floppy from the disk drive and press"
|
|
|
|
echo "any key to reboot."
|
|
|
|
reboot_it
|
|
|
|
}
|
|
|
|
|
1994-02-21 21:52:00 +00:00
|
|
|
echo ""
|
|
|
|
echo ""
|
1993-09-22 07:38:18 +00:00
|
|
|
echo Enter '"copy"' at the prompt to copy the kernel on this
|
1993-08-10 12:20:12 +00:00
|
|
|
echo floppy to your hard disk. enter anything else to reboot,
|
|
|
|
echo but wait for the machine to restart to remove the floppy.
|
|
|
|
echo ""
|
1993-08-24 19:55:16 +00:00
|
|
|
echo -n "kc> "
|
1993-08-10 12:20:12 +00:00
|
|
|
|
|
|
|
read todo
|
|
|
|
|
1993-09-21 10:24:42 +00:00
|
|
|
if [ X"$todo" = Xcopy ]; then
|
1993-08-10 12:20:12 +00:00
|
|
|
echo ""
|
1993-09-22 07:38:18 +00:00
|
|
|
echo "What disk partition should the kernel be installed on?"
|
|
|
|
echo "(e.g., "wd0a", "sd0a", etc.)"
|
1993-08-10 12:20:12 +00:00
|
|
|
echo ""
|
1993-08-24 19:55:16 +00:00
|
|
|
echo -n "copy kernel to> "
|
1993-09-21 10:24:42 +00:00
|
|
|
while :; do
|
|
|
|
read diskpart junk
|
|
|
|
[ -c /dev/r$diskpart ] && break
|
1993-09-22 07:38:18 +00:00
|
|
|
echo "${diskpart}: invalid partition"
|
1993-09-21 10:24:42 +00:00
|
|
|
echo
|
|
|
|
echo -n "copy kernel to> "
|
|
|
|
done
|
1993-08-10 12:20:12 +00:00
|
|
|
echo ""
|
1993-09-22 07:38:18 +00:00
|
|
|
echo "Checking the filesystem on $diskpart..."
|
1993-09-21 10:24:42 +00:00
|
|
|
fsck -y /dev/r$diskpart
|
1993-08-10 12:20:12 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo ""
|
1994-02-21 21:52:00 +00:00
|
|
|
echo "fsck failed... Sorry, can't copy kernel!"
|
1993-08-10 12:20:12 +00:00
|
|
|
bail_out
|
|
|
|
fi
|
1994-02-21 21:52:00 +00:00
|
|
|
echo -n "Mounting $diskpart on /mnt... "
|
1993-09-21 10:24:42 +00:00
|
|
|
mount /dev/$diskpart /mnt
|
1993-08-10 12:20:12 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo ""
|
1994-02-21 21:52:00 +00:00
|
|
|
echo "mount failed... Sorry, can't copy kernel!"
|
1993-08-10 12:20:12 +00:00
|
|
|
bail_out
|
|
|
|
fi
|
1994-02-21 21:52:00 +00:00
|
|
|
echo "done."
|
|
|
|
echo -n "Copying kernel... "
|
1993-09-21 10:24:42 +00:00
|
|
|
cp /386bsd /mnt/386bsd
|
1993-08-10 12:20:12 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
1994-02-21 21:52:00 +00:00
|
|
|
echo "failed... (?!?!?!)"
|
1993-08-10 12:20:12 +00:00
|
|
|
bail_out
|
|
|
|
fi
|
1994-02-21 21:52:00 +00:00
|
|
|
echo "done."
|
|
|
|
echo -n "Unmounting $diskpart... "
|
1993-09-21 10:24:42 +00:00
|
|
|
umount /mnt > /dev/null 2>&1
|
1993-08-10 12:20:12 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
1994-02-21 21:52:00 +00:00
|
|
|
echo -n "failed... Shouldn't be a problem... "
|
1993-08-10 12:20:12 +00:00
|
|
|
fi
|
1994-02-21 21:52:00 +00:00
|
|
|
echo "done."
|
1993-08-10 12:20:12 +00:00
|
|
|
bail_out
|
|
|
|
fi
|
|
|
|
|
|
|
|
reboot_it
|