aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/upgrade
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/lib/upgrade')
-rw-r--r--package/base-files/files/lib/upgrade/nand.sh10
1 files changed, 9 insertions, 1 deletions
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?