ramips: add feature to blink led on sysupgrade
authorJohn Crispin <john@openwrt.org>
Tue, 3 Nov 2015 13:32:55 +0000 (13:32 +0000)
committerJohn Crispin <john@openwrt.org>
Tue, 3 Nov 2015 13:32:55 +0000 (13:32 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
Backport of r47373

SVN-Revision: 47374

target/linux/ramips/base-files/etc/diag.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh

index 5fc5137ce2b42c5fd3229474c5b23c1ec60e8296..d32d69288bb1a422c2402160ef6f041e7ca8b656 100644 (file)
@@ -85,6 +85,10 @@ get_status_led() {
        hw550-3g)
                status_led="hw550-3g:green:status"
                ;;
+       linkits7688| \
+       linkits7688d)
+               [ "$1" = "upgrade" ] && status_led="mediatek:orange:wifi"
+               ;;
        m2m)
                status_led="m2m:blue:wifi"
                ;;
@@ -250,7 +254,7 @@ get_status_led() {
 }
 
 set_state() {
-       get_status_led
+       get_status_led $1
 
        case "$1" in
        preinit)
@@ -259,6 +263,7 @@ set_state() {
        failsafe)
                status_led_blink_failsafe
                ;;
+       upgrade | \
        preinit_regular)
                status_led_blink_preinit_regular
                ;;
index 23f4575dc626703250ae5aa9b675ebe551752393..11fee85ea12fbfc19b236e7820917cb40238dad0 100755 (executable)
@@ -196,4 +196,9 @@ disable_watchdog() {
        }
 }
 
+blink_led() {
+       . /etc/diag.sh; set_state upgrade
+}
+
 append sysupgrade_pre_upgrade disable_watchdog
+append sysupgrade_pre_upgrade blink_led