--- elwix/config/etc/default/rc.init 2011/11/02 10:04:11 1.1.1.1.6.1 +++ elwix/config/etc/default/rc.init 2012/10/10 14:29:11 1.1.1.1.6.4 @@ -2,7 +2,7 @@ # # Boot startup script for elwix :) # -# $Id: rc.init,v 1.1.1.1.6.1 2011/11/02 10:04:11 misho Exp $ +# $Id: rc.init,v 1.1.1.1.6.4 2012/10/10 14:29:11 misho Exp $ stty status '^T' @@ -18,10 +18,14 @@ EDITOR=vi PAGER=less export HOME PATH TERM BLOCKSIZE EDITOR PAGER -SYSPKGDIR="/system" +SYSPKGDIR="/var/sys" BOOTLOG="/var/run/elwix.boot" XML="/etc/config.xml" +MGMT_VLAN="4093" +MGMT_NAME="mgmt" +MGMT_ADDR="10.254.254.254/30" + umask 022 boot() @@ -54,8 +58,10 @@ 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` - hostname `xmler -g /elwix/system/hostname $XML` - domainname `xmler -g /elwix/system/domain $XML` + if [ -x /usr/bin/xmler ]; then + hostname `xmler -g /elwix/system/hostname $XML` + domainname `xmler -g /elwix/system/domain $XML` + fi } geteth() @@ -69,10 +75,18 @@ geteth() mgmt() { [ -r /etc/mylan ] && VDEV=`cat /etc/mylan` - VDEV=${VDEV:-`get1steth -g`} + if [ -x /usr/bin/get1steth ]; then + VDEV=${VDEV:-`get1steth -g`} + get1steth -v $VDEV | tee -a $BOOTLOG 1>/dev/null 2>&1 + else + VDEV=${VDEV:-`geteth`} + ifconfig vlan$MGMT_VLAN create vlan $MGMT_VLAN vlandev $VDEV + ifconfig vlan$MGMT_VLAN name $MGMT_NAME + ifconfig $MGMT_NAME inet $MGMT_ADDR + fi + echo "Configurete management interface to ($VDEV) ..." | tee -a $BOOTLOG - get1steth -v $VDEV | tee -a $BOOTLOG 1>/dev/null 2>&1 } syspkg() @@ -82,7 +96,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.fw; do if [ -r $i ]; then MDDEV=$(mdconfig -a -t vnode -f $i); install -d $SYSPKGDIR/$MDDEV; @@ -104,7 +118,7 @@ syspkg() fi done # UZIP images - for i in /elwix/cf/*-firmware-z.pkg; do + for i in /elwix/cf/*-pkg.fwz; do if [ -r $i ]; then MDDEV=$(mdconfig -a -t vnode -f $i); install -d $SYSPKGDIR/$MDDEV;