From dd448cd2767c42d0ccde960da61585a2537eaf5a Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Wed, 15 Aug 2018 19:12:27 +0200 Subject: [PATCH] treewide: fix upgrade led handling The upgrade led is only used if a running led is defined. If no running led is defined, the upgrade led is ignored and upgrade isn't indicated at all. Instead, turn off the running led prior to turning the upgrade led on. In most cases there isn't any visual change, but it allows to use an independent led for upgrade indication. Signed-off-by: Mathias Kresin --- target/linux/apm821xx/base-files/etc/diag.sh | 6 ++++-- target/linux/ath79/base-files/etc/diag.sh | 6 ++++-- target/linux/ipq40xx/base-files/etc/diag.sh | 6 ++++-- target/linux/ipq806x/base-files/etc/diag.sh | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/target/linux/apm821xx/base-files/etc/diag.sh b/target/linux/apm821xx/base-files/etc/diag.sh index 26c035c6f3..96d42a4892 100755 --- a/target/linux/apm821xx/base-files/etc/diag.sh +++ b/target/linux/apm821xx/base-files/etc/diag.sh @@ -29,9 +29,11 @@ set_state() { ;; upgrade) [ -n "$running" ] && { - status_led="$upgrade" - status_led_blink_preinit_regular + status_led="$running" + status_led_off } + status_led="$upgrade" + status_led_blink_preinit_regular ;; done) status_led_off diff --git a/target/linux/ath79/base-files/etc/diag.sh b/target/linux/ath79/base-files/etc/diag.sh index a3a7047702..782bab907a 100755 --- a/target/linux/ath79/base-files/etc/diag.sh +++ b/target/linux/ath79/base-files/etc/diag.sh @@ -32,9 +32,11 @@ set_state() { ;; upgrade) [ -n "$running" ] && { - status_led="$upgrade" - status_led_blink_preinit_regular + status_led="$running" + status_led_off } + status_led="$upgrade" + status_led_blink_preinit_regular ;; done) status_led_off diff --git a/target/linux/ipq40xx/base-files/etc/diag.sh b/target/linux/ipq40xx/base-files/etc/diag.sh index a3a7047702..782bab907a 100755 --- a/target/linux/ipq40xx/base-files/etc/diag.sh +++ b/target/linux/ipq40xx/base-files/etc/diag.sh @@ -32,9 +32,11 @@ set_state() { ;; upgrade) [ -n "$running" ] && { - status_led="$upgrade" - status_led_blink_preinit_regular + status_led="$running" + status_led_off } + status_led="$upgrade" + status_led_blink_preinit_regular ;; done) status_led_off diff --git a/target/linux/ipq806x/base-files/etc/diag.sh b/target/linux/ipq806x/base-files/etc/diag.sh index df4afd936c..9e6b4918ed 100755 --- a/target/linux/ipq806x/base-files/etc/diag.sh +++ b/target/linux/ipq806x/base-files/etc/diag.sh @@ -29,9 +29,11 @@ set_state() { ;; upgrade) [ -n "$running" ] && { - status_led="$upgrade" - status_led_blink_preinit_regular + status_led="$running" + status_led_off } + status_led="$upgrade" + status_led_blink_preinit_regular ;; done) status_led_off -- 2.30.2