diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2018-06-11 12:52:42 +0200 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-06-18 06:37:28 +0200 |
commit | 5b2e20807d2b38de1cc4185d15bb4320b8bd743a (patch) | |
tree | 4c34629f183fe8a5afca9869b86e4c91a3cc1583 | |
parent | 1c1e2542445040b62a13862e42f961ac9c7e54f5 (diff) | |
download | upstream-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>
-rw-r--r-- | package/base-files/files/lib/upgrade/common.sh | 1 |
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() { |