Return to rc CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / elwix / config / etc / default |
1.2 ! misho 1: #!/bin/sh ! 2: # ! 3: # Boot startup script for ELWIX RootFS ... ! 4: # ! 5: # $Id: rc,v 1.1.2.3 2013/08/02 13:27:57 misho Exp $ ! 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: { ! 33: echo " RootFS: Failed $1 - $2 ... Go to emergency shell !!!" ! 34: ! 35: exit 127 ! 36: } ! 37: ! 38: boot_elwix2() ! 39: { ! 40: echo " RootFS: Loading ELWIX secondary firmware" ! 41: ! 42: mdmfs -s $FRMSIZE2 -S -m0 -oasync $FRMDEV2 /usr/local ! 43: if [ "$?" != "0" ]; then ! 44: failed_sysvol "to mount firmware image " $FRMFILE2 ! 45: fi ! 46: cd /usr/local ! 47: pax -r -z -pe -f $FRMPATH/$FRMFILE2 ! 48: if [ "$?" != "0" ]; then ! 49: failed_sysvol "to load firmware image " $FRMFILE2 ! 50: fi ! 51: cd - ! 52: mount -ur /usr/local ! 53: } ! 54: ! 55: # ! 56: ## main() ! 57: # ! 58: ! 59: echo "ELWIX>>> Firmware RootFS boot stage ..." ! 60: echo " RootFS: Mount ELWIX system volume" ! 61: fsck -y 1>/dev/null 2>&1 && mount -a || fsck -y 1>/dev/null 2>&1 && mount -a || \ ! 62: fsck -f -y 1>/dev/null 2>&1 && mount -a || failed_sysvol mount "system volume" ! 63: ! 64: if test -c "$FIT2CF" -a -d "$CFDIR"; then ! 65: echo " RootFS: Mount ELWIX flash volume" ! 66: fsck -y -tufs $FIT2CF 1>/dev/null 2>&1 && mount -o ro $FIT2CF $CFDIR || \ ! 67: failed_sysvol mount "flash volume" ! 68: fi ! 69: ! 70: if [ -r $FRMPATH/$FRMFILE2 ]; then ! 71: boot_elwix2 ! 72: fi ! 73: ! 74: exec /etc/rc.init