Annotation of elwix/config/etc/rootfs/rc, revision 1.1.1.1.6.5
1.1 misho 1: #!/bin/sh
2: #
3: # Boot startup script for ELWIX RootFS ...
4: #
1.1.1.1.6.5! misho 5: # $Id: rc,v 1.1.1.1.6.4 2012/02/09 01:27:57 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: {
1.1.1.1.6.5! misho 35: echo " RootFS: Loading 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.5! misho 38: echo " RootFS: Failed firmware image! Try to load ELWIX system firmware from alternative location"
1.1.1.1.6.3 misho 39: mdconfig -d -u 1 >/dev/null 2>&1
1.1.1.1.6.2 misho 40: mdconfig -a -t vnode -u 1 -f /elwix/altroot/elwix-firmware.sys && mount -r /dev/md1.uzip /usr
41: if test $? -ne 0; then
1.1.1.1.6.3 misho 42: mdconfig -d -u 1 >/dev/null 2>&1
1.1.1.1.6.2 misho 43: failed_sysvol "load system and default image" elwix-firmware.sys
44: fi
1.1 misho 45: fi
46: sleep 2
47: }
48:
49: #
50: ## main()
51: #
52:
53: echo "ELWIX>>> Firmware RootFS boot stage ..."
54: echo " RootFS: Mount ELWIX system volume"
55: 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 56: fsck -f -y 1>/dev/null 2>&1 && mount -a || failed_sysvol mount "system volume"
57:
58: if test -c $FIT2CF -a -d $CFDIR; then
59: echo " RootFS: Mount ELWIX flash volume"
60: fsck -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \
61: fsck -f -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \
62: failed_sysvol mount "flash volume"
63: fi
1.1 misho 64:
1.1.1.1.6.5! misho 65: if [ -r /elwix/elwix-firmware.sys ]; then
! 66: boot_elwix
! 67: else
! 68: echo " RootFS: Skip loading ELWIX system firmware ..."
! 69: fi
1.1 misho 70:
1.1.1.1.6.4 misho 71: exec /etc/rc.init
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>