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@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle 2022-10-30 20:22:06 +00:00
parent 910bdda6af
commit 84ff6c90dd
No known key found for this signature in database
GPG Key ID: 5A8F39C31C3217CA
1 changed files with 9 additions and 1 deletions

View File

@ -418,12 +418,20 @@ nand_do_upgrade() {
local file="$1" local file="$1"
sync 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" echo "sysupgrade successful"
umount -a umount -a
reboot -f reboot -f
fi fi
nand_do_upgrade_failed
}
nand_do_upgrade_failed() {
sync sync
echo "sysupgrade failed" echo "sysupgrade failed"
# Should we reboot or bring up some failsafe mode instead? # Should we reboot or bring up some failsafe mode instead?