Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1364970 > unrolled thread

[PATCH] kconfig: Add localdefconfig helper

Started byPaul Kocialkowski <contact@paulk.fr>
First post2016-03-26 19:40 +0100
Last post2016-03-26 20:10 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] kconfig: Add localdefconfig helper Paul Kocialkowski <contact@paulk.fr> - 2016-03-26 19:40 +0100
    Re: [PATCH] kconfig: Add localdefconfig helper Paul Kocialkowski <contact@paulk.fr> - 2016-03-26 20:10 +0100
    Re: [PATCH] kconfig: Add localdefconfig helper Sam Ravnborg <sam@ravnborg.org> - 2016-03-26 20:10 +0100

#1364970 — [PATCH] kconfig: Add localdefconfig helper

FromPaul Kocialkowski <contact@paulk.fr>
Date2016-03-26 19:40 +0100
Subject[PATCH] kconfig: Add localdefconfig helper
Message-ID<rh1hT-4FG-1@gated-at.bofh.it>
This introduces a localdefconfig make target to specify out-of-tree default
configs. The out-of-tree default target is selected by defining
KBUILD_LOCALDEFCONFIG in the make command line.

The intent of this change is to easily allow using default configs that are not
part of the kernel source (e.g. for a specific device or use case), without ever
touching the kernel source tree.

This is somewhat equivalent to copying the default config to the output .config
and running olddefconfig. However, it seems better to make this part of the
kernel helpers since this use case is likely to be needed widely. In addition,
it keeps all the path handling logic inside the Makefiles, as opposed to
delegating some of it to a wrapper script or such, when copying the default
configuration to .config.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
---
 Makefile                 | 2 +-
 scripts/kconfig/Makefile | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index ed69074..0c2d209 100644
--- a/Makefile
+++ b/Makefile
@@ -529,7 +529,7 @@ ifeq ($(config-targets),1)
 # KBUILD_DEFCONFIG may point out an alternative default configuration
 # used for 'make defconfig'
 include arch/$(SRCARCH)/Makefile
-export KBUILD_DEFCONFIG KBUILD_KCONFIG
+export KBUILD_DEFCONFIG KBUILD_LOCALDEFCONFIG KBUILD_KCONFIG
 
 config: scripts_basic outputmakefile FORCE
 	$(Q)$(MAKE) $(build)=scripts/kconfig $@
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index ebced77..6fff25d 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -106,6 +106,14 @@ else
 endif
 endif
 
+localdefconfig: $(obj)/conf
+ifeq ($(KBUILD_LOCALDEFCONFIG),)
+	$(Q)$< $(silent) $(Kconfig)
+else
+	@$(kecho) "*** Default configuration is based on '$(KBUILD_LOCALDEFCONFIG)'"
+	$(Q)$< $(silent) --defconfig=$(KBUILD_LOCALDEFCONFIG) $(Kconfig)
+endif
+
 %_defconfig: $(obj)/conf
 	$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
 
@@ -148,6 +156,7 @@ help:
 	@echo  '  alldefconfig    - New config with all symbols set to default'
 	@echo  '  randconfig	  - New config with random answer to all options'
 	@echo  '  listnewconfig   - List new options'
+	@echo  '  localdefconfig  - New config with defaults from KBUILD_LOCALDEFCONFIG'
 	@echo  '  olddefconfig	  - Same as silentoldconfig but sets new symbols to their'
 	@echo  '                    default value'
 	@echo  '  kvmconfig	  - Enable additional options for kvm guest kernel support'
-- 
2.7.4

[toc] | [next] | [standalone]


#1364978

FromPaul Kocialkowski <contact@paulk.fr>
Date2016-03-26 20:10 +0100
Message-ID<rh1KW-57a-5@gated-at.bofh.it>
In reply to#1364970

[Multipart message — attachments visible in raw view] — view raw

Le samedi 26 mars 2016 à 19:53 +0100, Sam Ravnborg a écrit :
> On Sat, Mar 26, 2016 at 07:31:27PM +0100, Paul Kocialkowski wrote:
> > 
> > This introduces a localdefconfig make target to specify out-of-tree default
> > configs. The out-of-tree default target is selected by defining
> > KBUILD_LOCALDEFCONFIG in the make command line.
> > 
> > The intent of this change is to easily allow using default configs that are
> > not
> > part of the kernel source (e.g. for a specific device or use case), without
> > ever
> > touching the kernel source tree.
> > 
> Does this differ from what you can achieve with KCONFIG_ALLCONFIG?
> See Documentation/kbuild/kconfig.txt
> 
> From a quick glance the functionality is the same.

It looks like my suggestion is equivalent to specifying KCONFIG_ALLCONFIG and
running the alldefconfig target, indeed!

Thanks for pointing this out, I suppose this patch can be disregarded then.

Cheers,

-- 
Paul Kocialkowski, low-level free software developer on embedded devices

Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/

[toc] | [prev] | [next] | [standalone]


#1364979

FromSam Ravnborg <sam@ravnborg.org>
Date2016-03-26 20:10 +0100
Message-ID<rh1KW-57a-7@gated-at.bofh.it>
In reply to#1364970
On Sat, Mar 26, 2016 at 07:31:27PM +0100, Paul Kocialkowski wrote:
> This introduces a localdefconfig make target to specify out-of-tree default
> configs. The out-of-tree default target is selected by defining
> KBUILD_LOCALDEFCONFIG in the make command line.
> 
> The intent of this change is to easily allow using default configs that are not
> part of the kernel source (e.g. for a specific device or use case), without ever
> touching the kernel source tree.
> 
Does this differ from what you can achieve with KCONFIG_ALLCONFIG?
See Documentation/kbuild/kconfig.txt

From a quick glance the functionality is the same.

	Sam

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web