bcm53xx: exit if writing kernel during sysupgrade fails
authorRafał Miłecki <rafal@milecki.pl>
Mon, 18 Jun 2018 11:46:04 +0000 (13:46 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 18 Dec 2018 09:09:11 +0000 (10:09 +0100)
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(backported from 93cc44c433fed754bd76f8016a1660a6b932361e)

target/linux/bcm53xx/base-files/lib/upgrade/platform.sh

index 16285aaa089222b2ca686f8731c8dd6bcc6d4ea8..5a42a36ae4f7af14be314f038ad465d8aff2e20b 100644 (file)
@@ -206,7 +206,7 @@ platform_pre_upgrade_trx() {
        }
 
        # Flash
-       mtd write /tmp/kernel.trx firmware
+       mtd write /tmp/kernel.trx firmware || exit 1
        nand_do_upgrade /tmp/root.ubi
 }
 
@@ -252,7 +252,7 @@ platform_pre_upgrade_seama() {
 
        # Flash
        local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"\(kernel\|linux\)".*/\1/p' /proc/mtd)
-       mtd write $dir/kernel.seama firmware
+       mtd write $dir/kernel.seama firmware || exit 1
        mtd ${kernel_size:+-c 0x$kernel_size} fixseama firmware
        nand_do_upgrade $dir/root.ubi
 }