aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-06-11 12:52:42 +0200
committerJohn Crispin <john@phrozen.org>2018-06-18 06:37:28 +0200
commit5b2e20807d2b38de1cc4185d15bb4320b8bd743a (patch)
tree4c34629f183fe8a5afca9869b86e4c91a3cc1583 /package/base-files
parent1c1e2542445040b62a13862e42f961ac9c7e54f5 (diff)
downloadupstream-5b2e20807d2b38de1cc4185d15bb4320b8bd743a.tar.gz
upstream-5b2e20807d2b38de1cc4185d15bb4320b8bd743a.tar.bz2
upstream-5b2e20807d2b38de1cc4185d15bb4320b8bd743a.zip
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>
Diffstat (limited to 'package/base-files')
-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() {