summaryrefslogtreecommitdiffstats
path: root/src/makefile
diff options
context:
space:
mode:
authorAdam Muhle <armuhle@us.ibm.com>2013-04-10 17:07:37 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-04-22 17:01:48 -0500
commit399a43d3c6ffb46f6941434e02844ad2ab4da447 (patch)
tree83fcc17c2948f8671bc59656f3a68ad5556d958d /src/makefile
parent200fd79ccf031db09b25cd47330003654b09dd3a (diff)
downloadtalos-hostboot-399a43d3c6ffb46f6941434e02844ad2ab4da447.tar.gz
talos-hostboot-399a43d3c6ffb46f6941434e02844ad2ab4da447.zip
Verify HB Base image is under 508k
The maximum image size that SBE can load is 512k. That means the actual Hostboot base image must be under 508k to leave room for the secure boot header. This commit integrates this check into the build process. Change-Id: Ib339e968bd237e7793d0edea3858c52f731e9cd8 RTC: 62980 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4003 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/makefile')
-rw-r--r--src/makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/makefile b/src/makefile
index 89b04ba2a..750555c3b 100644
--- a/src/makefile
+++ b/src/makefile
@@ -94,7 +94,7 @@ hbicore_test_MODULES = ${hbicore_MODULES}
hbicore_test_EXTENDED_MODULES = ${hbicore_EXTENDED_MODULES} ${TESTCASE_MODULES}
hbicore_test_DATA_MODULES = ${hbicore_DATA_MODULES} testdata
-IMAGE_PASS_BODY += buildpnor
+IMAGE_PASS_BODY += buildpnor imgsizecheck
IMAGE_PASS_BODY += $(IMGDIR)/hbotStringFile
CLEAN_TARGETS += $(IMGDIR)/hbotStringFile
@@ -106,3 +106,11 @@ buildpnor: ${IMAGES}
$(IMGDIR)/hbotStringFile : $(IMAGES)
$(ROOTPATH)/src/build/trace/tracehash_hb.pl -c -d $(ROOTPATH)/obj -s $@
+
+.PHONY: imgsizecheck
+#make sure base image isn't over 508k (512K - 4K for secure header)
+#PROCESS: get size of hbicore.bin, sort with respect to 508k (520192), then see if
+#last word is 508k. If not, the base image is too big.
+MAX_BASE_SIZE = 520192
+imgsizecheck: ${IMGDIR}/hbicore.bin
+ $(if $(findstring $(shell (stat -c%s ${IMGDIR}/hbicore.bin; echo $(MAX_BASE_SIZE)) | sort -n | tail -n1), $(MAX_BASE_SIZE)),true, @echo ERROR: ${IMGDIR}/hbicore.bin too large. Max allowed size is $(MAX_BASE_SIZE); false)
OpenPOWER on IntegriCloud