Annotation of elwix/config/etc/rootfs/rc, revision 1.1.1.1.6.4
1.1 misho 1: #!/bin/sh
2: #
3: # Boot startup script for ELWIX RootFS ...
4: #
1.1.1.1.6.4! misho 5: # $Id: rc,v 1.1.1.1.6.3 2011/11/02 12:07:37 misho Exp $
1.1 misho 6:
7: stty status '^T'
8:
9: trap : 2
10: trap : 3
11: trap : 18
12:
13: HOME=/root
14: PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin
15: TERM=xterm
16: BLOCKSIZE=1k
17: EDITOR=vi
18: PAGER=less
19: export HOME PATH TERM BLOCKSIZE EDITOR PAGER
20:
1.1.1.1.6.1 misho 21: FIT2CF="/dev/ufs/fit2cf"
22: CFDIR="/elwix/cf"
23:
1.1 misho 24: umask 022
25:
26: failed_sysvol()
27: {
1.1.1.1.6.1 misho 28: echo " RootFS: Failed $1 ELWIX $2 ... Go to emergency shell !!!"
1.1 misho 29:
30: exit 127
31: }
32:
33: boot_elwix()
34: {
35: echo " RootFS: Load ELWIX system firmware"
1.1.1.1.6.2 misho 36: mdconfig -a -t vnode -u 1 -f /elwix/elwix-firmware.sys && mount -r /dev/md1.uzip /usr
37: if test $? -ne 0; then
1.1.1.1.6.3 misho 38: mdconfig -d -u 1 >/dev/null 2>&1
1.1.1.1.6.2 misho 39: mdconfig -a -t vnode -u 1 -f /elwix/altroot/elwix-firmware.sys && mount -r /dev/md1.uzip /usr
40: if test $? -ne 0; then
1.1.1.1.6.3 misho 41: mdconfig -d -u 1 >/dev/null 2>&1
1.1.1.1.6.2 misho 42: failed_sysvol "load system and default image" elwix-firmware.sys
43: fi
1.1 misho 44: fi
45: sleep 2
46: }
47:
48: #
49: ## main()
50: #
51:
52: echo "ELWIX>>> Firmware RootFS boot stage ..."
53: echo " RootFS: Mount ELWIX system volume"
54: fsck -q -y 1>/dev/null 2>&1 && mount -a || fsck -y 1>/dev/null 2>&1 && mount -a || \
1.1.1.1.6.1 misho 55: fsck -f -y 1>/dev/null 2>&1 && mount -a || failed_sysvol mount "system volume"
56:
57: if test -c $FIT2CF -a -d $CFDIR; then
58: echo " RootFS: Mount ELWIX flash volume"
59: fsck -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \
60: fsck -f -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \
61: failed_sysvol mount "flash volume"
62: fi
1.1 misho 63:
64: boot_elwix
65:
1.1.1.1.6.4! misho 66: exec /etc/rc.init
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>