2013-06-30 21:28:58 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# linux-headers
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# This package is used to provide Linux kernel headers for the
|
|
|
|
# internal toolchain backend.
|
|
|
|
|
package/linux-headers: add option to use same sources as the kernel
Some heavily (and most often improperly) modified Linux kernels may export
new APIs to userland, so as to speak to custom hardware or custom kernel
facilities.
However, we currently have no easy way to use such kernels as a source
for the linux-headers package, which precludes having those userland
headers intalled for userland applications to use them.
We do have a way for the kernel to use the same version as for the
headers, but that is definitely not enough, as the linux-headers package
has a version choice that is far less versatile and capable than that of
the linux package.
Add a new option for the linux-headers package, for the user to specify
that the version (really, the sources) of the kernel be used to install
the headers from.
We do that by making linux-headers patch-depend on the linux package.
We can't have linux-header simply depend on linux, because the simple
dependency means the the dependee will be configured, built and installed
before the dependent is configured. And since linux is a target package,
it depends on the toolchain, which internally dependes on linux-headers,
which would depend on linux, and we'd get a circular dependency.
Using patch-depend will ensure that linux is extracted and patched
before linux-headers is extracted, which is really all we need.
Then, we install the headers from the linux source tree, rather than
from linux-headers' source tree (as there's nothing in there!).
Since we need to install a private set for uClibc (see cde947f, uclibc:
prevent rebuilding after installation to staging), we explicitly set
INSTALL_HDR_PATH when calling the kernel' install-headers rule in
LINUX_HEADERS_CONFIGURE_CMDS, so that the headers are installed in
linux-headers' $(@D) instead of linux' $(@D).
Finally, as there is no way to know the kernel version in this case, we
must still prompt the user for the kernel series the headers are from
(like we do for a custom version) and check for consistency at build
time.
Note however that this still leaves users that want to built their
such-kernel outside of Buildroot out in the cold.
[Peter: drop comment as suggested by Thomas]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Karoly Kasza <kaszak@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-01-20 19:34:28 +01:00
|
|
|
ifeq ($(BR2_KERNEL_HEADERS_AS_KERNEL),y)
|
|
|
|
|
linux-headers: fix circular dependency when HEADERS_AS_KERNEL is used
The linux-headers -> linux dependency causes a circular dependency, breaking
the source/legal-info/graph-depends/.. targets:
make graph-depends
Getting targets
Getting dependencies for ['toolchain-buildroot', 'toolchain', 'busybox',
'glibc', 'initscripts', 'linux-headers', 'skeleton', 'linux',
'host-fakeroot', 'host-makedevs', 'rootfs-cpio', 'rootfs-initramfs']
Getting dependencies for ['host-kmod', 'host-gcc-final',
'host-gcc-initial', 'host-gawk']
Getting dependencies for ['host-gmp', 'host-binutils', 'host-pkgconf',
'host-mpfr', 'host-mpc']
Getting dependencies for ['host-m4']
Recursion detected for : toolchain
which is a dependency of: linux
which is a dependency of: linux-headers
which is a dependency of: glibc
which is a dependency of: host-gcc-final
which is a dependency of: toolchain-buildroot
which is a dependency of: toolchain
Makefile:721: recipe for target 'graph-depends' failed
make: *** [graph-depends] Error 1
Fix it by instead duplicating in linux-headers the 10-20 lines of linux.mk
logic that infer the _SOURCE/_SITE/_VERSION from the BR2_LINUX_KERNEL_*
variables.
This does mean that we extract the kernel sources twice though.
[Peter: use same git/hg tarball as linux kernel to not clone twice, minor fixes]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-02-24 15:04:09 +01:00
|
|
|
LINUX_HEADERS_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
|
|
|
|
|
|
|
|
# Compute LINUX_HEADERS_SOURCE and LINUX_HEADERS_SITE from the configuration
|
|
|
|
ifeq ($(BR2_LINUX_KERNEL_CUSTOM_TARBALL),y)
|
|
|
|
LINUX_HEADERS_TARBALL = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION))
|
|
|
|
LINUX_HEADERS_SITE = $(patsubst %/,%,$(dir $(LINUX_HEADERS_TARBALL)))
|
|
|
|
LINUX_HEADERS_SOURCE = $(notdir $(LINUX_HEADERS_TARBALL))
|
|
|
|
BR_NO_CHECK_HASH_FOR += $(LINUX_HEADERS_SOURCE)
|
|
|
|
else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_LOCAL),y)
|
|
|
|
LINUX_HEADERS_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOCAL_PATH))
|
|
|
|
LINUX_HEADERS_SITE_METHOD = local
|
|
|
|
else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
|
|
|
|
LINUX_HEADERS_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
|
|
|
|
LINUX_HEADERS_SITE_METHOD = git
|
|
|
|
# use same git tarball as linux kernel
|
|
|
|
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.gz
|
|
|
|
else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_HG),y)
|
|
|
|
LINUX_HEADERS_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
|
|
|
|
LINUX_HEADERS_SITE_METHOD = hg
|
|
|
|
# use same hg tarball as linux kernel
|
|
|
|
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.gz
|
|
|
|
else
|
|
|
|
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.xz
|
|
|
|
ifeq ($(BR2_LINUX_KERNEL_CUSTOM_VERSION),y)
|
|
|
|
BR_NO_CHECK_HASH_FOR += $(LINUX_HEADERS_SOURCE)
|
|
|
|
endif
|
|
|
|
# In X.Y.Z, get X and Y. We replace dots and dashes by spaces in order
|
|
|
|
# to use the $(word) function. We support versions such as 4.0, 3.1,
|
|
|
|
# 2.6.32, 2.6.32-rc1, 3.0-rc6, etc.
|
|
|
|
ifeq ($(findstring x2.6.,x$(LINUX_HEADERS_VERSION)),x2.6.)
|
|
|
|
LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v2.6
|
|
|
|
else ifeq ($(findstring x3.,x$(LINUX_HEADERS_VERSION)),x3.)
|
|
|
|
LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v3.x
|
|
|
|
else ifeq ($(findstring x4.,x$(LINUX_HEADERS_VERSION)),x4.)
|
|
|
|
LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v4.x
|
|
|
|
endif
|
|
|
|
# release candidates are in testing/ subdir
|
|
|
|
ifneq ($(findstring -rc,$(LINUX_HEADERS_VERSION)),)
|
|
|
|
LINUX_HEADERS_SITE := $(LINUX_HEADERS_SITE)/testing
|
|
|
|
endif # -rc
|
|
|
|
endif
|
package/linux-headers: add option to use same sources as the kernel
Some heavily (and most often improperly) modified Linux kernels may export
new APIs to userland, so as to speak to custom hardware or custom kernel
facilities.
However, we currently have no easy way to use such kernels as a source
for the linux-headers package, which precludes having those userland
headers intalled for userland applications to use them.
We do have a way for the kernel to use the same version as for the
headers, but that is definitely not enough, as the linux-headers package
has a version choice that is far less versatile and capable than that of
the linux package.
Add a new option for the linux-headers package, for the user to specify
that the version (really, the sources) of the kernel be used to install
the headers from.
We do that by making linux-headers patch-depend on the linux package.
We can't have linux-header simply depend on linux, because the simple
dependency means the the dependee will be configured, built and installed
before the dependent is configured. And since linux is a target package,
it depends on the toolchain, which internally dependes on linux-headers,
which would depend on linux, and we'd get a circular dependency.
Using patch-depend will ensure that linux is extracted and patched
before linux-headers is extracted, which is really all we need.
Then, we install the headers from the linux source tree, rather than
from linux-headers' source tree (as there's nothing in there!).
Since we need to install a private set for uClibc (see cde947f, uclibc:
prevent rebuilding after installation to staging), we explicitly set
INSTALL_HDR_PATH when calling the kernel' install-headers rule in
LINUX_HEADERS_CONFIGURE_CMDS, so that the headers are installed in
linux-headers' $(@D) instead of linux' $(@D).
Finally, as there is no way to know the kernel version in this case, we
must still prompt the user for the kernel series the headers are from
(like we do for a custom version) and check for consistency at build
time.
Note however that this still leaves users that want to built their
such-kernel outside of Buildroot out in the cold.
[Peter: drop comment as suggested by Thomas]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Karoly Kasza <kaszak@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-01-20 19:34:28 +01:00
|
|
|
|
linux-headers: fix circular dependency when HEADERS_AS_KERNEL is used
The linux-headers -> linux dependency causes a circular dependency, breaking
the source/legal-info/graph-depends/.. targets:
make graph-depends
Getting targets
Getting dependencies for ['toolchain-buildroot', 'toolchain', 'busybox',
'glibc', 'initscripts', 'linux-headers', 'skeleton', 'linux',
'host-fakeroot', 'host-makedevs', 'rootfs-cpio', 'rootfs-initramfs']
Getting dependencies for ['host-kmod', 'host-gcc-final',
'host-gcc-initial', 'host-gawk']
Getting dependencies for ['host-gmp', 'host-binutils', 'host-pkgconf',
'host-mpfr', 'host-mpc']
Getting dependencies for ['host-m4']
Recursion detected for : toolchain
which is a dependency of: linux
which is a dependency of: linux-headers
which is a dependency of: glibc
which is a dependency of: host-gcc-final
which is a dependency of: toolchain-buildroot
which is a dependency of: toolchain
Makefile:721: recipe for target 'graph-depends' failed
make: *** [graph-depends] Error 1
Fix it by instead duplicating in linux-headers the 10-20 lines of linux.mk
logic that infer the _SOURCE/_SITE/_VERSION from the BR2_LINUX_KERNEL_*
variables.
This does mean that we extract the kernel sources twice though.
[Peter: use same git/hg tarball as linux kernel to not clone twice, minor fixes]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-02-24 15:04:09 +01:00
|
|
|
LINUX_HEADERS_PATCHES = $(call qstrip,$(BR2_LINUX_KERNEL_PATCH))
|
|
|
|
|
|
|
|
# We rely on the generic package infrastructure to download and apply
|
|
|
|
# remote patches (downloaded from ftp, http or https). For local
|
|
|
|
# patches, we can't rely on that infrastructure, because there might
|
|
|
|
# be directories in the patch list (unlike for other packages).
|
|
|
|
LINUX_HEADERS_PATCH = $(filter ftp://% http://% https://%,$(LINUX_HEADERS_PATCHES))
|
|
|
|
|
|
|
|
define LINUX_HEADERS_APPLY_LOCAL_PATCHES
|
|
|
|
for p in $(filter-out ftp://% http://% https://%,$(LINUX_HEADERS_PATCHES)) ; do \
|
|
|
|
if test -d $$p ; then \
|
|
|
|
$(APPLY_PATCHES) $(@D) $$p \*.patch || exit 1 ; \
|
|
|
|
else \
|
|
|
|
$(APPLY_PATCHES) $(@D) `dirname $$p` `basename $$p` || exit 1; \
|
|
|
|
fi \
|
|
|
|
done
|
|
|
|
endef
|
package/linux-headers: add option to use same sources as the kernel
Some heavily (and most often improperly) modified Linux kernels may export
new APIs to userland, so as to speak to custom hardware or custom kernel
facilities.
However, we currently have no easy way to use such kernels as a source
for the linux-headers package, which precludes having those userland
headers intalled for userland applications to use them.
We do have a way for the kernel to use the same version as for the
headers, but that is definitely not enough, as the linux-headers package
has a version choice that is far less versatile and capable than that of
the linux package.
Add a new option for the linux-headers package, for the user to specify
that the version (really, the sources) of the kernel be used to install
the headers from.
We do that by making linux-headers patch-depend on the linux package.
We can't have linux-header simply depend on linux, because the simple
dependency means the the dependee will be configured, built and installed
before the dependent is configured. And since linux is a target package,
it depends on the toolchain, which internally dependes on linux-headers,
which would depend on linux, and we'd get a circular dependency.
Using patch-depend will ensure that linux is extracted and patched
before linux-headers is extracted, which is really all we need.
Then, we install the headers from the linux source tree, rather than
from linux-headers' source tree (as there's nothing in there!).
Since we need to install a private set for uClibc (see cde947f, uclibc:
prevent rebuilding after installation to staging), we explicitly set
INSTALL_HDR_PATH when calling the kernel' install-headers rule in
LINUX_HEADERS_CONFIGURE_CMDS, so that the headers are installed in
linux-headers' $(@D) instead of linux' $(@D).
Finally, as there is no way to know the kernel version in this case, we
must still prompt the user for the kernel series the headers are from
(like we do for a custom version) and check for consistency at build
time.
Note however that this still leaves users that want to built their
such-kernel outside of Buildroot out in the cold.
[Peter: drop comment as suggested by Thomas]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Karoly Kasza <kaszak@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-01-20 19:34:28 +01:00
|
|
|
|
linux-headers: fix circular dependency when HEADERS_AS_KERNEL is used
The linux-headers -> linux dependency causes a circular dependency, breaking
the source/legal-info/graph-depends/.. targets:
make graph-depends
Getting targets
Getting dependencies for ['toolchain-buildroot', 'toolchain', 'busybox',
'glibc', 'initscripts', 'linux-headers', 'skeleton', 'linux',
'host-fakeroot', 'host-makedevs', 'rootfs-cpio', 'rootfs-initramfs']
Getting dependencies for ['host-kmod', 'host-gcc-final',
'host-gcc-initial', 'host-gawk']
Getting dependencies for ['host-gmp', 'host-binutils', 'host-pkgconf',
'host-mpfr', 'host-mpc']
Getting dependencies for ['host-m4']
Recursion detected for : toolchain
which is a dependency of: linux
which is a dependency of: linux-headers
which is a dependency of: glibc
which is a dependency of: host-gcc-final
which is a dependency of: toolchain-buildroot
which is a dependency of: toolchain
Makefile:721: recipe for target 'graph-depends' failed
make: *** [graph-depends] Error 1
Fix it by instead duplicating in linux-headers the 10-20 lines of linux.mk
logic that infer the _SOURCE/_SITE/_VERSION from the BR2_LINUX_KERNEL_*
variables.
This does mean that we extract the kernel sources twice though.
[Peter: use same git/hg tarball as linux kernel to not clone twice, minor fixes]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-02-24 15:04:09 +01:00
|
|
|
LINUX_HEADERS_POST_PATCH_HOOKS += LINUX_HEADERS_APPLY_LOCAL_PATCHES
|
package/linux-headers: add option to use same sources as the kernel
Some heavily (and most often improperly) modified Linux kernels may export
new APIs to userland, so as to speak to custom hardware or custom kernel
facilities.
However, we currently have no easy way to use such kernels as a source
for the linux-headers package, which precludes having those userland
headers intalled for userland applications to use them.
We do have a way for the kernel to use the same version as for the
headers, but that is definitely not enough, as the linux-headers package
has a version choice that is far less versatile and capable than that of
the linux package.
Add a new option for the linux-headers package, for the user to specify
that the version (really, the sources) of the kernel be used to install
the headers from.
We do that by making linux-headers patch-depend on the linux package.
We can't have linux-header simply depend on linux, because the simple
dependency means the the dependee will be configured, built and installed
before the dependent is configured. And since linux is a target package,
it depends on the toolchain, which internally dependes on linux-headers,
which would depend on linux, and we'd get a circular dependency.
Using patch-depend will ensure that linux is extracted and patched
before linux-headers is extracted, which is really all we need.
Then, we install the headers from the linux source tree, rather than
from linux-headers' source tree (as there's nothing in there!).
Since we need to install a private set for uClibc (see cde947f, uclibc:
prevent rebuilding after installation to staging), we explicitly set
INSTALL_HDR_PATH when calling the kernel' install-headers rule in
LINUX_HEADERS_CONFIGURE_CMDS, so that the headers are installed in
linux-headers' $(@D) instead of linux' $(@D).
Finally, as there is no way to know the kernel version in this case, we
must still prompt the user for the kernel series the headers are from
(like we do for a custom version) and check for consistency at build
time.
Note however that this still leaves users that want to built their
such-kernel outside of Buildroot out in the cold.
[Peter: drop comment as suggested by Thomas]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Karoly Kasza <kaszak@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-01-20 19:34:28 +01:00
|
|
|
|
|
|
|
else # ! BR2_KERNEL_HEADERS_AS_KERNEL
|
|
|
|
|
2013-06-30 21:28:58 +02:00
|
|
|
LINUX_HEADERS_VERSION = $(call qstrip,$(BR2_DEFAULT_KERNEL_HEADERS))
|
|
|
|
ifeq ($(findstring x2.6.,x$(LINUX_HEADERS_VERSION)),x2.6.)
|
2014-07-31 10:46:58 +02:00
|
|
|
LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v2.6
|
2015-04-10 21:57:54 +02:00
|
|
|
else ifeq ($(findstring x3.,x$(LINUX_HEADERS_VERSION)),x3.)
|
2014-07-31 10:46:58 +02:00
|
|
|
LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v3.x
|
2015-04-10 21:57:54 +02:00
|
|
|
else ifeq ($(findstring x4.,x$(LINUX_HEADERS_VERSION)),x4.)
|
|
|
|
LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v4.x
|
2013-06-30 21:28:58 +02:00
|
|
|
endif
|
2013-07-04 12:50:38 +02:00
|
|
|
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.xz
|
package/linux-headers: add option to use same sources as the kernel
Some heavily (and most often improperly) modified Linux kernels may export
new APIs to userland, so as to speak to custom hardware or custom kernel
facilities.
However, we currently have no easy way to use such kernels as a source
for the linux-headers package, which precludes having those userland
headers intalled for userland applications to use them.
We do have a way for the kernel to use the same version as for the
headers, but that is definitely not enough, as the linux-headers package
has a version choice that is far less versatile and capable than that of
the linux package.
Add a new option for the linux-headers package, for the user to specify
that the version (really, the sources) of the kernel be used to install
the headers from.
We do that by making linux-headers patch-depend on the linux package.
We can't have linux-header simply depend on linux, because the simple
dependency means the the dependee will be configured, built and installed
before the dependent is configured. And since linux is a target package,
it depends on the toolchain, which internally dependes on linux-headers,
which would depend on linux, and we'd get a circular dependency.
Using patch-depend will ensure that linux is extracted and patched
before linux-headers is extracted, which is really all we need.
Then, we install the headers from the linux source tree, rather than
from linux-headers' source tree (as there's nothing in there!).
Since we need to install a private set for uClibc (see cde947f, uclibc:
prevent rebuilding after installation to staging), we explicitly set
INSTALL_HDR_PATH when calling the kernel' install-headers rule in
LINUX_HEADERS_CONFIGURE_CMDS, so that the headers are installed in
linux-headers' $(@D) instead of linux' $(@D).
Finally, as there is no way to know the kernel version in this case, we
must still prompt the user for the kernel series the headers are from
(like we do for a custom version) and check for consistency at build
time.
Note however that this still leaves users that want to built their
such-kernel outside of Buildroot out in the cold.
[Peter: drop comment as suggested by Thomas]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Karoly Kasza <kaszak@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-01-20 19:34:28 +01:00
|
|
|
|
linux-headers: fix circular dependency when HEADERS_AS_KERNEL is used
The linux-headers -> linux dependency causes a circular dependency, breaking
the source/legal-info/graph-depends/.. targets:
make graph-depends
Getting targets
Getting dependencies for ['toolchain-buildroot', 'toolchain', 'busybox',
'glibc', 'initscripts', 'linux-headers', 'skeleton', 'linux',
'host-fakeroot', 'host-makedevs', 'rootfs-cpio', 'rootfs-initramfs']
Getting dependencies for ['host-kmod', 'host-gcc-final',
'host-gcc-initial', 'host-gawk']
Getting dependencies for ['host-gmp', 'host-binutils', 'host-pkgconf',
'host-mpfr', 'host-mpc']
Getting dependencies for ['host-m4']
Recursion detected for : toolchain
which is a dependency of: linux
which is a dependency of: linux-headers
which is a dependency of: glibc
which is a dependency of: host-gcc-final
which is a dependency of: toolchain-buildroot
which is a dependency of: toolchain
Makefile:721: recipe for target 'graph-depends' failed
make: *** [graph-depends] Error 1
Fix it by instead duplicating in linux-headers the 10-20 lines of linux.mk
logic that infer the _SOURCE/_SITE/_VERSION from the BR2_LINUX_KERNEL_*
variables.
This does mean that we extract the kernel sources twice though.
[Peter: use same git/hg tarball as linux kernel to not clone twice, minor fixes]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-02-24 15:04:09 +01:00
|
|
|
endif # ! BR2_KERNEL_HEADERS_AS_KERNEL
|
|
|
|
|
2015-11-16 23:46:58 +01:00
|
|
|
LINUX_HEADERS_LICENSE = GPLv2
|
|
|
|
LINUX_HEADERS_LICENSE_FILES = COPYING
|
2013-06-30 21:28:58 +02:00
|
|
|
|
|
|
|
LINUX_HEADERS_INSTALL_STAGING = YES
|
|
|
|
|
2014-02-14 10:55:04 +01:00
|
|
|
# linux-headers is part of the toolchain so disable the toolchain dependency
|
|
|
|
LINUX_HEADERS_ADD_TOOLCHAIN_DEPENDENCY = NO
|
|
|
|
|
2014-02-23 15:35:18 +01:00
|
|
|
# For some architectures (eg. Arc, Cris, Hexagon, ia64, parisc,
|
|
|
|
# score and xtensa), the Linux buildsystem tries to call the
|
|
|
|
# cross-compiler, although it is not needed at all.
|
|
|
|
# This results in seemingly errors like:
|
|
|
|
# [...]/scripts/gcc-version.sh: line 26: arc-linux-uclibc-gcc: command not found
|
|
|
|
# Those can be safely ignored.
|
2014-06-04 22:27:33 +02:00
|
|
|
|
|
|
|
# This step is required to have a separate linux headers location for
|
|
|
|
# uClibc building. This way uClibc doesn't modify linux headers on installation
|
|
|
|
# of "its" headers
|
|
|
|
define LINUX_HEADERS_CONFIGURE_CMDS
|
linux-headers: fix circular dependency when HEADERS_AS_KERNEL is used
The linux-headers -> linux dependency causes a circular dependency, breaking
the source/legal-info/graph-depends/.. targets:
make graph-depends
Getting targets
Getting dependencies for ['toolchain-buildroot', 'toolchain', 'busybox',
'glibc', 'initscripts', 'linux-headers', 'skeleton', 'linux',
'host-fakeroot', 'host-makedevs', 'rootfs-cpio', 'rootfs-initramfs']
Getting dependencies for ['host-kmod', 'host-gcc-final',
'host-gcc-initial', 'host-gawk']
Getting dependencies for ['host-gmp', 'host-binutils', 'host-pkgconf',
'host-mpfr', 'host-mpc']
Getting dependencies for ['host-m4']
Recursion detected for : toolchain
which is a dependency of: linux
which is a dependency of: linux-headers
which is a dependency of: glibc
which is a dependency of: host-gcc-final
which is a dependency of: toolchain-buildroot
which is a dependency of: toolchain
Makefile:721: recipe for target 'graph-depends' failed
make: *** [graph-depends] Error 1
Fix it by instead duplicating in linux-headers the 10-20 lines of linux.mk
logic that infer the _SOURCE/_SITE/_VERSION from the BR2_LINUX_KERNEL_*
variables.
This does mean that we extract the kernel sources twice though.
[Peter: use same git/hg tarball as linux kernel to not clone twice, minor fixes]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-02-24 15:04:09 +01:00
|
|
|
(cd $(@D); \
|
2014-06-04 22:27:33 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) \
|
|
|
|
ARCH=$(KERNEL_ARCH) \
|
|
|
|
HOSTCC="$(HOSTCC)" \
|
|
|
|
HOSTCFLAGS="$(HOSTCFLAGS)" \
|
|
|
|
HOSTCXX="$(HOSTCXX)" \
|
package/linux-headers: add option to use same sources as the kernel
Some heavily (and most often improperly) modified Linux kernels may export
new APIs to userland, so as to speak to custom hardware or custom kernel
facilities.
However, we currently have no easy way to use such kernels as a source
for the linux-headers package, which precludes having those userland
headers intalled for userland applications to use them.
We do have a way for the kernel to use the same version as for the
headers, but that is definitely not enough, as the linux-headers package
has a version choice that is far less versatile and capable than that of
the linux package.
Add a new option for the linux-headers package, for the user to specify
that the version (really, the sources) of the kernel be used to install
the headers from.
We do that by making linux-headers patch-depend on the linux package.
We can't have linux-header simply depend on linux, because the simple
dependency means the the dependee will be configured, built and installed
before the dependent is configured. And since linux is a target package,
it depends on the toolchain, which internally dependes on linux-headers,
which would depend on linux, and we'd get a circular dependency.
Using patch-depend will ensure that linux is extracted and patched
before linux-headers is extracted, which is really all we need.
Then, we install the headers from the linux source tree, rather than
from linux-headers' source tree (as there's nothing in there!).
Since we need to install a private set for uClibc (see cde947f, uclibc:
prevent rebuilding after installation to staging), we explicitly set
INSTALL_HDR_PATH when calling the kernel' install-headers rule in
LINUX_HEADERS_CONFIGURE_CMDS, so that the headers are installed in
linux-headers' $(@D) instead of linux' $(@D).
Finally, as there is no way to know the kernel version in this case, we
must still prompt the user for the kernel series the headers are from
(like we do for a custom version) and check for consistency at build
time.
Note however that this still leaves users that want to built their
such-kernel outside of Buildroot out in the cold.
[Peter: drop comment as suggested by Thomas]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Karoly Kasza <kaszak@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-01-20 19:34:28 +01:00
|
|
|
INSTALL_HDR_PATH=$(@D)/usr \
|
2014-06-04 22:27:33 +02:00
|
|
|
headers_install)
|
|
|
|
endef
|
|
|
|
|
2013-06-30 21:28:58 +02:00
|
|
|
define LINUX_HEADERS_INSTALL_STAGING_CMDS
|
linux-headers: fix circular dependency when HEADERS_AS_KERNEL is used
The linux-headers -> linux dependency causes a circular dependency, breaking
the source/legal-info/graph-depends/.. targets:
make graph-depends
Getting targets
Getting dependencies for ['toolchain-buildroot', 'toolchain', 'busybox',
'glibc', 'initscripts', 'linux-headers', 'skeleton', 'linux',
'host-fakeroot', 'host-makedevs', 'rootfs-cpio', 'rootfs-initramfs']
Getting dependencies for ['host-kmod', 'host-gcc-final',
'host-gcc-initial', 'host-gawk']
Getting dependencies for ['host-gmp', 'host-binutils', 'host-pkgconf',
'host-mpfr', 'host-mpc']
Getting dependencies for ['host-m4']
Recursion detected for : toolchain
which is a dependency of: linux
which is a dependency of: linux-headers
which is a dependency of: glibc
which is a dependency of: host-gcc-final
which is a dependency of: toolchain-buildroot
which is a dependency of: toolchain
Makefile:721: recipe for target 'graph-depends' failed
make: *** [graph-depends] Error 1
Fix it by instead duplicating in linux-headers the 10-20 lines of linux.mk
logic that infer the _SOURCE/_SITE/_VERSION from the BR2_LINUX_KERNEL_*
variables.
This does mean that we extract the kernel sources twice though.
[Peter: use same git/hg tarball as linux kernel to not clone twice, minor fixes]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-02-24 15:04:09 +01:00
|
|
|
(cd $(@D); \
|
2013-06-30 21:28:58 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) \
|
|
|
|
ARCH=$(KERNEL_ARCH) \
|
|
|
|
HOSTCC="$(HOSTCC)" \
|
|
|
|
HOSTCFLAGS="$(HOSTCFLAGS)" \
|
|
|
|
HOSTCXX="$(HOSTCXX)" \
|
|
|
|
INSTALL_HDR_PATH=$(STAGING_DIR)/usr \
|
|
|
|
headers_install)
|
|
|
|
endef
|
|
|
|
|
package/linux-headers: add option to use same sources as the kernel
Some heavily (and most often improperly) modified Linux kernels may export
new APIs to userland, so as to speak to custom hardware or custom kernel
facilities.
However, we currently have no easy way to use such kernels as a source
for the linux-headers package, which precludes having those userland
headers intalled for userland applications to use them.
We do have a way for the kernel to use the same version as for the
headers, but that is definitely not enough, as the linux-headers package
has a version choice that is far less versatile and capable than that of
the linux package.
Add a new option for the linux-headers package, for the user to specify
that the version (really, the sources) of the kernel be used to install
the headers from.
We do that by making linux-headers patch-depend on the linux package.
We can't have linux-header simply depend on linux, because the simple
dependency means the the dependee will be configured, built and installed
before the dependent is configured. And since linux is a target package,
it depends on the toolchain, which internally dependes on linux-headers,
which would depend on linux, and we'd get a circular dependency.
Using patch-depend will ensure that linux is extracted and patched
before linux-headers is extracted, which is really all we need.
Then, we install the headers from the linux source tree, rather than
from linux-headers' source tree (as there's nothing in there!).
Since we need to install a private set for uClibc (see cde947f, uclibc:
prevent rebuilding after installation to staging), we explicitly set
INSTALL_HDR_PATH when calling the kernel' install-headers rule in
LINUX_HEADERS_CONFIGURE_CMDS, so that the headers are installed in
linux-headers' $(@D) instead of linux' $(@D).
Finally, as there is no way to know the kernel version in this case, we
must still prompt the user for the kernel series the headers are from
(like we do for a custom version) and check for consistency at build
time.
Note however that this still leaves users that want to built their
such-kernel outside of Buildroot out in the cold.
[Peter: drop comment as suggested by Thomas]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Karoly Kasza <kaszak@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-01-20 19:34:28 +01:00
|
|
|
ifeq ($(BR2_KERNEL_HEADERS_VERSION)$(BR2_KERNEL_HEADERS_AS_KERNEL),y)
|
2014-03-01 15:53:02 +01:00
|
|
|
define LINUX_HEADERS_CHECK_VERSION
|
|
|
|
$(call check_kernel_headers_version,\
|
support/check-kernel-headers: fix old custom toolchains without -print-sysroot
Old toolchains, with old gcc that do not support -print-sysroot, break the
kernel-headers version check script: it fails to find the sysroot of the
toolchain, and thus ends up including the host's linux/version.h.
Most of the time, this will break early, since the host's kernel headers
will not match the toolchain settings.
But it can happen that the check is succesful, although the configuration
of the toolchain is wrong:
- the custom toolchain has kernel headers vX.Y
- the user selected vX.Z (Z!=Y)
- the host has headers vX.Y
In this case, the check passes OK, but the build of some packages later on
will break (which is exactly what those _AT_LEAST_XXX options were added to
avoid).
Fix that by passing the sysroot to the check script, instead of the cross
compiler.
We get the sysroot as thus:
- for custom toolchains, we use the macro toolchain_find_sysroot. We can
do that, because we already have a complete sysroot with libc.a at that
time.
- for internal toolchain using a custom kernel headers version, we just
use $(STAGING_DIR). We can't use the macro as for custom toolchains
above, because at the time we install the kernel headers, we do not yet
have a complete sysroot with a libc.a. But we can just use
$(STAGING_DIR), since we're only interested in the kernel headers.
For all other types of toolchains, we already have the _AT_LEAST_XXX options
properly set, so we need not add a check in this case.
Fixes:
http://autobuild.buildroot.net/results/f33/f331a6eff0b0b93c73af52db3a6b43e4e598577e/
http://autobuild.buildroot.net/results/a57/a5797c025bec50c10efdcff74945aab4021d05e4/
[...]
[Thanks to Thomas for pointing out the toolchain_find_sysroot macro!]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-04-07 20:19:12 +02:00
|
|
|
$(STAGING_DIR),\
|
2014-03-01 15:53:02 +01:00
|
|
|
$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)))
|
|
|
|
endef
|
|
|
|
LINUX_HEADERS_POST_INSTALL_STAGING_HOOKS += LINUX_HEADERS_CHECK_VERSION
|
|
|
|
endif
|
|
|
|
|
2013-06-30 21:28:58 +02:00
|
|
|
$(eval $(generic-package))
|