--- elwix/config/etc/default/rc.init 2012/02/16 10:05:34 1.1.1.1.6.2 +++ elwix/config/etc/default/rc.init 2017/06/16 09:33:27 1.6.2.2 @@ -2,7 +2,7 @@ # # Boot startup script for elwix :) # -# $Id: rc.init,v 1.1.1.1.6.2 2012/02/16 10:05:34 misho Exp $ +# $Id: rc.init,v 1.6.2.2 2017/06/16 09:33:27 misho Exp $ stty status '^T' @@ -18,9 +18,8 @@ EDITOR=vi PAGER=less export HOME PATH TERM BLOCKSIZE EDITOR PAGER -SYSPKGDIR="/system" +SYSPKGDIR="/var/frm" BOOTLOG="/var/run/elwix.boot" -XML="/etc/config.xml" MGMT_VLAN="4093" MGMT_NAME="mgmt" @@ -30,16 +29,21 @@ umask 022 boot() { - echo "Check and mount filesystems ..." - fsck -y 1>/dev/null 2>&1 && mount -a || fsck -f -y - - echo "Loading elwix firmware variables ..." + echo "Loading ELWIX configz ..." cd /elwix/altroot pax -rw -pe var / chmod 1777 /var/tmp + mount -tunionfs -onoatime /var/db/etc /elwix/etc + 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 +62,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() @@ -81,6 +81,7 @@ mgmt() get1steth -v $VDEV | tee -a $BOOTLOG 1>/dev/null 2>&1 else VDEV=${VDEV:-`geteth`} + ifconfig $VDEV up ifconfig vlan$MGMT_VLAN create vlan $MGMT_VLAN vlandev $VDEV ifconfig vlan$MGMT_VLAN name $MGMT_NAME ifconfig $MGMT_NAME inet $MGMT_ADDR @@ -96,7 +97,7 @@ syspkg() echo "Mounting firmware system packages:" | tee -a $BOOTLOG # Raw images - for i in /elwix/cf/*-firmware.pkg; do + for i in /elwix/cf/*-pkg.frm; do if [ -r $i ]; then MDDEV=$(mdconfig -a -t vnode -f $i); install -d $SYSPKGDIR/$MDDEV; @@ -118,7 +119,7 @@ syspkg() fi done # UZIP images - for i in /elwix/cf/*-firmware-z.pkg; do + for i in /elwix/cf/*-pkg.frz; do if [ -r $i ]; then MDDEV=$(mdconfig -a -t vnode -f $i); install -d $SYSPKGDIR/$MDDEV; @@ -167,6 +168,7 @@ service() # boot +restore_uboot echo "elwix>>> Start system boot stage at `date`" | tee $BOOTLOG options passwd