--- elwix/config/etc/default/rc.init 2013/10/14 07:23:59 1.3.4.1 +++ elwix/config/etc/default/rc.init 2017/10/09 22:22:27 1.6.2.6 @@ -2,7 +2,7 @@ # # Boot startup script for elwix :) # -# $Id: rc.init,v 1.3.4.1 2013/10/14 07:23:59 misho Exp $ +# $Id: rc.init,v 1.6.2.6 2017/10/09 22:22:27 misho Exp $ stty status '^T' @@ -18,9 +18,9 @@ EDITOR=vi PAGER=less export HOME PATH TERM BLOCKSIZE EDITOR PAGER +CFDIR="/elwix/cf" SYSPKGDIR="/var/frm" BOOTLOG="/var/run/elwix.boot" -XML="/etc/config.xml" MGMT_VLAN="4093" MGMT_NAME="mgmt" @@ -30,16 +30,21 @@ umask 022 boot() { - echo "Check and mount filesystems ..." - fsck -y 1>/dev/null 2>&1 && mount -a || fsck -f -y + echo "Loading ELWIX configz ..." - echo "Loading elwix firmware variables ..." cd /elwix/altroot pax -rw -pe var / chmod 1777 /var/tmp + mount -ttmpfs tmpfs /var/db/pkg cd / } +restore_uboot() +{ + echo "Restore configz from NAND ..." + /etc/rc.cfg load /etc +} + options() { echo "Set firmware options ..." | tee -a $BOOTLOG @@ -58,10 +63,6 @@ local() echo "Configurate localhost ..." | tee -a $BOOTLOG ifconfig lo0 127.0.0.1 | tee -a $BOOTLOG 1>/dev/null 2>&1 hostname `cat /etc/myname` - if [ -x /usr/bin/xmler ]; then - hostname `xmler -g /elwix/system/hostname $XML` - domainname `xmler -g /elwix/system/domain $XML` - fi } geteth() @@ -97,7 +98,7 @@ syspkg() echo "Mounting firmware system packages:" | tee -a $BOOTLOG # Raw images - for i in /elwix/cf/*-pkg.frm; do + for i in ${CFDIR}/*-pkg.frm; do if [ -r $i ]; then MDDEV=$(mdconfig -a -t vnode -f $i); install -d $SYSPKGDIR/$MDDEV; @@ -119,7 +120,7 @@ syspkg() fi done # UZIP images - for i in /elwix/cf/*-pkg.frz; do + for i in ${CFDIR}/*-pkg.frz; do if [ -r $i ]; then MDDEV=$(mdconfig -a -t vnode -f $i); install -d $SYSPKGDIR/$MDDEV; @@ -146,7 +147,7 @@ service() { echo "Starting distribution static services:" | tee -a $BOOTLOG for i in /etc/rc.d/*.run; do - if [ -x $i ]; then + if [ -x "$i" ]; then $i fi done @@ -156,7 +157,7 @@ service() echo "Starting distribution services:" | tee -a $BOOTLOG for i in /etc/rc.S/*.run; do - if [ -x $i ]; then + if [ -x "$i" ]; then $i fi done @@ -168,6 +169,7 @@ service() # boot +restore_uboot echo "elwix>>> Start system boot stage at `date`" | tee $BOOTLOG options passwd