Skip to contentSkip to conversation

core: add kconfigsymbols to packages (branch yem/check-target-packages)

PATCH New Yann E. MORIN 2 participants 7 messages Dec 29, 2015 – Dec 30, 2015

lore
Share & tools
lore
#0 lore raw

cover core: add kconfigsymbols to packages (branch yem/check-target-packages)

Hello All!

Since we check that packages in _DEPENDENCIES are enabled at the Kconfig level, it means all the target packages need to have a Kconfig symbol.

This is currently not the case for quite a few of them:
- linux-headers
- netbsd-queue
- virtual packages
- a few more...

This series fixes the most critical ones (the three identified in the list above); others will be fixed in later patches when the autobulders find them.

Regards,
Yann E. MORIN.

The following changes since commit 5203541aa62c1d77d1e85662961bd7ab313813bc:

package/xtables-addons: require kernel modules from Kconfig (2015-12-29 23:53:04 +0100)

are available in the git repository at:

git://git.busybox.net/~ymorin/git/buildroot yem/check-target-packages

for you to fetch changes up to 7048b92dbba0ba35f610d7863f0c599eca3e3399:

core/pkg-virtual: do not check they are neabled (2015-12-30 00:07:09 +0100)

----------------------------------------------------------------
Yann E. MORIN (3):
package/c-libraries: need linux-headers package/netbsd-queue: add Kconfig symbol like for all target packages core/pkg-virtual: do not check they are neabled

 package/glibc/Config.in                 | 4 ++--
 package/linux-headers/Config.in         | 2 ++
 package/musl/Config.in                  | 3 ++-
 package/netbsd-queue/Config.in          | 2 ++
 package/pkg-generic.mk                  | 5 ++++-
 package/pkg-virtual.mk                  | 2 ++
 package/uclibc/Config.in                | 2 +-
 toolchain/toolchain-buildroot/Config.in | 1 +
 8 files changed, 16 insertions(+), 5 deletions(-)
 create mode 100644 package/linux-headers/Config.in
 create mode 100644 package/netbsd-queue/Config.in
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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/3 package/c-libraries: need linux-headers

Now that we check that a target package in the _DEPENDENCIES of another package has to be enabled in config, all target packages must have a kconfig symbol.

Add a Kconfig symbol for linux-headers, and select it from the packages that depends on it (C libraries).

Also remove the now-misleading comments "for legal-info" from the C libraries.

Fixes:
http://autobuild.buildroot.org/results/2a9/2a9e5d27b34357819b44f573a834da1ba5079030/
... and numerous similar failures ...

Cc Thomas Petazzoni <[email protected]>

---
Note: all target packages must have a kconfig symbol. Let's take care of the most problematic one for now; other patches will come later...

Conflicts:
package/musl/Config.in

---
 package/glibc/Config.in                 | 4 ++--
 package/linux-headers/Config.in         | 2 ++
 package/musl/Config.in                  | 2 +-
 package/uclibc/Config.in                | 2 +-
 toolchain/toolchain-buildroot/Config.in | 1 +
 5 files changed, 7 insertions(+), 4 deletions(-)
 create mode 100644 package/linux-headers/Config.in
package/glibc/Config.in +2 -2
index 72fd3df..aeb236c 100644
@@ -1,9 +1,9 @@
 if BR2_TOOLCHAIN_BUILDROOT_EGLIBC
 
-# For legal-info
 config BR2_PACKAGE_EGLIBC
 	bool
 	default y
+	select BR2_PACKAGE_LINUX_HEADERS
 
 choice
 	prompt "eglibc version"
@@ -25,10 +25,10 @@ endif
 
 if BR2_TOOLCHAIN_BUILDROOT_GLIBC
 
-# For legal-info
 config BR2_PACKAGE_GLIBC
 	bool
 	default y
+	select BR2_PACKAGE_LINUX_HEADERS
 
 choice
 	prompt "glibc version"
package/linux-headers/Config.in new file +2 -0
new file mode 100644
index 0000000..0ea9516
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_LINUX_HEADERS
+	bool
package/musl/Config.in +1 -1
index 0aa3537..4f6cc51 100644
@@ -1,5 +1,5 @@
-# For legal-info
 config BR2_PACKAGE_MUSL
 	bool
 	depends on BR2_TOOLCHAIN_USES_MUSL
 	default y
+	select BR2_PACKAGE_LINUX_HEADERS
package/uclibc/Config.in +1 -1
index bd95041..9ebec70 100644
@@ -1,9 +1,9 @@
 if BR2_TOOLCHAIN_BUILDROOT_UCLIBC
 
-# For legal-info
 config BR2_PACKAGE_UCLIBC
 	bool
 	default y
+	select BR2_PACKAGE_LINUX_HEADERS
 
 comment "uClibc Options"
 
toolchain/toolchain-buildroot/Config.in +1 -0
index cee2578..cbeb030 100644
@@ -110,6 +110,7 @@ config BR2_TOOLCHAIN_BUILDROOT_LIBC
 	default "glibc"  if BR2_TOOLCHAIN_BUILDROOT_GLIBC
 	default "musl"	 if BR2_TOOLCHAIN_BUILDROOT_MUSL
 
+source "package/linux-headers/Config.in"
 source "package/uclibc/Config.in"
 source "package/glibc/Config.in"
 source "package/binutils/Config.in.host"
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/3 package/c-libraries: need linux-headers

Dear Yann E. MORIN,

Quoted 14 lines · Yann E. MORIN

Now that we check that a target package in the _DEPENDENCIES of another package has to be enabled in config, all target packages must have a kconfig symbol.

Add a Kconfig symbol for linux-headers, and select it from the packages that depends on it (C libraries).

Also remove the now-misleading comments "for legal-info" from the C libraries.

Fixes:
http://autobuild.buildroot.org/results/2a9/2a9e5d27b34357819b44f573a834da1ba5079030/
... and numerous similar failures ...

Quoted 6 lines
Cc Thomas Petazzoni <[email protected]>

---
Note: all target packages must have a kconfig symbol. Let's take care of the most problematic one for now; other patches will come later...

I've applied, even though I'm not super happy with the fact that we already had a (useless?) BR2_PACKAGE_HOST_LINUX_HEADERS option, and we now have both a Config.in.host and a Config.in file for what is really a target package...

Ideally, we would move all the options to the Config.in file, and rename them.. but that would cause so much Config.in.legacy trouble :-/

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/3 package/netbsd-queue: add Kconfig symbol like for all target packages

In reply to Yann E. MORIN

Select that package from musl, too, since it is a dependency.

Fixes:
http://autobuild.buildroot.org/results/15c/15c9a80fb2754ed1866b59d5e62d02691b57834e/
... and numerous similar issues ...

Cc Sergio Prado <[email protected]>
Cc Luca Ceresoli <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Peter Korsgaard <[email protected]>

---
Conflicts:
package/musl/Config.in

---
 package/musl/Config.in         | 1 +
 package/netbsd-queue/Config.in | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 package/netbsd-queue/Config.in
package/musl/Config.in +1 -0
index 4f6cc51..f1a3150 100644
@@ -3,3 +3,4 @@ config BR2_PACKAGE_MUSL
 	depends on BR2_TOOLCHAIN_USES_MUSL
 	default y
 	select BR2_PACKAGE_LINUX_HEADERS
+	select BR2_PACKAGE_NETBSD_QUEUE
package/netbsd-queue/Config.in new file +2 -0
new file mode 100644
index 0000000..7837f4c
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_NETBSD_QUEUE
+	bool
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/3 package/netbsd-queue: add Kconfig symbol like for all target packages

Dear Yann E. MORIN,

Quoted 12 lines · Yann E. MORIN

Select that package from musl, too, since it is a dependency.

Fixes:
http://autobuild.buildroot.org/results/15c/15c9a80fb2754ed1866b59d5e62d02691b57834e/
... and numerous similar issues ...

Cc Sergio Prado <[email protected]>
Cc Luca Ceresoli <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Peter Korsgaard <[email protected]>
Quoted 8 lines

---
Conflicts:
package/musl/Config.in

---
 package/musl/Config.in         | 1 +
 package/netbsd-queue/Config.in | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 package/netbsd-queue/Config.in

I've applied, but I realized afterwards that you forgot the external toolchain case, so I did a follow-up commit to fix this case as well.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 3/3 core/pkg-virtual: do not check they are neabled

In reply to Yann E. MORIN

Virtual packages do not have a Kconfig symbol, so we must not check that they are enabled.

Fixes:
http://autobuild.buildroot.org/results/287/28713478cc6edf8e5d5c3e830fee86a42f0afa8d/
... and numerous similar failures ...

Cc Thomas Petazzoni <[email protected]>
---
 package/pkg-generic.mk | 5 ++++-
 package/pkg-virtual.mk | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)
package/pkg-generic.mk +4 -1
index 2daf337..08f9703 100644
@@ -186,7 +186,10 @@ $(BUILD_DIR)/%/.stamp_configured:
 # building a package, even if not enabled in the configuration, we
 # want to accept it.
 ifeq ($(MAKECMDGOALS),)
-	@if test "$($(PKG)_TYPE)" = "target" -a -z "$($($(PKG)_KCONFIG_VAR))" ; then \
+	@if test "$($(PKG)_TYPE)" = "target" \
+		-a ! "$($(PKG)_IS_VIRTUAL)" = "YES" \
+		-a -z "$($($(PKG)_KCONFIG_VAR))" ; \
+	then \
 		echo "ERROR: $($(PKG)_NAME) is in the dependency chain of a package that has" ; \
 		echo "added it to its _DEPENDENCIES variable (directly or indirectly)" ; \
 		echo "without selecting it from Config.in." ; \
package/pkg-virtual.mk +2 -0
index 9c68b51..244c1d0 100644
@@ -41,6 +41,8 @@ $$(error No implementation selected for virtual package $(1). Configuration erro
 endif
 endif
 
+$(2)_IS_VIRTUAL = YES
+
 # A virtual package does not have any source associated
 $(2)_SOURCE =
 
Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/3 core/pkg-virtual: do not check they are neabled

Dear Yann E. MORIN,

package/pkg-generic.mk $(BUILD_DIR)/%/.stamp_configured: · line 190

Quoted 4 lines · Yann E. MORIN

ifeq ($(MAKECMDGOALS),)

package/pkg-generic.mk +2 -1
-	@if test "$($(PKG)_TYPE)" = "target" -a -z "$($($(PKG)_KCONFIG_VAR))" ; then \
+	@if test "$($(PKG)_TYPE)" = "target" \
+		-a ! "$($(PKG)_IS_VIRTUAL)" = "YES" \

I changed this to:

		-a "$($(PKG)_IS_VIRTUAL)" != "YES" \

which I believe is a bit more logical.

package/pkg-virtual.mk $$(error No implementation selected for virtual package $(1). Configuration erro · line 44

Quoted 9 lines
package/pkg-virtual.mk +1 -0
index 9c68b51..244c1d0 100644
@@ -41,6 +41,8 @@ $$(error No implementation selected for virtual package $(1). Configuration erro
 endif
 endif
 
+$(2)_IS_VIRTUAL = YES

I wasn't sure whether a new variable was needed. We could have used $($(PKG)_VERSION) != "virtual", but that would have failed if one day we have a normal package that really has a version named "virtual" for some reason.

We can anyway change this later on if others have better suggestions.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com