lantiq: move 01_led_migration script to subtargets
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Fri, 17 Jul 2020 10:09:57 +0000 (12:09 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Fri, 17 Jul 2020 10:14:32 +0000 (12:14 +0200)
Split the /etc/uci-defaults/01_led_migration scripts into subtargets
as already done for most of the other base-files.

While this introduces a minor amount of code duplication, it still
is considered an improvement, as device-specific settings are kept
together in the subtargets' base-files and the script at hand can be
removed entirely for two of the subtargets not needing it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration [deleted file]
target/linux/lantiq/xrx200/base-files/etc/uci-defaults/01_led_migration [new file with mode: 0644]
target/linux/lantiq/xway/base-files/etc/uci-defaults/01_led_migration [new file with mode: 0644]
target/linux/lantiq/xway_legacy/base-files/etc/uci-defaults/01_led_migration [new file with mode: 0644]

diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration
deleted file mode 100644 (file)
index 961e39e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Copyright (C) 2013 OpenWrt.org
-#
-
-. /lib/functions/migrations.sh
-
-do_internet_led_rename()
-{
-       config_load system
-
-       [ -n $(config_get led_internet name) ] || return
-       [ -z $(config_get led_dsl name) ] || return
-
-       uci rename system.led_internet=led_dsl
-       uci set system.led_dsl.name=dsl
-
-       logger -t led-migration "internet led renamed to dsl"
-}
-
-case "$(board_name)" in
-alphanetworks,asl56026|\
-arcadyan,arv452cqw|\
-arcadyan,arv7510pw22|\
-arcadyan,arv7519rw22|\
-arcadyan,arv752dpw|\
-arcadyan,arv752dpw22|\
-arcadyan,vg3503j|\
-avm,fritz7360sl|\
-bt,homehub-v2b|\
-bt,homehub-v3a|\
-bt,homehub-v5a)
-       do_internet_led_rename
-       ;;
-netgear,dgn3500|\
-netgear,dgn3500b)
-       migrate_leds "dgn3500:blue:wireless=dgn3500:green:wireless"
-       ;;
-esac
-
-migrations_apply system
-
-exit 0
diff --git a/target/linux/lantiq/xrx200/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/xrx200/base-files/etc/uci-defaults/01_led_migration
new file mode 100644 (file)
index 0000000..35903d2
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+
+. /lib/functions/migrations.sh
+
+do_internet_led_rename()
+{
+       config_load system
+
+       [ -n $(config_get led_internet name) ] || return
+       [ -z $(config_get led_dsl name) ] || return
+
+       uci rename system.led_internet=led_dsl
+       uci set system.led_dsl.name=dsl
+
+       logger -t led-migration "internet led renamed to dsl"
+}
+
+case "$(board_name)" in
+alphanetworks,asl56026|\
+arcadyan,arv7519rw22|\
+arcadyan,vg3503j|\
+avm,fritz7360sl|\
+bt,homehub-v5a)
+       do_internet_led_rename
+       ;;
+esac
+
+migrations_apply system
+
+exit 0
diff --git a/target/linux/lantiq/xway/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/xway/base-files/etc/uci-defaults/01_led_migration
new file mode 100644 (file)
index 0000000..0139ef2
--- /dev/null
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+
+. /lib/functions/migrations.sh
+
+do_internet_led_rename()
+{
+       config_load system
+
+       [ -n $(config_get led_internet name) ] || return
+       [ -z $(config_get led_dsl name) ] || return
+
+       uci rename system.led_internet=led_dsl
+       uci set system.led_dsl.name=dsl
+
+       logger -t led-migration "internet led renamed to dsl"
+}
+
+case "$(board_name)" in
+arcadyan,arv7510pw22|\
+arcadyan,arv752dpw|\
+arcadyan,arv752dpw22|\
+bt,homehub-v2b|\
+bt,homehub-v3a)
+       do_internet_led_rename
+       ;;
+netgear,dgn3500|\
+netgear,dgn3500b)
+       migrate_leds "dgn3500:blue:wireless=dgn3500:green:wireless"
+       ;;
+esac
+
+migrations_apply system
+
+exit 0
diff --git a/target/linux/lantiq/xway_legacy/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/xway_legacy/base-files/etc/uci-defaults/01_led_migration
new file mode 100644 (file)
index 0000000..18bf6a3
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+
+. /lib/functions/migrations.sh
+
+do_internet_led_rename()
+{
+       config_load system
+
+       [ -n $(config_get led_internet name) ] || return
+       [ -z $(config_get led_dsl name) ] || return
+
+       uci rename system.led_internet=led_dsl
+       uci set system.led_dsl.name=dsl
+
+       logger -t led-migration "internet led renamed to dsl"
+}
+
+case "$(board_name)" in
+arcadyan,arv452cqw)
+       do_internet_led_rename
+       ;;
+esac
+
+migrations_apply system
+
+exit 0