summaryrefslogtreecommitdiff
path: root/util/flash_ec
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@google.com>2020-08-05 12:47:20 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-05 23:41:46 +0000
commit7ac9332b6b07fab2e09a8c4b6cf82a49ad9abcb9 (patch)
treee0fc722fbc7ee9a19611e19d537b609df25b437d /util/flash_ec
parent6d3d125dc792ce88eb047a6e62e2707bc4d786f0 (diff)
downloadchrome-ec-7ac9332b6b07fab2e09a8c4b6cf82a49ad9abcb9.tar.gz
util/flash_ec: fix in parse error in getting flash_size from flashrom
This patch fixes flash_ec to take the last line of grep result from the output of 'flashrom --flash-size'. BUG=b:162771462 BRANCH=none TEST=ran flash_ec on nocturne with suzy-Q connected. $ ./util/flash_ec --image /Downloads/nocturne.bin --board nocturne \ --verbose INFO: Using ccd_cr50. INFO: Using ec image : /Downloads/nocturne.bin INFO: Flashing chip npcx_int_spi. dut-control --port=9999 cold_reset:on dut-control --port=9999 fw_up:on dut-control --port=9999 cold_reset:off INFO: Running flashrom: ... Erasing and writing flash chip... SUCCESS INFO: Flashing done. INFO: Restoring servo settings... dut-control --port=9999 fw_up:off dut-control --port=9999 ccd_ec_boot_mode_uut:off dut-control --port=9999 ccd_ec_boot_mode_bitbang:off dut-control --port=9999 cold_reset:on Signed-off-by: Namyoon Woo <namyoon@chromium.org> Change-Id: I1120c828ddb33f327cce46435ec9fa26b10d1908 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2340088 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'util/flash_ec')
-rwxr-xr-xutil/flash_ec4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/flash_ec b/util/flash_ec
index 272f00d38a..2dff03a5d3 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -972,8 +972,8 @@ function flash_flashrom() {
info "Running flashrom:" 1>&2
echo " ${FLASHROM_GETSIZE}" 1>&2
fi
- SPI_SIZE=$(${FLASHROM_GETSIZE} | grep -oe '[0-9]\+$') || \
- die "Failed to determine chip size!"
+ SPI_SIZE=$(${FLASHROM_GETSIZE} | grep -oe '[0-9]\+$' |
+ tail -n1) || die "Failed to determine chip size!"
[[ ${SPI_SIZE} -eq 0 ]] && die "Chip size is 0!"
PATCH_SIZE=$((${SPI_SIZE} - ${IMG_SIZE}))