u-boot-fw-tools: fix script to account for more than 9 parts
When grepping for the mtd index "1" the script was also returning
partitions 10, 11, and so on.
Reported-by: Leonid Makhnovskiy <leonid.maknovskiy@digi.com>
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
(cherry picked from commit a2a8491140)
This commit is contained in:
parent
29add13409
commit
f67e16160d
|
|
@ -62,9 +62,9 @@ pkg_postinst_${PN}() {
|
||||||
# - Both copies starting at the same offset
|
# - Both copies starting at the same offset
|
||||||
ENV_REDUND_OFFSET="${UBOOT_ENV_OFFSET}"
|
ENV_REDUND_OFFSET="${UBOOT_ENV_OFFSET}"
|
||||||
# - Calculated erase block size
|
# - Calculated erase block size
|
||||||
ERASEBLOCK="$(grep "^${MTDINDEX}" ${PARTTABLE} | awk '{printf("0x%d",$3)}')"
|
ERASEBLOCK="$(grep "^${MTDINDEX}:" ${PARTTABLE} | awk '{printf("0x%d",$3)}')"
|
||||||
# - Calculated number of blocks
|
# - Calculated number of blocks
|
||||||
MTDSIZE="$(grep "^${MTDINDEX}" ${PARTTABLE} | awk '{printf("0x%d",$2)}')"
|
MTDSIZE="$(grep "^${MTDINDEX}:" ${PARTTABLE} | awk '{printf("0x%d",$2)}')"
|
||||||
NBLOCKS="$(((MTDSIZE - UBOOT_ENV_OFFSET) / ERASEBLOCK))"
|
NBLOCKS="$(((MTDSIZE - UBOOT_ENV_OFFSET) / ERASEBLOCK))"
|
||||||
# If a range was provided, calculate the number of
|
# If a range was provided, calculate the number of
|
||||||
# blocks in the range and use that number, unless they
|
# blocks in the range and use that number, unless they
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue