diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2016-06-27 15:22:43 +0200 |
---|---|---|
committer | Zoltan HERPAI <wigyori@uid0.hu> | 2016-06-27 15:22:43 +0200 |
commit | 2d74fcb9c48b43a568ba14afe4d072b71ff8001e (patch) | |
tree | 7b0a879feec336ba533df62dc24dafe91d72dccd /target/linux | |
parent | d86876d671d61c9e9e63b1e2886d3fcbf276fa34 (diff) | |
download | master-187ad058-2d74fcb9c48b43a568ba14afe4d072b71ff8001e.tar.gz master-187ad058-2d74fcb9c48b43a568ba14afe4d072b71ff8001e.tar.bz2 master-187ad058-2d74fcb9c48b43a568ba14afe4d072b71ff8001e.zip |
bcm53xx: calculate TRX CRC32 using whole kernel partition
This provides better protection of flash data.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/bcm53xx/base-files/etc/uci-defaults/09_fix_crc | 7 |
1 files changed, 6 insertions, 1 deletions
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 |