diff mbox series

[OpenWrt-Devel,2/2] ath79: engenius epg5000: add leds migration script

Message ID 20190318182136.23613-2-tomek_n@o2.pl
State Superseded
Headers show
Series [OpenWrt-Devel,1/2] base-files: add leds migration | expand

Commit Message

Tomasz Maciej Nowak March 18, 2019, 6:21 p.m. UTC
With transition from ar71xx to ath79 some of devices change their naming
of LEDs. When upgrading from ar71xx target images this will require the
user to adjust previously working configuration. This commit adds
migration script which can be used to rename old names to new ones.
With this previously working configuration will be automatically
adjusted, wihtout user intervention.

This commit adds migration case for EnGenius EPG5000, the wireless LEDs
names have changed from epg5000:blue:wlan2-g and epg5000:blue:wlan-5g to
epg5000:blue:wlan2g and epg5000:blue:wlan5g.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
---
 .../base-files/etc/uci-defaults/04_led_migration | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 target/linux/ath79/base-files/etc/uci-defaults/04_led_migration
diff mbox series

Patch

diff --git a/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration b/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration
new file mode 100644
index 0000000000..2ca87ccb34
--- /dev/null
+++ b/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration
@@ -0,0 +1,16 @@ 
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/functions/migrations.sh
+
+board=$(board_name)
+
+case "$board" in
+engenius,epg5000)
+	migrate_leds ":wlan-2g=:wlan2g" ":wlan-5g=:wlan5g"
+	;;
+esac
+
+migrations_apply system
+
+exit 0