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