diff mbox

[U-Boot,5/5] Makefile: preserve output for images that can contain HAB Blocks

Message ID 1478388157-93645-6-git-send-email-sven.ebenfeld@gmail.com
State Superseded
Delegated to: Stefano Babic
Headers show

Commit Message

Sven Ebenfeld Nov. 5, 2016, 11:22 p.m. UTC
To being able to sign created binaries, we need to know the HAB Blocks
for that image. Especially for the imximage type the HAB Blocks are
only available during creation of the image. We want to preserve the
information until we get to sign the files.
In the verbose case we still get them printed out instead of writing
to log files.

Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
---
 Makefile                     | 6 +++++-
 arch/arm/imx-common/Makefile | 3 +++
 doc/README.imx6              | 3 ++-
 scripts/Makefile.lib         | 2 +-
 scripts/Makefile.spl         | 2 +-
 5 files changed, 12 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 15151ff..37d1a7a 100644
--- a/Makefile
+++ b/Makefile
@@ -804,9 +804,11 @@  cmd_zobjcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
 quiet_cmd_efipayload = OBJCOPY $@
 cmd_efipayload = $(OBJCOPY) -I binary -O $(EFIPAYLOAD_BFDTARGET) -B $(EFIPAYLOAD_BFDARCH) $< $@
 
+MKIMAGEOUTPUT = /dev/null
+
 quiet_cmd_mkimage = MKIMAGE $@
 cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
-	$(if $(KBUILD_VERBOSE:1=), >/dev/null)
+	$(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT_$(@F)))
 
 quiet_cmd_cat = CAT     $@
 cmd_cat = cat $(filter-out $(PHONY), $^) > $@
@@ -928,6 +930,8 @@  MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
 MKIMAGEFLAGS_u-boot-ivt.img = -A $(ARCH) -T firmware_ivt -C none -O u-boot \
 	-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
 	-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
+MKIMAGEOUTPUT_u-boot-ivt.img = u-boot-ivt.img.log
+CLEAN_FILES += u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log
 endif
 
 MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 03b3c12..0bc51aa 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -68,6 +68,7 @@  $(IMX_CONFIG): %.cfgtmp: % FORCE
 
 MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
 	-e $(CONFIG_SYS_TEXT_BASE)
+MKIMAGEOUTPUT_u-boot.imx = u-boot.imx.log
 
 u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
 	$(call if_changed,mkimage)
@@ -75,6 +76,7 @@  u-boot.imx: u-boot.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
 ifeq ($(CONFIG_OF_SEPARATE),y)
 MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
 	-e $(CONFIG_SYS_TEXT_BASE)
+MKIMAGEOUTPUT_u-boot.imx = u-boot-dtb.imx.log
 
 u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
 	$(call if_changed,mkimage)
@@ -82,6 +84,7 @@  endif
 
 MKIMAGEFLAGS_SPL = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) -T imximage \
 	-e $(CONFIG_SPL_TEXT_BASE)
+MKIMAGEOUTPUT_SPL = SPL.log
 
 SPL: spl/u-boot-spl.bin $(IMX_CONFIG) $(PLUGIN).bin FORCE
 	$(call if_changed,mkimage)
diff --git a/doc/README.imx6 b/doc/README.imx6
index add1d80..0e00968 100644
--- a/doc/README.imx6
+++ b/doc/README.imx6
@@ -150,7 +150,8 @@  CONFIG_SECURE_BOOT is needed to build those two binaries.
 After building, you need to create a command sequence file and use
 Freescales Code Signing Tool to sign both binaries. After creation,
 the mkimage tool outputs the required information about the HAB Blocks
-parameter for the CSF.
+parameter for the CSF. During the build, the information is preserved
+in log files named as the binaries. (SPL.log and u-boot-ivt.log).
 
 More information about the CSF and HAB can be found in the AN4581.
 https://cache.freescale.com/files/32bit/doc/app_note/AN4581.pdf
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 45a0e1d..4fc4f94 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -433,4 +433,4 @@  cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
 # ---------------------------------------------------------------------------
 quiet_cmd_mkimage = MKIMAGE $@
 cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
-	$(if $(KBUILD_VERBOSE:1=), >/dev/null)
+	$(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT_$(@F)))
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index e8cf9f3..6369478 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -124,7 +124,7 @@  LDPPFLAGS += \
 
 quiet_cmd_mkimage = MKIMAGE $@
 cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
-	$(if $(KBUILD_VERBOSE:1=), >/dev/null)
+	$(if $(KBUILD_VERBOSE:1=), >$(MKIMAGEOUTPUT_$(@F)))
 
 MKIMAGEFLAGS_MLO = -T omapimage -a $(CONFIG_SPL_TEXT_BASE)