aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-06-11 12:52:42 +0200
committerJo-Philipp Wich <jo@mein.io>2018-12-18 09:43:59 +0100
commit21bcc90b1021d6137b89ebd02454c871f34ecd5d (patch)
treef87566f2d63efae4fd6798764887fe0a0a0c2702 /package
parentb81774cff80718d20982649c4f21a405fa71a07c (diff)
downloadupstream-21bcc90b1021d6137b89ebd02454c871f34ecd5d.tar.gz
upstream-21bcc90b1021d6137b89ebd02454c871f34ecd5d.tar.bz2
upstream-21bcc90b1021d6137b89ebd02454c871f34ecd5d.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> (backported from 5b2e20807d2b38de1cc4185d15bb4320b8bd743a)
Diffstat (limited to 'package')
-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() {