[openwrt/openwrt] base-files: bring back nand_do_upgrade_success

LEDE Commits lede-commits at lists.infradead.org
Sun Oct 30 13:27:38 PDT 2022


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/84ff6c90dda1bef517675c50397d3080cdd3c6c2

commit 84ff6c90dda1bef517675c50397d3080cdd3c6c2
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Oct 30 20:22:06 2022 +0000

    base-files: bring back nand_do_upgrade_success
    
    Several Broadcom targets were using the nand_do_upgrade_success
    shell function which has been removed by commit e25e6d8e54
    ("base-files: fix and clean up nand sysupgrade code"). Refactor the
    new nand_do_upgrade to bring back nand_do_upgrade_success with the
    behavior expected by those users.
    
    Fixes: e25e6d8e54 ("base-files: fix and clean up nand sysupgrade code")
    Reported-by: Chen Minqiang <ptpt52 at gmail.com>
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/base-files/files/lib/upgrade/nand.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh
index d9cfeede9c..1019b9927c 100644
--- a/package/base-files/files/lib/upgrade/nand.sh
+++ b/package/base-files/files/lib/upgrade/nand.sh
@@ -418,12 +418,20 @@ nand_do_upgrade() {
 	local file="$1"
 
 	sync
-	if nand_do_flash_file "$file" && nand_do_restore_config && sync; then
+	nand_do_flash_file "$file" && nand_do_upgrade_success
+	nand_do_upgrade_failed
+}
+
+nand_do_upgrade_success() {
+	if nand_do_restore_config && sync; then
 		echo "sysupgrade successful"
 		umount -a
 		reboot -f
 	fi
+	nand_do_upgrade_failed
+}
 
+nand_do_upgrade_failed() {
 	sync
 	echo "sysupgrade failed"
 	# Should we reboot or bring up some failsafe mode instead?




More information about the lede-commits mailing list