Browse Source

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 <[email protected]>
Rafał Miłecki 7 years ago
parent
commit
5b2e20807d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      package/base-files/files/lib/upgrade/common.sh

+ 1 - 0
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() {