diff options
author | James <> | 2013-03-17 12:16:37 +0000 |
---|---|---|
committer | James <> | 2013-03-17 12:16:37 +0000 |
commit | 27b76ab0671089c47506615a796a261e993896a7 (patch) | |
tree | 61213d67e7fa87b20356b23798558e2c4212c42f /target/linux/brcm47xx/base-files/lib/preinit/.svn | |
download | trunk-36060-master.tar.gz trunk-36060-master.tar.bz2 trunk-36060-master.zip |
Diffstat (limited to 'target/linux/brcm47xx/base-files/lib/preinit/.svn')
9 files changed, 433 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/base-files/lib/preinit/.svn/entries b/target/linux/brcm47xx/base-files/lib/preinit/.svn/entries new file mode 100644 index 0000000..40febaf --- /dev/null +++ b/target/linux/brcm47xx/base-files/lib/preinit/.svn/entries @@ -0,0 +1,300 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/brcm47xx/base-files/lib/preinit +svn://svn.openwrt.org/openwrt + + + +2013-02-20T15:31:43.052439Z +35704 +hauke + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +20_failsafe_set_boot_wait_brcm +file + + + + +2013-03-17T12:12:35.000000Z +eeeffdd4bf0de6528c6ab2ac3e756bb2 +2012-12-19T16:07:50.872491Z +34793 +mirko + + + + + + + + + + + + + + + + + + + + + +214 + +20_failsafe_net_echo_brcm +file + + + + +2013-03-17T12:12:35.000000Z +acd6ffc0309d7cd4638a3af4413218c5 +2012-11-25T14:03:51.450193Z +34329 +hauke + + + + + + + + + + + + + + + + + + + + + +164 + +03_init_hotplug_failsafe_brcm +file + + + + +2013-03-17T12:12:35.000000Z +ad2c1ecd327bc9b35af0ad76a30fd012 +2012-11-25T14:03:51.450193Z +34329 +hauke + + + + + + + + + + + + + + + + + + + + + +147 + +05_reset_button_brcm +file + + + + +2013-03-17T12:12:35.000000Z +0f6f06ce0b73e3e754a4670326b6e976 +2012-11-25T14:03:51.450193Z +34329 +hauke + + + + + + + + + + + + + + + + + + + + + +98 + +05_init_interfaces_brcm +file + + + + +2013-03-17T12:12:35.000000Z +6ae0ed185d35224b0308dfd4b512db72 +2013-02-16T16:24:15.143971Z +35624 +hauke + + + + + + + + + + + + + + + + + + + + + +747 + +05_set_failsafe_switch_brcm +file + + + + +2013-03-17T12:12:35.000000Z +31e0a50bc7b08d23dc2416725f069cf0 +2013-02-20T15:31:43.052439Z +35704 +hauke + + + + + + + + + + + + + + + + + + + + + +374 + +15_mount_proc_brcm +file + + + + +2013-03-17T12:12:35.000000Z +964ea24af2a1ed02a564e9a2cbe9d3f6 +2012-12-19T16:07:46.450520Z +34792 +mirko + + + + + + + + + + + + + + + + + + + + + +70 + +15_set_preinit_interface_brcm +file + + + + +2013-03-17T12:12:35.000000Z +9cc4526950fa429fcd5ef2d9664959ce +2013-02-20T15:31:43.052439Z +35704 +hauke + + + + + + + + + + + + + + + + + + + + + +929 + diff --git a/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/03_init_hotplug_failsafe_brcm.svn-base b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/03_init_hotplug_failsafe_brcm.svn-base new file mode 100644 index 0000000..a930b7e --- /dev/null +++ b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/03_init_hotplug_failsafe_brcm.svn-base @@ -0,0 +1,7 @@ +#!/bin/sh + +init_hotplug_failsafe() { + echo '/sbin/hotplug.failsafe' > /proc/sys/kernel/hotplug +} + +boot_hook_add preinit_main init_hotplug_failsafe diff --git a/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/05_init_interfaces_brcm.svn-base b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/05_init_interfaces_brcm.svn-base new file mode 100644 index 0000000..e85dd49 --- /dev/null +++ b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/05_init_interfaces_brcm.svn-base @@ -0,0 +1,39 @@ +#!/bin/sh + +set_preinit_iface() { + ifname=eth0 + + insmod diag + insmod hwmon + insmod pps_core + insmod ptp + insmod tg3 + insmod b44 + insmod bgmac + + # hardware specific overrides + case "$(cat /proc/diag/model)" in + "Linksys WAP54G V1") ifname=eth1;; + "ASUS WL-HDD") ifname=eth1;; + "ASUS WL-300g") ifname=eth1;; + "ASUS (unknown, BCM4702)") ifname=eth1;; + "Sitecom WL-105b") ifname=eth1;; + esac + ifconfig $ifname 0.0.0.0 up +} + +init_iface() { + insmod switch-core + insmod switch-robo + insmod switch-adm + + [ -d /proc/switch/eth0 ] && [ "$ifname" = "eth0" ] && { + case "$(cat /proc/switch/eth0/cpuport)" in + "5") cpu_port="5u*";; + "8") cpu_port="8u*";; + esac + } +} + +boot_hook_add preinit_main set_preinit_iface +boot_hook_add preinit_main init_iface diff --git a/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/05_reset_button_brcm.svn-base b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/05_reset_button_brcm.svn-base new file mode 100644 index 0000000..5aa7bc0 --- /dev/null +++ b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/05_reset_button_brcm.svn-base @@ -0,0 +1,7 @@ +#!/bin/sh + +enable_reset_button() { + insmod diag +} + +boot_hook_add preinit_main enable_reset_button diff --git a/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/05_set_failsafe_switch_brcm.svn-base b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/05_set_failsafe_switch_brcm.svn-base new file mode 100644 index 0000000..dd8fd6e --- /dev/null +++ b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/05_set_failsafe_switch_brcm.svn-base @@ -0,0 +1,14 @@ +#!/bin/sh + +failsafe_ip() { + [ -d /proc/switch/eth0 ] && [ "$ifname" = "eth0" ] && { + ifconfig eth0 0.0.0.0 down + echo "0 1 2 3 4 ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/1/ports + } + + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { + ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up + } +} + +boot_hook_add failsafe failsafe_ip diff --git a/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/15_mount_proc_brcm.svn-base b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/15_mount_proc_brcm.svn-base new file mode 100644 index 0000000..4ca4456 --- /dev/null +++ b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/15_mount_proc_brcm.svn-base @@ -0,0 +1,5 @@ +#!/bin/sh + +do_mount_procfs() { + mount -o noatime none /proc -t proc +} diff --git a/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/15_set_preinit_interface_brcm.svn-base b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/15_set_preinit_interface_brcm.svn-base new file mode 100644 index 0000000..8c425a0 --- /dev/null +++ b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/15_set_preinit_interface_brcm.svn-base @@ -0,0 +1,37 @@ +#!/bin/sh + +port_net_echo() { + [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { + if [ "$pi_preinit_net_messages" = "y" ] || [ "$pi_failsafe_net_message" = "true" ] && [ "$pi_preinit_no_failsafe_netmsg" != "y" ]; then + netmsg $pi_broadcast "$1" + fi + } +} + +preinit_ip_deconfig() { + if [ -z "$pi_ifname" ]; then + ifconfig $ifname 0.0.0.0 down + else + grep -q "$pi_ifname" /proc/net/dev && { + ifconfig $pi_ifname 0.0.0.0 down + } + fi +} + +preinit_net_echo() { + preinit_ip + + [ -d /proc/switch/eth0 ] && [ "$pi_ifname" = "eth0" ] && { + echo 1 > /proc/switch/eth0/reset + + # this would be easier if we blasted the message across all ports + # but we don't want packets leaking across interfaces + for port in $(seq 0 4); do { + echo "$port ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/1/ports + port_net_echo $1 + }; done + + echo "0 1 2 3 4 ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/1/ports + + } || port_net_echo $1 +} diff --git a/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/20_failsafe_net_echo_brcm.svn-base b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/20_failsafe_net_echo_brcm.svn-base new file mode 100644 index 0000000..2b0d2cc --- /dev/null +++ b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/20_failsafe_net_echo_brcm.svn-base @@ -0,0 +1,10 @@ +#!/bin/sh + +indicate_failsafe() { + preinit_net_echo() { + port_net_echo $1 + } + echo "- failsafe -" + preinit_net_echo "Entering Failsafe!\n" + indicate_failsafe_led +} diff --git a/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/20_failsafe_set_boot_wait_brcm.svn-base b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/20_failsafe_set_boot_wait_brcm.svn-base new file mode 100644 index 0000000..001f5f4 --- /dev/null +++ b/target/linux/brcm47xx/base-files/lib/preinit/.svn/text-base/20_failsafe_set_boot_wait_brcm.svn-base @@ -0,0 +1,14 @@ +#!/bin/sh + +. /lib/functions.sh + +set_boot_wait() { + [ -x "/usr/sbin/nvram" ] && { + [ "$(nvram get boot_wait)" != "on" ] && { + nvram set boot_wait=on + nvram commit + } + } +} + +boot_hook_add failsafe set_boot_wait |