Skip to content

Commit

Permalink
treewide: consolidate upgrade state set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mkresin committed Aug 16, 2018
1 parent 1ea1f3a commit 56b8ac1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 23 deletions.
5 changes: 5 additions & 0 deletions package/base-files/files/lib/upgrade/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions package/base-files/files/lib/upgrade/stage2
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
echo
}

indicate_upgrade

killall -9 telnetd
killall -9 dropbear
Expand Down
6 changes: 0 additions & 6 deletions target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,3 @@ platform_nand_pre_upgrade() {
;;
esac
}

blink_led() {
. /etc/diag.sh; set_state upgrade
}

append sysupgrade_pre_upgrade blink_led
6 changes: 0 additions & 6 deletions target/linux/ipq806x/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,3 @@ platform_nand_pre_upgrade() {
;;
esac
}

blink_led() {
. /etc/diag.sh; set_state upgrade
}

append sysupgrade_pre_upgrade blink_led
5 changes: 0 additions & 5 deletions target/linux/pistachio/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,3 @@ platform_nand_pre_upgrade() {
;;
esac
}

blink_led() {
. /etc/diag.sh; set_state upgrade
}
append sysupgrade_pre_upgrade blink_led
6 changes: 0 additions & 6 deletions target/linux/ramips/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,3 @@ platform_do_upgrade() {
;;
esac
}

blink_led() {
. /etc/diag.sh; set_state upgrade
}

append sysupgrade_pre_upgrade blink_led

0 comments on commit 56b8ac1

Please sign in to comment.