Annotation of elwix/config/etc/rootfs/rc, revision 1.1.1.1.6.6
1.1 misho 1: #!/bin/sh
2: #
3: # Boot startup script for ELWIX RootFS ...
4: #
1.1.1.1.6.6! misho 5: # $Id: rc,v 1.1.1.1.6.5 2012/02/14 13:54:08 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.6! misho 21: FRMDEV="md1"
! 22: FRMSIZE="82m"
! 23: FRMFILE="elwix-firmware.sys"
! 24: FRMPATH="/elwix"
! 25:
1.1.1.1.6.1 misho 26: FIT2CF="/dev/ufs/fit2cf"
27: CFDIR="/elwix/cf"
28:
1.1 misho 29: umask 022
30:
31: failed_sysvol()
32: {
1.1.1.1.6.1 misho 33: echo " RootFS: Failed $1 ELWIX $2 ... Go to emergency shell !!!"
1.1 misho 34:
35: exit 127
36: }
37:
38: boot_elwix()
39: {
1.1.1.1.6.5 misho 40: echo " RootFS: Loading ELWIX system firmware"
1.1.1.1.6.6! misho 41: if test ! -r $FRMPATH/$FRMFILE; then
! 42: echo " RootFS: WARNING! Failed default firmware image!"
! 43: echo " RootFS: Try to load ELWIX backup firmware ..."
! 44:
! 45: FRMPATH="$FRMPATH/altroot"
! 46: if test ! -r $FRMPATH/$FRMFILE; then
! 47: failed_sysvol "load backup and default image" elwix-firmware.sys
1.1.1.1.6.2 misho 48: fi
1.1 misho 49: fi
1.1.1.1.6.6! misho 50:
! 51: mdmfs -s $FRMSIZE -S -m0 -oasync $FRMDEV /usr
! 52: cd /usr
! 53: pax -r -z -f $FRMPATH/$FRMFILE
! 54:
1.1 misho 55: sleep 2
56: }
57:
58: #
59: ## main()
60: #
61:
62: echo "ELWIX>>> Firmware RootFS boot stage ..."
63: echo " RootFS: Mount ELWIX system volume"
64: 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 65: fsck -f -y 1>/dev/null 2>&1 && mount -a || failed_sysvol mount "system volume"
66:
67: if test -c $FIT2CF -a -d $CFDIR; then
68: echo " RootFS: Mount ELWIX flash volume"
69: fsck -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \
70: fsck -f -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \
71: failed_sysvol mount "flash volume"
72: fi
1.1 misho 73:
1.1.1.1.6.5 misho 74: if [ -r /elwix/elwix-firmware.sys ]; then
75: boot_elwix
76: else
77: echo " RootFS: Skip loading ELWIX system firmware ..."
78: fi
1.1 misho 79:
1.1.1.1.6.4 misho 80: exec /etc/rc.init
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>