1994-09-15 06:46:16 +02:00
|
|
|
# $Id: kc.profile,v 1.6 1994/02/21 21:52:00 rgrimes Exp $
|
1993-08-10 14:20:12 +02:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
1994-02-21 22:52:00 +01:00
|
|
|
echo ""
|
|
|
|
echo ""
|
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 ""
|
1994-02-21 22:52:00 +01:00
|
|
|
echo "fsck failed... Sorry, can't copy kernel!"
|
1993-08-10 14:20:12 +02:00
|
|
|
bail_out
|
|
|
|
fi
|
1994-02-21 22:52:00 +01:00
|
|
|
echo -n "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 ""
|
1994-02-21 22:52:00 +01:00
|
|
|
echo "mount failed... Sorry, can't copy kernel!"
|
1993-08-10 14:20:12 +02:00
|
|
|
bail_out
|
|
|
|
fi
|
1994-02-21 22:52:00 +01:00
|
|
|
echo "done."
|
|
|
|
echo -n "Copying kernel... "
|
1994-09-15 06:46:16 +02:00
|
|
|
cp -p /kernel /mnt
|
1993-08-10 14:20:12 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
1994-02-21 22:52:00 +01:00
|
|
|
echo "failed... (?!?!?!)"
|
1993-08-10 14:20:12 +02:00
|
|
|
bail_out
|
|
|
|
fi
|
1994-02-21 22:52:00 +01:00
|
|
|
echo "done."
|
|
|
|
echo -n "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
|
1994-02-21 22:52:00 +01:00
|
|
|
echo -n "failed... Shouldn't be a problem... "
|
1993-08-10 14:20:12 +02:00
|
|
|
fi
|
1994-02-21 22:52:00 +01:00
|
|
|
echo "done."
|
1993-08-10 14:20:12 +02:00
|
|
|
bail_out
|
|
|
|
fi
|
|
|
|
|
|
|
|
reboot_it
|