diff options
author | Mike Baker <mbm@openwrt.org> | 2007-05-10 14:37:47 +0000 |
---|---|---|
committer | Mike Baker <mbm@openwrt.org> | 2007-05-10 14:37:47 +0000 |
commit | 4a41439c46022840555c3c16c30324b5760c07e2 (patch) | |
tree | 4724b34dc713936c9d20d3d93dc5778a4e849db3 /target/linux/brcm-2.4/base-files/default/etc | |
parent | 862103b0398c9cf0b5ba1d1a58d8a81bbe3d4452 (diff) | |
download | mtk-20170518-4a41439c46022840555c3c16c30324b5760c07e2.zip mtk-20170518-4a41439c46022840555c3c16c30324b5760c07e2.tar.gz mtk-20170518-4a41439c46022840555c3c16c30324b5760c07e2.tar.bz2 |
unified preinit environment
SVN-Revision: 7173
Diffstat (limited to 'target/linux/brcm-2.4/base-files/default/etc')
-rwxr-xr-x | target/linux/brcm-2.4/base-files/default/etc/init.d/done | 15 | ||||
-rwxr-xr-x | target/linux/brcm-2.4/base-files/default/etc/preinit.arch (renamed from target/linux/brcm-2.4/base-files/default/etc/preinit) | 23 |
2 files changed, 7 insertions, 31 deletions
diff --git a/target/linux/brcm-2.4/base-files/default/etc/init.d/done b/target/linux/brcm-2.4/base-files/default/etc/init.d/done deleted file mode 100755 index 0640b61..0000000 --- a/target/linux/brcm-2.4/base-files/default/etc/init.d/done +++ /dev/null @@ -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 -} diff --git a/target/linux/brcm-2.4/base-files/default/etc/preinit b/target/linux/brcm-2.4/base-files/default/etc/preinit.arch index 7a61c94..d3a0bfc 100755 --- a/target/linux/brcm-2.4/base-files/default/etc/preinit +++ b/target/linux/brcm-2.4/base-files/default/etc/preinit.arch @@ -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 |