Annotation of elwix/config/etc/rootfs/rc, revision 1.1.1.1.6.2
1.1 misho 1: #!/bin/sh
2: #
3: # Boot startup script for ELWIX RootFS ...
4: #
1.1.1.1.6.2! misho 5: # $Id: rc,v 1.1.1.1.6.1 2011/11/02 10:04:11 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
! 38: mdconfig -a -t vnode -u 1 -f /elwix/altroot/elwix-firmware.sys && mount -r /dev/md1.uzip /usr
! 39: if test $? -ne 0; then
! 40: failed_sysvol "load system and default image" elwix-firmware.sys
! 41: fi
1.1 misho 42: fi
43: sleep 2
44: }
45:
46: #
47: ## main()
48: #
49:
50: echo "ELWIX>>> Firmware RootFS boot stage ..."
51: echo " RootFS: Mount ELWIX system volume"
52: 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 53: fsck -f -y 1>/dev/null 2>&1 && mount -a || failed_sysvol mount "system volume"
54:
55: if test -c $FIT2CF -a -d $CFDIR; then
56: echo " RootFS: Mount ELWIX flash volume"
57: fsck -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \
58: fsck -f -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \
59: failed_sysvol mount "flash volume"
60: fi
1.1 misho 61:
62: boot_elwix
63:
64: /etc/rc.init
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>