Explorar el Código

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 hace 7 años
padre
commit
5b2e20807d
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  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
 	else
 		get_image "$1" "$2" | mtd write - "${PART_NAME:-image}"
 		get_image "$1" "$2" | mtd write - "${PART_NAME:-image}"
 	fi
 	fi
+	[ $? -ne 0 ] && exit 1
 }
 }
 
 
 do_upgrade_stage2() {
 do_upgrade_stage2() {