[coreboot-gerrit] New patch to review for coreboot: build_system: Extend site-local

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Tue Feb 2 03:23:36 CET 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13413

-gerrit

commit 931867ca6a331c45adb28f40a57bcaf496e548f2
Author: Martin Roth <martinroth at google.com>
Date:   Sun Jan 24 19:38:33 2016 -0700

    build_system: Extend site-local
    
    - Add a target at the end of the build that can be used to run additional
    scripts or additional targets after coreboot.rom is built.
    - Source a site-local Kconfig file to allow site-specific configuration.
    
    This eliminates the need to add a hook for a script at the end of the
    build because you can add one yourself in site-local.
    
    Example site-local/Makefile.inc:
    
    build_complete::
    ifeq ($(CONFIG_SITE_LOCAL),y)
    	echo "Running additional steps in site-local"
    	# run some script here to make my build unreproducible.
    endif
    
    .phony: build_complete
    
    Example site-local/Kconfig:
    
    menu "site-local"
    
    config SITE_LOCAL
    	bool "site-local enabled"
    	help
    	  Enable my site-local configuration to do stuff.
    
    endmenu
    
    Change-Id: Id4d1e727c69b5cdb05e7d52731bbb1d1e201864a
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 Makefile.inc | 10 +++++++++-
 src/Kconfig  |  3 +++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index 89f02d4..22ad915 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -49,9 +49,16 @@ export objgenerated := $(obj)/generated
 real-target: $(obj)/config.h coreboot
 coreboot: build-dirs $(obj)/coreboot.rom $(obj)/cbfstool $(obj)/rmodtool
 
+build_complete::
+	printf "\nBuilt %s (%s)\n" $(CONFIG_MAINBOARD_DIR) \
+		$(CONFIG_MAINBOARD_PART_NUMBER)
+	# This target can be used in site local to run scripts or additional
+	# targets after the build completes by creating a Makefile.inc in the
+	# site-local directory with a target named 'build_complete::'
+
 #######################################################################
 # our phony targets
-PHONY+= clean-abuild coreboot lint lint-stable build-dirs
+PHONY+= clean-abuild coreboot lint lint-stable build-dirs build_complete
 
 #######################################################################
 # root source directories of coreboot
@@ -827,6 +834,7 @@ ifeq ($(CONFIG_IASL_WARNINGS_ARE_ERRORS),)
 	@printf "\n***** WARNING: IASL warnings as errors is disabled!  *****\n"
 	@printf "*****          Please fix the ASL for this platform. *****\n\n"
 endif
+	$(MAKE) build_complete
 
 cbfs-files-y += $(CONFIG_CBFS_PREFIX)/romstage
 $(CONFIG_CBFS_PREFIX)/romstage-file := $(objcbfs)/romstage.elf
diff --git a/src/Kconfig b/src/Kconfig
index 4df037b..3f02843 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -407,6 +407,9 @@ config FMDFILE
 
 endmenu
 
+# load site-local kconfig to allow user specific defaults and overrides
+source "site-local/Kconfig"
+
 config SYSTEM_TYPE_LAPTOP
 	default n
 	bool



More information about the coreboot-gerrit mailing list