summaryrefslogtreecommitdiff
path: root/src/vendorcode/google/chromeos/Makefile.inc
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2016-04-22 11:10:03 +0200
committerMartin Roth <martinroth@google.com>2016-05-03 20:15:29 +0200
commit36d7418afa42fbb2dccc435860f3d95721fb9652 (patch)
tree5ae902423b85a47ba7859341e8732db208484078 /src/vendorcode/google/chromeos/Makefile.inc
parent0cf7acc688706fc1cf14bbbb175e3c113733fd4f (diff)
downloadcoreboot-36d7418afa42fbb2dccc435860f3d95721fb9652.tar.xz
chromeos: Ensure that the last file in FW_MAIN is not also the first one
In the case where one of the FW_MAIN regions is empty, the last file (empty) will also appear to be first and have a zero offset, making head complain. This is a very borderline use case, since the FW_MAIN_ regions should have been filled previously, but an extra check doesn't hurt. Change-Id: I15491c5b4a5e7d1f9fb369cc5fa4e3875e2dad3b Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: https://review.coreboot.org/14472 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/vendorcode/google/chromeos/Makefile.inc')
-rw-r--r--src/vendorcode/google/chromeos/Makefile.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vendorcode/google/chromeos/Makefile.inc b/src/vendorcode/google/chromeos/Makefile.inc
index 0ae6fb0429..2b579d1587 100644
--- a/src/vendorcode/google/chromeos/Makefile.inc
+++ b/src/vendorcode/google/chromeos/Makefile.inc
@@ -138,7 +138,7 @@ $(obj)/FW_MAIN_%.bin: $(obj)/coreboot.rom
tail -1 | \
sed "s,^(empty)[[:space:]]\(0x[0-9a-f]*\)\tnull\t.*$$,\1," \
> $@.tmp.size
- if [ -n "$$(cat $@.tmp.size)" ]; then \
+ 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 \