From 6ad56fb34c7498084659f3bf1b501f104aa76879 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Tue, 28 Nov 2017 22:51:07 +0100 Subject: apm821xx: convert to dt based diag LED script Please note that users with a Netgear WNDR4700 will need to update the device-tree partition manually. For instructions, please refere to commit 49856a4bb581 ("apm821xx: make it possible to update the dtb partition on the WNDR4700") Signed-off-by: Christian Lamparter --- target/linux/apm821xx/base-files/etc/diag.sh | 48 +++++++++++++++------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'target/linux/apm821xx/base-files/etc/diag.sh') diff --git a/target/linux/apm821xx/base-files/etc/diag.sh b/target/linux/apm821xx/base-files/etc/diag.sh index eb9b04b525..e45f2a8522 100755 --- a/target/linux/apm821xx/base-files/etc/diag.sh +++ b/target/linux/apm821xx/base-files/etc/diag.sh @@ -3,40 +3,42 @@ . /lib/functions.sh . /lib/functions/leds.sh -get_status_led() { - local board=$(board_name) - - case $board in - mbl|\ - mr24|\ - mx60|\ - wndr4700) - status_led="$board:green:power" - ;; - - *) - ;; - esac -} +boot="$(get_dt_led boot)" +failsafe="$(get_dt_led failsafe)" +running="$(get_dt_led running)" +upgrade="$(get_dt_led upgrade)" set_state() { - get_status_led + status_led="$boot" case "$1" in + preinit_regular) + status_led_blink_preinit_regular + ;; preinit) status_led_blink_preinit ;; - failsafe) + status_led_off + [ -n "$running" ] && { + status_led="$running" + status_led_off + } + status_led="$failsafe" status_led_blink_failsafe ;; - - preinit_regular) - status_led_blink_preinit_regular - ;; - + upgrade) + [ -n "$running" ] && { + status_led="$upgrade" + status_led_blink_preinit_regular + } + ;; done) - status_led_on + status_led_off + [ -n "$running" ] && { + status_led="$running" + status_led_on + } ;; esac } -- cgit v1.2.3