From 551b3830c66bfa1241d84f7ef9f89e8408231a00 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 25 Nov 2015 18:47:56 +0100 Subject: 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 Reviewed-on: https://review.coreboot.org/12539 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- Makefile.inc | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Makefile.inc b/Makefile.inc index 4737f924df..4eebc712d6 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -223,6 +223,17 @@ cbfs-files-processor-vsa= \ $(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) @@ -657,15 +668,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" @@ -701,6 +703,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 -- cgit v1.2.3