Skip to contentSkip to conversation

kconfig: add KCONFIG_ALLCONFIG support for tinyconfig

PATCH In review Randrianaina Georges Aaron 2 participants 2 messages Mar 8, 2022 – Mar 9, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kconfig: add KCONFIG_ALLCONFIG support for tinyconfig

Since f8f0d06438e5, tinyconfig overrides KCONFIG_ALLCONFIG to include kernel/configs/tiny-base.config. However, this ignores user's preset if defined.

This modification checks if the user has set KCONFIG_ALLCONFIG and if so, concatenates it with kernel/configs/tiny-base.config to be used as preset config symbols.

Changes in v2:
- Remove <(echo) in the cat command as it is not portable
- Add $(srctree) in presets' path to make it compatible with O=<dir>

---
 scripts/kconfig/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)
scripts/kconfig/Makefile +6 -0
index b8ef0fb4bbef..58a677db9a73 100644
@@ -102,7 +102,13 @@ configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/c
 
 PHONY += tinyconfig
 tinyconfig:
+ifeq ($(KCONFIG_ALLCONFIG),)
 	$(Q)KCONFIG_ALLCONFIG=kernel/configs/tiny-base.config $(MAKE) -f $(srctree)/Makefile allnoconfig
+else
+	$(Q)cat $(srctree)/$(KCONFIG_ALLCONFIG) $(srctree)/kernel/configs/tiny-base.config > $(srctree)/.tmp.config
+	$(Q)KCONFIG_ALLCONFIG=$(srctree)/.tmp.config $(MAKE) -f $(srctree)/Makefile allnoconfig
+	$(Q)rm -f $(srctree)/.tmp.config
+endif
 	$(Q)$(MAKE) -f $(srctree)/Makefile tiny.config
 
 # CHECK: -o cache_dir=<path> working?
Signature · 1 line
2.34.1
#1 lore raw
Quoted 23 lines · Randrianaina Georges Aaron

Since f8f0d06438e5, tinyconfig overrides KCONFIG_ALLCONFIG to include kernel/configs/tiny-base.config. However, this ignores user's preset if defined.

This modification checks if the user has set KCONFIG_ALLCONFIG and if so, concatenates it with kernel/configs/tiny-base.config to be used as preset config symbols.

Changes in v2:
- Remove <(echo) in the cat command as it is not portable
- Add $(srctree) in presets' path to make it compatible with O=<dir>

---
 scripts/kconfig/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)
scripts/kconfig/Makefile +0 -0
index b8ef0fb4bbef..58a677db9a73 100644

scripts/kconfig/Makefile configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/c · line 108

Quoted 7 lines
scripts/kconfig/Makefile +3 -0
@@ -102,7 +102,13 @@ configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/c
 
 PHONY += tinyconfig
 tinyconfig:
+ifeq ($(KCONFIG_ALLCONFIG),)
        $(Q)KCONFIG_ALLCONFIG=kernel/configs/tiny-base.config $(MAKE) -f $(srctree)/Makefile allnoconfig
+else
+       $(Q)cat $(srctree)/$(KCONFIG_ALLCONFIG) $(srctree)/kernel/configs/tiny-base.config > $(srctree)/.tmp.config

No. Please remove $(srctree)/ from .tmp.config

You should never ever write anything to $(srctree) when O= is given.

$(srctree)/$(KCONFIG_ALLCONFIG) does not work well. It works only when KCONFIG_ALLCOFIG is relative to $(srctree). It does not work if it is absolute for example.

Quoted 8 lines
scripts/kconfig/Makefile +3 -1
+       $(Q)KCONFIG_ALLCONFIG=$(srctree)/.tmp.config $(MAKE) -f $(srctree)/Makefile allnoconfig
+       $(Q)rm -f $(srctree)/.tmp.config
+endif
        $(Q)$(MAKE) -f $(srctree)/Makefile tiny.config
 
 # CHECK: -o cache_dir=<path> working?
--

2.34.1

Signature · 2 lines
Best Regards
Masahiro Yamada