[OpenWrt-Devel] [PATCH 3/4] mvebu: enable LED diagnostics for Turris Omnia
Klaus Kudielka
klaus.kudielka at gmail.com
Thu Dec 13 00:29:51 EST 2018
Just before starting LED diagnostics, a preinit hook disables
the 'autonomous' flag for all LEDs. This way, the power LED will
start blinking during preinit, as desired. As a benefit, all
other LEDs remain dark, until boot is finished (and the desired
LED configuration is loaded). This avoids the rather distracting
on/off behaviour of some LAN LEDs during boot.
Signed-off-by: Klaus Kudielka <klaus.kudielka at gmail.com>
---
target/linux/mvebu/base-files/etc/diag.sh | 3 +++
.../mvebu/base-files/lib/preinit/09_initialize_leds | 12 ++++++++++++
2 files changed, 15 insertions(+)
create mode 100644 target/linux/mvebu/base-files/lib/preinit/09_initialize_leds
diff --git a/target/linux/mvebu/base-files/etc/diag.sh b/target/linux/mvebu/base-files/etc/diag.sh
index 327a82df93..f81dba083f 100644
--- a/target/linux/mvebu/base-files/etc/diag.sh
+++ b/target/linux/mvebu/base-files/etc/diag.sh
@@ -22,6 +22,9 @@ get_status_led() {
armada-385-linksys-venom)
status_led="venom:blue:power"
;;
+ armada-385-turris-omnia)
+ status_led="omnia-led:power"
+ ;;
armada-xp-linksys-mamba)
status_led="mamba:white:power"
;;
diff --git a/target/linux/mvebu/base-files/lib/preinit/09_initialize_leds b/target/linux/mvebu/base-files/lib/preinit/09_initialize_leds
new file mode 100644
index 0000000000..c83fa671e1
--- /dev/null
+++ b/target/linux/mvebu/base-files/lib/preinit/09_initialize_leds
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+do_initialize_leds() {
+ case $(board_name) in
+ armada-385-turris-omnia)
+ led_set_attr omnia-led:all autonomous 0
+ ;;
+ esac
+}
+
+boot_hook_add preinit_main do_initialize_leds
+
--
2.17.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list