Return to rc CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / elwix / config / etc / default |
1.2 misho 1: #!/bin/sh 2: # 1.3 misho 3: # Boot startup script for ELWIX BaseFS ... 1.2 misho 4: # 1.4 ! misho 5: # $Id: rc,v 1.3.2.11 2020/06/11 00:56:31 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.4 ! misho 21: ETCDEV="md1" ! 22: ETCSIZE="8m" ! 23: 1.3 misho 24: FRMDEV2="md4" 1.4 ! misho 25: FRMSIZE2="32m" 1.2 misho 26: FRMFILE2="elwix-firmware2.sys" 27: 28: FRMPATH="/elwix" 1.4 ! misho 29: FRM2PATH="/elwix/pkg" 1.2 misho 30: FIT2CF="/dev/ufs/fit2cf" 31: CFDIR="/elwix/cf" 32: 1.4 ! misho 33: ELWIX2="/dev/ufs/elwix2" ! 34: ELWIX="/dev/ufs/elwix" ! 35: 1.2 misho 36: umask 022 37: 38: failed_sysvol() 39: { 1.3 misho 40: echo " BaseFS: Failed $1 - $2 ... Go to emergency shell !!!" 1.2 misho 41: 42: exit 127 43: } 44: 45: boot_elwix2() 46: { 1.3 misho 47: echo " BaseFS: Loading ELWIX secondary firmware" 1.2 misho 48: 1.4 ! misho 49: mdmfs -s $FRMSIZE2 -S -n -m0 -oasync $FRMDEV2 $FRM2PATH 1.3 misho 50: if test $? -ne 0; then 1.2 misho 51: failed_sysvol "to mount firmware image " $FRMFILE2 52: fi 1.4 ! misho 53: cd $FRM2PATH 1.2 misho 54: pax -r -z -pe -f $FRMPATH/$FRMFILE2 1.3 misho 55: if test $? -ne 0; then 1.2 misho 56: failed_sysvol "to load firmware image " $FRMFILE2 57: fi 58: cd - 1.4 ! misho 59: mount -ur $FRM2PATH 1.2 misho 60: } 61: 62: # 63: ## main() 64: # 65: 1.3 misho 66: echo "ELWIX>>> Firmware BaseFS boot stage ..." 67: 68: if ! mount -a; then 69: umount -A 70: fsck -y 1>/dev/null 2>&1 71: if ! mount -a; then 72: umount -A -f 73: fsck -f -y 1>/dev/null 2>&1 74: if ! mount -a; then 1.4 ! misho 75: failed_sysvol mount "system volumes" 1.3 misho 76: fi 77: fi 78: fi 1.2 misho 79: 80: if test -c "$FIT2CF" -a -d "$CFDIR"; then 1.4 ! misho 81: echo " RootFS: Mount ELWIX flash volume" ! 82: if ! mount -o ro $FIT2CF $CFDIR; then ! 83: umount $CFDIR ! 84: fsck -y -tufs $FIT2CF 1>/dev/null 2>&1 ! 85: if ! mount -o ro $FIT2CF $CFDIR; then ! 86: echo "Error:: mount of $FIT2CF to $CFDIR failed!" ! 87: fi ! 88: fi 1.2 misho 89: fi 90: 1.3 misho 91: if test -r "$FRMPATH/$FRMFILE2"; then 1.2 misho 92: boot_elwix2 93: fi 94: 1.4 ! misho 95: mkdir /var/etc ! 96: mount -tunionfs /var/etc /etc ! 97: 1.2 misho 98: exec /etc/rc.init