* [Buildroot] [PATCH 1/6] Makefile: Support merged defconfigs
2016-05-18 19:25 [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs Patrick Williams
@ 2016-05-18 19:25 ` Patrick Williams
2016-05-18 19:25 ` [Buildroot] [PATCH 2/6] Makefile: Generate %_defconfig recipes from macro Patrick Williams
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Patrick Williams @ 2016-05-18 19:25 UTC (permalink / raw)
To: buildroot
From: Sam Bobroff <sam.bobroff@au1.ibm.com>
Within the Linux kernel, and several other packages, it's currently
possible to maintain defconfigs as diffs (fragments) against other
configs but this is not possible with buildroot itself.
This patch adds the capability, although using a slightly different
implementation. Files may be added in the normal config directories
($TOPDIR/configs or $BR2_EXTERNAL/configs) with the format
"xxx_defconfig.merge" that contain, one per line, the files to be
passed to merge_config.sh to create the matching xxx_defconfig file
(the first line should contain the base config followed by the
fragments). The generated defconfig file is then handled as it would
normally be.
Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Tested-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
---
Makefile | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Makefile b/Makefile
index ffbacfc..035d0ab 100644
--- a/Makefile
+++ b/Makefile
@@ -848,6 +848,16 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
@$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(BR2_EXTERNAL)/configs/$@ \
$< --defconfig=$(BR2_EXTERNAL)/configs/$@ $(CONFIG_CONFIG_IN)
+%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig.merge outputmakefile
+ @cd $(TOPDIR)/configs && xargs -a $@.merge -x -P 1 $(TOPDIR)/support/kconfig/merge_config.sh -m -O $(CONFIG_DIR)
+ @$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(CONFIG_DIR)/.config \
+ $< --defconfig=$(CONFIG_DIR)/.config $(CONFIG_CONFIG_IN)
+
+%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(BR2_EXTERNAL)/configs/%_defconfig.merge outputmakefile
+ @cd $(BR2_EXTERNAL)/configs && xargs -a $@.merge -x -P 1 $(TOPDIR)/support/kconfig/merge_config.sh -m -O $(CONFIG_DIR)
+ @$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(CONFIG_DIR)/.config \
+ $< --defconfig=$(CONFIG_DIR)/.config $(CONFIG_CONFIG_IN)
+
savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
@$(COMMON_CONFIG_ENV) $< \
--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
--
2.6.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH 2/6] Makefile: Generate %_defconfig recipes from macro.
2016-05-18 19:25 [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs Patrick Williams
2016-05-18 19:25 ` [Buildroot] [PATCH 1/6] Makefile: Support merged defconfigs Patrick Williams
@ 2016-05-18 19:25 ` Patrick Williams
2016-05-18 19:25 ` [Buildroot] [PATCH 3/6] Makefile: Support nested config directories Patrick Williams
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Patrick Williams @ 2016-05-18 19:25 UTC (permalink / raw)
To: buildroot
To reduce duplication in the %_defconfig recipes with $(TOPDIR) and
$(BR2_EXTERNAL) versions, generate these from a macro. The macro is
now called on a list of directories containing the appropriate ones.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
---
Makefile | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/Makefile b/Makefile
index 035d0ab..47e0d8a 100644
--- a/Makefile
+++ b/Makefile
@@ -840,23 +840,19 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
# Override the BR2_DEFCONFIG from COMMON_CONFIG_ENV with the new defconfig
-%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
- @$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(TOPDIR)/configs/$@ \
- $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
-
-%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(BR2_EXTERNAL)/configs/%_defconfig outputmakefile
- @$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(BR2_EXTERNAL)/configs/$@ \
- $< --defconfig=$(BR2_EXTERNAL)/configs/$@ $(CONFIG_CONFIG_IN)
-
-%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig.merge outputmakefile
- @cd $(TOPDIR)/configs && xargs -a $@.merge -x -P 1 $(TOPDIR)/support/kconfig/merge_config.sh -m -O $(CONFIG_DIR)
- @$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(CONFIG_DIR)/.config \
- $< --defconfig=$(CONFIG_DIR)/.config $(CONFIG_CONFIG_IN)
-
-%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(BR2_EXTERNAL)/configs/%_defconfig.merge outputmakefile
- @cd $(BR2_EXTERNAL)/configs && xargs -a $@.merge -x -P 1 $(TOPDIR)/support/kconfig/merge_config.sh -m -O $(CONFIG_DIR)
- @$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(CONFIG_DIR)/.config \
- $< --defconfig=$(CONFIG_DIR)/.config $(CONFIG_CONFIG_IN)
+define CREATE_DEFCONFIG_RECIPES
+%_defconfig: $$(BUILD_DIR)/buildroot-config/conf $1/%_defconfig outputmakefile
+ @$$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$$(TOPDIR)/configs/$$@ \
+ $$< --defconfig=$1/$$@ $$(CONFIG_CONFIG_IN)
+
+%_defconfig: $$(BUILD_DIR)/buildroot-config/conf $1/%_defconfig.merge outputmakefile
+ @cd $1 && xargs -a $$@.merge -x -P 1 $$(TOPDIR)/support/kconfig/merge_config.sh -m -O $$(CONFIG_DIR)
+ @$$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$$(CONFIG_DIR)/.config \
+ $$< --defconfig=$$(CONFIG_DIR)/.config $$(CONFIG_CONFIG_IN)
+endef
+
+BR2_DEFCONFIG_PATHS=$(TOPDIR)/configs $(BR2_EXTERNAL)/configs
+$(foreach path,$(BR2_DEFCONFIG_PATHS),$(eval $(call CREATE_DEFCONFIG_RECIPES,$(path))))
savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
@$(COMMON_CONFIG_ENV) $< \
--
2.6.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH 3/6] Makefile: Support nested config directories
2016-05-18 19:25 [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs Patrick Williams
2016-05-18 19:25 ` [Buildroot] [PATCH 1/6] Makefile: Support merged defconfigs Patrick Williams
2016-05-18 19:25 ` [Buildroot] [PATCH 2/6] Makefile: Generate %_defconfig recipes from macro Patrick Williams
@ 2016-05-18 19:25 ` Patrick Williams
2016-05-18 19:25 ` [Buildroot] [PATCH 4/6] Makefile: Add nested config dirs to list-defconfigs Patrick Williams
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Patrick Williams @ 2016-05-18 19:25 UTC (permalink / raw)
To: buildroot
From: Elizabeth Liner <eliner@us.ibm.com>
Extend the BR2_DEFCONFIG_PATH to support nested config directories.
This allows us to place config files in both .../config and
.../config/<arch>.
Both $(TOPDIR) and $(BR2_EXTERNAL) are supported.
Signed-off-by: Elizabeth Liner <eliner@us.ibm.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 47e0d8a..c9b6030 100644
--- a/Makefile
+++ b/Makefile
@@ -851,7 +851,8 @@ define CREATE_DEFCONFIG_RECIPES
$$< --defconfig=$$(CONFIG_DIR)/.config $$(CONFIG_CONFIG_IN)
endef
-BR2_DEFCONFIG_PATHS=$(TOPDIR)/configs $(BR2_EXTERNAL)/configs
+BR2_DEFCONFIG_PATHS=$(sort $(dir $(wildcard $(TOPDIR)/configs/*/))) \
+ $(sort $(dir $(wildcard $(BR2_EXTERNAL)/configs/*/)))
$(foreach path,$(BR2_DEFCONFIG_PATHS),$(eval $(call CREATE_DEFCONFIG_RECIPES,$(path))))
savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
--
2.6.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH 4/6] Makefile: Add nested config dirs to list-defconfigs
2016-05-18 19:25 [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs Patrick Williams
` (2 preceding siblings ...)
2016-05-18 19:25 ` [Buildroot] [PATCH 3/6] Makefile: Support nested config directories Patrick Williams
@ 2016-05-18 19:25 ` Patrick Williams
2016-05-18 19:25 ` [Buildroot] [PATCH 5/6] Makefile: Add merged defconfigs " Patrick Williams
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Patrick Williams @ 2016-05-18 19:25 UTC (permalink / raw)
To: buildroot
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
---
Makefile | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index c9b6030..8a9bb2b 100644
--- a/Makefile
+++ b/Makefile
@@ -201,6 +201,10 @@ LEGAL_LICENSES_TXT_HOST = $(LEGAL_INFO_DIR)/host-licenses.txt
LEGAL_WARNINGS = $(LEGAL_INFO_DIR)/.warnings
LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
+BR2_DEFCONFIG_PATHS_LOCAL=$(sort $(dir $(wildcard $(TOPDIR)/configs/*/)))
+BR2_DEFCONFIG_PATHS_USER=$(sort $(dir $(wildcard $(BR2_EXTERNAL)/configs/*/)))
+BR2_DEFCONFIG_PATHS=$(BR2_DEFCONFIG_PATHS_LOCAL) $(BR2_DEFCONFIG_PATHS_USER)
+
BR2_CONFIG = $(CONFIG_DIR)/.config
# Pull in the user's configuration file
@@ -851,8 +855,6 @@ define CREATE_DEFCONFIG_RECIPES
$$< --defconfig=$$(CONFIG_DIR)/.config $$(CONFIG_CONFIG_IN)
endef
-BR2_DEFCONFIG_PATHS=$(sort $(dir $(wildcard $(TOPDIR)/configs/*/))) \
- $(sort $(dir $(wildcard $(BR2_EXTERNAL)/configs/*/)))
$(foreach path,$(BR2_DEFCONFIG_PATHS),$(eval $(call CREATE_DEFCONFIG_RECIPES,$(path))))
savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
@@ -986,12 +988,12 @@ endif
list-defconfigs:
@echo 'Built-in configs:'
- @$(foreach b, $(sort $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig))), \
+ @$(foreach b, $(sort $(notdir $(foreach path,$(BR2_DEFCONFIG_PATHS_LOCAL),$(wildcard $(path)/*_defconfig)))), \
printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
ifneq ($(wildcard $(BR2_EXTERNAL)/configs/*_defconfig),)
@echo
@echo 'User-provided configs:'
- @$(foreach b, $(sort $(notdir $(wildcard $(BR2_EXTERNAL)/configs/*_defconfig))), \
+ @$(foreach b, $(sort $(notdir $(foreach path,$(BR2_DEFCONFIG_PATHS_USER),$(wildcard $(path)/*_defconfig)))), \
printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
endif
@echo
--
2.6.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH 5/6] Makefile: Add merged defconfigs to list-defconfigs.
2016-05-18 19:25 [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs Patrick Williams
` (3 preceding siblings ...)
2016-05-18 19:25 ` [Buildroot] [PATCH 4/6] Makefile: Add nested config dirs to list-defconfigs Patrick Williams
@ 2016-05-18 19:25 ` Patrick Williams
2016-05-18 19:25 ` [Buildroot] [PATCH 6/6] Makefile: Fix merge defconfig clobber of .config.old Patrick Williams
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Patrick Williams @ 2016-05-18 19:25 UTC (permalink / raw)
To: buildroot
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 8a9bb2b..2694339 100644
--- a/Makefile
+++ b/Makefile
@@ -988,12 +988,12 @@ endif
list-defconfigs:
@echo 'Built-in configs:'
- @$(foreach b, $(sort $(notdir $(foreach path,$(BR2_DEFCONFIG_PATHS_LOCAL),$(wildcard $(path)/*_defconfig)))), \
+ @$(foreach b, $(sort $(notdir $(foreach path,$(BR2_DEFCONFIG_PATHS_LOCAL),$(basename $(wildcard $(path)/*_defconfig $(path)/*_defconfig.merge))))), \
printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
ifneq ($(wildcard $(BR2_EXTERNAL)/configs/*_defconfig),)
@echo
@echo 'User-provided configs:'
- @$(foreach b, $(sort $(notdir $(foreach path,$(BR2_DEFCONFIG_PATHS_USER),$(wildcard $(path)/*_defconfig)))), \
+ @$(foreach b, $(sort $(notdir $(foreach path,$(BR2_DEFCONFIG_PATHS_USER),$(basename $(wildcard $(path)/*_defconfig $(path)/*_defconfig.merge))))), \
printf " %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
endif
@echo
--
2.6.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH 6/6] Makefile: Fix merge defconfig clobber of .config.old
2016-05-18 19:25 [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs Patrick Williams
` (4 preceding siblings ...)
2016-05-18 19:25 ` [Buildroot] [PATCH 5/6] Makefile: Add merged defconfigs " Patrick Williams
@ 2016-05-18 19:25 ` Patrick Williams
2016-05-18 23:42 ` [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs Samuel Mendoza-Jonas
2016-05-24 15:31 ` Patrick Williams
7 siblings, 0 replies; 9+ messages in thread
From: Patrick Williams @ 2016-05-18 19:25 UTC (permalink / raw)
To: buildroot
The merged defconfig support was using .config as a temporary file to
store the merged defconfig. The result of then running the 'conf' tool
is that .config.old contains the contents of the merged defconfig
instead of the actual old .config.
Place the temporary merged defconfig into $(CONFIG_DIR)/.merge_config
instead to prevent this clobbering.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
---
Makefile | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 2694339..7a675d6 100644
--- a/Makefile
+++ b/Makefile
@@ -850,9 +850,11 @@ define CREATE_DEFCONFIG_RECIPES
$$< --defconfig=$1/$$@ $$(CONFIG_CONFIG_IN)
%_defconfig: $$(BUILD_DIR)/buildroot-config/conf $1/%_defconfig.merge outputmakefile
- @cd $1 && xargs -a $$@.merge -x -P 1 $$(TOPDIR)/support/kconfig/merge_config.sh -m -O $$(CONFIG_DIR)
- @$$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$$(CONFIG_DIR)/.config \
- $$< --defconfig=$$(CONFIG_DIR)/.config $$(CONFIG_CONFIG_IN)
+ @mkdir $$(CONFIG_DIR)/.merge_config
+ @cd $1 && xargs -a $$@.merge -x -P 1 $$(TOPDIR)/support/kconfig/merge_config.sh -m -O $$(CONFIG_DIR)/.merge_config
+ @$$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$$(CONFIG_DIR)/.merge_config/.config \
+ $$< --defconfig=$$(CONFIG_DIR)/.merge_config/.config $$(CONFIG_CONFIG_IN)
+ @rm -rf $$(CONFIG_DIR)/.merge_config
endef
$(foreach path,$(BR2_DEFCONFIG_PATHS),$(eval $(call CREATE_DEFCONFIG_RECIPES,$(path))))
--
2.6.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs.
2016-05-18 19:25 [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs Patrick Williams
` (5 preceding siblings ...)
2016-05-18 19:25 ` [Buildroot] [PATCH 6/6] Makefile: Fix merge defconfig clobber of .config.old Patrick Williams
@ 2016-05-18 23:42 ` Samuel Mendoza-Jonas
2016-05-24 15:31 ` Patrick Williams
7 siblings, 0 replies; 9+ messages in thread
From: Samuel Mendoza-Jonas @ 2016-05-18 23:42 UTC (permalink / raw)
To: buildroot
On Wed, May 18, 2016 at 02:25:24PM -0500, Patrick Williams wrote:
> This is a combination and cleanup of the previous efforts by
> Sam Bobroff and Elizabeth Liner to introduce merged defconfigs
> and nested defconfig directories respectively.
>
> Merged defconfigs allow us to create defconfig snippets for aspects
> that are common across multiple machines and create a combined defconfig
> from the snippets. The support scripts for merged kernel defconfigs is
> reused.
>
> Nested defconfig directories allow us to organize the defconfig
> directory into sub-directories. A likely use for this is to place
> defconfigs into architecture-specific subdirectories.
>
> Elizabeth Liner (1):
> Makefile: Support nested config directories
>
> Patrick Williams (4):
> Makefile: Generate %_defconfig recipes from macro.
> Makefile: Add nested config dirs to list-defconfigs
> Makefile: Add merged defconfigs to list-defconfigs.
> Makefile: Fix merge defconfig clobber of .config.old
>
> Sam Bobroff (1):
> Makefile: Support merged defconfigs
>
> Makefile | 27 +++++++++++++++++++--------
> 1 file changed, 19 insertions(+), 8 deletions(-)
Acked-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
>
> --
> 2.6.3
>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread* [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs.
2016-05-18 19:25 [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs Patrick Williams
` (6 preceding siblings ...)
2016-05-18 23:42 ` [Buildroot] [PATCH 0/6] Makefile: Support merged and nested defconfigs Samuel Mendoza-Jonas
@ 2016-05-24 15:31 ` Patrick Williams
7 siblings, 0 replies; 9+ messages in thread
From: Patrick Williams @ 2016-05-24 15:31 UTC (permalink / raw)
To: buildroot
Any feedback on this patch set?
On Wed, May 18, 2016 at 02:25:24PM -0500, Patrick Williams wrote:
> This is a combination and cleanup of the previous efforts by
> Sam Bobroff and Elizabeth Liner to introduce merged defconfigs
> and nested defconfig directories respectively.
>
> Merged defconfigs allow us to create defconfig snippets for aspects
> that are common across multiple machines and create a combined defconfig
> from the snippets. The support scripts for merged kernel defconfigs is
> reused.
>
> Nested defconfig directories allow us to organize the defconfig
> directory into sub-directories. A likely use for this is to place
> defconfigs into architecture-specific subdirectories.
>
> Elizabeth Liner (1):
> Makefile: Support nested config directories
>
> Patrick Williams (4):
> Makefile: Generate %_defconfig recipes from macro.
> Makefile: Add nested config dirs to list-defconfigs
> Makefile: Add merged defconfigs to list-defconfigs.
> Makefile: Fix merge defconfig clobber of .config.old
>
> Sam Bobroff (1):
> Makefile: Support merged defconfigs
>
> Makefile | 27 +++++++++++++++++++--------
> 1 file changed, 19 insertions(+), 8 deletions(-)
>
> --
> 2.6.3
>
--
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160524/3382ea7d/attachment.asc>
^ permalink raw reply [flat|nested] 9+ messages in thread