diff mbox series

[v2] kconfig: add KCONFIG_ALLCONFIG support for tinyconfig

Message ID 87v8wo25we.fsf@irisa.fr (mailing list archive)
State New, archived
Headers show
Series [v2] kconfig: add KCONFIG_ALLCONFIG support for tinyconfig | expand

Commit Message

Randrianaina Georges Aaron March 8, 2022, 8:34 a.m. UTC
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>

Signed-off-by: Randrianaina Georges Aaron <georges-aaron.randrianaina@irisa.fr>
---
 scripts/kconfig/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Masahiro Yamada March 9, 2022, 9:43 a.m. UTC | #1
On Tue, Mar 8, 2022 at 5:40 PM Randrianaina Georges Aaron
<georges-aaron.randrianaina@irisa.fr> wrote:
>
> 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>
>
> Signed-off-by: Randrianaina Georges Aaron <georges-aaron.randrianaina@irisa.fr>
> ---
>  scripts/kconfig/Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> index b8ef0fb4bbef..58a677db9a73 100644
> --- a/scripts/kconfig/Makefile
> +++ b/scripts/kconfig/Makefile
> @@ -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.








> +       $(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
diff mbox series

Patch

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index b8ef0fb4bbef..58a677db9a73 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -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?