<p>Patrick Georgi has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21609">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">vboot: use cbfstool truncate<br><br>Instead of a shell based parser for cbfstool print -k output.<br><br>BUG=b:65853903<br>BRANCH=none<br>TEST=`abuild -x -t GOOGLE_KEVIN -p none` creates a valid-looking image.<br><br>Change-Id: I33b7e1c483a69e66e82541c09582be2a71356a10<br>Signed-off-by: Patrick Georgi <pgeorgi@google.com><br>---<br>M src/vboot/Makefile.inc<br>1 file changed, 4 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/21609/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/vboot/Makefile.inc b/src/vboot/Makefile.inc<br>index 0d6ce57..3128fae 100644<br>--- a/src/vboot/Makefile.inc<br>+++ b/src/vboot/Makefile.inc<br>@@ -239,17 +239,11 @@<br> # in the keyblock, and coreboot's vboot code clips the region_device to match,<br> # which prevents any potential extension attacks.<br> $(obj)/FW_MAIN_%.bin: $(obj)/coreboot.rom<br>+    $(CBFSTOOL) $< truncate -r $(basename $(notdir $@)) > $@.tmp.size<br>       $(CBFSTOOL) $< read -r $(basename $(notdir $@)) -f $@.tmp<br>- $(CBFSTOOL) $(obj)/coreboot.rom print -k -r $(basename $(notdir $@)) | \<br>-             tail -1 | \<br>-          sed "s,^(empty)[[:space:]]\(0x[0-9a-f]*\)\tnull\t.*$$,\1," \<br>-               > $@.tmp.size<br>-     if [ -n "$$(cat $@.tmp.size)" ] && [ $$( printf "%d" $$(cat $@.tmp.size)) -gt 0 ]; then \<br>-                head -c $$( printf "%d" $$(cat $@.tmp.size)) $@.tmp > $@.tmp2 && \<br>-              mv $@.tmp2 $@; \<br>-     else \<br>-               mv $@.tmp $@; \<br>-      fi<br>+   head -c $$( printf "%d" $$(cat $@.tmp.size)) $@.tmp > $@.tmp2<br>+   mv $@.tmp2 $@<br>+        rm -f $@.tmp $@.tmp.size<br> <br> $(obj)/VBLOCK_%.bin: $(obj)/FW_MAIN_%.bin $(FUTILITY)<br>   $(FUTILITY) vbutil_firmware \<br></pre><p>To view, visit <a href="https://review.coreboot.org/21609">change 21609</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/21609"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I33b7e1c483a69e66e82541c09582be2a71356a10 </div>
<div style="display:none"> Gerrit-Change-Number: 21609 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Georgi <pgeorgi@google.com> </div>