From f67e16160d6675598decedc72ba0325fc33a0358 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Fri, 10 Aug 2018 16:24:21 +0200 Subject: [PATCH] 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 Signed-off-by: Hector Palacios (cherry picked from commit a2a84911402da7a868ee7984e12e2c1f588fb25d) --- meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend index ae81b52bc..3d6c4863a 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend @@ -62,9 +62,9 @@ pkg_postinst_${PN}() { # - Both copies starting at the same offset ENV_REDUND_OFFSET="${UBOOT_ENV_OFFSET}" # - 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 - MTDSIZE="$(grep "^${MTDINDEX}" ${PARTTABLE} | awk '{printf("0x%d",$2)}')" + MTDSIZE="$(grep "^${MTDINDEX}:" ${PARTTABLE} | awk '{printf("0x%d",$2)}')" NBLOCKS="$(((MTDSIZE - UBOOT_ENV_OFFSET) / ERASEBLOCK))" # If a range was provided, calculate the number of # blocks in the range and use that number, unless they