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 0cbd2ab3a69f9fd75b98e9b01d69913fffe5a746..9e9144cba4e9bbe0d95b77b5b3bec716e1403fb0 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 3985d8fd7eca9de22b5480f019c137891fc77a32..bdc12c742609e1d6f49f34bfe8c5a29608fa3d9f 100755 (executable)
@@ -122,6 +122,7 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
        echo
 }
 
+indicate_upgrade
 
 killall -9 telnetd
 killall -9 dropbear
index 0e29302465fb5fca6f2a2194c751728f492053d5..610f9bbbdbc174f6cc00b3dac846faa94b9af9cd 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 b41bea1c29cfa8909d504b4b7871a8c03889af33..6e282f99f45c091101a81eaaf9cfc7b1623044cb 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 d7d2ba065aa3c7f4128b73b6e44a0d1c26fccb1c..4de019a27cad08edd24b2ba9821afeb5166f6868 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 67c032cb8a9dcfbe8044764235949d5646aabfe1..78b75d4648e1af8d3289ce857a9f263d20f8967b 100755 (executable)
@@ -367,9 +367,3 @@ platform_do_upgrade() {
                ;;
        esac
 }
-
-blink_led() {
-       . /etc/diag.sh; set_state upgrade
-}
-
-append sysupgrade_pre_upgrade blink_led