summaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/base-files/etc
diff options
context:
space:
mode:
authorRoman Yeryomin <roman@advem.lv>2013-05-26 01:02:55 +0300
committerRoman Yeryomin <roman@advem.lv>2013-05-26 01:02:55 +0300
commit342045a35b1981a89e4bc80842b10c065e1050da (patch)
tree4140720b20e8d641c11da882010d6130a75fef21 /target/linux/ramips/base-files/etc
parent7338133dde8238afce34676214b494c8db96689b (diff)
parent1a116ce7818ecee5d167a9c0ebb1a0feca9120e6 (diff)
Merge trunk into realtek-unstable
Conflicts: Config.in feeds.conf.default package/base-files/files/etc/hotplug2-common.rules package/network/config/netifd/files/etc/init.d/network
Diffstat (limited to 'target/linux/ramips/base-files/etc')
-rwxr-xr-xtarget/linux/ramips/base-files/etc/diag.sh63
-rw-r--r--target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom25
-rw-r--r--target/linux/ramips/base-files/etc/inittab1
-rwxr-xr-xtarget/linux/ramips/base-files/etc/uci-defaults/01_leds (renamed from target/linux/ramips/base-files/etc/uci-defaults/leds)44
-rwxr-xr-xtarget/linux/ramips/base-files/etc/uci-defaults/02_network (renamed from target/linux/ramips/base-files/etc/uci-defaults/network)125
-rwxr-xr-xtarget/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header (renamed from target/linux/ramips/base-files/etc/uci-defaults/fixseama)0
6 files changed, 179 insertions, 79 deletions
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index d189db518..1970ae0bc 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -1,42 +1,33 @@
#!/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-615-d | 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)
@@ -70,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)
@@ -122,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"
;;
@@ -136,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 d02b1e0b4..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
;;
@@ -42,7 +42,6 @@ case "$FIRMWARE" in
rt2x00_eeprom_extract "devdata" 0 272
;;
- dir-615-d | \
rt-n10-plus | \
rt-g32-b1)
rt2x00_eeprom_extract "devconf" 0 272
@@ -54,14 +53,23 @@ 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 | \
@@ -72,6 +80,7 @@ case "$FIRMWARE" in
nbg-419n | \
nw718 | \
omni-emb | \
+ omni-emb-hpm | \
psr-680w | \
rt-n15 | \
rt-n56u | \
@@ -79,6 +88,7 @@ case "$FIRMWARE" in
v11st-fe | \
v22rw-2x2 | \
w306r-v20 | \
+ w150m | \
w502u | \
wcr-150gn | \
whr-g300n | \
@@ -86,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 81d9c44ea..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|\
@@ -41,6 +71,9 @@ case $board in
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"
;;
@@ -61,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"
;;
@@ -80,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 dff0fd66f..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
@@ -42,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"
;;
@@ -63,6 +64,12 @@ 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"
@@ -70,12 +77,28 @@ ramips_setup_interfaces()
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"
@@ -106,11 +129,12 @@ ramips_setup_interfaces()
ucidef_add_switch_vlan "switch0" "2" "0t 5"
;;
- freestation5 | \
wcr-150gn)
ucidef_set_interfaces_lan_wan "eth0.2" "eth0.1"
;;
+ d105 | \
+ omni-emb-hpm|\
wli-tx4-ag300n)
ucidef_set_interface_lan "eth0"
;;
@@ -136,96 +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=$(ramips_get_mac_nvram nvram lanmac)
- wan_mac=$(ramips_get_mac_nvram nvram wanmac)
+ 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=$(ramips_get_mac_binary factory 40)
- wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 3)
+ lan_mac=$(mtd_get_mac_binary factory 40)
+ wan_mac=$(macaddr_add "$lan_mac" 3)
;;
tew-692gr)
- lan_mac=$(ramips_get_mac_binary factory 40)
- wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 4)
+ 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/fixseama b/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header
index d8bed7951..d8bed7951 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/fixseama
+++ b/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header