1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

unified preinit environment

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7173 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
mbm
2007-05-10 14:37:47 +00:00
parent c5eea72dc5
commit de0bb1d6c4
14 changed files with 49 additions and 343 deletions

View File

@@ -1,15 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=95
boot() {
[ -d /tmp/root ] && {
lock /tmp/.switch2jffs
firstboot switch2jffs
lock -u /tmp/.switch2jffs
}
# set leds to normal state
. /etc/diag.sh
set_state done
}

View File

@@ -1,11 +1,12 @@
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
. /etc/functions.sh
. /etc/diag.sh
failsafe_ip() {
ifconfig $ifname 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up
}
failsafe() {
lock /tmp/.failsafe
failsafe_ip
echo "0 1 2 3 4 5u*" > /proc/switch/eth0/vlan/0/ports
@@ -23,10 +24,8 @@ failsafe() {
ash --login
}
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
mount none /proc -t proc
size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo)
mount none /tmp -t tmpfs -o size=$size
if grep devfs /proc/filesystems > /dev/null; then
mount none /dev -t devfs
M0=/dev/pty/m0
@@ -66,7 +65,7 @@ case "$(cat /proc/diag/model)" in
"ASUS (unknown, BCM4702)") ifname=eth1;;
esac
ifconfig $ifname 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up
failsafe_ip
insmod switch-core
insmod switch-robo || insmod switch-adm || rmmod switch-core
@@ -83,14 +82,6 @@ insmod switch-robo || insmod switch-adm || rmmod switch-core
} || netmsg 192.168.1.255 "Press reset now, to enter Failsafe!"
sleep 2
eval ${FAILSAFE:+failsafe}
lock -w /tmp/.failsafe
set_state preinit
echo "$HOTPLUG" > /proc/sys/kernel/hotplug
ifconfig $ifname 0.0.0.0 down
mount_root
exec /sbin/init