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