[coreboot-gerrit] New patch to review for coreboot: build system: move defconfig creation into a cbfs-files filter

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Wed Nov 25 19:29:00 CET 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12539

-gerrit

commit 05ca58db1dbe0d3a603039b2553be3cdc6415beb
Author: Patrick Georgi <pgeorgi at chromium.org>
Date:   Wed Nov 25 18:47:56 2015 +0100

    build system: move defconfig creation into a cbfs-files filter
    
    That allows this special case to become a normal cbfs-files instance,
    too.
    
    Change-Id: I896ffebe4cec64c9c11605b4f09c7790e5419928
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
 Makefile.inc | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index 6208951..3d0f0fa 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -220,6 +220,17 @@ cbfs-files-processor-vsa= \
 		printf "    CREATE     $(2) (from $(1))\n";  $(OBJCOPY_ramstage) --set-start 0x20 --adjust-vma 0x60000 -I binary -O elf32-i386 -B i386 $(1) $(2).tmp && $(LD_ramstage) -m elf_i386 -e 0x60020 --section-start .data=0x60000 $(2).tmp -o $(2))
 
 #######################################################################
+# Reduce a .config file to its minimal representation
+# arg1: input
+# arg2: output
+cbfs-files-processor-defconfig= \
+	$(eval $(2): $(1) ; \
+		printf "    CREATE     $(2) (from $(1))\n"; \
+		echo "\# This image was built using git revision" `git rev-parse HEAD` > $(2).tmp && \
+		$(MAKE) DOTCONFIG=$(1) DEFCONFIG=$(2).tmp savedefconfig && \
+		\mv -f $(2).tmp $(2))
+
+#######################################################################
 # Add handler for arbitrary files in CBFS
 $(call add-special-class,cbfs-files)
 cbfs-files-handler= \
@@ -642,15 +653,6 @@ ifneq ($(CONFIG_SEABIOS_PS2_TIMEOUT),0)
 	$(CBFSTOOL) $@.tmp add-int -i $(CONFIG_SEABIOS_PS2_TIMEOUT) -n etc/ps2-keyboard-spinup
 endif
 endif
-ifeq ($(CONFIG_INCLUDE_CONFIG_FILE),y)
-	@printf "    CONFIG     $(DOTCONFIG)\n"
-	if [ -f $(DOTCONFIG) ]; then \
-	echo "# This image was built using git revision" `git rev-parse HEAD` > $(obj)/config.tmp && \
-	$(MAKE) DOTCONFIG=$(DOTCONFIG) DEFCONFIG=$(obj)/config.tmp savedefconfig && \
-	$(CBFSTOOL) $@.tmp add -f $(obj)/config.tmp -n config -t raw; rm -f $(obj)/config.tmp ; fi
-	@printf "    REVISION   build.h\n"
-	if [ -f $(obj)/build.h ]; then $(CBFSTOOL) $@.tmp add -f $(obj)/build.h -n revision -t raw; fi
-endif
 ifeq ($(CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE),y)
 ifeq ($(CONFIG_CPU_MICROCODE_CBFS_GENERATE),y)
 	@printf "    UPDATE-FIT \n"
@@ -686,6 +688,14 @@ cbfs-files-$(CONFIG_PXE_ROM) += pci$(CONFIG_PXE_ROM_ID).rom
 pci$(CONFIG_PXE_ROM_ID).rom-file := $(CONFIG_PXE_ROM_FILE)
 pci$(CONFIG_PXE_ROM_ID).rom-type := raw
 
+cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += config
+config-file := $(DOTCONFIG):defconfig
+config-type := raw
+
+cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += revision
+revision-file := $(obj)/build.h
+revision-type := raw
+
 cbfs-files-$(CONFIG_INCLUDE_CONFIG_FILE) += payload_config
 payload_config-file := $(PAYLOAD_CONFIG)
 payload_config-type := raw



More information about the coreboot-gerrit mailing list