Annotation of elwix/config/etc/default/rc, revision 1.3.2.2
1.2 misho 1: #!/bin/sh
2: #
1.3 misho 3: # Boot startup script for ELWIX BaseFS ...
1.2 misho 4: #
1.3.2.2 ! misho 5: # $Id: rc,v 1.3.2.1 2017/06/15 22:54:56 misho Exp $
1.2 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.3.2.2 ! misho 21: FRMDEV2="md3"
1.2 misho 22: FRMSIZE2="21m"
23: FRMFILE2="elwix-firmware2.sys"
24:
25: FRMPATH="/elwix"
26: FIT2CF="/dev/ufs/fit2cf"
27: CFDIR="/elwix/cf"
28:
29: umask 022
30:
31: failed_sysvol()
32: {
1.3 misho 33: echo " BaseFS: Failed $1 - $2 ... Go to emergency shell !!!"
1.2 misho 34:
35: exit 127
36: }
37:
38: boot_elwix2()
39: {
1.3 misho 40: echo " BaseFS: Loading ELWIX secondary firmware"
1.2 misho 41:
1.3.2.1 misho 42: mdmfs -s $FRMSIZE2 -S -m0 -oasync $FRMDEV2 /elwix/pkg
1.3 misho 43: if test $? -ne 0; then
1.2 misho 44: failed_sysvol "to mount firmware image " $FRMFILE2
45: fi
1.3.2.1 misho 46: cd /elwix/pkg
1.2 misho 47: pax -r -z -pe -f $FRMPATH/$FRMFILE2
1.3 misho 48: if test $? -ne 0; then
1.2 misho 49: failed_sysvol "to load firmware image " $FRMFILE2
50: fi
51: cd -
1.3.2.1 misho 52: mount -ur /elwix/pkg || failed_sysvol mount "secondary firmware"
1.2 misho 53: }
54:
55: #
56: ## main()
57: #
58:
1.3 misho 59: echo "ELWIX>>> Firmware BaseFS boot stage ..."
60:
61: if ! mount -a; then
62: umount -A
63: fsck -y 1>/dev/null 2>&1
64: if ! mount -a; then
65: umount -A -f
66: fsck -f -y 1>/dev/null 2>&1
67: if ! mount -a; then
68: failed_sysvol mount "system volume"
69: fi
70: fi
71: fi
1.2 misho 72:
73: if test -c "$FIT2CF" -a -d "$CFDIR"; then
1.3 misho 74: echo " BaseFS: Mount ELWIX flash volume"
75: mount -o ro $FIT2CF || \
76: fsck -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \
1.2 misho 77: failed_sysvol mount "flash volume"
78: fi
79:
1.3 misho 80: if test -r "$FRMPATH/$FRMFILE2"; then
1.2 misho 81: boot_elwix2
82: fi
83:
84: exec /etc/rc.init
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>