aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/mt76x8/base-files
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/mt76x8/base-files
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/mt76x8/base-files')
-rwxr-xr-xtarget/linux/ramips/mt76x8/base-files/etc/board.d/01_leds127
-rw-r--r--target/linux/ramips/mt76x8/base-files/etc/uci-defaults/04_led_migration20
2 files changed, 59 insertions, 88 deletions
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
index 52be48e1ef..3108688da3 100755
--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt76x8/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,7 +16,7 @@ led_wlan="$(get_dt_led wlan)"
case $board in
alfa-network,awusfree1)
- set_wifi_led "$boardname:blue:wlan"
+ set_wifi_led "blue:wlan"
;;
asus,rt-n10p-v3|\
asus,rt-n11p-b1|\
@@ -26,119 +24,112 @@ asus,rt-n12-vp-b1|\
netgear,r6020|\
netgear,r6080|\
netgear,r6120)
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0xf"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0xf"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
;;
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"
+ ucidef_set_led_switch "wan" "wan" "blue:wan" "switch0" "0x10"
+ ucidef_set_led_switch "lan1" "lan1" "blue:lan1" "switch0" "0x08"
+ ucidef_set_led_switch "lan2" "lan2" "blue:lan2" "switch0" "0x04"
;;
glinet,gl-mt300n-v2)
- set_wifi_led "$boardname:red:wlan"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x1"
+ set_wifi_led "red:wlan"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x1"
;;
hilink,hlk-7628n|\
skylab,skw92a)
- set_wifi_led "$boardname:green:wlan"
+ set_wifi_led "green:wlan"
;;
hiwifi,hc5661a|\
hiwifi,hc5761a)
- ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
+ ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x10"
;;
mediatek,linkit-smart-7688)
- ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt"
+ ucidef_set_led_wlan "wifi" "wifi" "orange:wifi" "phy0tpt"
;;
rakwireless,rak633)
- set_wifi_led "$boardname:blue:wifi"
+ set_wifi_led "blue:wifi"
;;
tama,w06)
- ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
- ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
+ ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
+ ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt"
;;
tplink,archer-c20-v4|\
-tplink,archer-c20-v5)
- ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
+tplink,archer-c20-v5|\
+tplink,tl-wr841n-v14|\
+tplink,tl-wr850n-v2)
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
;;
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"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
+ ucidef_set_led_wlan "wlan2g" "wlan2g" "green:wlan2g" "phy0tpt"
+ ucidef_set_led_wlan "wlan5g" "wlan5g" "green:wlan5g" "phy1tpt"
;;
tplink,re200-v2|\
tplink,re200-v3|\
tplink,re220-v2|\
tplink,tl-mr3020-v3|\
tplink,tl-wa801nd-v5)
- ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
+ ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
;;
tplink,tl-mr3420-v5|\
+tplink,tl-wr840n-v4|\
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-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"
+ ucidef_set_led_wlan "wlan2g" "wlan2g" "green:wlan" "phy0tpt"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x1e"
+ ucidef_set_led_switch "wan" "wan" "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|\
-tplink,tl-wr850n-v2)
- 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" "green:wlan" "phy0tpt"
+ ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x2"
+ ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x4"
+ ucidef_set_led_switch "lan3" "lan3" "green:lan3" "switch0" "0x8"
+ ucidef_set_led_switch "lan4" "lan4" "green:lan4" "switch0" "0x10"
+ ucidef_set_led_switch "wan" "wan" "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"
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
+ ucidef_set_led_wlan "wlan2g" "wlan2g" "green:wlan" "phy0tpt"
+ ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x10"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "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"
+ ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x2"
+ ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x4"
+ ucidef_set_led_switch "lan3" "lan3" "green:lan3" "switch0" "0x8"
+ ucidef_set_led_switch "lan4" "lan4" "green:lan4" "switch0" "0x10"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01"
+ set_wifi_led "green:wlan"
;;
wavlink,wl-wn570ha1)
- ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
+ ucidef_set_led_switch "wan" "wan" "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"
+ ucidef_set_led_rssi "wifi-low" "wifi-low" "green:wifi-low" "wlan0" "1" "49"
+ ucidef_set_led_rssi "wifi-med" "wifi-med" "green:wifi-med" "wlan0" "50" "84"
+ ucidef_set_led_rssi "wifi-high" "wifi-high" "green:wifi-high" "wlan0" "85" "100"
+ set_wifi_led "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"
+ ucidef_set_led_rssi "wifi-low" "wifi-low" "green:wifi-low" "wlan1" "1" "49"
+ ucidef_set_led_rssi "wifi-med" "wifi-med" "green:wifi-med" "wlan1" "50" "84"
+ ucidef_set_led_rssi "wifi-high" "wifi-high" "green:wifi-high" "wlan1" "85" "100"
;;
wavlink,wl-wn577a2)
- 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_switch "lan" "lan" "green:lan" "switch0" "0x8"
+ ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
;;
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"
+ set_wifi_led "green:wlan"
+ ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x01"
+ ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x02"
+ ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x10"
;;
zyxel,keenetic-extra-ii)
- set_wifi_led "$boardname:green:wifi"
- ucidef_set_led_switch "internet" "internet" "$boardname:green:internet" "switch0" "0x01"
+ set_wifi_led "green:wifi"
+ ucidef_set_led_switch "internet" "internet" "green:internet" "switch0" "0x01"
;;
esac
diff --git a/target/linux/ramips/mt76x8/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt76x8/base-files/etc/uci-defaults/04_led_migration
deleted file mode 100644
index 44815b2ddc..0000000000
--- a/target/linux/ramips/mt76x8/base-files/etc/uci-defaults/04_led_migration
+++ /dev/null
@@ -1,20 +0,0 @@
-. /lib/functions.sh
-. /lib/functions/migrations.sh
-
-board=$(board_name)
-
-case "$board" in
-tplink,archer-c20-v4)
- migrate_leds "^c20-v4:=archer-c20-v4:"
- ;;
-tplink,archer-c50-v3)
- migrate_leds "^c50-v3:=archer-c50-v3:"
- ;;
-tplink,archer-c50-v4)
- migrate_leds "^c50-v4:=archer-c50-v4:"
- ;;
-esac
-
-migrations_apply system
-
-exit 0