--- elwix/config/etc/rootfs/rc 2012/10/09 12:19:20 1.1.1.1.6.6 +++ elwix/config/etc/rootfs/rc 2012/10/10 09:14:25 1.1.1.1.6.10 @@ -2,7 +2,7 @@ # # Boot startup script for ELWIX RootFS ... # -# $Id: rc,v 1.1.1.1.6.6 2012/10/09 12:19:20 misho Exp $ +# $Id: rc,v 1.1.1.1.6.10 2012/10/10 09:14:25 misho Exp $ stty status '^T' @@ -30,7 +30,7 @@ umask 022 failed_sysvol() { - echo " RootFS: Failed $1 ELWIX $2 ... Go to emergency shell !!!" + echo " RootFS: Failed $1 - $2 ... Go to emergency shell !!!" exit 127 } @@ -38,21 +38,28 @@ failed_sysvol() boot_elwix() { echo " RootFS: Loading ELWIX system firmware" - if test ! -r $FRMPATH/$FRMFILE; then - echo " RootFS: WARNING! Failed default firmware image!" - echo " RootFS: Try to load ELWIX backup firmware ..." - FRMPATH="$FRMPATH/altroot" - if test ! -r $FRMPATH/$FRMFILE; then - failed_sysvol "load backup and default image" elwix-firmware.sys - fi - fi - mdmfs -s $FRMSIZE -S -m0 -oasync $FRMDEV /usr + if [ "$?" != "0" ]; then + failed_sysvol "to mount firmware image " elwix-firmware.sys + fi cd /usr - pax -r -z -f $FRMPATH/$FRMFILE + pax -r -z -pe -f $FRMPATH/$FRMFILE + if [ "$?" != "0" ]; then + failed_sysvol "to load firmware image " elwix-firmware.sys + fi + cd - + mount -ur /usr +} - sleep 2 +mount_usr() +{ + echo " RootFS: Mounting ELWIX system image" + + mount -t nullfs -r $FRMPATH/usr /usr + if [ "$?" != "0" ]; then + failed_sysvol "to mount system image " elwix-firmware.sys + fi } # @@ -71,10 +78,14 @@ if test -c $FIT2CF -a -d $CFDIR; then failed_sysvol mount "flash volume" fi -if [ -r /elwix/elwix-firmware.sys ]; then +if [ -r $FRMPATH/$FRMFILE ]; then boot_elwix else - echo " RootFS: Skip loading ELWIX system firmware ..." + if [ -d $FRMPATH/usr ]; then + mount_usr + else + echo " RootFS: Skip loading ELWIX system firmware ..." + fi fi exec /etc/rc.init