summaryrefslogtreecommitdiff
path: root/src/vboot/Makefile.inc
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2017-09-20 12:01:28 +0200
committerPatrick Georgi <pgeorgi@google.com>2017-10-10 15:16:25 +0000
commitbf375e3943ada9b75083f6f162a6ccd1c6cdadbf (patch)
tree33459a50aa6898bc9485c7cc483ac03770b3e1c6 /src/vboot/Makefile.inc
parent12631a4d1d1c2e06b3a2c53b884cf6c33000b9b9 (diff)
downloadcoreboot-bf375e3943ada9b75083f6f162a6ccd1c6cdadbf.tar.xz
vboot: use cbfstool truncate
Instead of a shell based parser for cbfstool print -k output. BUG=b:65853903 BRANCH=none TEST=`abuild -x -t GOOGLE_KEVIN -p none` creates a valid-looking image. Change-Id: I33b7e1c483a69e66e82541c09582be2a71356a10 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/21609 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/vboot/Makefile.inc')
-rw-r--r--src/vboot/Makefile.inc14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/vboot/Makefile.inc b/src/vboot/Makefile.inc
index 0d6ce57f50..3128fae5b0 100644
--- a/src/vboot/Makefile.inc
+++ b/src/vboot/Makefile.inc
@@ -239,17 +239,11 @@ endif
# in the keyblock, and coreboot's vboot code clips the region_device to match,
# which prevents any potential extension attacks.
$(obj)/FW_MAIN_%.bin: $(obj)/coreboot.rom
+ $(CBFSTOOL) $< truncate -r $(basename $(notdir $@)) > $@.tmp.size
$(CBFSTOOL) $< read -r $(basename $(notdir $@)) -f $@.tmp
- $(CBFSTOOL) $(obj)/coreboot.rom print -k -r $(basename $(notdir $@)) | \
- tail -1 | \
- sed "s,^(empty)[[:space:]]\(0x[0-9a-f]*\)\tnull\t.*$$,\1," \
- > $@.tmp.size
- if [ -n "$$(cat $@.tmp.size)" ] && [ $$( printf "%d" $$(cat $@.tmp.size)) -gt 0 ]; then \
- head -c $$( printf "%d" $$(cat $@.tmp.size)) $@.tmp > $@.tmp2 && \
- mv $@.tmp2 $@; \
- else \
- mv $@.tmp $@; \
- fi
+ head -c $$( printf "%d" $$(cat $@.tmp.size)) $@.tmp > $@.tmp2
+ mv $@.tmp2 $@
+ rm -f $@.tmp $@.tmp.size
$(obj)/VBLOCK_%.bin: $(obj)/FW_MAIN_%.bin $(FUTILITY)
$(FUTILITY) vbutil_firmware \