brcm-2.4: Fixed preinit and failsafe switch configuration
authorDaniel Dickinson <crazycshore@gmail.com>
Mon, 10 May 2010 17:10:47 +0000 (17:10 +0000)
committerDaniel Dickinson <crazycshore@gmail.com>
Mon, 10 May 2010 17:10:47 +0000 (17:10 +0000)
SVN-Revision: 21417

.gitignore
target/linux/brcm-2.4/base-files/lib/preinit/05_failsafe_config_switch_brcm [new file with mode: 0644]
target/linux/brcm-2.4/base-files/lib/preinit/15_set_preinit_interface_brcm
target/linux/brcm-2.4/base-files/lib/preinit/20_failsafe_net_echo [new file with mode: 0644]

index e3479758d0ee3ee4f07373d68532b370d3c23d69..6142076be2e5b0b00245ed9c91d376a419afdddb 100644 (file)
@@ -1,7 +1,6 @@
 .*.swp
 /env
 /dl
-/.config
 /.config.old
 /bin
 /build_dir
@@ -9,7 +8,5 @@
 /tmp
 /logs
 /feeds
-/feeds.conf
-/files
 /package/feeds
 /package/openwrt-packages
diff --git a/target/linux/brcm-2.4/base-files/lib/preinit/05_failsafe_config_switch_brcm b/target/linux/brcm-2.4/base-files/lib/preinit/05_failsafe_config_switch_brcm
new file mode 100644 (file)
index 0000000..0bfce5f
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+failsafe_config_switch() {
+       [ -d /proc/switch/eth0 ] && [ "$ifname" = "eth0" ] && {
+               echo "0 1 2 3 4 ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/0/ports
+       }
+}
+
+boot_hook_add failsafe failsafe_config_switch
+
index 1bef26bf00ae01cef9cb63f6a91c86f3d84efa74..fdc7c71ca7e03ed78a96f6a56298af45b21e6fe7 100644 (file)
@@ -30,9 +30,10 @@ preinit_net_echo() {
                        echo "$port ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/0/ports
                        port_net_echo $1
                }; done
+               
+               echo "0 ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/0/ports
+               
        } || port_net_echo $1
-
-       preinit_ip_deconfig
 }
 
 
diff --git a/target/linux/brcm-2.4/base-files/lib/preinit/20_failsafe_net_echo b/target/linux/brcm-2.4/base-files/lib/preinit/20_failsafe_net_echo
new file mode 100644 (file)
index 0000000..f030cb2
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+indicate_failsafe() {
+       preinit_net_echo() {
+               port_net_echo $1
+       }
+       echo "- failsafe -"
+       preinit_net_echo "Entering Failsafe!\n"
+       indicate_failsafe_led
+}
+
+