version 1.1.1.1.6.4, 2012/10/10 14:29:11
|
version 1.6.2.7, 2020/06/11 00:56:31
|
Line 18 EDITOR=vi
|
Line 18 EDITOR=vi
|
PAGER=less |
PAGER=less |
export HOME PATH TERM BLOCKSIZE EDITOR PAGER |
export HOME PATH TERM BLOCKSIZE EDITOR PAGER |
|
|
SYSPKGDIR="/var/sys" | CFDIR="/elwix/cf" |
| SYSPKGDIR="/var/frm" |
BOOTLOG="/var/run/elwix.boot" |
BOOTLOG="/var/run/elwix.boot" |
XML="/etc/config.xml" |
|
|
|
MGMT_VLAN="4093" |
MGMT_VLAN="4093" |
MGMT_NAME="mgmt" |
MGMT_NAME="mgmt" |
Line 30 umask 022
|
Line 30 umask 022
|
|
|
boot() |
boot() |
{ |
{ |
echo "Check and mount filesystems ..." | echo "Loading ELWIX configz ..." |
fsck -y 1>/dev/null 2>&1 && mount -a || fsck -f -y | |
|
|
echo "Loading elwix firmware variables ..." |
|
cd /elwix/altroot |
cd /elwix/altroot |
pax -rw -pe var / |
pax -rw -pe var / |
chmod 1777 /var/tmp |
chmod 1777 /var/tmp |
|
mount -ttmpfs tmpfs /var/db/pkg |
cd / |
cd / |
} |
} |
|
|
|
restore_uboot() |
|
{ |
|
echo "Restore configz from NAND ..." |
|
/etc/rc.cfg load /etc |
|
} |
|
|
options() |
options() |
{ |
{ |
echo "Set firmware options ..." | tee -a $BOOTLOG |
echo "Set firmware options ..." | tee -a $BOOTLOG |
Line 56 passwd()
|
Line 61 passwd()
|
local() |
local() |
{ |
{ |
echo "Configurate localhost ..." | tee -a $BOOTLOG |
echo "Configurate localhost ..." | tee -a $BOOTLOG |
ifconfig lo0 127.0.0.1 | tee -a $BOOTLOG 1>/dev/null 2>&1 | ifconfig lo0 inet 127.0.0.1 netmask 255.0.0.0 | tee -a $BOOTLOG 1>/dev/null 2>&1 |
hostname `cat /etc/myname` |
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() |
geteth() |
Line 81 mgmt()
|
Line 82 mgmt()
|
get1steth -v $VDEV | tee -a $BOOTLOG 1>/dev/null 2>&1 |
get1steth -v $VDEV | tee -a $BOOTLOG 1>/dev/null 2>&1 |
else |
else |
VDEV=${VDEV:-`geteth`} |
VDEV=${VDEV:-`geteth`} |
|
ifconfig $VDEV up |
ifconfig vlan$MGMT_VLAN create vlan $MGMT_VLAN vlandev $VDEV |
ifconfig vlan$MGMT_VLAN create vlan $MGMT_VLAN vlandev $VDEV |
ifconfig vlan$MGMT_VLAN name $MGMT_NAME |
ifconfig vlan$MGMT_VLAN name $MGMT_NAME |
ifconfig $MGMT_NAME inet $MGMT_ADDR |
ifconfig $MGMT_NAME inet $MGMT_ADDR |
Line 96 syspkg()
|
Line 98 syspkg()
|
|
|
echo "Mounting firmware system packages:" | tee -a $BOOTLOG |
echo "Mounting firmware system packages:" | tee -a $BOOTLOG |
# Raw images |
# Raw images |
for i in /elwix/cf/*-pkg.fw; do | for i in ${CFDIR}/*-pkg.frm; do |
if [ -r $i ]; then |
if [ -r $i ]; then |
MDDEV=$(mdconfig -a -t vnode -f $i); |
MDDEV=$(mdconfig -a -t vnode -f $i); |
install -d $SYSPKGDIR/$MDDEV; |
install -d $SYSPKGDIR/$MDDEV; |
Line 118 syspkg()
|
Line 120 syspkg()
|
fi |
fi |
done |
done |
# UZIP images |
# UZIP images |
for i in /elwix/cf/*-pkg.fwz; do | for i in ${CFDIR}/*-pkg.frz; do |
if [ -r $i ]; then |
if [ -r $i ]; then |
MDDEV=$(mdconfig -a -t vnode -f $i); |
MDDEV=$(mdconfig -a -t vnode -f $i); |
install -d $SYSPKGDIR/$MDDEV; |
install -d $SYSPKGDIR/$MDDEV; |
Line 145 service()
|
Line 147 service()
|
{ |
{ |
echo "Starting distribution static services:" | tee -a $BOOTLOG |
echo "Starting distribution static services:" | tee -a $BOOTLOG |
for i in /etc/rc.d/*.run; do |
for i in /etc/rc.d/*.run; do |
if [ -x $i ]; then | if [ -x "$i" ]; then |
$i |
$i |
fi |
fi |
done |
done |
Line 155 service()
|
Line 157 service()
|
|
|
echo "Starting distribution services:" | tee -a $BOOTLOG |
echo "Starting distribution services:" | tee -a $BOOTLOG |
for i in /etc/rc.S/*.run; do |
for i in /etc/rc.S/*.run; do |
if [ -x $i ]; then | if [ -x "$i" ]; then |
$i |
$i |
fi |
fi |
done |
done |
Line 167 service()
|
Line 169 service()
|
# |
# |
|
|
boot |
boot |
|
restore_uboot |
echo "elwix>>> Start system boot stage at `date`" | tee $BOOTLOG |
echo "elwix>>> Start system boot stage at `date`" | tee $BOOTLOG |
options |
options |
passwd |
passwd |