From: Rafał Miłecki Date: Fri, 10 Jun 2016 10:53:11 +0000 (+0200) Subject: bcm53xx: calculate TRX CRC32 using whole kernel partition X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=95d8568cb87fd96086998c304a453aef6ff88298;p=openwrt%2Fstaging%2Fkaloz.git bcm53xx: calculate TRX CRC32 using whole kernel partition This provides better protection of flash data. Signed-off-by: Rafał Miłecki --- diff --git a/target/linux/bcm53xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bcm53xx/base-files/etc/uci-defaults/09_fix_crc index 3d14827482..2959905e81 100644 --- a/target/linux/bcm53xx/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/bcm53xx/base-files/etc/uci-defaults/09_fix_crc @@ -1,3 +1,8 @@ #!/bin/sh -mtd fixtrx firmware || mtd fixseama firmware +kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"\(kerel\|liux\)".*/\1/p' /proc/mtd) +[ -n "$kernel_size" ] && kernel_size=$((0x$kernel_size)) + +mtd ${kernel_size:+-c $kernel_size} fixtrx firmware && exit 0 +mtd fixseama firmware && exit 0 +exit 1