summaryrefslogtreecommitdiffstats
path: root/etc/etc.i386/kc.profile
blob: 1bc715b53aef4ada3174fa673f9849214e3b6e1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#	$Id: kc.profile,v 1.6 1994/02/21 21:52:00 rgrimes Exp $
#
# rc for kernel distribution floppy

PATH=/bin:/sbin
export PATH

reboot_it() {
	echo    ""
	echo    "halting the machine..."
	halt
	echo "Halt failed!  Try power-cycling the machine..."
	exit 1
}

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
}

echo	""
echo	""
echo    Enter '"copy"' at the prompt to copy the kernel on this
echo    floppy to your hard disk.  enter anything else to reboot,
echo	but wait for the machine to restart to remove the floppy.
echo    ""
echo -n "kc> "

read todo

if [ X"$todo" = Xcopy ]; then
	echo    ""
	echo    "What disk partition should the kernel be installed on?"
	echo    "(e.g., "wd0a", "sd0a", etc.)"
	echo    ""
	echo -n "copy kernel to> "
	while :; do
		read diskpart junk
		[ -c /dev/r$diskpart ] && break
		echo "${diskpart}: invalid partition"
		echo
		echo -n "copy kernel to> "
	done
	echo    ""
	echo    "Checking the filesystem on $diskpart..."
	fsck -y /dev/r$diskpart
	if [ $? -ne 0 ]; then
		echo ""
		echo "fsck failed...  Sorry, can't copy kernel!"
		bail_out
	fi
	echo -n	"Mounting $diskpart on /mnt... "
	mount /dev/$diskpart /mnt
	if [ $? -ne 0 ]; then
		echo ""
		echo "mount failed...  Sorry, can't copy kernel!"
		bail_out
	fi
	echo    "done."
	echo -n	"Copying kernel... "
	cp -p /kernel /mnt
	if [ $? -ne 0 ]; then
		echo "failed...  (?!?!?!)"
		bail_out
	fi
	echo    "done."
	echo -n	"Unmounting $diskpart... "
	umount /mnt > /dev/null 2>&1
	if [ $? -ne 0 ]; then
		echo -n "failed...  Shouldn't be a problem... "
	fi
	echo "done."
	bail_out
fi

reboot_it
OpenPOWER on IntegriCloud