Skip to contentSkip to conversation

Add dependency on kernel headers

PATCH New Yann E. MORIN 2 participants 15 messages Mar 1, 2014

lore
Share & tools
lore
#0 lore raw

v3 cover Add dependency on kernel headers

From: "Yann E. MORIN" <[email protected]>

Hello All!

This series introduces infrastructure for packages to depend on the required version of kernel headers.

It follows the proposal made on the list:

    http://lists.busybox.net/pipermail/buildroot/2014-February/088924.html

The basic idea is to add a symbol for each kernel header version, and have toolchains select the appropriate symbol, and packages depend on the appropriate symbol.

In this series:

- such symbols are added for all kernel headers >= 3.0;

- the internal toochain backend selects the appropriate symbol, without user-visible changes for known kernel headers versions, and with a new choice for manually-specified kernel headers version;

- the predefined external toolchains select the appropriate symbols without user-visible changes; those using kernel headers older than 3.0, select nothing, and a comment is added to state so;

- for the custom external toolchain, a new choice is shown to the

    user, to select the appropriate kernel headers version;

- five packages are converted to take advantage of this.

For example:

- BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1 selects

    BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3

- dvb-apps depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3

Changes v2 -> v3:
- move the manual patch after all toolchains are converted (Arnout)
- rebase on top of master
- a few typoes here and there

Changes v1 -> v2:
- typo and asciidoc syntax in the manual (Samuel, Thomas DS)
- add choice for custom kernel headers (Arnout)
- add check to strictly enforce selection (Thomas, Arnout)
- add help to choice (Thomas DS)

Regards,
Yann E. MORIN.

----------------------------------------------------------------
Yann E. MORIN (13):
package/linux-headers: remove 2.6 snapshot
toolchain/common: add minimum kernel headers options toolchain/external/predefined: add choice to select 'AT_LEAST_XXX' header version toolchain/external/custom: add choice to select 'AT_LEAST_XXX' header version package/linux-headers: select appropriate 'AT_LEAST_XXX' header version toolchain/external: check kernel headers version for custom toolchain toolchain/internal: check kernel headers version for manually-specified version
manual: document minimal kernel headers dependency package/dvb-apps: requires kernel headers >= 3.3
package/w_scan: requires kernel headers >= 3.0
package/weston: requires kernel headers >= 3.0
package/tvheadend: requires kernel headers >= 3.2 package/mmc-utils: requires kernel headers >= 3.0

 Config.in.legacy                                   |   7 ++
 docs/manual/adding-packages-directory.txt          |   6 ++
 package/dvb-apps/Config.in                         |   5 +-
 package/linux-headers/Config.in.host               |  86 +++++++++++++++-
 package/linux-headers/linux-headers.mk             |   9 ++
 package/mmc-utils/Config.in                        |   5 +-
 package/tvheadend/Config.in                        |   5 +-
 package/w_scan/Config.in                           |   4 +
 package/weston/Config.in                           |   5 +-
 support/scripts/check-kernel-headers.sh            |  21 ++++
 toolchain/helpers.mk                               |  13 +++
 toolchain/toolchain-common.in                      |  79 +++++++++++++++
 toolchain/toolchain-external/Config.in             | 111 +++++++++++++++++++++
 toolchain/toolchain-external/toolchain-external.mk |   7 +-
 14 files changed, 350 insertions(+), 13 deletions(-)
 create mode 100755 support/scripts/check-kernel-headers.sh
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 v3 1/13 package/linux-headers: remove 2.6 snapshot

From: "Yann E. MORIN" <[email protected]>

As Thomas states:
It is completely weird to ask the tarball to be named exactly linux-2.6.tar.bz2. IMO, we should simply get rid of this feature.

Make it so! ;-)

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
---
 Config.in.legacy                     | 7 +++++++
 package/linux-headers/Config.in.host | 4 ----
 2 files changed, 7 insertions(+), 4 deletions(-)
Config.in.legacy +7 -0
index 09c3a2b..cfcf5a3 100644
@@ -101,6 +101,13 @@ endif
 ###############################################################################
 comment "Legacy options removed in 2014.05"
 
+config BR2_KERNEL_HEADERS_SNAP
+	bool "Local Linux snapshot support removed"
+	select BR2_LEGACY
+	help
+	  Support for using a custom snapshot to install the Linux
+	  kernel headers has been removed.
+
 config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
 	bool "/dev management by udev removed"
 	select BR2_LEGACY
package/linux-headers/Config.in.host +0 -4
index 134e338..fcecd62 100644
@@ -56,9 +56,6 @@ choice
 
 	config BR2_KERNEL_HEADERS_VERSION
 		bool "Manually specified Linux version"
-
-	config BR2_KERNEL_HEADERS_SNAP
-		bool "Local Linux snapshot (linux-2.6.tar.bz2)"
 endchoice
 
 config BR2_DEFAULT_KERNEL_VERSION
@@ -81,5 +78,4 @@ config BR2_DEFAULT_KERNEL_HEADERS
 	default "3.11.10"	if BR2_KERNEL_HEADERS_3_11
 	default "3.12.13"	if BR2_KERNEL_HEADERS_3_12
 	default "3.13.5"	if BR2_KERNEL_HEADERS_3_13
-	default "2.6"		if BR2_KERNEL_HEADERS_SNAP
 	default BR2_DEFAULT_KERNEL_VERSION if BR2_KERNEL_HEADERS_VERSION
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH v3 2/13 toolchain/common: add minimum kernel headers options

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

We now have quite a few packages that depend on the kernel headers to be at least a certain version. For example, dvb-apps requires at least the 3.3 kernel headers.

Add a set of options that packages can depend on, to check that the kernel headers match their required version.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Thomas De Schampheleire <[email protected]>

---
Notes:
1. We only add those versions already in the internal backend choice, on the assumption that we won't have a package that depends on headers older than the ones we provide ourselves in our internal backend.

This may pose a problem if the user selects (eg.) 2.6.39 as a custom version, and a package would work with those headers. But since we only start with 3.0, the package would not be selectable.

2. This does not address the format of the comment for when a package depends on a specific kernel headers, to come in a following patch.

3. This is not used for now, but will be in the following patches.

---
 toolchain/toolchain-common.in | 59 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
toolchain/toolchain-common.in +59 -0
index c4e3890..01bb39f 100644
@@ -110,3 +110,62 @@ config BR2_ECLIPSE_REGISTER
 	  This options tells Buildroot to generate the necessary
 	  configuration files to make your toolchain appear within
 	  Eclipse, through the Eclipse Buildroot plugin.
+
+# Options for packages to depend on, if they require at least a
+# specific version of the kernel headers.
+# Toolchains should choose the adequate option (ie. the highest
+# version, not all of them).
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
+	bool
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
+
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
Signature · 1 line
1.8.3.2
#3 lore raw

PATCH v3 3/13 toolchain/external/predefined: add choice to select 'AT_LEAST_XXX' header version

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Select the appropriate BR2_TOOLCHAIN_HEADERS_AT_LEAST_XXX options for the external, pre-defined toolchains.

Also annotate those toolchain with older-than-3.0 headers.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Thomas De Schampheleire <[email protected]>
---
 toolchain/toolchain-external/Config.in | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
toolchain/toolchain-external/Config.in +32 -0
index 90bcc3b..5981ef2 100644
@@ -17,6 +17,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_11
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
 	help
 	  Linaro toolchain for the ARM architecture. It uses Linaro
 	  GCC 2013.11 (based on gcc 4.8), Linaro GDB 2013.10 (based on
@@ -39,6 +40,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_10
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
 	help
 	  Linaro toolchain for the ARM architecture. It uses Linaro
 	  GCC 2013.10 (based on gcc 4.8), Linaro GDB 2013.10 (based on
@@ -61,6 +63,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_09
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
 	help
 	  Linaro toolchain for the ARM architecture. It uses Linaro
 	  GCC 2013.09 (based on gcc 4.8), Linaro GDB 2013.05 (based on
@@ -87,6 +90,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201311
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
 	help
 	  Sourcery CodeBench toolchain for the ARM architecture, from
 	  Mentor Graphics. It uses gcc 4.8.1, binutils 2.23.52, glibc
@@ -113,6 +117,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201305
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
 	help
 	  Sourcery CodeBench toolchain for the ARM architecture, from
 	  Mentor Graphics. It uses gcc 4.7.3, binutils 2.23.52, glibc
@@ -139,6 +144,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201203
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 	help
 	  Sourcery CodeBench toolchain for the ARM architecture, from
 	  Mentor Graphics. It uses gcc 4.6.3, binutils 2.21.53, glibc
@@ -172,6 +178,7 @@ config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV7A_201109
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	# kernel headers: 2.6.31
 	help
 	  Texas Instruments Arago 2011.09 toolchain, with gcc 4.5.3,
 	  binutils 2.20.1, glibc 2.12, gdb 7.2.
@@ -195,6 +202,7 @@ config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV5TE_201109
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	# kernel headers: 2.6.31
 	help
 	  Texas Instruments Arago ARMv5 2011.09 toolchain, with gcc
 	  4.5.3, binutils 2.20.1, glibc 2.12, gdb 7.2.
@@ -211,6 +219,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201311
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
 	help
 	  Sourcery CodeBench toolchain for the MIPS architecture, from
 	  Mentor Graphics. It uses gcc 4.8.1, binutils 2.23.52, glibc
@@ -279,6 +288,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201305
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
 	help
 	  Sourcery CodeBench toolchain for the MIPS architecture, from
 	  Mentor Graphics. It uses gcc 4.7.3, binutils 2.23.52, glibc
@@ -347,6 +357,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201209
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
 	help
 	  Sourcery CodeBench toolchain for the MIPS architecture, from
 	  Mentor Graphics. It uses gcc 4.7.2, binutils 2.23.51, glibc
@@ -418,6 +429,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
 	help
 	  Sourcery CodeBench toolchain for the Nios-II architecture,
 	  from Mentor Graphics. It uses gcc 4.7.3, binutils 2.23.52,
@@ -432,6 +444,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201103
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	# kernel headers: 2.6.38
 	help
 	  Sourcery CodeBench toolchain for the PowerPC architecture,
 	  from Mentor Graphics. It uses gcc 4.5.2, binutils 2.20.51,
@@ -463,6 +476,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	# kernel headers: 2.6.35
 	help
 	  Sourcery CodeBench toolchain for the PowerPC architecture,
 	  from Mentor Graphics. It uses gcc 4.5.1, binutils 2.20,
@@ -494,6 +508,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201209
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
 	help
 	  Sourcery CodeBench toolchain for the SuperH architecture,
 	  from Mentor Graphics. It uses gcc 4.7.2, binutils 2.23.51,
@@ -516,6 +531,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201203
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 	help
 	  Sourcery CodeBench toolchain for the SuperH architecture,
 	  from Mentor Graphics. It uses gcc 4.6.3, binutils 2.21.53,
@@ -539,6 +555,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201103
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	# kernel headers: 2.6.38
 	help
 	  Sourcery CodeBench toolchain for the SuperH architecture,
 	  from Mentor Graphics. It uses gcc 4.5.2, binutils 2.20,
@@ -565,6 +582,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH2A_201103
 	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	# kernel headers: 2.6.38
 	help
 	  Sourcery CodeBench toolchain for the SuperH architecture,
 	  from Mentor Graphics. It uses gcc 4.5.2, binutils 2.20,
@@ -584,6 +602,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH2A_201009
 	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	# kernel headers: 2.6.35
 	help
 	  Sourcery CodeBench toolchain for the SuperH architecture,
 	  from Mentor Graphics. It uses gcc 4.5.1, binutils 2.20,
@@ -601,6 +620,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201209
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
 	help
 	  Sourcery CodeBench toolchain for the x86/x86_64
 	  architectures, from Mentor Graphics. It uses gcc 4.7.2,
@@ -626,6 +646,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201203
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 	help
 	  Sourcery CodeBench toolchain for the x86/x86_64
 	  architectures, from Mentor Graphics. It uses gcc 4.6.3,
@@ -652,6 +673,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201109
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 	help
 	  Sourcery CodeBench toolchain for the x86/x86_64
 	  architectures, from Mentor Graphics. It uses gcc 4.6.1,
@@ -681,6 +703,7 @@ config BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2013R1
 	select BR2_TOOLCHAIN_HAS_THREADS
 	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
 	help
 	  Toolchain for the Blackfin architecture, from
 	  http://blackfin.uclinux.org.
@@ -698,6 +721,7 @@ config BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R2
 	select BR2_TOOLCHAIN_HAS_THREADS
 	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
 	help
 	  Toolchain for the Blackfin architecture, from
 	  http://blackfin.uclinux.org.
@@ -715,6 +739,7 @@ config BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX_2012R1
 	select BR2_TOOLCHAIN_HAS_THREADS
 	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
 	help
 	  Toolchain for the Blackfin architecture, from
 	  http://blackfin.uclinux.org.
@@ -728,6 +753,7 @@ config BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEEL_14_3
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
 	help
 	  Toolchain for the Microblaze architecture, from
 	  http://git.xilinx.com/?p=microblaze-gnu.git;a=tree;f=binaries. It
@@ -741,6 +767,7 @@ config BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEEL_V2
 	depends on BR2_DEPRECATED_SINCE_2014_02
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	# kernel headers: 2.6.37
 	help
 	  Toolchain for the Microblaze architecture, from
 	  http://wiki.xilinx.com/mb-gnu-tools
@@ -754,6 +781,7 @@ config BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEBE_14_3
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
 	help
 	  Toolchain for the Microblaze architecture, from
 	  http://git.xilinx.com/?p=microblaze-gnu.git;a=tree;f=binaries. It
@@ -767,6 +795,7 @@ config BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEBE_V2
 	depends on BR2_DEPRECATED_SINCE_2014_02
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	# kernel headers: 2.6.37
 	help
 	  Toolchain for the Microblaze architecture, from
 	  http://wiki.xilinx.com/mb-gnu-tools
@@ -780,6 +809,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_11
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
 	help
 	  Toolchain for the AArch64 architecture, from
 	  http://www.linaro.org/engineering/armv8/
@@ -793,6 +823,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_10
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
 	help
 	  Toolchain for the AArch64 architecture, from
 	  http://www.linaro.org/engineering/armv8/
@@ -806,6 +837,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_13_09
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_HOSTARCH_NEEDS_IA32_LIBS
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
 	help
 	  Toolchain for the AArch64 architecture, from
 	  http://www.linaro.org/engineering/armv8/
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH v3 4/13 toolchain/external/custom: add choice to select 'AT_LEAST_XXX' header version

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Select the appropriate BR2_TOOLCHAIN_HEADERS_AT_LEAST_XXX options for the external, custom toolchain backend.

We try to be conservative here, and default to kernel headers 2.6.x.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Thomas De Schampheleire <[email protected]>

---
Changes v1 -> v2:
- add help entry (Thomas DS)

---
 toolchain/toolchain-external/Config.in | 79 ++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
toolchain/toolchain-external/Config.in +79 -0
index 5981ef2..7a94f5a 100644
@@ -945,6 +945,85 @@ config BR2_TOOLCHAIN_EXTERNAL_MUSL
 if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
 
 choice
+	bool "External toolchain kernel headers series"
+	depends on BR2_TOOLCHAIN_EXTERNAL_CUSTOM
+	default BR2_TOOLCHAIN_EXTERNAL_HEADERS_REALLY_OLD
+	help
+	  Set to the kernel headers version that were used to build
+	  this external toolchain.
+
+	  This is used to hide/show some packages that have strict
+	  requirements on the version of kernel headers.
+
+	  If unsure what version your toolchain is using, you can look
+	  at the value of LINUX_VERSION_CODE in linux/version.h in your
+	  toolchain. The Linux version is M.m.p, with:
+	    M = ( LINUX_VERSION_CODE >> 16 ) & 0xFF
+	    m = ( LINUX_VERSION_CODE >> 8  ) & 0xFF
+	    p = ( LINUX_VERSION_CODE >> 0  ) & 0xFF
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_13
+	bool "3.13.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_12
+	bool "3.12.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_11
+	bool "3.11.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10
+	bool "3.10.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_9
+	bool "3.9.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_8
+	bool "3.8.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_7
+	bool "3.7.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_6
+	bool "3.6.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_5
+	bool "3.5.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_4
+	bool "3.4.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_3
+	bool "3.3.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_2
+	bool "3.2.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_1
+	bool "3.1.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_0
+	bool "3.0.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
+
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_REALLY_OLD
+	bool "2.6.x"
+
+endchoice
+
+choice
 	prompt "External toolchain C library"
 	default BR2_TOOLCHAIN_EXTERNAL_CUSTOM_UCLIBC
 
Signature · 1 line
1.8.3.2
#5 lore raw

PATCH v3 5/13 package/linux-headers: select appropriate 'AT_LEAST_XXX' header version

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Select the appropriate BR2_TOOLCHAIN_HEADERS_AT_LEAST_XXX options for the internal toolchain backend.

For the manualy-specified version, we bring up the choice that sets the _AT_LEAST_XXX symbols.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Thomas De Schampheleire <[email protected]>
Cc Paul Cercueil <[email protected]>
---
 package/linux-headers/Config.in.host | 82 ++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)
package/linux-headers/Config.in.host +82 -0
index fcecd62..bd15fac 100644
@@ -17,42 +17,53 @@ choice
 	config BR2_KERNEL_HEADERS_3_0
 		bool "Linux 3.0.x kernel headers"
 		depends on !BR2_arc
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 
 	config BR2_KERNEL_HEADERS_3_2
 		bool "Linux 3.2.x kernel headers"
 		depends on !BR2_arc
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 
 	config BR2_KERNEL_HEADERS_3_4
 		bool "Linux 3.4.x kernel headers"
 		depends on !BR2_arc
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
 
 	config BR2_KERNEL_HEADERS_3_6
 		bool "Linux 3.6.x kernel headers"
 		depends on BR2_DEPRECATED_SINCE_2013_05 && !BR2_arc
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
 
 	config BR2_KERNEL_HEADERS_3_7
 		bool "Linux 3.7.x kernel headers"
 		depends on BR2_DEPRECATED_SINCE_2013_05 && !BR2_arc
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
 
 	config BR2_KERNEL_HEADERS_3_8
 		bool "Linux 3.8.x kernel headers"
 		depends on BR2_DEPRECATED_SINCE_2013_08 && !BR2_arc
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
 
 	config BR2_KERNEL_HEADERS_3_9
 		bool "Linux 3.9.x kernel headers"
 		depends on BR2_DEPRECATED_SINCE_2013_11
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
 
 	config BR2_KERNEL_HEADERS_3_10
 		bool "Linux 3.10.x kernel headers"
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
 
 	config BR2_KERNEL_HEADERS_3_11
 		bool "Linux 3.11.x kernel headers"
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
 
 	config BR2_KERNEL_HEADERS_3_12
 		bool "Linux 3.12.x kernel headers"
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
 
 	config BR2_KERNEL_HEADERS_3_13
 		bool "Linux 3.13.x kernel headers"
+		select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
 
 	config BR2_KERNEL_HEADERS_VERSION
 		bool "Manually specified Linux version"
@@ -65,6 +76,77 @@ config BR2_DEFAULT_KERNEL_VERSION
 	  Specify the version you want to use.
 	  E.G.: 3.6.10
 
+choice
+	bool "Custom kernel headers series"
+	depends on BR2_KERNEL_HEADERS_VERSION
+	default BR2_PACKAGE_HOST_LINUX_HEADERS_REALLY_OLD
+	help
+	  Set to the kernel headers series you manually set above.
+
+	  This is used to hide/show some packages that have strict
+	  requirements on the version of kernel headers.
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_13
+	bool "3.13.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_12
+	bool "3.12.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_11
+	bool "3.11.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_10
+	bool "3.10.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_9
+	bool "3.9.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_8
+	bool "3.8.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_7
+	bool "3.7.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_6
+	bool "3.6.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_5
+	bool "3.5.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_4
+	bool "3.4.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_3
+	bool "3.3.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_2
+	bool "3.2.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_1
+	bool "3.1.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_3_0
+	bool "3.0.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
+
+config BR2_PACKAGE_HOST_LINUX_HEADERS_REALLY_OLD
+	bool "2.6.x"
+
+endchoice
+
 config BR2_DEFAULT_KERNEL_HEADERS
 	string
 	default "3.0.101"	if BR2_KERNEL_HEADERS_3_0
Signature · 1 line
1.8.3.2
#6 lore raw

PATCH v3 6/13 toolchain/external: check kernel headers version for custom toolchain

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Ensure the kernel headers version used in the custom external toolchain, or the manually-specified kernel headers version, matches exactly the one selected by the user.

We do not care about the patch-level, since headers are not supposed to change between patchlevels. This applies only to kernels >= 3.0, but those are actually the ones we do care about; we treat all 2.6.x kernels as being a single version, since we do not support any 2.6 kernels for packages with kernel-dependant features.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Thomas De Schampheleire <[email protected]>
---
 support/scripts/check-kernel-headers.sh            | 21 +++++++++++++++++++++
 toolchain/helpers.mk                               | 13 +++++++++++++
 toolchain/toolchain-common.in                      | 20 ++++++++++++++++++++
 toolchain/toolchain-external/toolchain-external.mk |  7 ++++++-
 4 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100755 support/scripts/check-kernel-headers.sh
support/scripts/check-kernel-headers.sh new file +21 -0
new file mode 100755
index 0000000..d7fe7d4
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+CC="${1}"
+# Make sure we have enough version components
+HDR_VER="${2}.0.0"
+
+HDR_M="${HDR_VER%%.*}"
+HDR_V="${HDR_VER#*.}"
+HDR_m="${HDR_V%%.*}"
+
+# We do not want to account for the patch-level, since headers are
+# not supposed to change for different patchlevels, so we mask it out.
+# This only applies to kernels >= 3.0, but those are the only one
+# we actually care about; we treat all 2.6.x kernels equally.
+
+exec ${CC} -E -x c -o - - >/dev/null 2>&1 <<_EOF_
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE & ~0xFF) != KERNEL_VERSION(${HDR_M},${HDR_m},0)
+#error Incorrect kernel header version.
+#endif
+_EOF_
toolchain/helpers.mk +13 -0
index 892ab4b..64d5095 100644
@@ -163,6 +163,19 @@ copy_toolchain_sysroot = \
 	find $(STAGING_DIR) -type d | xargs chmod 755
 
 #
+# Check the specified kernel headers version actually matches the
+# version in the toolchain.
+#
+# $1: cross-gcc path
+# $2: kernel version string, in the form: X.Y
+#
+check_kernel_headers_version = \
+	if ! support/scripts/check-kernel-headers.sh $(1) $(2); then \
+		echo "Incorrect selection of kernel headers"; \
+	    exit 1; \
+	fi
+
+#
 # Check the availability of a particular glibc feature. This function
 # is used to check toolchain options that are always supported by
 # glibc, so we simply check that the corresponding option is properly
toolchain/toolchain-common.in +20 -0
index 01bb39f..8927bf7 100644
@@ -169,3 +169,23 @@ config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
 	bool
 	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
+
+# This order guarantees that the highest version is set, as kconfig
+# stops affecting a value on the first matching default.
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST
+	string
+	default "3.13" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
+	default "3.12" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
+	default "3.11" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
+	default "3.10" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
+	default "3.9"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
+	default "3.8"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
+	default "3.7"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
+	default "3.6"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
+	default "3.5"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
+	default "3.4"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
+	default "3.3"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
+	default "3.2"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
+	default "3.1"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
+	default "3.0"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
+	default "2.6"
toolchain/toolchain-external/toolchain-external.mk +6 -1
index 51da480..378e7b2 100644
@@ -412,7 +412,7 @@ endef
 # Checks for an already installed toolchain: check the toolchain
 # location, check that it supports sysroot, and then verify that it
 # matches the configuration provided in Buildroot: ABI, C++ support,
-# type of C library and all C library features.
+# kernel headers version, type of C library and all C library features.
 define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS
 	$(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC))
 	$(Q)$(call check_unusable_toolchain,$(TOOLCHAIN_EXTERNAL_CC))
@@ -421,6 +421,11 @@ define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS
 		@echo "External toolchain doesn't support --sysroot. Cannot use." ; \
 		exit 1 ; \
 	fi ; \
+	if [ "$(BR2_TOOLCHAIN_EXTERNAL_CUSTOM)" = "y" ]; then \
+		$(call check_kernel_headers_version,\
+			"$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS)",\
+			$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST))); \
+	fi ; \
 	if test "$(BR2_arm)" = "y" ; then \
 		$(call check_arm_abi,\
 			"$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS)",\
Signature · 1 line
1.8.3.2
#7 lore raw

PATCH v3 7/13 toolchain/internal: check kernel headers version for manually-specified version

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Ensure the kernel headers version matches exactly the one manually specified by the user.

Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
Cc Thomas De Schampheleire <[email protected]>
---
 package/linux-headers/linux-headers.mk | 9 +++++++++
 1 file changed, 9 insertions(+)
package/linux-headers/linux-headers.mk +9 -0
index 49fd9ca..2361e40 100644
@@ -37,4 +37,13 @@ define LINUX_HEADERS_INSTALL_STAGING_CMDS
 			headers_install)
 endef
 
+ifeq ($(BR2_KERNEL_HEADERS_VERSION),y)
+define LINUX_HEADERS_CHECK_VERSION
+	$(call check_kernel_headers_version,\
+		"$(TARGET_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS)",\
+		$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)))
+endef
+LINUX_HEADERS_POST_INSTALL_STAGING_HOOKS += LINUX_HEADERS_CHECK_VERSION
+endif
+
 $(eval $(generic-package))
Signature · 1 line
1.8.3.2
#8 lore raw

PATCH v3 8/13 manual: document minimal kernel headers dependency

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

---
Changes v1 -> v2:
- fix typo (Samuel)
- fix asciidoc syntax (Thomas DS)

---
 docs/manual/adding-packages-directory.txt | 6 ++++++
 1 file changed, 6 insertions(+)
docs/manual/adding-packages-directory.txt +6 -0
index 6145f54..e56e59a 100644
@@ -218,6 +218,12 @@ use in the comment.
 ** Dependency symbol: +BR2_USE_MMU+
 ** Comment string: no comment to be added
 
+* Kernel headers
+** Dependency symbol: +BR2_TOOLCHAIN_HEADERS_AT_LEAST_X_Y+, (replace
+   +X_Y+ with the proper version, see +toolchain/toolchain-common.in+)
+** Comment string: +headers >= X.Y+ (replace +X.Y+ with the
+   proper version)
+
 * C library
 ** Dependency symbol: +BR2_TOOLCHAIN_USES_GLIBC+,
 +BR2_TOOLCHAIN_USES_UCLIBC+
Signature · 1 line
1.8.3.2
#9 lore raw

PATCH v3 9/13 package/dvb-apps: requires kernel headers >= 3.3

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

dvb-apps requires linux kernel headers >= 3.3, for:
SYS_TURBO, SYS_DVBC_ANNEX_A : introduced in 3.2
SYS_DVBC_ANNEX_C, DTV_ENUM_DELSYS: introduced in 3.3

Fixes:

    http://autobuild.buildroot.net/results/a77/a7786dffa28e5472fbc9c8fe4ab302c84d7a3cb9
---
 package/dvb-apps/Config.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/dvb-apps/Config.in +3 -2
index ba3ce45..ea0a12f 100644
@@ -8,13 +8,14 @@ config BR2_PACKAGE_DVB_APPS
 
 if BR2_PACKAGE_DVB_APPS
 
-comment "dvb-apps utils needs a toolchain w/ largefile, threads"
-	depends on !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS
+comment "dvb-apps utils needs a toolchain w/ largefile, threads, headers >= 3.3"
+	depends on !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
 
 config BR2_PACKAGE_DVB_APPS_UTILS
 	bool "dvb-apps utilities"
 	depends on BR2_LARGEFILE
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
 	help
 	  A small number of DVB test and utility programs,
Signature · 1 line
1.8.3.2
#10 lore raw

PATCH v3 10/13 package/w_scan: requires kernel headers >= 3.0

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

It needs DVB API version 5.3 or later, introduced in linux 3.0.

Fixes:

    http://autobuild.buildroot.net/results/6e7/6e7c691099a8f3eef4fc84860ceb1a94f25873eb
---
 package/w_scan/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
package/w_scan/Config.in +4 -0
index 4487b0a..02cb2c3 100644
@@ -1,5 +1,9 @@
+comment "w_scan needs a toolchain w/ headers >= 3.0"
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
+
 config BR2_PACKAGE_W_SCAN
 	bool "w_scan"
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
 	help
 	  w_scan is a small command line utility used to perform frequency
Signature · 1 line
1.8.3.2
#11 lore raw

PATCH v3 11/13 package/weston: requires kernel headers >= 3.0

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

It needs K_OFF, introduced in 2.6.39.

Since we do not have dependencies on kernel headers before 3.0, just depend on kernel headers 3.0.

Fixes:

    http://autobuild.buildroot.net/results/aa5/aa54b1aaf0ac89531d7a1e7dd3900b35605ae3f5
---
 package/weston/Config.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/weston/Config.in +3 -2
index 36bbb01..aaef405 100644
@@ -1,6 +1,6 @@
-comment "weston needs udev and a toolchain w/ threads"
+comment "weston needs udev and a toolchain w/ threads, headers >= 3.0"
 	depends on !BR2_avr32
-	depends on !BR2_PACKAGE_HAS_UDEV || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_PACKAGE_HAS_UDEV || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 
 config BR2_PACKAGE_WESTON
 	bool "weston"
@@ -14,6 +14,7 @@ config BR2_PACKAGE_WESTON
 	depends on BR2_PACKAGE_HAS_UDEV
 	depends on !BR2_avr32 # wayland
 	depends on BR2_TOOLCHAIN_HAS_THREADS # wayland
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 	# Runtime dependency
 	select BR2_PACKAGE_XKEYBOARD_CONFIG
 	# Make sure at least one compositor is selected.
Signature · 1 line
1.8.3.2
#12 lore raw

PATCH v3 12/13 package/tvheadend: requires kernel headers >= 3.2

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

tvheadend requires SYS_TURBO, introduced in linux 3.2.

Fixes:

    http://autobuild.buildroot.net/results/4df/4df8cd85e0287910567df81c0394b2914570e98a
---
 package/tvheadend/Config.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/tvheadend/Config.in +3 -2
index 74df825..a5bbeee 100644
@@ -1,10 +1,11 @@
-comment "tvheadend needs a toolchain w/ largefile, IPv6, NPTL"
-	depends on !BR2_LARGEFILE || !BR2_INET_IPV6 || !BR2_TOOLCHAIN_HAS_THREADS_NPTL
+comment "tvheadend needs a toolchain w/ largefile, IPv6, NPTL, headers >= 3.2"
+	depends on !BR2_LARGEFILE || !BR2_INET_IPV6 || !BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 
 config BR2_PACKAGE_TVHEADEND
 	bool "tvheadend"
 	depends on BR2_LARGEFILE && BR2_INET_IPV6
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 	# tvheadend requires an atomic_add operation. Either you have
 	# a gcc >= 4.3 toolchain and it uses the gcc intrinsics, or it
 	# has special code for x86, x86-64, PPC and ARM. So in the
Signature · 1 line
1.8.3.2
#13 lore raw

PATCH v3 13/13 package/mmc-utils: requires kernel headers >= 3.0

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

mmc-utils needs the mmc ioctls, introduced in linux 3.0.

Fixes:

    http://autobuild.buildroot.net/results/0c1/0c15e2b193418c6f0edbc98a6ea3957bdf71a98b
---
 package/mmc-utils/Config.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/mmc-utils/Config.in +3 -2
index 07650c8..d321800 100644
@@ -1,10 +1,11 @@
 config BR2_PACKAGE_MMC_UTILS
 	bool "mmc-utils"
 	depends on BR2_LARGEFILE
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 	help
 	  MMC utils
 
 	  https://git.kernel.org/cgit/linux/kernel/git/cjb/mmc-utils.git
 
-comment "mmc-utils needs a toolchain w/ largefile"
-	depends on !BR2_LARGEFILE
+comment "mmc-utils needs a toolchain w/ largefile, headers >= 3.0"
+	depends on !BR2_LARGEFILE || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
Signature · 1 line
1.8.3.2
#14 lore raw

v3 cover Add dependency on kernel headers

In reply to Yann E. MORIN

Dear Yann E. MORIN,

Quoted 2 lines · Yann E. MORIN

This series introduces infrastructure for packages to depend on the required version of kernel headers.

Series committed, thanks!

Thomas

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