diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2019-10-22 12:37:13 +0200 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2019-11-03 00:26:17 +0100 |
commit | 19724e28c81e3ff642f09c49f612cd147c54a697 (patch) | |
tree | 278c45d3b1563cee6108e65c3b5856dbab304062 /target/linux/ramips/base-files | |
parent | 0975c35b83a632f9662d1944307f87da9db06154 (diff) | |
download | upstream-19724e28c81e3ff642f09c49f612cd147c54a697.tar.gz upstream-19724e28c81e3ff642f09c49f612cd147c54a697.tar.bz2 upstream-19724e28c81e3ff642f09c49f612cd147c54a697.zip |
ramips: split base-files into subtargets
While most of the target's contents are split into subtargets, the
base-files are maintained for the target as a whole.
However, OpenWrt already implements a mechanism that will use (and
even prefer) files in the subtargets' directories. This can be
exploited to make several scripts subtarget-specific and thus save
some space.
In certain cases, keeping files in parent (=target) base-files was
more convenient, and thus no splitting was performed for those.
Note that this will increase overall code lines, but reduce code
per subtarget.
base-files ipk size reduction:
master (mt7621) 60958 B
split (mt7620) 46358 B (- 14.3 kiB)
split (mt7621) 48759 B (- 11.9 kiB)
split (mt76x8) 44948 B (- 15.6 kiB)
split (rt288x) 43508 B (- 17.0 kiB)
split (rt305x) 45616 B (- 15.0 kiB)
split (rt3883) 44176 B (- 16.4 kiB)
Run-tested on:
GL.iNet GL-MT300N-V2 (mt76x8)
D-Link DWR-116 (mt7620)
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ramips/base-files')
8 files changed, 0 insertions, 1594 deletions
diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds deleted file mode 100755 index 662bf6b6cd..0000000000 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ /dev/null @@ -1,481 +0,0 @@ -#!/bin/sh - -. /lib/functions/leds.sh -. /lib/functions/uci-defaults.sh - -set_wifi_led() { - ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}" -} - - -board=$(board_name) -boardname="${board##*,}" - -board_config_update - -led_wlan="$(get_dt_led wlan)" -[ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt" - -case $board in -7links,px-4885-4m|\ -7links,px-4885-8m) - set_wifi_led "px-4885:orange:wifi" - ;; -aigale,ai-br100) - ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "eth0.2" - set_wifi_led "$boardname:blue:wlan" - ;; -airlink101,ar670w|\ -airlink101,ar725w|\ -asiarf,awapn2403) - set_wifi_led "rt2800soc-phy0::radio" - ;; -airlive,air3gii|\ -aximcom,mr-102n|\ -edimax,3g-6200nl|\ -hilink,hlk-7628n|\ -netgear,wnce2001|\ -skylab,skw92a|\ -zbtlink,zbt-we2026) - set_wifi_led "$boardname:green:wlan" - ;; -alfa-network,ac1200rm) - set_wifi_led "$boardname:green:wlan2g" "wlan1" - ;; -alfa-network,awusfree1|\ -edimax,br-6478ac-v2|\ -edimax,ew-7478apc) - set_wifi_led "$boardname:blue:wlan" - ;; -alfa-network,tube-e4g) - ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0" - ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" "eth0" - ;; -allnet,all0256n-4m|\ -allnet,all0256n-8m) - ucidef_set_rssimon "wlan0" "200000" "1" - ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6" - ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5" - ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8" - set_wifi_led "rt2800pci-phy0::radio" - ;; -alphanetworks,asl26555-8m|\ -alphanetworks,asl26555-16m) - ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0" - set_wifi_led "asl26555:green:wlan" - ;; -asus,rp-n53) - ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0" - set_wifi_led "$boardname:blue:wifi" - ;; -asus,rt-n12p) - ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" eth0.1 - ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" eth0.2 - set_wifi_led "$boardname:green:air" - ;; -asus,rt-n14u) - ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" eth0.1 - ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" eth0.2 - set_wifi_led "$boardname:blue:air" - ;; -bdcom,wap2100-sk) - set_wifi_led "$boardname:green:wlan2g" - ;; -belkin,f9k1109v1) - set_usb_led "$boardname:green:usb1" - ucidef_set_led_netdev "lan" "lan" "$boardname:blue:wps" "eth0" - ;; -alfa-network,w502u|\ -dlink,dir-300-b1|\ -dlink,dir-300-b7|\ -dlink,dir-320-b1|\ -dlink,dir-600-b1|\ -dlink,dir-610-a1|\ -dlink,dir-615-d|\ -dlink,dir-615-h1|\ -dlink,dir-620-a1|\ -engenius,esr-9753|\ -hilink,hlk-rm04|\ -nexx,wt1520-4m|\ -nexx,wt1520-8m|\ -ralink,v11st-fe|\ -skyline,sl-r7205|\ -tenda,w306r-v2|\ -zyxel,keenetic-start|\ -zyxel,keenetic|\ -zyxel,nbg-419n-v2) - set_wifi_led "rt2800pci-phy0::radio" - ;; -asus,rt-ac51u|\ -kingston,mlw221|\ -kingston,mlwg2|\ -rakwireless,rak633|\ -sanlinking,d240) - set_wifi_led "$boardname:blue:wifi" - ;; -belkin,f5d8235-v1) - set_wifi_led "$boardname:blue:wireless" - ;; -comfast,cf-wr800n) - ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1 - set_wifi_led "$boardname:white:wifi" - ;; -cudy,wr1000) - ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10" - ucidef_set_led_switch "lan1" "lan1" "$boardname:blue:lan1" "switch0" "0x08" - ucidef_set_led_switch "lan2" "lan2" "$boardname:blue:lan2" "switch0" "0x04" - ;; -d-team,newifi-d2) - ucidef_set_led_switch "internet" "internet" "$boardname:amber:internet" "switch0" "0x10" - ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0" - ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1" - ;; -d-team,pbr-m1|\ -gehua,ghl-r-001) - ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" - ;; -dlink,dcs-930l-b1) - ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps" - ;; -dlink,dir-620-d1|\ -dlink,dwr-116-a1|\ -head-weblink,hdrm200|\ -ohyeah,oy-0001|\ -planex,mzk-ex300np|\ -trendnet,tew-714tru|\ -zbtlink,zbt-wr8305rt|\ -zyxel,keenetic-omni|\ -zyxel,keenetic-omni-ii|\ -zyxel,keenetic-viva) - set_wifi_led "$boardname:green:wifi" - ;; -dlink,dir-860l-b1) - ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2" - ;; -dlink,dwr-118-a1) - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1f" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x20" - set_wifi_led "$boardname:green:wlan2g" "wlan1" - ;; -dlink,dwr-118-a2) - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" - set_wifi_led "$boardname:green:wlan2g" "wlan1" - ;; -dlink,dwr-921-c1|\ -dlink,dwr-922-e2) - set_wifi_led "$boardname:green:wifi" - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f" - ucidef_set_led_netdev "signalstrength" "signalstrength" "$boardname:green:sigstrength" "wwan0" "link" - ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0" "tx rx" - ;; -dovado,tiny-ac|\ -fon,fonera-20n) - set_wifi_led "$boardname:orange:wifi" - ;; -edimax,3g-6200n|\ -edimax,br-6475nd|\ -planex,mzk-w300nh2) - set_wifi_led "$boardname:amber:wlan" - ;; -edimax,ew-7476rpc|\ -edimax,ew-7478ac) - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x20" - ;; -elecom,wrh-300cr) - set_wifi_led "$boardname:green:wlan" - ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0" - ;; -engenius,esr600) - ucidef_set_led_netdev "wlan5g" "5.0GHz" "$boardname:blue:wlan5g" "wlan0" - ucidef_set_led_netdev "wlan2g" "2.4GHz" "$boardname:blue:wlan2g" "wlan1" - ;; -glinet,gl-mt300a|\ -glinet,gl-mt300n|\ -glinet,gl-mt750) - set_wifi_led "$boardname:wlan" - ;; -glinet,gl-mt300n-v2) - set_wifi_led "$boardname:red:wlan" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x1" - ;; -gnubee,gb-pc1|\ -gnubee,gb-pc2) - ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x01" - ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x10" - ;; -hauppauge,broadway) - set_wifi_led "$boardname:red:wps_active" - ;; -hiwifi,hc5661) - ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x01" - set_wifi_led "$boardname:blue:wlan2g" - ;; -hiwifi,hc5661a|\ -hiwifi,hc5761a|\ -xzwifi,creativebox-v1) - ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10" - ;; -hiwifi,hc5761) - ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x01" - ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "wlan0" - ucidef_set_led_netdev "wifi2g" "wifi2g" "$boardname:blue:wlan2g" "wlan1" - ;; -hiwifi,hc5861) - ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x20" - ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "wlan0" - ucidef_set_led_netdev "wifi2g" "wifi2g" "$boardname:blue:wlan2g" "wlan1" - ;; -hnet,c108) - ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0" - ucidef_set_led_netdev "modem" "modem" "$boardname:green:modem" "wwan0" - ;; -hootoo,ht-tm02) - ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:lan" "eth0" - set_wifi_led "$boardname:blue:wlan" - ;; -huawei,hg255d) - set_wifi_led "$boardname:green:wlan" - ucidef_set_led_netdev "internet" "internet" "$boardname:green:internet" "eth0.2" - ;; -intenso,memory2move) - set_wifi_led "$boardname:blue:wifi" - ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:wan" "eth0" - ;; -iodata,wn-ac1167gr|\ -iodata,wn-ac733gr3) - ucidef_set_led_wlan "wlan5g" "WLAN5G" "$boardname:green:wlan5g" "phy0radio" - ucidef_set_led_wlan "wlan2g" "WLAN2G" "$boardname:green:wlan2g" "phy1radio" - ;; -kimax,u25awf-h1) - set_wifi_led "u25awf:red:wifi" - ucidef_set_led_netdev "eth" "eth" "u25awf:green:lan" "eth0" - ;; -kimax,u35wf) - set_wifi_led "$boardname:blue:wifi" - ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0" - ;; -lava,lr-25g001) - ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "wlan1" - ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:green:wlan5g" "wlan0" - ;; -lenovo,newifi-y1) - ucidef_set_led_netdev "wifi" "WIFI" "$boardname:blue:wifi" "wlan1" - ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi5g" "wlan0" - ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x03" - ;; -lenovo,newifi-y1s) - ucidef_set_led_netdev "wifi" "WIFI" "$boardname:yellow:wifi" "wlan1" - ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi" "wlan0" - ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx" - ;; -mediatek,linkit-smart-7688) - ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt" - ;; -mikrotik,rbm11g) - ucidef_set_rssimon "wlan0" "200000" "1" - ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100" - ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100" - ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssi2" "wlan0" "40" "100" - ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi3" "wlan0" "60" "100" - ucidef_set_led_rssi "rssiveryhigh" "RSSIVERYHIGH" "$boardname:green:rssi4" "wlan0" "80" "100" - ;; -mtc,wr1201) - ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x0f" - ;; -netgear,ex2700|\ -netgear,wn3000rp-v3) - set_wifi_led "$boardname:green:router" - ;; -netgear,ex3700) - ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$boardname:green:router" "wlan0" - ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1" - ;; -netgear,r6120) - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10" - ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "phy0tpt" - ;; -netgear,r6220|\ -netgear,r6260|\ -netgear,r6350|\ -netgear,r6850|\ -netgear,wndr3700-v5) - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10" - ;; -omnima,hpm) - ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0" - set_wifi_led "$boardname:green:wifi" - ;; -omnima,miniembplug) - set_wifi_led "$boardname:red:wlan" - ;; -phicomm,psg1208) - set_wifi_led "$boardname:white:wlan2g" - ;; -planex,mzk-ex750np|\ -zbtlink,zbt-we826-e) - set_wifi_led "$boardname:red:wifi" - ;; -tama,w06) - ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" - ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt" - ;; -tplink,archer-c2-v1) - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch1" "0x1e" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch1" "0x01" - set_wifi_led "$boardname:green:wlan" - ;; -tplink,archer-c20-v1) - ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01" - ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:blue:wlan2g" "wlan0" - ;; -tplink,archer-c20-v4) - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" - ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" "wlan0" - ;; -tplink,archer-c20i) - ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01" - ucidef_set_led_wlan "wlan" "wlan" "$boardname:blue:wlan" "phy0radio" - ;; -tplink,archer-c50-v1) - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" - ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" wlan1 - set_wifi_led "$boardname:green:wlan5g" - ;; -tplink,archer-c50-v3|\ -tplink,archer-c50-v4) - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" - ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan2g" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "wlan5g" "$boardname:green:wlan5g" "phy1tpt" - ;; -tplink,archer-mr200) - ucidef_set_led_netdev "lan" "lan" "$boardname:white:lan" "eth0.1" - ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "usb0" - set_wifi_led "$boardname:white:wlan" - ;; -tplink,re350-v1|\ -tplink,re650-v1) - ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0" - ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1" - ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "eth0" "tx rx" - ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x01" - ;; -tplink,tl-mr3020-v3) - set_wifi_led "$boardname:green:wlan" - ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" - ;; -tplink,tl-mr3420-v5|\ -tplink,tl-wr842n-v5) - ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt" - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" - ;; -tplink,tl-wa801nd-v5) - ucidef_set_led_wlan "wlan" "wlan" "$boardname:green:wlan" "phy0tpt" - ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0" - ;; -tplink,tl-wr840n-v4) - ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt" - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" - ;; -tplink,tl-wr841n-v13) - ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt" - ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x2" - ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x4" - ucidef_set_led_switch "lan3" "lan3" "$boardname:green:lan3" "switch0" "0x8" - ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x10" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" - ;; -tplink,tl-wr841n-v14) - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" - ;; -tplink,tl-wr902ac-v3) - ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt" - ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x10" - ;; -unielec,u7628-01-16m) - ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2" - ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4" - ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8" - ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10" - ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01" - set_wifi_led "u7628-01:green:wlan" - ;; -vocore,vocore-8m|\ -vocore,vocore-16m) - ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0" - ;; -wavlink,wl-wn570ha1) - ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" - ucidef_set_rssimon "wlan0" "200000" "1" - ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan0" "1" "49" - ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan0" "50" "84" - ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan0" "85" "100" - set_wifi_led "$boardname:green:wifi" - ;; -wavlink,wl-wn575a3) - ucidef_set_rssimon "wlan1" "200000" "1" - ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan1" "1" "49" - ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84" - ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100" - ;; -xiaomi,mir3g) - ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08" - ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08" - ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08" - ;; -xiaomi,mir3p) - ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x10" "0x08" - ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x02" "0x08" - ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08" - ucidef_set_led_switch "lan3-amber" "LAN3 (amber)" "$boardname:amber:lan3" "switch0" "0x08" "0x08" - ;; -youhua,wr1200js) - ucidef_set_led_switch "internet" "INTERNET" "$boardname:green:wan" "switch0" "0x01" - ;; -youku,yk1) - set_wifi_led "$boardname:blue:air" - ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10" - ;; -zbtlink,zbt-ape522ii) - ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$boardname:green:wlan2g4" "wlan1" - ucidef_set_led_netdev "sys1" "wlan1" "$boardname:green:sys1" "wlan1" "tx rx" - ucidef_set_led_netdev "sys2" "wlan0" "$boardname:green:sys2" "wlan0" "tx rx" - ;; -zbtlink,zbt-wa05) - set_wifi_led "$boardname:blue:air" - ;; -zbtlink,zbt-we826-16m|\ -zbtlink,zbt-we826-32m) - set_wifi_led "zbt-we826:green:wifi" - ;; -zbtlink,zbt-we1026-5g-16m) - ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0" - set_wifi_led "we1026-5g:green:wifi" - ;; -zbtlink,zbt-we1226) - set_wifi_led "$boardname:green:wlan" - ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x01" - ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x02" - ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x10" - ;; -zorlik,zl5900v2) - ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" eth0 - ;; -zyxel,keenetic-extra-ii) - set_wifi_led "$boardname:green:wifi" - ucidef_set_led_switch "internet" "internet" "$boardname:green:internet" "switch0" "0x01" - ;; -esac - -board_config_flush - -exit 0 diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network deleted file mode 100755 index 480726a870..0000000000 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ /dev/null @@ -1,752 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh -. /lib/functions/uci-defaults.sh -. /lib/functions/system.sh - -ramips_setup_rt3x5x_vlans() -{ - if [ ! -x /sbin/swconfig ]; then - # legacy default - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - return - fi - local wanports="" - local lanports="" - for port in 5 4 3 2 1 0; do - if [ "$(swconfig dev rt305x port $port get disable)" = "1" ]; then - continue - fi - if [ "$(swconfig dev rt305x port $port get lan)" = "0" ]; then - wanports="$port:wan $wanports" - else - lanports="$port:lan $lanports" - fi - done - ucidef_add_switch "rt305x" $lanports $wanports "6t@eth0" -} - -ramips_setup_interfaces() -{ - local board="$1" - - case $board in - accton,wr6202|\ - alfa-network,w502u|\ - netcore,nw718|\ - petatel,psr-680w|\ - skyline,sl-r7205|\ - upvel,ur-336un) - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - ;; - adslr,g7|\ - afoundry,ew1200|\ - aigale,ai-br100|\ - alfa-network,ac1200rm|\ - asus,rt-n12p|\ - buffalo,whr-g300n|\ - d-team,pbr-m1|\ - dlink,dir-300-b7|\ - dlink,dir-320-b1|\ - dlink,dir-610-a1|\ - dlink,dir-810l|\ - dlink,dwr-116-a1|\ - dlink,dwr-921-c1|\ - dlink,dwr-922-e2|\ - edimax,3g-6200n|\ - firefly,firewrt|\ - hilink,hlk-rm04|\ - hiwifi,hc5661a|\ - hiwifi,hc5761a|\ - hiwifi,hc5962|\ - mediatek,ap-mt7621a-v60|\ - mediatek,mt7621-eval-board|\ - mediatek,mt7628an-eval-board|\ - mercury,mac1200r-v2|\ - mqmaker,witi|\ - mtc,wr1201|\ - netis,wf-2881|\ - nixcore,x1-16m|\ - nixcore,x1-8m|\ - ohyeah,oy-0001|\ - phicomm,k2p|\ - phicomm,psg1208|\ - phicomm,psg1218a|\ - planex,db-wrt01|\ - planex,mzk-750dhp|\ - planex,mzk-w300nh2|\ - planex,vr500|\ - samknows,whitebox-v8|\ - sanlinking,d240|\ - storylink,sap-g3200u3|\ - telco-electronics,x1|\ - totolink,a7000r|\ - totolink,lr1200|\ - unielec,u7621-06-16m|\ - unielec,u7621-06-64m|\ - wavlink,wl-wn570ha1|\ - wavlink,wl-wn575a3|\ - xiaomi,miwifi-mini|\ - xiaomi,miwifi-nano|\ - xiaoyu,xy-c5|\ - xzwifi,creativebox-v1|\ - youku,yk-l2|\ - youku,yk1|\ - zbtlink,zbt-ape522ii|\ - zbtlink,zbt-we1326|\ - zbtlink,zbt-we3526|\ - zbtlink,zbt-we826-16m|\ - zbtlink,zbt-we826-32m|\ - zbtlink,zbt-we826-e|\ - zbtlink,zbt-wg2626|\ - zbtlink,zbt-wg3526-16m|\ - zbtlink,zbt-wg3526-32m|\ - zbtlink,zbt-wr8305rt|\ - zyxel,keenetic|\ - zyxel,keenetic-omni) - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" - ;; - airlink101,ar670w|\ - airlink101,ar725w|\ - asus,rt-ac51u|\ - rakwireless,rak633) - ucidef_add_switch "switch0" \ - "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" - ;; - alfa-network,awusfree1|\ - alfa-network,tube-e4g|\ - buffalo,wli-tx4-ag300n|\ - buffalo,wmr-300|\ - dlink,dap-1522-a1|\ - dlink,dch-m225|\ - d-team,pbr-d1|\ - elecom,wrh-300cr|\ - huawei,d105|\ - kimax,u25awf-h1|\ - loewe,wmdr-143n|\ - netgear,ex2700|\ - netgear,ex3700|\ - netgear,wn3000rp-v3|\ - omnima,hpm|\ - planex,cs-qr10|\ - planex,mzk-ex300np|\ - planex,mzk-ex750np|\ - ravpower,wd03|\ - sercomm,na930|\ - tama,w06|\ - tplink,tl-mr3020-v3|\ - tplink,tl-wr802n-v4) - ucidef_set_interface_lan "eth0" - ;; - allnet,all0256n-4m|\ - allnet,all0256n-8m|\ - allnet,all5002|\ - allnet,all5003|\ - dlink,dcs-930l-b1|\ - dlink,dcs-930|\ - edimax,ew-7476rpc|\ - edimax,ew-7478ac|\ - hame,mpr-a2|\ - hauppauge,broadway|\ - hootoo,ht-tm02|\ - intenso,memory2move|\ - kimax,u35wf|\ - mediatek,linkit-smart-7688|\ - microduino,microwrt|\ - mikrotik,rbm11g|\ - netgear,wnce2001|\ - onion,omega2p|\ - onion,omega2|\ - tenda,3g150b|\ - tenda,3g300m|\ - tenda,w150m|\ - thunder,timecloud|\ - tplink,tl-wa801nd-v5|\ - unbranded,a5-v11|\ - wansview,ncs601w|\ - widora,neo-16m|\ - widora,neo-32m|\ - yukai,bocco|\ - zbtlink,zbt-cpe102|\ - zorlik,zl5900v2|\ - zte,q7) - ucidef_add_switch "switch0" - ucidef_add_switch_attr "switch0" "enable" "false" - ucidef_set_interface_lan "eth0" - ;; - alphanetworks,asl26555-8m|\ - alphanetworks,asl26555-16m|\ - asus,rp-n53) - ucidef_add_switch "switch0" \ - "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" - ;; - argus,atp-52b|\ - asiarf,awm002-evb-4m|\ - asiarf,awm002-evb-8m|\ - asus,rt-ac57u|\ - asus,rt-n14u|\ - bdcom,wap2100-sk|\ - dlink,dir-645|\ - glinet,gl-mt300a|\ - glinet,gl-mt300n|\ - glinet,gl-mt750|\ - hilink,hlk-7628n|\ - hiwifi,hc5661|\ - hiwifi,hc5861b|\ - jcg,jhr-n805r|\ - jcg,jhr-n825r|\ - jcg,jhr-n926r|\ - mikrotik,rb750gr3|\ - mikrotik,rbm33g|\ - planex,mzk-wdpr|\ - skylab,skw92a|\ - tplink,archer-c20-v4|\ - tplink,archer-c20i|\ - tplink,archer-c50-v3|\ - tplink,archer-c50-v4|\ - tplink,tl-mr3420-v5|\ - tplink,tl-wr840n-v4|\ - tplink,tl-wr840n-v5|\ - tplink,tl-wr841n-v13|\ - tplink,tl-wr841n-v14|\ - tplink,tl-wr842n-v5|\ - unielec,u7628-01-16m|\ - ubiquiti,edgerouterx|\ - ubiquiti,edgerouterx-sfp|\ - upvel,ur-326n4g|\ - wrtnode,wrtnode|\ - wrtnode,wrtnode2p|\ - wrtnode,wrtnode2r|\ - youhua,wr1200js|\ - zbtlink,zbt-wa05|\ - zyxel,keenetic-extra-ii) - ucidef_add_switch "switch0" \ - "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" - ;; - asiarf,ap7621-001) - ucidef_add_switch "switch0" "0:lan" "4:wan" "6@eth0" - ;; - asiarf,ap7621-nv1) - ucidef_add_switch "switch0" "0:wan" "2:lan" "3:lan" "6@eth0" - ;; - asiarf,awapn2403) - ucidef_add_switch "switch0" \ - "0:lan" "1:wan" "6@eth0" - ;; - asus,rt-ac65p|\ - asus,rt-ac85p|\ - dlink,dir-860l-b1|\ - elecom,wrc-1167ghbk2-s|\ - elecom,wrc-1900gst|\ - elecom,wrc-2533gst|\ - huawei,hg255d|\ - iodata,wn-ax1167gr|\ - iodata,wn-gx300gr|\ - iodata,wnpr2600g|\ - iptime,a604m) - ucidef_add_switch "switch0" \ - "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" - ;; - asus,rt-n15|\ - belkin,f9k1109v1|\ - sitecom,wl-351) - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" - ;; - asus,rt-n56u) - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "8@eth0" - ;; - asus,wl-330n|\ - easyacc,wizard-8800|\ - kingston,mlwg2) - ucidef_set_interface_lan "eth0.1" - ;; - aximcom,mr-102n|\ - kingston,mlw221) - ucidef_set_interface_lan "eth0.2" - ;; - belkin,f5d8235-v1|\ - belkin,f5d8235-v2|\ - buffalo,wzr-agl300nh|\ - ralink,v11st-fe|\ - trendnet,tew-714tru) - ucidef_add_switch "switch0" \ - "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0" - ;; - buffalo,wcr-1166ds) - ucidef_add_switch "switch0" \ - "3:lan" "4:wan" "6@eth0" - ;; - buffalo,whr-300hp2|\ - buffalo,whr-600d|\ - buffalo,wsr-1166dhp|\ - buffalo,wsr-600dhp) - ucidef_add_switch "switch0" \ - "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan:5" "6@eth0" - ;; - buffalo,whr-1166d) - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "5:wan" "6@eth0" - ;; - comfast,cf-wr800n|\ - hnet,c108|\ - tplink,tl-wr902ac-v3|\ - trendnet,tew-638apb-v2) - ucidef_add_switch "switch0" \ - "4:lan" "6@eth0" - ;; - cudy,wr1000|\ - xiaomi,mir3g-v2) - ucidef_add_switch "switch0" \ - "2:lan:2" "3:lan:1" "4:wan" "6@eth0" - ;; - dlink,dir-510l|\ - glinet,vixmini|\ - netgear,ex6150|\ - tplink,re350-v1|\ - tplink,re650-v1) - ucidef_add_switch "switch0" \ - "0:lan" "6@eth0" - ;; - dlink,dir-615-h1|\ - d-team,newifi-d2|\ - wevo,11acnas|\ - wevo,w2914ns-v2|\ - zbtlink,zbt-we2026) - ucidef_add_switch "switch0" \ - "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0" - ;; - dlink,dwr-118-a1) - ucidef_add_switch "switch0" \ - "1:lan:2" "2:lan:3" "3:lan:1" "4:lan:0" "5:wan" "6@eth0" - ;; - dlink,dwr-118-a2) - ucidef_add_switch "switch0" \ - "1:lan:2" "2:lan:1" "3:lan:3" "4:lan" "0:wan" "6@eth0" - ;; - duzun,dm06) - ucidef_add_switch "switch0" \ - "1:lan" "0:wan" "6@eth0" - ;; - edimax,br-6475nd) - ucidef_add_switch "switch0" \ - "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0" - ;; - edimax,br-6478ac-v2|\ - tplink,archer-c2-v1) - ucidef_add_switch "switch1" \ - "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" - ;; - engenius,esr600) - ucidef_add_switch "switch0" \ - "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "0@eth0" - ;; - fon,fon2601) - ucidef_add_switch "switch0" \ - "0:lan" "4:wan" "6@eth0" - ;; - edimax,rg21s) - ucidef_add_switch "switch0" \ - "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" - ;; - gehua,ghl-r-001) - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "4:wan" "6@eth0" - ;; - glinet,gl-mt300n-v2) - ucidef_add_switch "switch0" \ - "1:lan" "0:wan" "6@eth0" - ;; - gnubee,gb-pc1|\ - gnubee,gb-pc2) - ucidef_add_switch "switch0" \ - "0:lan" "4:lan" "6@eth0" - ;; - head-weblink,hdrm200) - ucidef_add_switch "switch0" \ - "1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "0:wan" "6@eth0" - ;; - hiwifi,hc5761) - ucidef_add_switch "switch0" \ - "1:lan" "4:lan" "0:wan" "6@eth0" - ;; - hiwifi,hc5861) - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "5:wan" "6@eth0" - ;; - iodata,wn-ac1167gr|\ - iodata,wn-ac733gr3) - ucidef_add_switch "switch1" \ - "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" - ;; - iptime,a3) - ucidef_add_switch "switch0" \ - "2:lan:2" "3:lan:1" "0:wan" "6@eth0" - ;; - lava,lr-25g001|\ - sitecom,wlr-6000|\ - trendnet,tew-691gr|\ - trendnet,tew-692gr) - ucidef_add_switch "switch0" \ - "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" - ;; - lenovo,newifi-d1) - ucidef_add_switch "switch0" \ - "1:lan:2" "2:lan:1" "4:wan" "6@eth0" - ;; - lenovo,newifi-y1|\ - zbtlink,zbt-we1226) - ucidef_add_switch "switch0" \ - "0:lan:2" "1:lan:1" "4:wan" "6@eth0" - ;; - lenovo,newifi-y1s) - ucidef_add_switch "switch0" \ - "1:lan:4" "2:lan:3" "4:lan:2" "5:lan:1" "0:wan" "6@eth0" - ;; - linksys,e1700|\ - ralink,mt7620a-mt7530-evb) - ucidef_add_switch "switch1" \ - "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" - ;; - linksys,re6500) - ucidef_add_switch "switch0" \ - "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "6@eth0" - ;; - netgear,r6120|\ - netgear,r6220|\ - netgear,r6260|\ - netgear,r6350|\ - netgear,r6850|\ - netgear,wndr3700-v5) - ucidef_add_switch "switch0" \ - "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" - ;; - nexx,wt1520-4m|\ - nexx,wt1520-8m|\ - vonets,var11n-300) - ucidef_add_switch "switch0" \ - "0:lan" "4:wan" "6@eth0" - ;; - nexx,wt3020-4m|\ - nexx,wt3020-8m) - ucidef_add_switch "switch0" \ - "4:lan" "0:wan" "6@eth0" - ;; - phicomm,k2g) - ucidef_add_switch "switch0" \ - "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5:wan" "6@eth0" - ;; - phicomm,psg1218b) - ucidef_add_switch "switch0" \ - "0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "6@eth0" - ;; - planex,mzk-dp150n|\ - vocore,vocore-8m|\ - vocore,vocore-16m) - ucidef_add_switch "switch0" \ - "0:lan" "4:lan" "6t@eth0" - ;; - samsung,cy-swr1100) - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "9@eth0" - ;; - sparklan,wcr-150gn|\ - zbtlink,zbt-we1026-5g-16m) - ucidef_add_switch "switch0" \ - "0:lan" "6t@eth0" - ;; - tplink,archer-c20-v1|\ - tplink,archer-c50-v1) - ucidef_add_switch "switch0" \ - "1:lan:3" "2:lan:4" "3:lan:1" "4:lan:2" "0:wan" "6@eth0" - ;; - tplink,archer-mr200) - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0" - ucidef_set_interface_wan "usb0" - ;; - vocore,vocore2|\ - vocore,vocore2-lite) - ucidef_add_switch "switch0" \ - "0:lan" "2:lan" "6t@eth0" - ;; - wiznet,wizfi630a) - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:wan" "6@eth0" - ;; - wiznet,wizfi630s) - ucidef_add_switch "switch0" \ - "0:wan" "3:lan" "4:lan" "6@eth0" - ;; - xiaomi,mir3g) - ucidef_add_switch "switch0" \ - "2:lan:2" "3:lan:1" "1:wan" "6t@eth0" - ;; - xiaomi,mir3p) - ucidef_add_switch "switch0" \ - "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" - ;; - xiaomi,mir4a-100m) - ucidef_add_switch "switch0" \ - "4:lan:1" "2:lan:2" "0:wan" "6@eth0" - ;; - zyxel,keenetic-omni-ii) - ucidef_add_switch "switch0" \ - "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6@eth0" - ;; - zyxel,keenetic-start) - ucidef_add_switch "switch0" \ - "0:lan:3" "1:lan:2" "2:lan:1" "3:lan:0" "4:wan" "6@eth0" - ;; - zyxel,keenetic-viva) - ucidef_add_switch "switch1" \ - "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "7t@eth0" - ;; - *) - RT3X5X=$(grep -E "(RT3.5|RT5350)" /proc/cpuinfo) - if [ -n "${RT3X5X}" ]; then - ramips_setup_rt3x5x_vlans - else - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - fi - ;; - esac -} - -ramips_setup_macs() -{ - local board="$1" - local lan_mac="" - local wan_mac="" - - case $board in - 8devices,carambola|\ - alfa-network,w502u|\ - arcwireless,freestation5|\ - lenovo,newifi-y1|\ - lenovo,newifi-y1s|\ - netgear,wnce2001|\ - ohyeah,oy-0001|\ - phicomm,k2g|\ - skylab,skw92a|\ - totolink,lr1200) - wan_mac=$(mtd_get_mac_binary factory 0x2e) - ;; - dlink,dir-300-b7|\ - dlink,dir-320-b1|\ - dlink,dir-620-a1|\ - engenius,esr-9753|\ - hame,mpr-a1|\ - hauppauge,broadway|\ - huawei,d105|\ - hilink,hlk-7628n|\ - hilink,hlk-rm04|\ - nexaira,bc2|\ - petatel,psr-680w|\ - skyline,sl-r7205) - lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)") - wan_mac=$(macaddr_add "$lan_mac" 1) - ;; - asus,rt-ac57u|\ - d-team,newifi-d2|\ - d-team,pbr-m1|\ - elecom,wrc-1167ghbk2-s|\ - elecom,wrc-1900gst|\ - elecom,wrc-2533gst|\ - lenovo,newifi-d1|\ - phicomm,k2p|\ - planex,vr500|\ - samknows,whitebox-v8|\ - youhua,wr1200js|\ - youku,yk-l2|\ - zbtlink,zbt-we3526) - wan_mac=$(mtd_get_mac_binary factory 0xe006) - ;; - asus,rt-ac65p|\ - asus,rt-ac85p) - wan_mac=$(mtd_get_mac_ascii u-boot-env et1macaddr) - label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) - ;; - asus,rt-n56u) - lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)") - wan_mac=$(mtd_get_mac_binary factory 0x8004) - ;; - belkin,f9k1109v1) - wan_mac=$(mtd_get_mac_ascii uboot-env HW_WAN_MAC) - lan_mac=$(mtd_get_mac_ascii uboot-env HW_LAN_MAC) - label_mac=$wan_mac - ;; - buffalo,wcr-1166ds|\ - buffalo,wsr-1166dhp) - local index="$(find_mtd_index "board_data")" - wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)" - lan_mac=$wan_mac - ;; - buffalo,whr-1166d|\ - buffalo,whr-300hp2|\ - buffalo,whr-600d|\ - buffalo,whr-g300n|\ - buffalo,wsr-600dhp|\ - glinet,gl-mt300n-v2|\ - xiaomi,miwifi-mini|\ - zyxel,keenetic-start) - # This empty case has to be kept for devices without any MAC address adjustments - ;; - cudy,wr1000) - wan_mac=$(mtd_get_mac_binary factory 0x2e) - label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) - ;; - dlink,dch-m225|\ - samsung,cy-swr1100) - lan_mac=$(mtd_get_mac_ascii factory lanmac) - ;; - dlink,dir-510l|\ - dlink,dwr-116-a1|\ - dlink,dwr-118-a1|\ - dlink,dwr-118-a2|\ - dlink,dwr-921-c1|\ - dlink,dwr-922-e2|\ - lava,lr-25g001) - wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000) - lan_mac=$(macaddr_add "$wan_mac" 1) - label_mac=$wan_mac - ;; - dlink,dir-615-d|\ - dlink,dir-615-h1|\ - glinet,gl-mt300a|\ - glinet,gl-mt300n|\ - glinet,gl-mt750|\ - zbtlink,zbt-wg3526-16m|\ - zbtlink,zbt-wg3526-32m) - wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1) - label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) - ;; - dlink,dir-645) - lan_mac=$(mtd_get_mac_ascii nvram lanmac) - wan_mac=$(mtd_get_mac_ascii nvram wanmac) - ;; - dlink,dir-860l-b1) - lan_mac=$(mtd_get_mac_ascii factory lanmac) - wan_mac=$(mtd_get_mac_ascii factory wanmac) - label_mac=$(cat /sys/class/ieee80211/phy1/macaddress) - ;; - dovado,tiny-ac) - lan_mac=$(mtd_get_mac_ascii u-boot-env LAN_MAC_ADDR) - wan_mac=$(mtd_get_mac_ascii u-boot-env WAN_MAC_ADDR) - ;; - edimax,br-6475nd) - wan_mac=$(mtd_get_mac_binary devdata 0x7) - ;; - edimax,br-6478ac-v2|\ - netgear,r6260|\ - netgear,r6350|\ - netgear,r6850) - wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 2) - ;; - edimax,rg21s|\ - engenius,esr600) - lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) - wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) - ;; - hiwifi,hc5661|\ - hiwifi,hc5661a|\ - hiwifi,hc5761|\ - hiwifi,hc5761a|\ - hiwifi,hc5861|\ - hiwifi,hc5861b|\ - hiwifi,hc5962) - lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ") - label_mac=$lan_mac - [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address) - wan_mac=$(macaddr_add "$lan_mac" 1) - ;; - iodata,wn-ac1167gr|\ - iodata,wn-ac733gr3) - wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) - ;; - iodata,wn-ax1167gr|\ - iodata,wn-gx300gr|\ - trendnet,tew-692gr) - wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1) - ;; - iodata,wnpr2600g) - wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) - label_mac=$wan_mac - ;; - iptime,a3|\ - iptime,a604m) - wan_mac=$(mtd_get_mac_binary u-boot 0x1fc40) - ;; - linksys,e1700) - wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR) - ;; - mediatek,linkit-smart-7688|\ - onion,omega2|\ - onion,omega2p) - wan_mac=$(mtd_get_mac_binary factory 0x4) - lan_mac=$(mtd_get_mac_binary factory 0x2e) - ;; - mercury,mac1200r-v2) - wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory_info 0xd)" 1) - ;; - poray,m3|\ - poray,m4-4m|\ - poray,m4-8m|\ - poray,x5|\ - poray,x8) - lan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" -2) - ;; - sitecom,wlr-6000) - wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x8004)" 2) - ;; - sparklan,wcr-150gn|\ - wiznet,wizfi630a|\ - zyxel,keenetic-omni|\ - zyxel,keenetic-omni-ii|\ - zyxel,keenetic-viva) - wan_mac=$(mtd_get_mac_binary factory 0x28) - ;; - tenda,w306r-v2) - wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 5) - ;; - trendnet,tew-691gr) - wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 3) - ;; - vocore,vocore2|\ - vocore,vocore2-lite) - label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) - ;; - xiaomi,mir3g) - lan_mac=$(mtd_get_mac_binary factory 0xe006) - ;; - xiaomi,mir3g-v2) - wan_mac=$(mtd_get_mac_binary factory 0xe006) - label_mac=$wan_mac - ;; - xiaomi,mir3p) - lan_mac=$(mtd_get_mac_binary factory 0xe006) - label_mac=$lan_mac - ;; - zbtlink,zbt-we1326) - wan_mac=$(mtd_get_mac_binary factory 0xe006) - label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) - ;; - *) - wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1) - ;; - esac - - [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac - [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac - [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac -} - -board_config_update -board=$(board_name) -ramips_setup_interfaces $board -ramips_setup_macs $board -board_config_flush - -exit 0 diff --git a/target/linux/ramips/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/base-files/etc/board.d/03_gpio_switches deleted file mode 100755 index 9acd78ea0b..0000000000 --- a/target/linux/ramips/base-files/etc/board.d/03_gpio_switches +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -. /lib/functions/uci-defaults.sh - -board_config_update - -board=$(board_name) - -case "$board" in -dlink,dir-510l) - ucidef_add_gpio_switch "usb_enable1" "USB 1A enable" "12" "0" - ucidef_add_gpio_switch "usb_enable05" "USB 0.5A enable" "13" "1" - ;; -head-weblink,hdrm200) - ucidef_add_gpio_switch "sim_switch" "SIM slot switch" "0" - ucidef_add_gpio_switch "io1" "I/O 1" "1" - ucidef_add_gpio_switch "io2" "I/O 2" "2" - ucidef_add_gpio_switch "io3" "I/O 3" "11" - ucidef_add_gpio_switch "io4" "I/O 4" "14" - ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "21" "1" - ;; -mikrotik,rb750gr3) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "17" - ;; -telco-electronics,x1) - ucidef_add_gpio_switch "modem_reset" "Modem Reset" "16" - ;; -ubiquiti,edgerouterx) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "0" - ;; -ubiquiti,edgerouterx-sfp) - ucidef_add_gpio_switch "poe_power_port0" "PoE Power Port0" "496" - ucidef_add_gpio_switch "poe_power_port1" "PoE Power Port1" "497" - ucidef_add_gpio_switch "poe_power_port2" "PoE Power Port2" "498" - ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "499" - ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "500" - ;; -zbtlink,zbt-we826-e) - ucidef_add_gpio_switch "sim_switch" "SIM slot switch" "13" - ucidef_add_gpio_switch "power_mpcie" "mPCIe power" "14" "1" - ;; -esac - -board_config_flush - -exit 0 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 deleted file mode 100644 index f33ed82f62..0000000000 --- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -[ -e /lib/firmware/$FIRMWARE ] && exit 0 - -. /lib/functions/caldata.sh - -jboot_eeprom_extract() { - local part=$1 - local offset=$2 - local mtd - - mtd=$(find_mtd_part $part) - [ -n "$mtd" ] || \ - caldata_die "no mtd device found for partition $part" - - jboot_config_read -i $mtd -o $offset -e /lib/firmware/$FIRMWARE 2>/dev/null || \ - caldata_die "failed to extract from $mtd" -} - -board=$(board_name) - -case "$FIRMWARE" in -"soc_wmac.eeprom") - case $board in - dlink,dir-510l|\ - dlink,dwr-116-a1|\ - dlink,dwr-118-a1|\ - dlink,dwr-118-a2|\ - dlink,dwr-921-c1|\ - dlink,dwr-922-e2|\ - lava,lr-25g001) - wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000) - wifi_mac=$(macaddr_add "$wan_mac" 1) - jboot_eeprom_extract "config" 0xE000 - caldata_patch_mac $wifi_mac 0x4 - ;; - dovado,tiny-ac) - wifi_mac=$(mtd_get_mac_ascii u-boot-env INIC_MAC_ADDR) - caldata_extract "factory" 0x0 0x200 - caldata_patch_mac $wifi_mac 0x4 - ;; - *) - caldata_die "Please define mtd-eeprom in $board DTS file!" - ;; - esac - ;; -esac diff --git a/target/linux/ramips/base-files/lib/preinit/04_handle_checksumming b/target/linux/ramips/base-files/lib/preinit/04_handle_checksumming deleted file mode 100644 index 8f741faf9d..0000000000 --- a/target/linux/ramips/base-files/lib/preinit/04_handle_checksumming +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -# Netgear WNCE2001 has does a checksum check on boot and goes into recovery -# tftp mode when the check fails. Initializing the JFFS2 partition triggers -# this, so we make sure to zero checksum and size to be checksummed before -# that happens, so this needs to run very early during boot. - -do_checksumming_disable() { - . /lib/functions.sh - - local board=$(board_name) - - case "$board" in - netgear,wnce2001) - echo "Board is WNCE2001, updating checksum partition..." - local zeroes=/dev/zero - local tmpfile=/tmp/wnce2001_checksum - local partname=checksum - local mtd=$(find_mtd_part $partname) - dd if=$mtd of=$tmpfile bs=80 count=1 2>/dev/null - signature=$(dd if=$tmpfile bs=1 skip=24 count=20 2>/dev/null) - checksum=$(dd if=$tmpfile bs=1 count=4 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"') - if [ "$signature" != "RT3052-AP-WNCE2001-3" ]; then - echo "Signature of checksum partition is wrong, bailing." - return 0 - fi - if [ "$checksum" != "00000000" ]; then - echo "Checksum is set, zeroing." - # zero out checksum - dd if=$zeroes of=$tmpfile conv=notrunc bs=1 seek=0 count=4 2>/dev/null - # zero out bytecount to be checksummed - dd if=$zeroes of=$tmpfile conv=notrunc bs=1 seek=60 count=4 2>/dev/null - mtd write $tmpfile $partname - else - echo "Checksum is already zero, nothing to do." - fi - ;; - asus,rt-n56u) - echo "Board is ASUS RT-N56U, replacing uImage header..." - local firmware_mtd=$(find_mtd_part firmware) - local rootfs_mtd=$(find_mtd_part rootfs) - local rootfs_data_mtd=$(find_mtd_part rootfs_data) - local rootfs_len=$(grep \"rootfs\" /proc/mtd | awk -F' ' '{print "0x"$2}') - local rootfs_data_len=$(grep \"rootfs_data\" /proc/mtd | awk -F' ' '{print "0x"$2}') - local offset=$(echo "$rootfs_len $rootfs_data_len 0x40" | awk -F' ' '{printf "%i",$1-$2-$3}') - local signature=$(dd if=$rootfs_mtd skip=$offset bs=1 count=4 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"') - if [ "$signature" = "27051956" ]; then - dd conv=notrunc if=$rootfs_mtd skip=$offset of=$firmware_mtd bs=1 count=64 2>/dev/null - fi - ;; - esac - - return 0 -} - -boot_hook_add preinit_main do_checksumming_disable diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh deleted file mode 100755 index 03e994dfa4..0000000000 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright (C) 2010 OpenWrt.org -# - -PART_NAME=firmware -REQUIRE_IMAGE_METADATA=1 - -platform_check_image() { - return 0 -} - -platform_do_upgrade() { - local board=$(board_name) - - case "$board" in - mikrotik,rb750gr3|\ - mikrotik,rbm11g|\ - mikrotik,rbm33g) - [ -z "$(rootfs_type)" ] && mtd erase firmware - ;; - asus,rt-ac65p|\ - asus,rt-ac85p) - echo "Backing up firmware" - dd if=/dev/mtd4 bs=1024 count=4096 > /tmp/backup_firmware.bin - dd if=/dev/mtd5 bs=1024 count=52224 >> /tmp/backup_firmware.bin - mtd -e firmware2 write /tmp/backup_firmware.bin firmware2 - ;; - esac - - case "$board" in - asus,rt-ac65p|\ - asus,rt-ac85p|\ - hiwifi,hc5962|\ - netgear,r6220|\ - netgear,r6260|\ - netgear,r6350|\ - netgear,r6850|\ - xiaomi,mir3g|\ - xiaomi,mir3p) - nand_do_upgrade "$1" - ;; - tplink,archer-c50-v4) - MTD_ARGS="-t romfile" - default_do_upgrade "$1" - ;; - ubiquiti,edgerouterx|\ - ubiquiti,edgerouterx-sfp) - platform_upgrade_ubnt_erx "$1" - ;; - *) - default_do_upgrade "$1" - ;; - esac -} diff --git a/target/linux/ramips/base-files/lib/upgrade/ubnt.sh b/target/linux/ramips/base-files/lib/upgrade/ubnt.sh deleted file mode 100644 index 748ec8e628..0000000000 --- a/target/linux/ramips/base-files/lib/upgrade/ubnt.sh +++ /dev/null @@ -1,78 +0,0 @@ -# -# Copyright (C) 2015 OpenWrt.org -# - -. /lib/functions.sh -#Note: this code also uses some functions from nand.sh, but it is expected to be run by nand.sh, so we are not -#sourcing it explicitly here - -UBNT_ERX_KERNEL_INDEX_OFFSET=160 - -ubnt_get_target_kernel() { - local factory_mtd=$1 - local current_kernel_index=$(hexdump -s $UBNT_ERX_KERNEL_INDEX_OFFSET -n 1 -e '/1 "%X "' ${factory_mtd}) - - if [ $current_kernel_index == "0" ]; then - echo 'kernel2' - elif [ $current_kernel_index == "1" ]; then - echo 'kernel1' - fi -} - -ubnt_update_target_kernel() { - local factory_mtd=$1 - local kernel_part=$2 - - local new_kernel_index - if [ $kernel_part == "kernel1" ]; then - new_kernel_index="\x00" - elif [ $kernel_part == "kernel2" ]; then - new_kernel_index="\x01" - else - echo 'Unknown kernel image index' >&2 - return 1 - fi - - if ! (echo -e $new_kernel_index | dd of=${factory_mtd} bs=1 count=1 seek=$UBNT_ERX_KERNEL_INDEX_OFFSET); then - echo 'Failed to update kernel bootup index' >&2 - return 1 - fi -} - -platform_upgrade_ubnt_erx() { - local factory_mtd=$(find_mtd_part factory) - if [ -z "$factory_mtd" ]; then - echo "cannot find factory partition" >&2 - exit 1 - fi - - local kernel_part="$(ubnt_get_target_kernel ${factory_mtd})" - if [ -z "$kernel_part" ]; then - echo "cannot find factory partition" >&2 - exit 1 - fi - - # This is a global defined in nand.sh, sets partition kernel will be flashed into - CI_KERNPART=${kernel_part} - - #Remove volume possibly left over from stock firmware - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - if [ -z "$ubidev" ]; then - local mtdnum="$( find_mtd_index "$CI_UBIPART" )" - if [ -z "$mtdnum" ]; then - echo "cannot find ubi mtd partition $CI_UBIPART" >&2 - exit 1 - fi - ubiattach -m "$mtdnum" - sync - ubidev="$( nand_find_ubi "$CI_UBIPART" )" - fi - if [ -n "$ubidev" ]; then - local troot_ubivol="$( nand_find_volume $ubidev troot )" - [ -n "$troot_ubivol" ] && ubirmvol /dev/$ubidev -N troot || true - fi - - ubnt_update_target_kernel ${factory_mtd} ${kernel_part} || exit 1 - - nand_do_upgrade "$1" -} diff --git a/target/linux/ramips/base-files/sbin/fixup-mac-address b/target/linux/ramips/base-files/sbin/fixup-mac-address deleted file mode 100755 index dad15c5842..0000000000 --- a/target/linux/ramips/base-files/sbin/fixup-mac-address +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -. /lib/functions.sh -. /lib/functions/system.sh - -partname="" -offset="" -NEW_MAC= -YES= - -board=$(board_name) -case $board in - mqmaker,witi) - partname=factory - offset=$((0xe000)) - ;; - *) - echo "Unsupported board" - exit 1 - ;; -esac - -while [ -n "$1" ]; do - case "$1" in - ??:??:??:??:??:??) NEW_MAC="$1";; - -y) YES=1;; - *) - cat <<EOF -Unknown option/argument '$1' -Usage: $0 [-y] [<macaddr>] -EOF - exit 1 - ;; - esac - shift -done - -ask_bool() { - local message="$1" - local default="$((! ${2:-0}))" - [ -n "$YES" ] && return 0 - echo -n "$message " - read opt - case "$opt" in - y|Y) return 0;; - n|N) return 1;; - *) return $default;; - esac -} - -convert_hex() { - hexdump -e '/1 "%02x "' -} - -gen_mac() { - dd if=/dev/urandom bs=6 count=1 2>/dev/null -} - -mac="$(mtd_get_mac_binary $partname $offset)" -case "$mac" in - 00:00:00:00:00:00);; - ff:ff:ff:ff:ff:ff);; - *) - echo "Current MAC address: $mac" - ask_bool "Overwrite (y/N)?" 0 || exit - ;; -esac - -if [ -n "$NEW_MAC" ]; then - set -- $(echo "$NEW_MAC" | sed 's,:, ,g') -else - set -- $(gen_mac | convert_hex) - set -- $(printf %02x $(( (0x$1 & 0xfe) | 0x02 ))) $2 $3 $4 $5 $6 -fi -echo "New MAC address: $1:$2:$3:$4:$5:$6" -ask_bool "Write to EEPROM (y/N)?" || exit - -part=$(find_mtd_part "$partname") -[ -n "$part" ] || exit -echo -ne "\x$1\x$2\x$3\x$4\x$5\x$6" | dd of=$part conv=notrunc bs=1 count=6 seek=$offset 2>/dev/null -echo "Done" |