diff options
author | mbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-05-10 14:37:47 +0000 |
---|---|---|
committer | mbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-05-10 14:37:47 +0000 |
commit | de0bb1d6c480b2945cf25f80116d963b22dd3c7a (patch) | |
tree | 0d8ea6a346ce1aed9ac866ebb526f81832423ec0 /target/linux/brcm-2.4/base-files/default/etc | |
parent | c5eea72dc54a79a3375fa7e9cf560ba757e01147 (diff) |
unified preinit environment
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7173 3c298f89-4303-0410-b956-a3cf2f4a3e73
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 0640b6193..000000000 --- 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 7a61c9412..d3a0bfc49 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 |