Annotation of elwix/config/etc/default/rc, revision 1.2.8.1
1.2 misho 1: #!/bin/sh
2: #
1.2.8.1 ! misho 3: # Boot startup script for ELWIX BaseFS ...
1.2 misho 4: #
1.2.8.1 ! misho 5: # $Id: rc,v 1.2 2013/08/05 13:10:17 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:
21: FRMDEV2="md2"
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.2.8.1 ! 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.2.8.1 ! misho 40: echo " BaseFS: Loading ELWIX secondary firmware"
1.2 misho 41:
42: mdmfs -s $FRMSIZE2 -S -m0 -oasync $FRMDEV2 /usr/local
1.2.8.1 ! misho 43: if test $? -ne 0; then
1.2 misho 44: failed_sysvol "to mount firmware image " $FRMFILE2
45: fi
46: cd /usr/local
47: pax -r -z -pe -f $FRMPATH/$FRMFILE2
1.2.8.1 ! misho 48: if test $? -ne 0; then
1.2 misho 49: failed_sysvol "to load firmware image " $FRMFILE2
50: fi
51: cd -
1.2.8.1 ! misho 52: mount -ur /usr/local || failed_sysvol mount "secondary firmware"
1.2 misho 53: }
54:
55: #
56: ## main()
57: #
58:
1.2.8.1 ! misho 59: echo "ELWIX>>> Firmware BaseFS boot stage ..."
! 60:
! 61: mount -a || \
! 62: umount -A && fsck -y 1>/dev/null 2>&1 && mount -a || \
! 63: umount -Af && fsck -f -y 1>/dev/null 2>&1 && mount -a || \
! 64: failed_sysvol mount "system volume"
1.2 misho 65:
66: if test -c "$FIT2CF" -a -d "$CFDIR"; then
1.2.8.1 ! misho 67: echo " BaseFS: Mount ELWIX flash volume"
! 68: mount -o ro $FIT2CF || \
! 69: fsck -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \
1.2 misho 70: failed_sysvol mount "flash volume"
71: fi
72:
1.2.8.1 ! misho 73: if test -r "$FRMPATH/$FRMFILE2"; then
1.2 misho 74: boot_elwix2
75: fi
76:
77: exec /etc/rc.init
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>