Introduction of kconfig-package
PATCH v2 1/1 Introduction of kconfig-package
This patch series introduces a kconfig-package infrastructure and already converts the uclibc and busybox packages.
I believe this series is complete in the sense that it could be applied as one whole, not yet including the conversion of linux and barebox.
In a subsequent series, linux and barebox can be converted to kconfig-package too, but there will need to be some changes to kconfig-package to support them.
One particular difference with uclibc/busybox is that linux/barebox use a different method to copy the original config file: instead of simply copying it to build_dir/.config, it is first copied to arch/.../buildroot_defconfig and then 'make ... buildroot_defconfig' is called. I'm considering in adding a FOO_KCONFIG_INSTALL_CONFIG_CMDS variable to support this, which defaults to the simple copy used by busybox/uclibc, but can be overwritten appropriately by linux and barebox.
Anyway, this part is not yet ready and will only be available for 2014.11.
---
Thomas De Schampheleire (6):
infra: introduce a kconfig-package infrastructure
manual: add documentation for kconfig-package
uclibc: convert to kconfig-package infrastructure
uclibc: only add targets if uclibc is enabled
busybox: convert to kconfig-package infrastructure
busybox: only add kconfig targets if uclibc is enabled
docs/manual/adding-packages-kconfig.txt | 56 +++++++++++++++++ docs/manual/adding-packages.txt | 2 + package/Makefile.in | 1 + package/busybox/busybox.config | 18 ++-- package/busybox/busybox.mk | 27 +++---- package/pkg-kconfig.mk | 82 +++++++++++++++++++++++++ package/uclibc/uclibc.mk | 36 +++------- 7 files changed, 173 insertions(+), 49 deletions(-)
PATCH v2 1/1 infra: introduce a kconfig-package infrastructure
There are several packages that have a configuration file managed by
kconfig: uclibc, busybox, linux and barebox. All these packages need some make targets to handle the kconfig specificities: creating a configuration (menuconfig, ...) and saving it back (update-config, ...)
These targets should be the same for each of these packages, but unfortunately they are not. Especially with respect to saving back the configuration to the original config file, there are many differences.
A previous set of patches fixed these targets for the uclibc package. This patch extracts these targets into a common kconfig-package infrastructure, with the goals of:
- aligning the behavior of all kconfig-based packages
- removing code duplication
In order to use this infrastructure, a package should at a minimum specify FOO_KCONFIG_FILE and eval the kconfig-package macro. The supported configuration editors can be set with FOO_KCONFIG_EDITORS and defaults to menuconfig only.
Additionally, a package can specify FOO_KCONFIG_OPT for extra options to pass to the invocation of the kconfig editors, and FOO_KCONFIG_FIXUP_CMDS for a list of shell commands used to fixup the .config file after a configuration has been created/edited.
---
v2:
- fold comments into this patch
- inherit from generic-package instead of sitting alongside of it (ThomasP)
Notes:
- the issue with MAKE_OPT vs MAKE_OPTS has been worked around currently by not relying on any MAKE_OPT(S) but instead requiring the package to add the necessary variable to FOO_KCONFIG_OPT.
However, I still believe we should create a consistent set here, either MAKE_OPT or MAKE_OPTS, and the same for CONFIGURE_OPT(S), but this is now no longer related to the introduction of kconfig-package.
- the targets in this patch are sufficient to handle uclibc and busybox. For linux and barebox, some changes will be needed, but for clarity this will be added later.
package/Makefile.in | 1 + package/pkg-kconfig.mk | 80 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 0 deletions(-)
package/Makefile.in +1 -0
@@ -388,3 +388,4 @@ include package/pkg-python.mk include package/pkg-virtual.mk include package/pkg-generic.mk +include package/pkg-kconfig.mk
package/pkg-kconfig.mk new file +82 -0
82 lines not on this page · raw message
PATCH v2 1/1 infra: introduce a kconfig-package infrastructure
Thomas, All,
On 2014-07-30 21:58 +0200, Thomas De Schampheleire spake thusly:
[--SNIP--]
package/pkg-kconfig.mk
Quoted 4 lines
diff -r
4ee2201e6e6b-r83a2e5f2641apackage/pkg-kconfig.mkpackage/pkg-kconfig.mk new file +0
-0@@ -0,0 +1,82 @@
[--SNIP--]
Quoted 10 lines
package/pkg-kconfig.mk new file +10
-0+# The .config file is obtained by copying it from the specified source +# configuration file, after the package has been patched. + +$$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) | $(1)-patch + $$(INSTALL) -m 0644 $$($(2)_KCONFIG_FILE) $$($(2)_DIR)/.config + +# In order to get a usable, consistent configuration, some fixup may be needed. +# The exact rules are specified by the package .mk file. + +$$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config
package/pkg-kconfig.mk line 65
Quoted 10 lines
package/pkg-kconfig.mk new file +10
-0+ $$($(2)_KCONFIG_FIXUP_CMDS) + $$(Q)touch $$@ + +# Before running configure, the configuration file should be present and fixed + +$$($(2)_TARGET_CONFIGURE): $$($(2)_DIR)/.stamp_kconfig_fixup_done + +# Configuration editors (menuconfig, ...) + +$$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.config
Should we not depend on .stamp_kconfig_fixup_done instead of .config, so we present to the user a .config that is already tweak to our needs?
Regards,
Yann E. MORIN.
Quoted 21 lines
package/pkg-kconfig.mk new file +17
-0+ $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ + $$($(2)_KCONFIG_OPT) $$(subst $(1)-,,$$@) + rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built} + rm -f $$($(2)_DIR)/.stamp_{target,staging}_installed + +# Target to copy back the configuration to the source configuration file + +$(1)-update-config: $$($(2)_DIR)/.stamp_kconfig_fixup_done + cp -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE) + +endef # inner-kconfig-package + +################################################################################ +# kconfig-package -- the target generator macro for kconfig packages +################################################################################ + +kconfig-package = $(call inner-kconfig-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)))_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/1 infra: introduce a kconfig-package infrastructure
Hi Yann,
Quoted 24 lines · Yann E. MORIN
Thomas, All,
On 2014-07-30 21:58 +0200, Thomas De Schampheleire spake thusly:
[--SNIP--]package/pkg-kconfig.mk Mon Jun 30 21:08:13 2014 +0200
Quoted 4 lines
diff -r
4ee2201e6e6b-r83a2e5f2641apackage/pkg-kconfig.mkpackage/pkg-kconfig.mk Mon Jun 30 21:08:13 2014 +0200 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +0
-0@@ -0,0 +1,82 @@[--SNIP--]
Quoted 15 lines
package/pkg-kconfig.mk Mon Jun 30 21:08:13 2014 +0200 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +15
-0+# The .config file is obtained by copying it from the specified source +# configuration file, after the package has been patched. + +$$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) | $(1)-patch + $$(INSTALL) -m 0644 $$($(2)_KCONFIG_FILE) $$($(2)_DIR)/.config + +# In order to get a usable, consistent configuration, some fixup may be needed. +# The exact rules are specified by the package .mk file. + +$$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config + $$($(2)_KCONFIG_FIXUP_CMDS) + $$(Q)touch $$@ + +# Before running configure, the configuration file should be present and fixed +
Quoted 8 lines
package/pkg-kconfig.mk Mon Jun 30 21:08:13 2014 +0200 line 20
Quoted 5 lines
package/pkg-kconfig.mk Mon Jun 30 21:08:13 2014 +0200 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +5
-0+$$($(2)_TARGET_CONFIGURE): $$($(2)_DIR)/.stamp_kconfig_fixup_done + +# Configuration editors (menuconfig, ...) + +$$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.configShould we not depend on .stamp_kconfig_fixup_done instead of .config, so we present to the user a .config that is already tweak to our needs?
Yes indeed, that is more logical.
I will add an initial patch to uclibc to do this, then take it along in the kconfig-package infra.
Thanks!
Thomas
PATCH v2 1/1 manual: add documentation for kconfig-package
In reply to Thomas De SchampheleireThis patch adds documentation for the new kconfig-package infrastructure to the manual.
Note that due to the simplicity of the infrastructure, the documentation is not split in a 'tutorial' and a 'reference', like for the other infrastructures. Instead, the usage is described in one section.
---
v2: update after move to a real infrastructure
docs/manual/adding-packages-kconfig.txt | 56 +++++++++++++++++++++++++++++ docs/manual/adding-packages.txt | 2 + 2 files changed, 58 insertions(+), 0 deletions(-)
docs/manual/adding-packages-kconfig.txt new file +56 -0
@@ -0,0 +1,56 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: + +=== Infrastructure for packages using kconfig for configuration files + +A popular way for a software package to handle user-specified +configuration is +kconfig+. Among others, it is used by the Linux +kernel, Busybox, and Buildroot itself. The presence of a .config file +and a +menuconfig+ target are two well-known symptoms of kconfig being +used. + +Buildroot features an infrastructure for packages that use kconfig for +configuration. This infrastructure provides the necessary make logic to +expose the package +menuconfig+ target as +foo-menuconfig+ in Buildroot, +and to handle the copying and copy-back of the configuration file in a +correct way. + +The +kconfig-package+ infrastructure is based on the +generic-package+ +infrastructure. All variables supported by +generic-package+ are +available in +kconfig-package+ as well. See +xref:generic-package-reference[] for more details. + +In order to use the +kconfig-package+ infrastructure for a Buildroot +package, the minimally required lines in the .mk file in addition to +the variables required by the +generic-package+ infrastructure, are: + +------------------------------ +FOO_KCONFIG_FILE = reference-to-source-configuration-file + +$(eval $(kconfig-package)) +------------------------------ + +This snippet will create following make targets: + +* +foo-menuconfig+, which calls the package's +menuconfig+ target + +* +foo-update-config+, which copies back the configuration to the source + configuration file. + +and will ensure that the source configuration file is copied to the build +directory at the right moment. + +In addition to these minimally required lines, several optional variables can +be set to suit the needs of the package under consideration: + +* +FOO_KCONFIG_EDITORS+: a space-separated list of kconfig editors to + support, for example 'menuconfig xconfig'. By default, 'menuconfig'. + +* +FOO_KCONFIG_OPT+: extra options to pass when calling the kconfig + ediftors. This may need to include '$(FOO_MAKE_OPT)', for example. By + default, empty. + +* +FOO_KCONFIG_FIXUP_CMDS+: a list of shell commands needed to fixup the + configuration file after copying it or running a kconfig editor. Such + commands may be needed to ensure a configuration consistent with other + configuration of Buildroot, for example. By default, empty.
docs/manual/adding-packages.txt +2 -0
@@ -25,6 +25,8 @@ include::adding-packages-virtual.txt[] +include::adding-packages-kconfig.txt[] + include::adding-packages-hooks.txt[] include::adding-packages-gettext.txt[]
PATCH v2 1/1 manual: add documentation for kconfig-package
Thomas, All,
On 2014-07-30 21:58 +0200, Thomas De Schampheleire spake thusly:
Quoted 23 lines
This patch adds documentation for the new kconfig-package infrastructure to the manual.
Note that due to the simplicity of the infrastructure, the documentation is not split in a 'tutorial' and a 'reference', like for the other infrastructures. Instead, the usage is described in one section.
Signed-off-by Thomas De Schampheleire <[email protected]>---
v2: update after move to a real infrastructuredocs/manual/adding-packages-kconfig.txt | 56 +++++++++++++++++++++++++++++ docs/manual/adding-packages.txt | 2 + 2 files changed, 58 insertions(+), 0 deletions(-)diff -r
83a2e5f2641a-r7e76c27202ecdocs/manual/adding-packages-kconfig.txtdocs/manual/adding-packages-kconfig.txt new file +3
-0@@ -0,0 +1,56 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: +
docs/manual/adding-packages-kconfig.txt line 13
Quoted 10 lines
docs/manual/adding-packages-kconfig.txt new file +10
-0+=== Infrastructure for packages using kconfig for configuration files + +A popular way for a software package to handle user-specified +configuration is +kconfig+. Among others, it is used by the Linux +kernel, Busybox, and Buildroot itself. The presence of a .config file +and a +menuconfig+ target are two well-known symptoms of kconfig being +used. + +Buildroot features an infrastructure for packages that use kconfig for +configuration. This infrastructure provides the necessary make logic to
... for their configuration ...
... the necessary logic...
docs/manual/adding-packages-kconfig.txt line 14
Quoted 1 line
docs/manual/adding-packages-kconfig.txt new file +1
-0+expose the package +menuconfig+ target as +foo-menuconfig+ in Buildroot,
... the package's +menuconfig+ ...
docs/manual/adding-packages-kconfig.txt line 15
Quoted 1 line
docs/manual/adding-packages-kconfig.txt new file +1
-0+and to handle the copying and copy-back of the configuration file in a
... the copying back and forth of ...
docs/manual/adding-packages-kconfig.txt line 24
Quoted 9 lines
docs/manual/adding-packages-kconfig.txt new file +9
-0+correct way. + +The +kconfig-package+ infrastructure is based on the +generic-package+ +infrastructure. All variables supported by +generic-package+ are +available in +kconfig-package+ as well. See +xref:generic-package-reference[] for more details. + +In order to use the +kconfig-package+ infrastructure for a Buildroot +package, the minimally required lines in the .mk file in addition to
... in the +.mk+ file, in addition to ...
docs/manual/adding-packages-kconfig.txt line 33
Quoted 9 lines
docs/manual/adding-packages-kconfig.txt new file +9
-0+the variables required by the +generic-package+ infrastructure, are: + +------------------------------ +FOO_KCONFIG_FILE = reference-to-source-configuration-file + +$(eval $(kconfig-package)) +------------------------------ + +This snippet will create following make targets:
The snippet creates the following ...
docs/manual/adding-packages-kconfig.txt line 40
Quoted 6 lines
docs/manual/adding-packages-kconfig.txt new file +6
-0+* +foo-menuconfig+, which calls the package's +menuconfig+ target + +* +foo-update-config+, which copies back the configuration to the source + configuration file. + +and will ensure that the source configuration file is copied to the build
... and ensures that ...
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/1 uclibc: convert to kconfig-package infrastructure
In reply to Thomas De SchampheleireThis patch converts the uclibc package to the new kconfig-package infrastructure, thus removing code duplication and ensuring a consistent behavior of kconfig packages.
---
v2: kconfig-package is now a real package infrastructure, so remove call
to generic-package
package/uclibc/uclibc.mk | 34 ++++++++++------------------------ 1 files changed, 10 insertions(+), 24 deletions(-)
package/uclibc/uclibc.mk +10 -24
@@ -37,6 +37,14 @@ UCLIBC_CONFIG_FILE = $(call qstrip,$(BR2_UCLIBC_CONFIG)) endif +UCLIBC_KCONFIG_FILE = $(UCLIBC_CONFIG_FILE) + +UCLIBC_KCONFIG_OPT = \ + $(UCLIBC_MAKE_FLAGS) \ + PREFIX=$(STAGING_DIR) \ + DEVEL_PREFIX=/usr/ \ + RUNTIME_PREFIX=$(STAGING_DIR)/ \ + UCLIBC_TARGET_ARCH = $(call qstrip,$(BR2_UCLIBC_TARGET_ARCH)) ifeq ($(GENERATE_LOCALE),)
@@ -393,7 +401,7 @@ UCLIBC_EXTRA_CFLAGS="$(UCLIBC_EXTRA_CFLAGS) $(TARGET_ABI)" \ HOSTCC="$(HOSTCC)" -define UCLIBC_FIXUP_DOT_CONFIG +define UCLIBC_KCONFIG_FIXUP_CMDS $(call KCONFIG_SET_OPT,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D)/.config) $(call KCONFIG_ENABLE_OPT,TARGET_$(UCLIBC_TARGET_ARCH),$(@D)/.config) $(call KCONFIG_SET_OPT,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)",$(@D)/.config)
@@ -531,29 +539,7 @@ $(UCLIBC_INSTALL_UTILS_STAGING) endef -$(eval $(generic-package)) - -$(UCLIBC_DIR)/.config: $(UCLIBC_CONFIG_FILE) | uclibc-patch - $(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(UCLIBC_DIR)/.config - -$(UCLIBC_DIR)/.stamp_config_fixup_done: $(UCLIBC_DIR)/.config - $(UCLIBC_FIXUP_DOT_CONFIG) - $(Q)touch $@ - -$(UCLIBC_TARGET_CONFIGURE): $(UCLIBC_DIR)/.stamp_config_fixup_done - -uclibc-menuconfig: $(UCLIBC_DIR)/.config - $(MAKE) -C $(UCLIBC_DIR) \ - $(UCLIBC_MAKE_FLAGS) \ - PREFIX=$(STAGING_DIR) \ - DEVEL_PREFIX=/usr/ \ - RUNTIME_PREFIX=$(STAGING_DIR)/ \ - menuconfig - rm -f $(UCLIBC_DIR)/.stamp_{config_fixup_done,configured,built} - rm -f $(UCLIBC_DIR)/.stamp_{target,staging}_installed - -uclibc-update-config: $(UCLIBC_DIR)/.stamp_config_fixup_done - cp -f $(UCLIBC_DIR)/.config $(UCLIBC_CONFIG_FILE) +$(eval $(kconfig-package)) # Before uClibc is built, we must have the second stage cross-compiler $(UCLIBC_TARGET_BUILD): | host-gcc-intermediate
PATCH v2 1/1 uclibc: convert to kconfig-package infrastructure
Thomas, All,
On 2014-07-30 21:58 +0200, Thomas De Schampheleire spake thusly:
Quoted 5 lines
This patch converts the uclibc package to the new kconfig-package infrastructure, thus removing code duplication and ensuring a consistent behavior of kconfig packages.
Signed-off-by Thomas De Schampheleire <[email protected]>
However, I'd suggest a small enhancement (for a future patch):
UCLIBC_KCONFIG_EDITORS = menuconfig nconfig
Regards,
Yann E. MORIN.
Quoted 69 lines
---
v2: kconfig-package is now a real package infrastructure, so remove call
to generic-packagepackage/uclibc/uclibc.mk | 34 ++++++++++------------------------ 1 files changed, 10 insertions(+), 24 deletions(-)diff -r
7e76c27202ec-r083076145a2bpackage/uclibc/uclibc.mkpackage/uclibc/uclibc.mk +10
-24@@ -37,6 +37,14 @@ UCLIBC_CONFIG_FILE = $(call qstrip,$(BR2_UCLIBC_CONFIG)) endif +UCLIBC_KCONFIG_FILE = $(UCLIBC_CONFIG_FILE) + +UCLIBC_KCONFIG_OPT = \ + $(UCLIBC_MAKE_FLAGS) \ + PREFIX=$(STAGING_DIR) \ + DEVEL_PREFIX=/usr/ \ + RUNTIME_PREFIX=$(STAGING_DIR)/ \ + UCLIBC_TARGET_ARCH = $(call qstrip,$(BR2_UCLIBC_TARGET_ARCH)) ifeq ($(GENERATE_LOCALE),)@@ -393,7 +401,7 @@ UCLIBC_EXTRA_CFLAGS="$(UCLIBC_EXTRA_CFLAGS) $(TARGET_ABI)" \ HOSTCC="$(HOSTCC)" -define UCLIBC_FIXUP_DOT_CONFIG +define UCLIBC_KCONFIG_FIXUP_CMDS $(call KCONFIG_SET_OPT,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D)/.config) $(call KCONFIG_ENABLE_OPT,TARGET_$(UCLIBC_TARGET_ARCH),$(@D)/.config) $(call KCONFIG_SET_OPT,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)",$(@D)/.config)@@ -531,29 +539,7 @@ $(UCLIBC_INSTALL_UTILS_STAGING) endef -$(eval $(generic-package)) - -$(UCLIBC_DIR)/.config: $(UCLIBC_CONFIG_FILE) | uclibc-patch - $(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(UCLIBC_DIR)/.config - -$(UCLIBC_DIR)/.stamp_config_fixup_done: $(UCLIBC_DIR)/.config - $(UCLIBC_FIXUP_DOT_CONFIG) - $(Q)touch $@ - -$(UCLIBC_TARGET_CONFIGURE): $(UCLIBC_DIR)/.stamp_config_fixup_done - -uclibc-menuconfig: $(UCLIBC_DIR)/.config - $(MAKE) -C $(UCLIBC_DIR) \ - $(UCLIBC_MAKE_FLAGS) \ - PREFIX=$(STAGING_DIR) \ - DEVEL_PREFIX=/usr/ \ - RUNTIME_PREFIX=$(STAGING_DIR)/ \ - menuconfig - rm -f $(UCLIBC_DIR)/.stamp_{config_fixup_done,configured,built} - rm -f $(UCLIBC_DIR)/.stamp_{target,staging}_installed - -uclibc-update-config: $(UCLIBC_DIR)/.stamp_config_fixup_done - cp -f $(UCLIBC_DIR)/.config $(UCLIBC_CONFIG_FILE) +$(eval $(kconfig-package)) # Before uClibc is built, we must have the second stage cross-compiler $(UCLIBC_TARGET_BUILD): | host-gcc-intermediate_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/1 uclibc: convert to kconfig-package infrastructure
Hi Yann,
Quoted 7 lines · Yann E. MORIN
Thomas, All,
On 2014-07-30 21:58 +0200, Thomas De Schampheleire spake thusly:
Quoted 4 lines
This patch converts the uclibc package to the new kconfig-package infrastructure, thus removing code duplication and ensuring a consistent behavior of kconfig packages.
Quoted 6 lines
Quoted 1 line
Signed-off-by Thomas De Schampheleire <[email protected]>Reviewed-by "Yann E. MORIN" <[email protected]>However, I'd suggest a small enhancement (for a future patch):
UCLIBC_KCONFIG_EDITORS= menuconfig nconfig
Unless I'm missing something, this is not possible without patching uclibc, because their makefiles do not define any other config editor than menuconfig...
Best regards,
Thomas
PATCH v2 1/1 uclibc: convert to kconfig-package infrastructure
Thomas, All,
On 2014-08-01 21:42 +0200, Thomas De Schampheleire spake thusly:
Quoted 8 lines · Yann E. MORIN
Quoted 7 lines
On 2014-07-30 21:58 +0200, Thomas De Schampheleire spake thusly:
Quoted 5 lines
This patch converts the uclibc package to the new kconfig-package infrastructure, thus removing code duplication and ensuring a consistent behavior of kconfig packages.
Signed-off-by Thomas De Schampheleire <[email protected]>
Quoted 8 lines
Quoted 4 lines
Reviewed-by "Yann E. MORIN" <[email protected]>However, I'd suggest a small enhancement (for a future patch):
UCLIBC_KCONFIG_EDITORS= menuconfig nconfigUnless I'm missing something, this is not possible without patching uclibc, because their makefiles do not define any other config editor than menuconfig...
Indeed. I was looking at their master, which has nconfig. But it is missing in any of the releases so far.
When (if?) there is a new release, it can be added conditionally to that version. One day. Maybe... ;-]
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/1 uclibc: only add targets if uclibc is enabled
In reply to Thomas De SchampheleireIn analogy of linux.mk, only enable its targets (in particular the kconfig targets (menuconfig, update-config, ...) when the uclibc package is actually enabled.
---
v2: rebase after making kconfig-package a full infra
Note: now that kconfig-package is a full package infra (inheriting from generic-package) this may seem a bit odd, as other packages do not do this. Nevertheless, it does not hurt and will slightly improve the parsing of the Makefiles when the package is not selected.
package/uclibc/uclibc.mk | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
package/uclibc/uclibc.mk +2 -0
@@ -539,7 +539,9 @@ $(UCLIBC_INSTALL_UTILS_STAGING) endef +ifeq ($(BR2_TOOLCHAIN_BUILDROOT_UCLIBC),y) $(eval $(kconfig-package)) +endif # Before uClibc is built, we must have the second stage cross-compiler $(UCLIBC_TARGET_BUILD): | host-gcc-intermediate
PATCH v2 1/1 uclibc: only add targets if uclibc is enabled
Thomas, All,
On 2014-07-30 21:58 +0200, Thomas De Schampheleire spake thusly:
Quoted 5 lines
In analogy of linux.mk, only enable its targets (in particular the kconfig targets (menuconfig, update-config, ...) when the uclibc package is actually enabled.
Signed-off-by Thomas De Schampheleire <[email protected]>
Regards,
Yann E. MORIN.
Quoted 28 lines
---
v2: rebase after making kconfig-package a full infraNote: now that kconfig-package is a full package infra (inheriting from generic-package) this may seem a bit odd, as other packages do not do this. Nevertheless, it does not hurt and will slightly improve the parsing of the Makefiles when the package is not selected.
package/uclibc/uclibc.mk | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)diff -r
083076145a2b-r540167f28c2dpackage/uclibc/uclibc.mkpackage/uclibc/uclibc.mk +2
-0@@ -539,7 +539,9 @@ $(UCLIBC_INSTALL_UTILS_STAGING) endef +ifeq ($(BR2_TOOLCHAIN_BUILDROOT_UCLIBC),y) $(eval $(kconfig-package)) +endif # Before uClibc is built, we must have the second stage cross-compiler $(UCLIBC_TARGET_BUILD): | host-gcc-intermediate_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/1 uclibc: only add targets if uclibc is enabled
In reply to Thomas De SchampheleireDear Thomas De Schampheleire,
Quoted 21 lines · Thomas De Schampheleire
In analogy of linux.mk, only enable its targets (in particular the kconfig targets (menuconfig, update-config, ...) when the uclibc package is actually enabled.
Signed-off-by Thomas De Schampheleire <[email protected]>---
v2: rebase after making kconfig-package a full infraNote: now that kconfig-package is a full package infra (inheriting from generic-package) this may seem a bit odd, as other packages do not do this. Nevertheless, it does not hurt and will slightly improve the parsing of the Makefiles when the package is not selected.
package/uclibc/uclibc.mk | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)diff -r
083076145a2b-r540167f28c2dpackage/uclibc/uclibc.mk
package/uclibc/uclibc.mk line 544
Quoted 6 lines
package/uclibc/uclibc.mk +2
-0@@ -539,7 +539,9 @@ $(UCLIBC_INSTALL_UTILS_STAGING) endef +ifeq ($(BR2_TOOLCHAIN_BUILDROOT_UCLIBC),y) $(eval $(kconfig-package)) +endif
I actually don't like this that much, because I like a lot the fact that I can do "make <foo>-source" "make <foo>-extract", "make <foo>-patch" or even "make <foo>" (though this last case, for the specific situation of uClibc doesn't seem really possible).
Though it's true it can be considered a bit strange to allow "make <foo>-patch" but not "make <foo>-menuconfig".
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 1/1 uclibc: only add targets if uclibc is enabled
Hi Thomas, Yann, all,
Quoted 37 lines · Thomas Petazzoni
Dear Thomas De Schampheleire,
Quoted 21 lines · Thomas De Schampheleire
In analogy of linux.mk, only enable its targets (in particular the kconfig targets (menuconfig, update-config, ...) when the uclibc package is actually enabled.
Signed-off-by Thomas De Schampheleire <[email protected]>---
v2: rebase after making kconfig-package a full infraNote: now that kconfig-package is a full package infra (inheriting from generic-package) this may seem a bit odd, as other packages do not do this. Nevertheless, it does not hurt and will slightly improve the parsing of the Makefiles when the package is not selected.
package/uclibc/uclibc.mk | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)diff -r
083076145a2b-r540167f28c2dpackage/uclibc/uclibc.mkpackage/uclibc/uclibc.mk Wed Jul 23 20:12:32 2014 +0200 line 544
Quoted 6 lines
package/uclibc/uclibc.mk Wed Jul 23 20:12:32 2014 +0200 renamed from package/uclibc/uclibc.mk Tue Jul 22 20:35:36 2014 +0200 +2
-0@@ -539,7 +539,9 @@ $(UCLIBC_INSTALL_UTILS_STAGING) endef +ifeq ($(BR2_TOOLCHAIN_BUILDROOT_UCLIBC),y) $(eval $(kconfig-package)) +endifI actually don't like this that much, because I like a lot the fact that I can do "make <foo>-source" "make <foo>-extract", "make <foo>-patch" or even "make <foo>" (though this last case, for the specific situation of uClibc doesn't seem really possible).
Quoted 2 lines
Though it's true it can be considered a bit strange to allow "make <foo>-patch" but not "make <foo>-menuconfig".
I fully understand what you say. I also use that feature a lot. Given that linux added such a check around its menuconfig target (which you added by the way) and the fact that we are extracting everything in a kconfig-package infrastructure, there are three ways to proceed:
- introduce the check in each of the kconfig-based packages
- remove the check from each of the kconfig-based packages
- introduce another way in kconfig-package to only allow menuconfig when the package is selected
What is your preference here?
Thanks,
Thomas
PATCH v2 1/1 uclibc: only add targets if uclibc is enabled
Thomas, All,
On 2014-08-01 21:37 +0200, Thomas De Schampheleire spake thusly:
Quoted 52 lines
Quoted 37 lines · Thomas Petazzoni
Dear Thomas De Schampheleire,
Quoted 21 lines · Thomas De Schampheleire
In analogy of linux.mk, only enable its targets (in particular the kconfig targets (menuconfig, update-config, ...) when the uclibc package is actually enabled.
Signed-off-by Thomas De Schampheleire <[email protected]>---
v2: rebase after making kconfig-package a full infraNote: now that kconfig-package is a full package infra (inheriting from generic-package) this may seem a bit odd, as other packages do not do this. Nevertheless, it does not hurt and will slightly improve the parsing of the Makefiles when the package is not selected.
package/uclibc/uclibc.mk | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)diff -r
083076145a2b-r540167f28c2dpackage/uclibc/uclibc.mkpackage/uclibc/uclibc.mk Wed Jul 23 20:12:32 2014 +0200 line 544
Quoted 6 lines
package/uclibc/uclibc.mk Wed Jul 23 20:12:32 2014 +0200 renamed from package/uclibc/uclibc.mk Tue Jul 22 20:35:36 2014 +0200 +2
-0@@ -539,7 +539,9 @@ $(UCLIBC_INSTALL_UTILS_STAGING) endef +ifeq ($(BR2_TOOLCHAIN_BUILDROOT_UCLIBC),y) $(eval $(kconfig-package)) +endifI actually don't like this that much, because I like a lot the fact that I can do "make <foo>-source" "make <foo>-extract", "make <foo>-patch" or even "make <foo>" (though this last case, for the specific situation of uClibc doesn't seem really possible).
Quoted 2 lines
Though it's true it can be considered a bit strange to allow "make <foo>-patch" but not "make <foo>-menuconfig".
I fully understand what you say. I also use that feature a lot. Given that linux added such a check around its menuconfig target (which you added by the way) and the fact that we are extracting everything in a kconfig-package infrastructure, there are three ways to proceed:
- introduce the check in each of the kconfig-based packages
- remove the check from each of the kconfig-based packages
- introduce another way in kconfig-package to only allow menuconfig when the package is selected
Quoted 1 line
What is your preference here?
Except for uClibc, I think it is still usefull (for debugging purposes, for example) to be able to build a non-configured package.
So, in retrospect, I would side with Thomas P. on that one. We could just maybe hide uClibc if not enabled, but allow it for the other packages.
BTW, we now have the BR2_PACKAGE_UCLIBC (as well as BR2_PACKAGE_GLIBC and BR2_PACKAGE_MUSL) if you need to know whether the corresponding package is enabled.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/1 busybox: convert to kconfig-package infrastructure
In reply to Thomas De SchampheleireThis patch converts the busybox package to the new kconfig-package infrastructure, thus removing code duplication and ensuring a consistent behavior of kconfig packages.
---
v2: rebase after making kconfig-package a full infra
package/busybox/busybox.mk | 25 +++++++++---------------- 1 files changed, 9 insertions(+), 16 deletions(-)
package/busybox/busybox.mk +9 -16
@@ -45,6 +45,10 @@ BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG)) endif +BUSYBOX_KCONFIG_FILE = $(BUSYBOX_CONFIG_FILE) +BUSYBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig +BUSYBOX_KCONFIG_OPT = $(BUSYBOX_MAKE_OPTS) + define BUSYBOX_PERMISSIONS /bin/busybox f 4755 0 0 - - - - - /usr/share/udhcpc/default.script f 755 0 0 - - - - -
@@ -136,10 +140,6 @@ endef endif -define BUSYBOX_COPY_CONFIG - $(INSTALL) -D -m 0644 $(BUSYBOX_CONFIG_FILE) $(BUSYBOX_BUILD_CONFIG) -endef - # Disable shadow passwords support if unsupported by the C library ifeq ($(BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS),) define BUSYBOX_INTERNAL_SHADOW_PASSWORDS
@@ -190,8 +190,7 @@ $(SED) 's/^noclobber="0"$$/noclobber="1"/' $(@D)/applets/install.sh endef -define BUSYBOX_CONFIGURE_CMDS - $(BUSYBOX_COPY_CONFIG) +define BUSYBOX_KCONFIG_FIXUP_CMDS $(BUSYBOX_SET_MMU) $(BUSYBOX_SET_LARGEFILE) $(BUSYBOX_SET_IPV6)
@@ -203,6 +202,9 @@ $(BUSYBOX_INTERNAL_SHADOW_PASSWORDS) $(BUSYBOX_SET_INIT) $(BUSYBOX_SET_WATCHDOG) +endef + +define BUSYBOX_CONFIGURE_CMDS @yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \ -C $(@D) oldconfig $(BUSYBOX_NOCLOBBER_INSTALL)
@@ -224,13 +226,4 @@ $(BUSYBOX_INSTALL_WATCHDOG_SCRIPT) endef -$(eval $(generic-package)) - -busybox-menuconfig busybox-xconfig busybox-gconfig: busybox-patch - $(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(BUSYBOX_DIR) \ - $(subst busybox-,,$@) - rm -f $(BUSYBOX_DIR)/.stamp_built - rm -f $(BUSYBOX_DIR)/.stamp_target_installed - -busybox-update-config: busybox-configure - cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE) +$(eval $(kconfig-package))
PATCH v2 1/1 busybox: convert to kconfig-package infrastructure
Thomas, All,
On 2014-07-30 21:58 +0200, Thomas De Schampheleire spake thusly:
Quoted 5 lines
This patch converts the busybox package to the new kconfig-package infrastructure, thus removing code duplication and ensuring a consistent behavior of kconfig packages.
Signed-off-by Thomas De Schampheleire <[email protected]>
Regards,
Yann E. MORIN.
Quoted 70 lines
---
v2: rebase after making kconfig-package a full infrapackage/busybox/busybox.mk | 25 +++++++++---------------- 1 files changed, 9 insertions(+), 16 deletions(-)diff -r
540167f28c2d-rf995a8adfa24package/busybox/busybox.mkpackage/busybox/busybox.mk +9
-16@@ -45,6 +45,10 @@ BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG)) endif +BUSYBOX_KCONFIG_FILE = $(BUSYBOX_CONFIG_FILE) +BUSYBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig +BUSYBOX_KCONFIG_OPT = $(BUSYBOX_MAKE_OPTS) + define BUSYBOX_PERMISSIONS /bin/busybox f 4755 0 0 - - - - - /usr/share/udhcpc/default.script f 755 0 0 - - - - -@@ -136,10 +140,6 @@ endef endif -define BUSYBOX_COPY_CONFIG - $(INSTALL) -D -m 0644 $(BUSYBOX_CONFIG_FILE) $(BUSYBOX_BUILD_CONFIG) -endef - # Disable shadow passwords support if unsupported by the C library ifeq ($(BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS),) define BUSYBOX_INTERNAL_SHADOW_PASSWORDS@@ -190,8 +190,7 @@ $(SED) 's/^noclobber="0"$$/noclobber="1"/' $(@D)/applets/install.sh endef -define BUSYBOX_CONFIGURE_CMDS - $(BUSYBOX_COPY_CONFIG) +define BUSYBOX_KCONFIG_FIXUP_CMDS $(BUSYBOX_SET_MMU) $(BUSYBOX_SET_LARGEFILE) $(BUSYBOX_SET_IPV6)@@ -203,6 +202,9 @@ $(BUSYBOX_INTERNAL_SHADOW_PASSWORDS) $(BUSYBOX_SET_INIT) $(BUSYBOX_SET_WATCHDOG) +endef + +define BUSYBOX_CONFIGURE_CMDS @yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \ -C $(@D) oldconfig $(BUSYBOX_NOCLOBBER_INSTALL)@@ -224,13 +226,4 @@ $(BUSYBOX_INSTALL_WATCHDOG_SCRIPT) endef -$(eval $(generic-package)) - -busybox-menuconfig busybox-xconfig busybox-gconfig: busybox-patch - $(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(BUSYBOX_DIR) \ - $(subst busybox-,,$@) - rm -f $(BUSYBOX_DIR)/.stamp_built - rm -f $(BUSYBOX_DIR)/.stamp_target_installed - -busybox-update-config: busybox-configure - cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE) +$(eval $(kconfig-package))_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/1 busybox: only add kconfig targets if uclibc is enabled
In reply to Thomas De SchampheleireIn analogy of linux.mk, only enable its targets, in particular the kconfig targets (menuconfig, update-config, ...) when the busybox package is actually enabled.
--- package/busybox/busybox.mk | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
package/busybox/busybox.mk +2 -0
@@ -226,4 +226,6 @@ $(BUSYBOX_INSTALL_WATCHDOG_SCRIPT) endef +ifeq ($(BR2_PACKAGE_BUSYBOX),y) $(eval $(kconfig-package)) +endif
PATCH v2 1/1 busybox: only add kconfig targets if uclibc is enabled
Thomas, All,
On 2014-07-30 21:58 +0200, Thomas De Schampheleire spake thusly:
Quoted 5 lines
In analogy of linux.mk, only enable its targets, in particular the kconfig targets (menuconfig, update-config, ...) when the busybox package is actually enabled.
Signed-off-by Thomas De Schampheleire <[email protected]>
Typo in subject:
busybox: only add kconfig targets if uclibc is enabled
s/uclibc/busybox/
Otherwise:
Regards,
Yann E. MORIN.
Quoted 18 lines
--- package/busybox/busybox.mk | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)diff -r
f995a8adfa24-r469e4493e128package/busybox/busybox.mkpackage/busybox/busybox.mk +2
-0@@ -226,4 +226,6 @@ $(BUSYBOX_INSTALL_WATCHDOG_SCRIPT) endef +ifeq ($(BR2_PACKAGE_BUSYBOX),y) $(eval $(kconfig-package)) +endif_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'