1993-08-10 14:20:12 +02:00
|
|
|
# $Header
|
|
|
|
#
|
|
|
|
# rc for kernel distribution floppy
|
|
|
|
|
|
|
|
PATH=/bin:/sbin
|
|
|
|
export PATH
|
|
|
|
|
|
|
|
reboot_it() {
|
|
|
|
echo ""
|
|
|
|
echo "halting the machine..."
|
|
|
|
|
1993-09-21 12:24:42 +02:00
|
|
|
halt
|
|
|
|
sync
|
|
|
|
sync
|
|
|
|
echo "Halt failed! Try power-cycling the machine..."
|
|
|
|
exit 1
|
1993-08-10 14:20:12 +02: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
|
|
|
|
}
|
|
|
|
|
1993-09-22 09:38:18 +02:00
|
|
|
echo Enter '"copy"' at the prompt to copy the kernel on this
|
1993-08-10 14:20:12 +02: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 21:55:16 +02:00
|
|
|
echo -n "kc> "
|
1993-08-10 14:20:12 +02:00
|
|
|
|
|
|
|
read todo
|
|
|
|
|
1993-09-21 12:24:42 +02:00
|
|
|
if [ X"$todo" = Xcopy ]; then
|
1993-08-10 14:20:12 +02:00
|
|
|
echo ""
|
1993-09-22 09:38:18 +02:00
|
|
|
echo "What disk partition should the kernel be installed on?"
|
|
|
|
echo "(e.g., "wd0a", "sd0a", etc.)"
|
1993-08-10 14:20:12 +02:00
|
|
|
echo ""
|
1993-08-24 21:55:16 +02:00
|
|
|
echo -n "copy kernel to> "
|
1993-09-21 12:24:42 +02:00
|
|
|
while :; do
|
|
|
|
read diskpart junk
|
|
|
|
[ -c /dev/r$diskpart ] && break
|
1993-09-22 09:38:18 +02:00
|
|
|
echo "${diskpart}: invalid partition"
|
1993-09-21 12:24:42 +02:00
|
|
|
echo
|
|
|
|
echo -n "copy kernel to> "
|
|
|
|
done
|
1993-08-10 14:20:12 +02:00
|
|
|
echo ""
|
1993-09-22 09:38:18 +02:00
|
|
|
echo "Checking the filesystem on $diskpart..."
|
1993-09-21 12:24:42 +02:00
|
|
|
fsck -y /dev/r$diskpart
|
1993-08-10 14:20:12 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo ""
|
1993-09-22 09:38:18 +02:00
|
|
|
echo "fsck failed... Sorry, can't copy kernel..."
|
1993-08-10 14:20:12 +02:00
|
|
|
bail_out
|
|
|
|
fi
|
|
|
|
echo ""
|
|
|
|
echo "mounting $diskpart on /mnt..."
|
1993-09-21 12:24:42 +02:00
|
|
|
mount /dev/$diskpart /mnt
|
1993-08-10 14:20:12 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo ""
|
1993-09-22 09:38:18 +02:00
|
|
|
echo "mount failed... Sorry, can't copy kernel..."
|
1993-08-10 14:20:12 +02:00
|
|
|
bail_out
|
|
|
|
fi
|
|
|
|
echo ""
|
1993-09-22 09:38:18 +02:00
|
|
|
echo "Please wait. Copying kernel..."
|
1993-09-21 12:24:42 +02:00
|
|
|
cp /386bsd /mnt/386bsd
|
1993-08-10 14:20:12 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo ""
|
1993-09-22 09:38:18 +02:00
|
|
|
echo "Copy failed... (?!?!?!)"
|
1993-08-10 14:20:12 +02:00
|
|
|
bail_out
|
|
|
|
fi
|
|
|
|
echo ""
|
|
|
|
echo "unmounting $diskpart..."
|
1993-09-21 12:24:42 +02:00
|
|
|
umount /mnt > /dev/null 2>&1
|
1993-08-10 14:20:12 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo ""
|
1993-09-22 09:38:18 +02:00
|
|
|
echo "unmount failed... Shouldn't be a problem..."
|
1993-08-10 14:20:12 +02:00
|
|
|
fi
|
|
|
|
bail_out
|
|
|
|
fi
|
|
|
|
|
|
|
|
reboot_it
|