diff options
Diffstat (limited to 'target/linux/ramips/base-files/etc')
-rwxr-xr-x | target/linux/ramips/base-files/etc/diag.sh | 73 | ||||
-rw-r--r-- | target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom | 25 | ||||
-rw-r--r-- | target/linux/ramips/base-files/etc/inittab | 1 | ||||
-rwxr-xr-x | target/linux/ramips/base-files/etc/uci-defaults/01_leds (renamed from target/linux/ramips/base-files/etc/uci-defaults/leds) | 45 | ||||
-rwxr-xr-x | target/linux/ramips/base-files/etc/uci-defaults/02_network (renamed from target/linux/ramips/base-files/etc/uci-defaults/network) | 147 | ||||
-rwxr-xr-x | target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header | 20 |
6 files changed, 238 insertions, 73 deletions
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 472013025..1970ae0bc 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -1,44 +1,38 @@ #!/bin/sh -# -# Copyright (C) 2010 OpenWrt.org -# -# +# Copyright (C) 2010-2013 OpenWrt.org +. /lib/functions/leds.sh . /lib/ramips.sh -status_led="" - -led_set_attr() { - [ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2" -} - -status_led_set_timer() { - led_set_attr $status_led "trigger" "timer" - led_set_attr $status_led "delay_on" "$1" - led_set_attr $status_led "delay_off" "$2" -} - -status_led_on() { - led_set_attr $status_led "trigger" "none" - led_set_attr $status_led "brightness" 255 -} - -status_led_off() { - led_set_attr $status_led "trigger" "none" - led_set_attr $status_led "brightness" 0 -} - get_status_led() { case $(ramips_board_name) in 3g-6200n) status_led="edimax:green:power" ;; + 3g300m | w150m) + status_led="tenda:blue:ap" + ;; argus-atp52b) status_led="argus-atp52b:green:run" ;; - dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-615-h1 | dir-620-a1) + asl26555) + status_led="asl26555:green:power" + ;; + br6524n) + status_led="edimax:blue:power" + ;; + br6425) + status_led="edimax:green:power" + ;; + d105) + status_led="d105:red:power" + ;; + dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-615-h1 | dir-615-d | dir-620-a1| dir-620-d1) status_led="d-link:green:status" ;; + dir-645) + status_led="d-link:green:wps" + ;; dap-1350) status_led="d-link:blue:power" ;; @@ -51,6 +45,9 @@ get_status_led() { fonera20n) status_led="fonera20n:green:power" ;; + rt-n13u) + status_led="rt-n13u:power" + ;; all0239-3g|\ hw550-3g) status_led="hw550-3g:green:status" @@ -64,7 +61,8 @@ get_status_led() { nw718) status_led="nw718:amber:cpu" ;; - omni-emb) + omni-emb|\ + omni-emb-hpm) status_led="emb:green:status" ;; psr-680w) @@ -85,6 +83,10 @@ get_status_led() { sl-r7205) status_led="sl-r7205:green:status" ;; + tew-691gr|\ + tew-692gr) + status_led="trendnet:green:wps" + ;; v11st-fe) status_led="v11st-fe:green:status" ;; @@ -112,6 +114,15 @@ get_status_led() { wr512-3gn) status_led="wr512:green:wps" ;; + wnce2001) + status_led="netgear:green:power" + ;; + mzk-w300nh2) + status_led="mzkw300nh2:green:power" + ;; + ur-326n4g) + status_led="ur326:green:wps" + ;; ur-336un) status_led="ur336:green:wps" ;; @@ -126,11 +137,11 @@ set_state() { case "$1" in preinit) - insmod leds-gpio - status_led_set_timer 200 200 + insmod leds-gpio 2> /dev/null + status_led_blink_preinit ;; failsafe) - status_led_set_timer 50 50 + status_led_blink_failsafe ;; done) status_led_on diff --git a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom index bb7f66284..320e01d90 100644 --- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom +++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom @@ -11,7 +11,7 @@ rt2x00_eeprom_extract() { local count=$3 local mtd - . /etc/functions.sh + . /lib/functions.sh mtd=$(find_mtd_part $part) [ -n "$mtd" ] || \ @@ -28,13 +28,13 @@ rt2x00_eeprom_extract() { board=$(ramips_board_name) case "$FIRMWARE" in -"RT288X.eeprom" | \ -"RT305X.eeprom" | \ -"RT3883.eeprom") +"soc_wmac.eeprom") case $board in + asl26555 | \ dir-300-b1 | \ dir-600-b1 | \ - dir-600-b2) + dir-600-b2 | \ + dir-615-d) rt2x00_eeprom_extract "devdata" 16384 272 ;; @@ -53,16 +53,26 @@ case "$FIRMWARE" in ;; 3g-6200n | \ + 3g-6200nl | \ + 3g300m | \ + air3gii | \ all0239-3g | \ all0256n | \ all5002 | \ + all5003 | \ argus-atp52b | \ bc2 | \ + br6425 | \ + broadway | \ + br6524n | \ carambola | \ + d105 | \ dir-615-h1 | \ dir-620-a1 | \ + dir-620-d1 | \ esr-9753 | \ fonera20n | \ + rt-n13u | \ freestation5 | \ hw550-3g | \ mofi3500-3gn | \ @@ -70,6 +80,7 @@ case "$FIRMWARE" in nbg-419n | \ nw718 | \ omni-emb | \ + omni-emb-hpm | \ psr-680w | \ rt-n15 | \ rt-n56u | \ @@ -77,6 +88,7 @@ case "$FIRMWARE" in v11st-fe | \ v22rw-2x2 | \ w306r-v20 | \ + w150m | \ w502u | \ wcr-150gn | \ whr-g300n | \ @@ -84,8 +96,11 @@ case "$FIRMWARE" in wl-330n3g | \ wl-351 | \ wli-tx4-ag300n | \ + wnce2001 | \ wr512-3gn | \ wr6202 | \ + mzk-w300nh2 | \ + ur-326n4g | \ ur-336un | \ xdxrn502j) rt2x00_eeprom_extract "factory" 0 272 diff --git a/target/linux/ramips/base-files/etc/inittab b/target/linux/ramips/base-files/etc/inittab index 67c36a6a9..870b3cc76 100644 --- a/target/linux/ramips/base-files/etc/inittab +++ b/target/linux/ramips/base-files/etc/inittab @@ -1,4 +1,3 @@ ::sysinit:/etc/init.d/rcS S boot ::shutdown:/etc/init.d/rcS K shutdown ttyS0::askfirst:/bin/ash --login -ttyS1::askfirst:/bin/ash --login diff --git a/target/linux/ramips/base-files/etc/uci-defaults/leds b/target/linux/ramips/base-files/etc/uci-defaults/01_leds index 2fddc011e..ec031883e 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/leds +++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds @@ -18,6 +18,16 @@ case $board in set_wifi_led "edimax:amber:wlan" set_usb_led "edimax:blue:3g" ;; + 3g-6200nl) + set_wifi_led "edimax:green:wlan" + ;; + 3g300m) + set_usb_led "tenda:blue:3g" + ;; + air3gii) + set_wifi_led "airlive:green:wlan" + set_usb_led "airlive:green:mobile" + ;; all0256n) ucidef_set_rssimon "wlan0" "40000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6" @@ -25,9 +35,29 @@ case $board in ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8" set_wifi_led "rt2800pci-phy0::radio" ;; + asl26555) + ucidef_set_led_default "power" "POWER" "asl26555:green:power" "1" + ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0" + set_wifi_led "asl26555:green:wlan" + set_usb_led "asl26555:green:3g" + ;; bc2) set_usb_led "bc2:blue:usb" ;; + br6425) + set_wifi_led "edimax:orange:wlan" + ;; + broadway) + set_usb_led "red:diskmounted" + set_wifi_led "red:wps_active" + ;; + br6524n) + set_wifi_led "edimax:blue:wlan" + ;; + d105) + ucidef_set_led_default "power" "POWER" "d105:red:power" "1" + set_usb_led "d105:green:usb" + ;; dir-300-b1|\ dir-600-b1|\ dir-600-b2|\ @@ -36,10 +66,14 @@ case $board in ucidef_set_led_default "wan" "WAN LED (amber)" "d-link:amber:wan" "1" set_wifi_led "rt2800pci-phy0::radio" ;; + dir-615-d|\ dir-615-h1) ucidef_set_led_default "status" "Status LED (amber)" "d-link:amber:status" "0" set_wifi_led "rt2800pci-phy0::radio" ;; + dir-620-d1) + set_wifi_led "d-link:green:wifi" + ;; esr-9753) set_wifi_led "rt2800pci-phy0::radio" ;; @@ -60,9 +94,17 @@ case $board in mofi3500-3gn) set_usb_led "mofi3500-3gn:green:usb" ;; + mzk-w300nh2) + set_wifi_led "mzkw300nh2:amber:wlan" + ;; nw718) set_usb_led "nw718:amber:usb" ;; + omni-emb-hpm) + ucidef_set_led_default "power" "POWER" "emb:orange:power" "1" + ucidef_set_led_netdev "eth" "ETH" "emb:green:eth" "eth0" + set_wifi_led "emb:green:wifi" + ;; sl-r7205) set_wifi_led "rt2800pci-phy0::radio" ;; @@ -79,6 +121,9 @@ case $board in wcr-150gn) set_usb_led "wcr150gn:amber:user" ;; + wnce2001) + set_wifi_led "netgear:green:wlan" + ;; esac ucidef_commit_leds diff --git a/target/linux/ramips/base-files/etc/uci-defaults/network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 76c690198..fe81899e7 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -1,14 +1,9 @@ #!/bin/sh -. /etc/functions.sh +. /lib/functions.sh . /lib/ramips.sh . /lib/functions/uci-defaults.sh -if [ ! -x /usr/sbin/maccalc ]; then - echo "$0: maccalc not found!" - return -fi - ramips_setup_rt3x5x_vlans() { if [ ! -x /sbin/swconfig ]; then @@ -18,6 +13,7 @@ ramips_setup_rt3x5x_vlans() fi local wanports="" local lanports="" + swconfig dev rt305x set reset 1 for port in 5 4 3 2 1 0; do if [ `swconfig dev rt305x port $port get disable` = "1" ]; then continue @@ -41,12 +37,18 @@ ramips_setup_interfaces() ucidef_set_interface_loopback case $board in + 3g300m | \ + w150m | \ all0256n | \ - all5002) + all5002 | \ + all5003 | \ + broadway | \ + wnce2001) + ucidef_add_switch "switch0" "1" "0" ucidef_set_interface_lan "eth0" ;; - dir-615-h1 | \ + 3g-6200nl | \ wl-330n) ucidef_set_interface_lan "eth0.1" ;; @@ -62,12 +64,41 @@ ramips_setup_interfaces() ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ;; + asl26555) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t" + ;; + + dir-645) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t" + ucidef_add_switch_vlan "switch0" "2" "0 6t" + ;; + + dir-615-h1 | \ + mzk-w300nh2) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t" + ucidef_add_switch_vlan "switch0" "2" "4 6t" + ;; + f5d8235-v1 | \ f5d8235-v2 | \ + ur-326n4g) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t" + ucidef_add_switch_vlan "switch0" "2" "0 6t" + ;; + ur-336un) ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ;; + br6524n | \ v11st-fe) ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ucidef_add_switch "switch0" "1" "1" @@ -90,17 +121,26 @@ ramips_setup_interfaces() ucidef_add_switch_vlan "switch0" "2" "4 8t" ;; - freestation5 | \ + tew-691gr|\ + tew-692gr) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4" + ucidef_add_switch_vlan "switch0" "2" "0t 5" + ;; + wcr-150gn) ucidef_set_interfaces_lan_wan "eth0.2" "eth0.1" ;; + d105 | \ + omni-emb-hpm|\ wli-tx4-ag300n) ucidef_set_interface_lan "eth0" ;; *) - RT3X5X=`cat /proc/cpuinfo | grep RT3.5` + RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"` if [ -n "${RT3X5X}" ]; then ramips_setup_rt3x5x_vlans else @@ -120,80 +160,115 @@ ramips_setup_macs() all0256n | \ all5002 | \ dir-615-h1) - lan_mac=$(ramips_get_mac_binary factory 40) + lan_mac=$(mtd_get_mac_binary factory 40) ;; 3g-6200n | \ + 3g300m | \ + w150m | \ + air3gii | \ argus-atp52b | \ bc2 | \ + br6425 | \ + broadway | \ + dir-620-d1 | \ f5d8235-v1 | \ + mzk-w300nh2 | \ nw718 | \ psr-680w | \ rt-n15 | \ sl-r7205 | \ wl-351) - lan_mac=$(ramips_get_mac_binary factory 4) - wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1) + lan_mac=$(mtd_get_mac_binary factory 4) + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + + asl26555) + lan_mac=$(mtd_get_mac_binary devdata 16388) ;; w306r-v20) - lan_mac=$(ramips_get_mac_binary factory 4) - wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 5) + lan_mac=$(mtd_get_mac_binary factory 4) + wan_mac=$(macaddr_add "$lan_mac" 5) ;; + rt-n13u | \ fonera20n) - lan_mac=$(ramips_get_mac_binary factory 40) - wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1) + lan_mac=$(mtd_get_mac_binary factory 40) + wan_mac=$(macaddr_add "$lan_mac" 1) ;; dir-300-b1 |\ dir-300-b2 |\ dir-600-b1) - lan_mac=$(ramips_get_mac_binary devdata 16388) - wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1) + lan_mac=$(mtd_get_mac_binary devdata 16388) + wan_mac=$(macaddr_add "$lan_mac" 1) ;; dir-620-a1) - lan_mac=$(ramips_get_mac_binary factory 4) - lan_mac=$(maccalc or "$lan_mac" "02:00:00:00:00:00") - wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1) + lan_mac=$(mtd_get_mac_binary factory 4) + lan_mac=$(macaddr_setbit_la "$lan_mac") + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + + dir-645) + lan_mac=$(mtd_get_mac_ascii nvram lanmac) + wan_mac=$(mtd_get_mac_ascii nvram wanmac) ;; esr-9753 | \ + ur-326n4g | \ ur-336un) - lan_mac=$(ramips_get_mac_binary devdata 16388) - wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1) + lan_mac=$(mtd_get_mac_binary devdata 16388) + wan_mac=$(macaddr_add "$lan_mac" 1) ;; nbg-419n | \ wcr-150gn) - lan_mac=$(ramips_get_mac_binary factory 4) - wan_mac=$(ramips_get_mac_binary factory 40) + lan_mac=$(mtd_get_mac_binary factory 4) + wan_mac=$(mtd_get_mac_binary factory 40) + ;; + + omni-emb-hpm) + lan_mac=$(mtd_get_mac_binary factory 40) ;; f5d8235-v2) - lan_mac=$(ramips_get_mac_binary "u-boot" 262148) - wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1) + lan_mac=$(mtd_get_mac_binary "u-boot" 262148) + wan_mac=$(macaddr_add "$lan_mac" 1) ;; rt-n56u) - lan_mac=$(ramips_get_mac_binary factory 4) - wan_mac=$(ramips_get_mac_binary factory 32772) + lan_mac=$(mtd_get_mac_binary factory 4) + wan_mac=$(mtd_get_mac_binary factory 32772) + ;; + + tew-691gr) + lan_mac=$(mtd_get_mac_binary factory 40) + wan_mac=$(macaddr_add "$lan_mac" 3) + ;; + + tew-692gr) + lan_mac=$(mtd_get_mac_binary factory 40) + wan_mac=$(macaddr_add "$lan_mac" 4) ;; all0239-3g | \ carambola | \ - w502u) - lan_mac=$(ramips_get_mac_binary factory 40) - wan_mac=$(ramips_get_mac_binary factory 46) + freestation5 | \ + w502u | \ + wnce2001) + lan_mac=$(mtd_get_mac_binary factory 40) + wan_mac=$(mtd_get_mac_binary factory 46) ;; wl341v3) - lan_mac=$(ramips_get_mac_binary board-nvram 65440) - wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1) + lan_mac=$(mtd_get_mac_binary board-nvram 65440) + wan_mac=$(macaddr_add "$lan_mac" 1) ;; + d105 | \ wli-tx4-ag300n) - lan_mac=$(ramips_get_mac_binary factory 4) + lan_mac=$(mtd_get_mac_binary factory 4) ;; esac diff --git a/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header b/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header new file mode 100755 index 000000000..d8bed7951 --- /dev/null +++ b/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Copyright (C) 2012 OpenWrt.org +# + +. /lib/ramips.sh + +fix_seama_header() { + local part=$1 + + mtd fixseama $part +} + +board=$(ramips_board_name) + +case "$board" in +dir-645) + fix_seama_header kernel + ;; +esac |