Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv3] *config: improve handling of BR2_LEGACY
@ 2015-04-08 20:36 Yann E. MORIN
  2015-04-10 23:43 ` Arnout Vandecappelle
  0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2015-04-08 20:36 UTC (permalink / raw)
  To: buildroot

From: Arnout Vandecappelle <arnout@mind.be>

In 8a46d4bf1f the randpackageconfig and allpackageyesconfig were
extended with disabling all the legacy options, otherwise the resulting
config couldn't be built. However, that didn't work for randconfig and
allyesconfig.

This commit reverts 8a46d4bf1f and replaces it with a different
approach: skipping of the legacy config options is passed explicitly
through the environment variable SKIP_LEGACY, which forces
BR2_SKIP_LEGACY to y.

We add a (silent) call to olddefconfig to set out the old legacy
options aside.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[yann.morin.1998 at free.fr: do not rely on a user-visible option, works
 perfectly well with only blind options set from the environment]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

---
Changes v2 -> v3:
  - add the missing pieces (calling olddefconfig)

Changes v1 -> v2:
  - don't use a user-visible option  (Yann)
---
 Config.in.legacy | 12 ++++++++++++
 Makefile         | 27 ++++++++++++++-------------
 2 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/Config.in.legacy b/Config.in.legacy
index 445cab7..38fca09 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -52,6 +52,16 @@
 #
 # [End of example]
 
+config BR2_SKIP_LEGACY_ENV
+	bool
+	option env="SKIP_LEGACY"
+
+config BR2_SKIP_LEGACY
+	bool
+	default y if BR2_SKIP_LEGACY_ENV
+
+if !BR2_SKIP_LEGACY
+
 config BR2_LEGACY
 	bool
 	help
@@ -1281,3 +1291,5 @@ config BR2_BFIN_FLAT
 	select BR2_LEGACY
 
 endmenu
+
+endif # !SKIP_LEGACY
diff --git a/Makefile b/Makefile
index 2ad8832..294967c 100644
--- a/Makefile
+++ b/Makefile
@@ -700,7 +700,8 @@ COMMON_CONFIG_ENV = \
 	KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
 	KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
 	BR2_CONFIG=$(BR2_CONFIG) \
-	BR2_EXTERNAL=$(BR2_EXTERNAL)
+	BR2_EXTERNAL=$(BR2_EXTERNAL) \
+	SKIP_LEGACY=
 
 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
@@ -728,45 +729,45 @@ oldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 randconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --randconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --randconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
 
 allyesconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --allyesconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allyesconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
 
 allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --allnoconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allnoconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
 
 randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
-	@grep '^config BR2_PACKAGE_' Config.in.legacy | \
-		while read config pkg; do \
-		echo "# $$pkg is not set" >> $(CONFIG_DIR)/.config.nopkg; done
-	@$(COMMON_CONFIG_ENV) \
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
 		KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
 		$< --randconfig $(CONFIG_CONFIG_IN)
 	@rm -f $(CONFIG_DIR)/.config.nopkg
+	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
 
 allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
-	@grep '^config BR2_PACKAGE_' Config.in.legacy | \
-		while read config pkg; do \
-		echo "# $$pkg is not set" >> $(CONFIG_DIR)/.config.nopkg; done
-	@$(COMMON_CONFIG_ENV) \
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
 		KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
 		$< --allyesconfig $(CONFIG_CONFIG_IN)
 	@rm -f $(CONFIG_DIR)/.config.nopkg
+	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
 
 allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
-	@$(COMMON_CONFIG_ENV) \
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
 		KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
 		$< --allnoconfig $(CONFIG_CONFIG_IN)
 	@rm -f $(CONFIG_DIR)/.config.nopkg
+	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
 
 silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCHv3] *config: improve handling of BR2_LEGACY
  2015-04-08 20:36 [Buildroot] [PATCHv3] *config: improve handling of BR2_LEGACY Yann E. MORIN
@ 2015-04-10 23:43 ` Arnout Vandecappelle
  2015-04-11  8:15   ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Arnout Vandecappelle @ 2015-04-10 23:43 UTC (permalink / raw)
  To: buildroot

On 08/04/15 22:36, Yann E. MORIN wrote:
> From: Arnout Vandecappelle <arnout@mind.be>
> 
> In 8a46d4bf1f the randpackageconfig and allpackageyesconfig were
> extended with disabling all the legacy options, otherwise the resulting
> config couldn't be built. However, that didn't work for randconfig and
> allyesconfig.
> 
> This commit reverts 8a46d4bf1f and replaces it with a different
> approach: skipping of the legacy config options is passed explicitly
> through the environment variable SKIP_LEGACY, which forces
> BR2_SKIP_LEGACY to y.
> 
> We add a (silent) call to olddefconfig to set out the old legacy
> options aside.

 Yes, that's another way to avoid the 'make oldconfig' problem.

 I actually found it useful to have the option user-visible, because then it's
possible to get rid of all of them in one shot. But on the other hand, it's not
so nice that it gets saved in the defconfig...


> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> [yann.morin.1998 at free.fr: do not rely on a user-visible option, works
>  perfectly well with only blind options set from the environment]
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> ---
> Changes v2 -> v3:
>   - add the missing pieces (calling olddefconfig)
> 
> Changes v1 -> v2:
>   - don't use a user-visible option  (Yann)
> ---
>  Config.in.legacy | 12 ++++++++++++
>  Makefile         | 27 ++++++++++++++-------------
>  2 files changed, 26 insertions(+), 13 deletions(-)
> 
> diff --git a/Config.in.legacy b/Config.in.legacy
> index 445cab7..38fca09 100644
> --- a/Config.in.legacy
> +++ b/Config.in.legacy
> @@ -52,6 +52,16 @@
>  #
>  # [End of example]
>  
> +config BR2_SKIP_LEGACY_ENV
> +	bool
> +	option env="SKIP_LEGACY"

 This additional option is no longer needed if it's not user visible.


 v4 coming up.


 Regards,
 Arnout

> +
> +config BR2_SKIP_LEGACY
> +	bool
> +	default y if BR2_SKIP_LEGACY_ENV
> +
> +if !BR2_SKIP_LEGACY
> +
>  config BR2_LEGACY
>  	bool
>  	help
[snip]


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCHv3] *config: improve handling of BR2_LEGACY
  2015-04-10 23:43 ` Arnout Vandecappelle
@ 2015-04-11  8:15   ` Yann E. MORIN
  0 siblings, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2015-04-11  8:15 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2015-04-11 01:43 +0200, Arnout Vandecappelle spake thusly:
> On 08/04/15 22:36, Yann E. MORIN wrote:
> > From: Arnout Vandecappelle <arnout@mind.be>
> > 
> > In 8a46d4bf1f the randpackageconfig and allpackageyesconfig were
> > extended with disabling all the legacy options, otherwise the resulting
> > config couldn't be built. However, that didn't work for randconfig and
> > allyesconfig.
> > 
> > This commit reverts 8a46d4bf1f and replaces it with a different
> > approach: skipping of the legacy config options is passed explicitly
> > through the environment variable SKIP_LEGACY, which forces
> > BR2_SKIP_LEGACY to y.
> > 
> > We add a (silent) call to olddefconfig to set out the old legacy
> > options aside.
> 
>  Yes, that's another way to avoid the 'make oldconfig' problem.
> 
>  I actually found it useful to have the option user-visible, because then it's
> possible to get rid of all of them in one shot. But on the other hand, it's not
> so nice that it gets saved in the defconfig...

Yeah, I don't like it at all either...

However...

> > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> > [yann.morin.1998 at free.fr: do not rely on a user-visible option, works
> >  perfectly well with only blind options set from the environment]
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > 
> > ---
> > Changes v2 -> v3:
> >   - add the missing pieces (calling olddefconfig)
> > 
> > Changes v1 -> v2:
> >   - don't use a user-visible option  (Yann)
> > ---
> >  Config.in.legacy | 12 ++++++++++++
> >  Makefile         | 27 ++++++++++++++-------------
> >  2 files changed, 26 insertions(+), 13 deletions(-)
> > 
> > diff --git a/Config.in.legacy b/Config.in.legacy
> > index 445cab7..38fca09 100644
> > --- a/Config.in.legacy
> > +++ b/Config.in.legacy
> > @@ -52,6 +52,16 @@
> >  #
> >  # [End of example]
> >  
> > +config BR2_SKIP_LEGACY_ENV
> > +	bool
> > +	option env="SKIP_LEGACY"
> 
>  This additional option is no longer needed if it's not user visible.

... I was planning on re-instating the user-vibility of this variable in
a follw-up patch, with a trick so that it does not remaint set in the
.config .

Well, it's been committed as your v4, but re-adding it should not be too
complex. ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-11  8:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-08 20:36 [Buildroot] [PATCHv3] *config: improve handling of BR2_LEGACY Yann E. MORIN
2015-04-10 23:43 ` Arnout Vandecappelle
2015-04-11  8:15   ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox