Put in proper address information for Poul-Henning Kamp.
[unix-history] / etc / etc.i386 / kc.profile
CommitLineData
10a2c021
RG
1# $Header
2#
3# rc for kernel distribution floppy
4
5PATH=/bin:/sbin
6export PATH
7
10a2c021
RG
8reboot_it() {
9 echo ""
10 echo "halting the machine..."
11
52617f4e
AM
12 halt
13 sync
14 sync
15 echo "Halt failed! Try power-cycling the machine..."
16 exit 1
10a2c021
RG
17}
18
19bail_out() {
20 echo ""
21 echo "Time to reboot the machine!"
22 echo "Once the machine has halted (it'll tell you when),"
23 echo "remove the floppy from the disk drive and press"
24 echo "any key to reboot."
25 reboot_it
26}
27
39087e97 28echo Enter '"copy"' at the prompt to copy the kernel on this
10a2c021
RG
29echo floppy to your hard disk. enter anything else to reboot,
30echo but wait for the machine to restart to remove the floppy.
31echo ""
9e5f5695 32echo -n "kc> "
10a2c021
RG
33
34read todo
35
52617f4e 36if [ X"$todo" = Xcopy ]; then
10a2c021 37 echo ""
39087e97
AM
38 echo "What disk partition should the kernel be installed on?"
39 echo "(e.g., "wd0a", "sd0a", etc.)"
10a2c021 40 echo ""
9e5f5695 41 echo -n "copy kernel to> "
52617f4e
AM
42 while :; do
43 read diskpart junk
44 [ -c /dev/r$diskpart ] && break
39087e97 45 echo "${diskpart}: invalid partition"
52617f4e
AM
46 echo
47 echo -n "copy kernel to> "
48 done
10a2c021 49 echo ""
39087e97 50 echo "Checking the filesystem on $diskpart..."
52617f4e 51 fsck -y /dev/r$diskpart
10a2c021
RG
52 if [ $? -ne 0 ]; then
53 echo ""
39087e97 54 echo "fsck failed... Sorry, can't copy kernel..."
10a2c021
RG
55 bail_out
56 fi
10a2c021
RG
57 echo ""
58 echo "mounting $diskpart on /mnt..."
52617f4e 59 mount /dev/$diskpart /mnt
10a2c021
RG
60 if [ $? -ne 0 ]; then
61 echo ""
39087e97 62 echo "mount failed... Sorry, can't copy kernel..."
10a2c021
RG
63 bail_out
64 fi
10a2c021 65 echo ""
39087e97 66 echo "Please wait. Copying kernel..."
52617f4e 67 cp /386bsd /mnt/386bsd
10a2c021
RG
68 if [ $? -ne 0 ]; then
69 echo ""
39087e97 70 echo "Copy failed... (?!?!?!)"
10a2c021
RG
71 bail_out
72 fi
10a2c021
RG
73 echo ""
74 echo "unmounting $diskpart..."
52617f4e 75 umount /mnt > /dev/null 2>&1
10a2c021
RG
76 if [ $? -ne 0 ]; then
77 echo ""
39087e97 78 echo "unmount failed... Shouldn't be a problem..."
10a2c021 79 fi
10a2c021
RG
80 bail_out
81fi
82
83reboot_it