aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/mt7620
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-09-27 19:40:51 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-10-02 14:51:57 +0200
commitc846dd91f0a6f99b529ed6e1ec4ab149466dc0d2 (patch)
tree700447cce24d5047340897eb5e5cf5c9d0e03726 /target/linux/ramips/mt7620
parent9b4eab023c0add0063260e8a5da6193fc44f1658 (diff)
downloadupstream-c846dd91f0a6f99b529ed6e1ec4ab149466dc0d2.tar.gz
upstream-c846dd91f0a6f99b529ed6e1ec4ab149466dc0d2.tar.bz2
upstream-c846dd91f0a6f99b529ed6e1ec4ab149466dc0d2.zip
ramips: remove model name from LED labels
Like in the previous patch for ath79 target, this will remove the "devicename" from LED labels in ramips as well. The devicename is removed in DTS files and 01_leds, consolidation of definitions into DTSI files is done where (easily) possible, and migration scripts are updated. For the latter, all existing definitions were actually just devicename migrations anyway. Therefore, those are removed and a common migration file is created in target base-files. This is actually another example of how the devicename removal makes things easier. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ramips/mt7620')
-rwxr-xr-xtarget/linux/ramips/mt7620/base-files/etc/board.d/01_leds197
-rw-r--r--target/linux/ramips/mt7620/base-files/etc/uci-defaults/04_led_migration50
2 files changed, 95 insertions, 152 deletions
diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds
index ec86ed4b3f..519d643a8c 100755
--- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds
@@ -7,9 +7,7 @@ set_wifi_led() {
ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}"
}
-
board=$(board_name)
-boardname="${board##*,}"
board_config_update
@@ -18,220 +16,215 @@ led_wlan="$(get_dt_led wlan)"
case $board in
aigale,ai-br100)
- ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "eth0.2"
- set_wifi_led "$boardname:blue:wlan"
+ ucidef_set_led_netdev "wan" "wan" "blue:wan" "eth0.2"
+ set_wifi_led "blue:wlan"
;;
alfa-network,ac1200rm)
- set_wifi_led "$boardname:green:wlan2g" "wlan1"
+ set_wifi_led "green:wlan2g" "wlan1"
;;
alfa-network,r36m-e4g)
- ucidef_set_led_netdev "4g" "4g" "$boardname:orange:4g" "wwan0"
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x8"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
+ ucidef_set_led_netdev "4g" "4g" "orange:4g" "wwan0"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x8"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
;;
alfa-network,tube-e4g)
- ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0"
- ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" "eth0"
+ ucidef_set_led_netdev "4g" "4g" "green:4g" "wwan0"
+ ucidef_set_led_netdev "lan" "lan" "blue:lan" "eth0"
;;
asus,rp-n53)
- ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0"
- set_wifi_led "$boardname:blue:wifi"
+ ucidef_set_led_netdev "eth" "Network" "white:back" "eth0"
+ set_wifi_led "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"
+ ucidef_set_led_netdev "lan" "lan" "green:lan" eth0.1
+ ucidef_set_led_netdev "wan" "wan" "green:wan" eth0.2
+ set_wifi_led "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"
+ ucidef_set_led_netdev "lan" "lan" "blue:lan" eth0.1
+ ucidef_set_led_netdev "wan" "wan" "blue:wan" eth0.2
+ set_wifi_led "blue:air"
;;
bdcom,wap2100-sk)
- set_wifi_led "$boardname:green:wlan2g"
+ set_wifi_led "green:wlan2g"
;;
comfast,cf-wr800n)
- ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1
- set_wifi_led "$boardname:white:wifi"
+ ucidef_set_led_netdev "lan" "lan" "white:ethernet" eth0.1
+ set_wifi_led "white:wifi"
;;
dlink,dir-810l|\
trendnet,tew-810dr)
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
;;
dlink,dwr-116-a1|\
head-weblink,hdrm200|\
ohyeah,oy-0001|\
planex,mzk-ex300np|\
+zbtlink,zbt-we826-16m|\
+zbtlink,zbt-we826-32m|\
zbtlink,zbt-wr8305rt|\
zyxel,keenetic-omni|\
zyxel,keenetic-omni-ii|\
zyxel,keenetic-viva)
- set_wifi_led "$boardname:green:wifi"
+ set_wifi_led "green:wifi"
;;
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"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x1f"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x20"
+ set_wifi_led "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"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
+ set_wifi_led "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"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x0f"
+ ucidef_set_led_netdev "signalstrength" "signalstrength" "green:sigstrength" "wwan0" "link"
+ ucidef_set_led_netdev "4g" "4g" "green:4g" "wwan0" "tx rx"
+ set_wifi_led "green:wifi"
;;
dlink,dwr-960)
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x2e"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x2e"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
;;
dovado,tiny-ac)
- set_wifi_led "$boardname:orange:wifi"
+ set_wifi_led "orange:wifi"
;;
edimax,br-6478ac-v2|\
edimax,ew-7478apc)
- set_wifi_led "$boardname:blue:wlan"
+ set_wifi_led "blue:wlan"
;;
edimax,ew-7476rpc|\
edimax,ew-7478ac)
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x20"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x20"
;;
elecom,wrh-300cr)
- set_wifi_led "$boardname:green:wlan"
- ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0"
+ ucidef_set_led_netdev "lan" "lan" "green:ethernet" "eth0"
+ set_wifi_led "green:wlan"
;;
engenius,esr600)
- ucidef_set_led_netdev "wlan5g" "5.0GHz" "$boardname:blue:wlan5g" "wlan0"
- ucidef_set_led_netdev "wlan2g" "2.4GHz" "$boardname:blue:wlan2g" "wlan1"
+ ucidef_set_led_netdev "wlan5g" "5.0GHz" "blue:wlan5g" "wlan0"
+ ucidef_set_led_netdev "wlan2g" "2.4GHz" "blue:wlan2g" "wlan1"
;;
glinet,gl-mt300a|\
glinet,gl-mt300n|\
glinet,gl-mt750)
- set_wifi_led "$boardname:wlan"
+ set_wifi_led "wlan"
;;
hiwifi,hc5661|\
hiwifi,hc5761)
- ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x01"
+ ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x01"
;;
hiwifi,hc5861)
- ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x20"
+ ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x20"
;;
hnet,c108)
- ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
- ucidef_set_led_netdev "modem" "modem" "$boardname:green:modem" "wwan0"
+ ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
+ ucidef_set_led_netdev "modem" "modem" "green:modem" "wwan0"
;;
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"
+ ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy0radio"
+ ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy1radio"
;;
kimax,u25awf-h1)
- set_wifi_led "u25awf:red:wifi"
- ucidef_set_led_netdev "eth" "eth" "u25awf:green:lan" "eth0"
+ ucidef_set_led_netdev "eth" "eth" "green:lan" "eth0"
+ set_wifi_led "red:wifi"
;;
kimax,u35wf)
- set_wifi_led "$boardname:blue:wifi"
- ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
+ ucidef_set_led_netdev "eth" "ETH" "green:eth" "eth0"
+ set_wifi_led "blue:wifi"
;;
kingston,mlw221|\
kingston,mlwg2|\
sanlinking,d240)
- set_wifi_led "$boardname:blue:wifi"
+ set_wifi_led "blue:wifi"
;;
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"
+ ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "green:wlan2g" "wlan1"
+ ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "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"
+ ucidef_set_led_netdev "wifi" "WIFI" "blue:wifi" "wlan1"
+ ucidef_set_led_netdev "wifi5g" "WIFI5G" "blue:wifi5g" "wlan0"
+ ucidef_set_led_switch "lan" "LAN" "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"
+ ucidef_set_led_netdev "wifi" "WIFI" "yellow:wifi" "wlan1"
+ ucidef_set_led_netdev "wifi5g" "WIFI5G" "blue:wifi" "wlan0"
+ ucidef_set_led_netdev "wan" "WAN" "blue:internet" "eth0.2" "tx rx"
;;
netgear,ex2700|\
netgear,wn3000rp-v3)
- set_wifi_led "$boardname:green:router"
+ set_wifi_led "green:router"
;;
netgear,ex3700|\
netgear,ex6130)
- ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$boardname:green:router" "wlan0"
- ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1"
+ ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "green:router" "wlan0"
+ ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "green:device" "wlan1"
;;
netgear,jwnr2010-v5)
- ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x08"
- ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x04"
- ucidef_set_led_switch "lan3" "lan3" "$boardname:green:lan3" "switch0" "0x02"
- ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x01"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
+ ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x08"
+ ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x04"
+ ucidef_set_led_switch "lan3" "lan3" "green:lan3" "switch0" "0x02"
+ ucidef_set_led_switch "lan4" "lan4" "green:lan4" "switch0" "0x01"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
;;
phicomm,psg1208)
- set_wifi_led "$boardname:white:wlan2g"
+ set_wifi_led "white:wlan2g"
;;
planex,mzk-ex750np|\
zbtlink,zbt-we826-e)
- set_wifi_led "$boardname:red:wifi"
+ set_wifi_led "red:wifi"
;;
ravpower,rp-wd03)
- ucidef_set_led_netdev "internet" "internet" "$boardname:green:wifi" "eth0"
+ ucidef_set_led_netdev "internet" "internet" "green:wifi" "eth0"
;;
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"
- ;;
-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_switch "lan" "lan" "green:lan" "switch1" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch1" "0x01"
;;
+tplink,archer-c20-v1|\
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_switch "lan" "lan" "blue:lan" "switch0" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "blue:wan" "switch0" "0x01"
;;
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_switch "lan" "lan" "green:lan" "switch0" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
;;
tplink,archer-mr200)
- ucidef_set_led_netdev "lan" "lan" "$boardname:white:lan" "eth0.1"
- ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "usb0"
+ ucidef_set_led_netdev "lan" "lan" "white:lan" "eth0.1"
+ ucidef_set_led_netdev "wan" "wan" "white:wan" "usb0"
;;
tplink,re200-v1)
- ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
+ ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
;;
youku,yk1)
- set_wifi_led "$boardname:blue:air"
- ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
+ ucidef_set_led_switch "wan" "wan" "blue:wan" "switch0" "0x10"
+ set_wifi_led "blue:air"
;;
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"
+ ucidef_set_led_netdev "wlan2g4" "wlan1-link" "green:wlan2g4" "wlan1"
+ ucidef_set_led_netdev "sys1" "wlan1" "green:sys1" "wlan1" "tx rx"
+ ucidef_set_led_netdev "sys2" "wlan0" "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"
+ set_wifi_led "blue:air"
;;
zbtlink,zbt-we1026-5g-16m)
- ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0"
- set_wifi_led "we1026-5g:green:wifi"
+ ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
+ set_wifi_led "green:wifi"
;;
zbtlink,zbt-we1026-h-32m)
- set_wifi_led "we1026-h:green:wifi"
- ucidef_set_led_switch "lan" "lan" "we1026-h:green:lan" "switch0" "0x8"
- ucidef_set_led_switch "wan" "wan" "we1026-h:green:wan" "switch0" "0x10"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x8"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
+ set_wifi_led "green:wifi"
;;
zbtlink,zbt-we2026)
- set_wifi_led "$boardname:green:wlan"
+ set_wifi_led "green:wlan"
;;
esac
diff --git a/target/linux/ramips/mt7620/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt7620/base-files/etc/uci-defaults/04_led_migration
deleted file mode 100644
index 0f2e08cf7f..0000000000
--- a/target/linux/ramips/mt7620/base-files/etc/uci-defaults/04_led_migration
+++ /dev/null
@@ -1,50 +0,0 @@
-. /lib/functions.sh
-. /lib/functions/migrations.sh
-
-board=$(board_name)
-
-case "$board" in
-lenovo,newifi-y1)
- migrate_leds "^y1:=newifi-y1:"
- ;;
-lenovo,newifi-y1s)
- migrate_leds "^y1s:=newifi-y1s:"
- ;;
-netgear,wn3000rp-v3)
- migrate_leds "^wn3000rpv3:=wn3000rp-v3:"
- ;;
-ravpower,rp-wd03)
- migrate_leds "^wd03:=rp-wd03:"
- ;;
-tplink,archer-c2-v1)
- migrate_leds "^c2-v1:=archer-c2-v1:"
- ;;
-tplink,archer-c20-v1)
- migrate_leds "^c20-v1:=archer-c20-v1:"
- ;;
-tplink,archer-c20i)
- migrate_leds "^c20i:=archer-c20i:"
- ;;
-tplink,archer-c50-v1)
- migrate_leds "^c50:=archer-c50-v1:"
- ;;
-tplink,archer-mr200)
- migrate_leds "^mr200:=archer-mr200:"
- ;;
-youku,yk1)
- migrate_leds "^youku-yk1:=yk1:"
- ;;
-zyxel,keenetic-omni)
- migrate_leds "^kn_rc:=keenetic-omni:"
- ;;
-zyxel,keenetic-omni-ii)
- migrate_leds "^kn_rc:=keenetic-omni-ii:"
- ;;
-zyxel,keenetic-viva)
- migrate_leds "^kng_rc:=keenetic-viva:"
- ;;
-esac
-
-migrations_apply system
-
-exit 0