[coreboot-gerrit] New patch to review for coreboot: build system: Unwind multi-region cbfstool add commands
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Thu Jan 28 22:35:58 CET 2016
Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13504
-gerrit
commit 0d47172af0032ac6fcd305e8f738b2be211a5d58
Author: Patrick Georgi <pgeorgi at chromium.org>
Date: Thu Jan 28 22:22:38 2016 +0100
build system: Unwind multi-region cbfstool add commands
Add files to fmap regions one-by-one, so we can modify options
per-file-per-region.
Change-Id: Ic3ff5a4e563796c9fdd5705236aef37c883abf5e
Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
Makefile.inc | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index 84d7a2d..8b69109 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -649,9 +649,9 @@ ifeq ($(CONFIG_CBFS_AUTOGEN_ATTRIBUTES),y)
cbfs-autogen-attributes=-g
endif
-define cbfs-add-cmd
- printf " CBFS $(call extract_nth,2,$(1))\n"
- $(if $(2),-$(CBFSTOOL) $@.tmp remove -n $(call extract_nth,2,$(file)) 2>/dev/null)
+# cbfs-add-cmd-for-region
+# $(call cbfs-add-cmd-for-region,file in extract_nth format,region name)
+define cbfs-add-cmd-for-region
$(CBFSTOOL) $@.tmp \
add$(if $(filter stage,$(call extract_nth,3,$(1))),-stage)$(if $(filter payload,$(call extract_nth,3,$(1))),-payload) \
-f $(call extract_nth,1,$(1)) \
@@ -659,10 +659,23 @@ define cbfs-add-cmd
$(if $(filter-out stage,$(call extract_nth,3,$(1))),-t $(call extract_nth,3,$(1))) \
$(if $(call extract_nth,4,$(1)),-c $(call extract_nth,4,$(1))) \
$(cbfs-autogen-attributes) \
- -r $(call regions-for-file,$(call extract_nth,2,$(1))) \
+ -r $(2) \
$(if $(call extract_nth,6,$(1)),-a $(call extract_nth,6,$(file)), \
$(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file)))) \
$(call extract_nth,7,$(1))
+
+endef
+# Empty line before endef is necessary so cbfs-add-cmd-for-region ends in a
+# newline
+
+# cbfs-add-cmd
+# $(call cbfs-add-cmd,file in extract_nth format,non-empty if file removal requested)
+define cbfs-add-cmd
+ printf " CBFS $(call extract_nth,2,$(1))\n"
+ $(if $(2),-$(CBFSTOOL) $@.tmp remove -n $(call extract_nth,2,$(file)) 2>/dev/null)
+ $(eval _tmp-cbfs-add-cmd-regions=$(call regions-for-file,$(call extract_nth,2,$(1)))) \
+ $(foreach region,$(subst $(comma),$(spc),$(_tmp-cbfs-add-cmd-regions)), \
+ $(call cbfs-add-cmd-for-region,$(1),$(region)))
endef
cbfs-files=$(cbfs-files-fixed) $(cbfs-files-aligned) $(cbfs-files-regular)
More information about the coreboot-gerrit
mailing list