summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki2018-06-11 10:52:42 +0000
committerJohn Crispin2018-06-18 04:37:28 +0000
commit5b2e20807d2b38de1cc4185d15bb4320b8bd743a (patch)
tree4c34629f183fe8a5afca9869b86e4c91a3cc1583
parent1c1e2542445040b62a13862e42f961ac9c7e54f5 (diff)
downloadopenwrt-5b2e20807d2b38de1cc4185d15bb4320b8bd743a.tar.gz
base-files: exit if mtd write command fails during sysupgrade
It avoids confusing situations like: > Could not get image magic > Image check failed. > Upgrade completed > Rebooting system... Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-rw-r--r--package/base-files/files/lib/upgrade/common.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index 38056fd346..0cbd2ab3a6 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -222,6 +222,7 @@ default_do_upgrade() {
else
get_image "$1" "$2" | mtd write - "${PART_NAME:-image}"
fi
+ [ $? -ne 0 ] && exit 1
}
do_upgrade_stage2() {