aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/mt7621
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/mt7621
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/mt7621')
-rwxr-xr-xtarget/linux/ramips/mt7621/base-files/etc/board.d/01_leds78
-rw-r--r--target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration27
2 files changed, 37 insertions, 68 deletions
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 8c3be541b0..052b4ed5bb 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/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,51 +16,52 @@ led_wlan="$(get_dt_led wlan)"
case $board in
d-team,newifi-d2)
- ucidef_set_led_netdev "internet" "internet" "$boardname:amber:internet" "wan"
- ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0"
- ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1"
+ ucidef_set_led_netdev "internet" "internet" "amber:internet" "wan"
+ ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "blue:wlan2g" "wlan0"
+ ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "blue:wlan5g" "wlan1"
;;
d-team,pbr-m1|\
-gehua,ghl-r-001)
- ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
+gehua,ghl-r-001|\
+xzwifi,creativebox-v1)
+ ucidef_set_led_netdev "internet" "internet" "blue:internet" "wan"
;;
dlink,dir-1960-a1|\
dlink,dir-2660-a1)
- ucidef_set_led_netdev "wan" "wan" "$boardname:white:net" "wan"
+ ucidef_set_led_netdev "wan" "wan" "white:net" "wan"
;;
dlink,dir-860l-b1|\
dlink,dir-867-a1|\
dlink,dir-878-a1|\
dlink,dir-882-a1)
- ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "wan"
+ ucidef_set_led_netdev "wan" "wan" "green:net" "wan"
;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
- ucidef_set_led_netdev "lan1" "lan1" "$boardname:green:lan1" "lan1"
- ucidef_set_led_netdev "lan2" "lan2" "$boardname:green:lan2" "lan2"
+ ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1"
+ ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2"
;;
linksys,ea7300-v1|\
linksys,ea7300-v2|\
linksys,ea7500-v2)
- ucidef_set_led_netdev "lan1" "lan1 link" "$boardname:green:lan1" "lan1" "link"
- ucidef_set_led_netdev "lan2" "lan2 link" "$boardname:green:lan2" "lan2" "link"
- ucidef_set_led_netdev "lan3" "lan3 link" "$boardname:green:lan3" "lan3" "link"
- ucidef_set_led_netdev "lan4" "lan4 link" "$boardname:green:lan4" "lan4" "link"
- ucidef_set_led_netdev "wan" "wan link" "$boardname:green:wan" "wan" "link"
+ ucidef_set_led_netdev "lan1" "lan1 link" "green:lan1" "lan1" "link"
+ ucidef_set_led_netdev "lan2" "lan2 link" "green:lan2" "lan2" "link"
+ ucidef_set_led_netdev "lan3" "lan3 link" "green:lan3" "lan3" "link"
+ ucidef_set_led_netdev "lan4" "lan4 link" "green:lan4" "lan4" "link"
+ ucidef_set_led_netdev "wan" "wan link" "green:wan" "wan" "link"
;;
mikrotik,routerboard-760igs)
- ucidef_set_led_netdev "sfp" "SFP" "$boardname:blue:sfp" "sfp"
+ ucidef_set_led_netdev "sfp" "SFP" "blue:sfp" "sfp"
;;
mikrotik,routerboard-m11g)
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"
+ ucidef_set_led_rssi "rssilow" "RSSILOW" "green:rssi0" "wlan0" "1" "100"
+ ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "green:rssi1" "wlan0" "20" "100"
+ ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "green:rssi2" "wlan0" "40" "100"
+ ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:rssi3" "wlan0" "60" "100"
+ ucidef_set_led_rssi "rssiveryhigh" "RSSIVERYHIGH" "green:rssi4" "wlan0" "80" "100"
;;
mtc,wr1201)
- ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "br-lan"
+ ucidef_set_led_netdev "eth_link" "LAN link" "green:eth_link" "br-lan"
;;
netgear,r6220|\
netgear,r6260|\
@@ -70,38 +69,35 @@ netgear,r6350|\
netgear,r6850|\
netgear,wac124|\
netgear,wndr3700-v5)
- ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" "wan"
+ ucidef_set_led_netdev "wan" "wan" "green:wan" "wan"
;;
netgear,r6700-v2|\
netgear,r6800)
- ucidef_set_led_netdev "wan" "WAN" "$boardname:white:wan" "wan"
- ucidef_set_led_netdev "lan1" "LAN1" "$boardname:white:lan1" "lan1"
- ucidef_set_led_netdev "lan2" "LAN2" "$boardname:white:lan2" "lan2"
- ucidef_set_led_netdev "lan3" "LAN3" "$boardname:white:lan3" "lan3"
- ucidef_set_led_netdev "lan4" "LAN4" "$boardname:white:lan4" "lan4"
+ ucidef_set_led_netdev "wan" "WAN" "white:wan" "wan"
+ ucidef_set_led_netdev "lan1" "LAN1" "white:lan1" "lan1"
+ ucidef_set_led_netdev "lan2" "LAN2" "white:lan2" "lan2"
+ ucidef_set_led_netdev "lan3" "LAN3" "white:lan3" "lan3"
+ ucidef_set_led_netdev "lan4" "LAN4" "white:lan4" "lan4"
;;
tplink,re350-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" "lan" "tx rx"
- ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "lan" "link"
+ ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "blue:wifi2G" "wlan0"
+ ucidef_set_led_netdev "wifi5g" "Wifi 5G" "blue:wifi5G" "wlan1"
+ ucidef_set_led_netdev "eth_act" "LAN act" "green:eth_act" "lan" "tx rx"
+ ucidef_set_led_netdev "eth_link" "LAN link" "green:eth_link" "lan" "link"
;;
tplink,re500-v1|\
tplink,re650-v1)
- ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "lan" "tx rx"
- ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "lan" "link"
- ;;
-xzwifi,creativebox-v1)
- ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
+ ucidef_set_led_netdev "eth_act" "LAN act" "green:eth_act" "lan" "tx rx"
+ ucidef_set_led_netdev "eth_link" "LAN link" "green:eth_link" "lan" "link"
;;
xiaomi,mi-router-ac2100)
- ucidef_set_led_netdev "wan-blue" "WAN (blue)" "$boardname:blue:wan" "wan"
+ ucidef_set_led_netdev "wan-blue" "WAN (blue)" "blue:wan" "wan"
;;
xiaomi,redmi-router-ac2100)
- ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "wan"
+ ucidef_set_led_netdev "wan" "wan" "white:wan" "wan"
;;
youhua,wr1200js)
- ucidef_set_led_netdev "internet" "INTERNET" "$boardname:green:wan" "wan"
+ ucidef_set_led_netdev "internet" "INTERNET" "green:wan" "wan"
;;
esac
diff --git a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration
deleted file mode 100644
index 4b298654b6..0000000000
--- a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration
+++ /dev/null
@@ -1,27 +0,0 @@
-. /lib/functions.sh
-. /lib/functions/migrations.sh
-
-board=$(board_name)
-boardonly="${board##*,}"
-
-case "$board" in
-asus,rt-ac65p)
- migrate_leds "^rt-ac85p:=rt-ac65p:"
- ;;
-mikrotik,routerboard-750gr3)
- migrate_leds "^rb750gr3:=$boardonly:"
- ;;
-mikrotik,routerboard-m11g)
- migrate_leds "^rbm11g:=$boardonly:"
- ;;
-mikrotik,routerboard-m33g)
- migrate_leds "^rbm33g:=$boardonly:"
- ;;
-netgear,wndr3700-v5)
- migrate_leds "^wndr3700v5:=$boardonly:"
- ;;
-esac
-
-migrations_apply system
-
-exit 0