treewide: consolidate upgrade state set
authorMathias Kresin <dev@kresin.me>
Wed, 15 Aug 2018 16:55:01 +0000 (18:55 +0200)
committerMathias Kresin <dev@kresin.me>
Thu, 16 Aug 2018 19:20:57 +0000 (21:20 +0200)
Set the (sys)upgrade state when sourcing the stage2 script instead of
setting the state for each target individual.

This change fixes the, due to a missing state set, not working upgrade
led on ath79 and apm821xx.

Signed-off-by: Mathias Kresin <dev@kresin.me>
package/base-files/files/lib/upgrade/common.sh
package/base-files/files/lib/upgrade/stage2
target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
target/linux/ipq806x/base-files/lib/upgrade/platform.sh
target/linux/pistachio/base-files/lib/upgrade/platform.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh

index 0cbd2ab..9e9144c 100644 (file)
@@ -211,6 +211,11 @@ jffs2_copy_config() {
        fi
 }
 
+indicate_upgrade() {
+       . /etc/diag.sh
+       set_state upgrade
+}
+
 # Flash firmware to MTD partition
 #
 # $(1): path to image
index 3985d8f..bdc12c7 100755 (executable)
@@ -122,6 +122,7 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
        echo
 }
 
+indicate_upgrade
 
 killall -9 telnetd
 killall -9 dropbear
index 0e29302..610f9bb 100644 (file)
@@ -83,9 +83,3 @@ platform_nand_pre_upgrade() {
                ;;
        esac
 }
-
-blink_led() {
-       . /etc/diag.sh; set_state upgrade
-}
-
-append sysupgrade_pre_upgrade blink_led
index b41bea1..6e282f9 100644 (file)
@@ -46,9 +46,3 @@ platform_nand_pre_upgrade() {
                ;;
        esac
 }
-
-blink_led() {
-       . /etc/diag.sh; set_state upgrade
-}
-
-append sysupgrade_pre_upgrade blink_led
index d7d2ba0..4de019a 100755 (executable)
@@ -49,8 +49,3 @@ platform_nand_pre_upgrade() {
                ;;
        esac
 }
-
-blink_led() {
-       . /etc/diag.sh; set_state upgrade
-}
-append sysupgrade_pre_upgrade blink_led
index 67c032c..78b75d4 100755 (executable)
@@ -367,9 +367,3 @@ platform_do_upgrade() {
                ;;
        esac
 }
-
-blink_led() {
-       . /etc/diag.sh; set_state upgrade
-}
-
-append sysupgrade_pre_upgrade blink_led