summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-01-20 11:27:26 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-27 02:47:33 +0000
commit20cd803e1798863c6c0d865451649b37b1e10436 (patch)
treef89e1de16718e21d9313ac9f78c4e92470a52cf9
parent78ffa1d5380dcc0e229a50e7bf3082e4ff71ca08 (diff)
downloadchrome-ec-20cd803e1798863c6c0d865451649b37b1e10436.tar.gz
makefile: fix flash image size reporting
The Makefile uses awk to find a section named FLASH in the output map file and parses the size of the section to determine the free space remaining. NPCX RO images include sections named FLASH and FLASH_HDR. Modify the awk command so the FLASH_HDR section isn't used by mistake. BUG=none BRANCH=none TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I3e420fbb45fdebc4f1e2578f819bbbce4994d2a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2640873 Commit-Queue: caveh jalali <caveh@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
-rw-r--r--Makefile.rules2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 6d0140b607..ba73deeff6 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -409,7 +409,7 @@ cmd_size=
else
cmd_size=$(Q)awk '\
/__flash_used =/ {flash_used = strtonum($$1)} \
- /^FLASH/ {flash_size = strtonum($$3)} \
+ /^FLASH / {flash_size = strtonum($$3)} \
/__ram_free =/ {ram_free = strtonum($$1)} \
END {room_free = flash_size - flash_used; \
print ram_free > "$(out)/$(1)/space_free_ram.txt"; \