[Mod] First commit

This commit is contained in:
2022-10-31 22:18:58 +08:00
commit 1c8a3d9709
13090 changed files with 526733 additions and 0 deletions

View File

@ -0,0 +1,2 @@
config BR2_PACKAGE_LINUX_HEADERS
bool

View File

@ -0,0 +1,389 @@
comment "Kernel Header Options"
config BR2_PACKAGE_HOST_LINUX_HEADERS
bool
choice
prompt "Kernel Headers"
default BR2_KERNEL_HEADERS_AS_KERNEL if BR2_LINUX_KERNEL
default BR2_KERNEL_HEADERS_5_17
help
Select the kernel version to get headers from.
The kernel headers must be at least as old as the oldest
kernel you intend to run on your target.
If you use Buildroot to build a kernel, then you can use
the sources from that kernel as source for the headers.
If you choose a custom version of the kernel headers, or
choose to use the same sources as the kernel, you'll have to
select (below) the series of that kernel, so that Buildroot
can show or hide packages that have strong requirements on the
kernel headers.
config BR2_KERNEL_HEADERS_AS_KERNEL
bool "Same as kernel being built"
depends on BR2_LINUX_KERNEL
select BR2_KERNEL_HEADERS_LATEST if BR2_LINUX_KERNEL_LATEST_VERSION
config BR2_KERNEL_HEADERS_4_9
bool "Linux 4.9.x kernel headers"
depends on !BR2_riscv
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9
config BR2_KERNEL_HEADERS_4_14
bool "Linux 4.14.x kernel headers"
depends on !BR2_riscv
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
config BR2_KERNEL_HEADERS_4_19
bool "Linux 4.19.x kernel headers"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
config BR2_KERNEL_HEADERS_5_4
bool "Linux 5.4.x kernel headers"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
config BR2_KERNEL_HEADERS_5_10
bool "Linux 5.10.x kernel headers"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10
config BR2_KERNEL_HEADERS_5_15
bool "Linux 5.15.x kernel headers"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15
config BR2_KERNEL_HEADERS_5_17
bool "Linux 5.17.x kernel headers"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17
select BR2_KERNEL_HEADERS_LATEST
config BR2_KERNEL_HEADERS_VERSION
bool "Manually specified Linux version"
help
This option allows you to use a specific official version from
kernel.org, like 2.6.x, 2.6.x.y, 3.x.y, ...
Note: you cannot use this option to select a _longterm_ 2.6
kernel, because these kernels are not located at the standard
URL at kernel.org. Instead, select "Custom tarball" and
specify the right URL directly.
config BR2_KERNEL_HEADERS_CUSTOM_TARBALL
bool "Custom tarball"
help
This option allows you to specify a URL pointing to a kernel
source tarball. This URL can use any protocol recognized by
Buildroot, like http://, ftp://, file:// or scp://.
When pointing to a local tarball using file://, you may want
to use a make variable like $(TOPDIR) to reference the root of
the Buildroot tree.
config BR2_KERNEL_HEADERS_CUSTOM_GIT
bool "Custom Git repository"
help
This option allows Buildroot to get the Linux kernel source
code from a Git repository.
endchoice
# Select this for the latest kernel headers version (for license hashes)
config BR2_KERNEL_HEADERS_LATEST
bool
config BR2_DEFAULT_KERNEL_VERSION
string "linux version"
depends on BR2_KERNEL_HEADERS_VERSION
help
Specify the version you want to use.
E.G.: 3.6.10
config BR2_KERNEL_HEADERS_CUSTOM_TARBALL_LOCATION
string "URL of custom kernel tarball"
depends on BR2_KERNEL_HEADERS_CUSTOM_TARBALL
if BR2_KERNEL_HEADERS_CUSTOM_GIT
config BR2_KERNEL_HEADERS_CUSTOM_REPO_URL
string "URL of custom repository"
config BR2_KERNEL_HEADERS_CUSTOM_REPO_VERSION
string "Custom repository version"
help
Revision to use in the typical format used by
Git/Mercurial/Subversion E.G. a sha id, a tag, branch, ..
endif
choice
bool "Custom kernel headers series"
depends on !BR2_LINUX_KERNEL_LATEST_VERSION || !BR2_KERNEL_HEADERS_AS_KERNEL
depends on !BR2_LINUX_KERNEL_LATEST_CIP_VERSION || !BR2_KERNEL_HEADERS_AS_KERNEL
depends on !BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION || !BR2_KERNEL_HEADERS_AS_KERNEL
depends on BR2_KERNEL_HEADERS_VERSION || BR2_KERNEL_HEADERS_AS_KERNEL || \
BR2_KERNEL_HEADERS_CUSTOM_TARBALL || BR2_KERNEL_HEADERS_CUSTOM_GIT
help
Specify the kernel headers series you manually selected,
above.
This is used to hide/show some packages that have strict
requirements on the version of kernel headers.
If your kernel headers are more recent than the latest version
in the choice, then select the latest version.
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_17
bool "5.17.x or later"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_16
bool "5.16.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_16
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15
bool "5.15.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_14
bool "5.14.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_14
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_13
bool "5.13.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_13
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_12
bool "5.12.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_12
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_11
bool "5.11.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_11
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10
bool "5.10.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_9
bool "5.9.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_9
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8
bool "5.8.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_8
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7
bool "5.7.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_7
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_6
bool "5.6.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_6
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_5
bool "5.5.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_5
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4
bool "5.4.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_3
bool "5.3.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_3
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_2
bool "5.2.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_2
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_1
bool "5.1.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_0
bool "5.0.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_20
bool "4.20.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19
bool "4.19.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_18
bool "4.18.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_17
bool "4.17.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16
bool "4.16.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_15
bool "4.15.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_14
bool "4.14.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_13
bool "4.13.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_12
bool "4.12.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_11
bool "4.11.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_10
bool "4.10.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9
bool "4.9.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_8
bool "4.8.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_7
bool "4.7.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_6
bool "4.6.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_5
bool "4.5.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4
bool "4.4.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_3
bool "4.3.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_2
bool "4.2.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1
bool "4.1.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_0
bool "4.0.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_19
bool "3.19.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_18
bool "3.18.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_17
bool "3.17.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_16
bool "3.16.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_15
bool "3.15.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_14
bool "3.14.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_13
bool "3.13.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_12
bool "3.12.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_11
bool "3.11.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_10
bool "3.10.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_9
bool "3.9.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_8
bool "3.8.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_7
bool "3.7.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_6
bool "3.6.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_5
bool "3.5.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_4
bool "3.4.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_3
bool "3.3.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_2
bool "3.2.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_1
bool "3.1.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_0
bool "3.0.x"
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
config BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_REALLY_OLD
bool "2.6.x"
endchoice
config BR2_DEFAULT_KERNEL_HEADERS
string
default "4.9.327" if BR2_KERNEL_HEADERS_4_9
default "4.14.292" if BR2_KERNEL_HEADERS_4_14
default "4.19.257" if BR2_KERNEL_HEADERS_4_19
default "5.4.212" if BR2_KERNEL_HEADERS_5_4
default "5.10.142" if BR2_KERNEL_HEADERS_5_10
default "5.15.67" if BR2_KERNEL_HEADERS_5_15
default "5.17.15" if BR2_KERNEL_HEADERS_5_17
default BR2_DEFAULT_KERNEL_VERSION if BR2_KERNEL_HEADERS_VERSION
default "custom" if BR2_KERNEL_HEADERS_CUSTOM_TARBALL
default BR2_KERNEL_HEADERS_CUSTOM_REPO_VERSION \
if BR2_KERNEL_HEADERS_CUSTOM_GIT

View File

@ -0,0 +1 @@
../../linux/linux.hash

View File

@ -0,0 +1,173 @@
################################################################################
#
# linux-headers
#
################################################################################
# This package is used to provide Linux kernel headers for the
# internal toolchain backend.
# Set variables depending on whether we are using headers from a kernel
# build or a standalone header package.
ifeq ($(BR2_KERNEL_HEADERS_AS_KERNEL),y)
LINUX_HEADERS_CUSTOM_TARBALL = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL))
LINUX_HEADERS_CUSTOM_GIT = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_GIT))
LINUX_HEADERS_CUSTOM_HG = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_HG))
LINUX_HEADERS_CUSTOM_SVN = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_SVN))
LINUX_HEADERS_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
LINUX_HEADERS_CUSTOM_TARBALL_LOCATION = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION))
LINUX_HEADERS_REPO_URL = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
LINUX_HEADERS_CIP = $(BR2_LINUX_KERNEL_LATEST_CIP_VERSION)$(BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION)
ifneq ($(LINUX_HEADERS_OVERRIDE_SRCDIR),)
$(error LINUX_HEADERS_OVERRIDE_SRCDIR must not be set when BR2_KERNEL_HEADERS_AS_KERNEL=y)
endif
LINUX_HEADERS_OVERRIDE_SRCDIR = $(LINUX_OVERRIDE_SRCDIR)
else # ! BR2_KERNEL_HEADERS_AS_KERNEL
LINUX_HEADERS_CUSTOM_TARBALL = $(call qstrip,$(BR2_KERNEL_HEADERS_CUSTOM_TARBALL))
LINUX_HEADERS_CUSTOM_GIT = $(call qstrip,$(BR2_KERNEL_HEADERS_CUSTOM_GIT))
LINUX_HEADERS_CUSTOM_HG =
LINUX_HEADERS_CUSTOM_SVN =
LINUX_HEADERS_VERSION = $(call qstrip,$(BR2_DEFAULT_KERNEL_HEADERS))
LINUX_HEADERS_CUSTOM_TARBALL_LOCATION = $(call qstrip,$(BR2_KERNEL_HEADERS_CUSTOM_TARBALL_LOCATION))
LINUX_HEADERS_REPO_URL = $(call qstrip,$(BR2_KERNEL_HEADERS_CUSTOM_REPO_URL))
LINUX_HEADERS_CIP =
endif # BR2_KERNEL_HEADERS_AS_KERNEL
ifeq ($(BR2_KERNEL_HEADERS_VERSION)$(BR_BUILDING),yy)
ifeq ($(LINUX_HEADERS_VERSION),)
$(error No kernel headers version set, check your BR2_DEFAULT_KERNEL_VERSION setting)
endif
endif
# Compute LINUX_HEADERS_SOURCE and LINUX_HEADERS_SITE from the configuration
ifeq ($(LINUX_HEADERS_CUSTOM_TARBALL),y)
ifeq ($(BR_BUILDING),y)
ifeq ($(LINUX_HEADERS_CUSTOM_TARBALL_LOCATION),)
$(error No kernel headers tarball location set, check your BR2_KERNEL_HEADERS_CUSTOM_TARBALL_LOCATION setting)
endif
endif
LINUX_HEADERS_SOURCE = $(notdir $(LINUX_HEADERS_CUSTOM_TARBALL_LOCATION))
LINUX_HEADERS_SITE = $(patsubst %/,%,$(dir $(LINUX_HEADERS_CUSTOM_TARBALL_LOCATION)))
else ifeq ($(LINUX_HEADERS_CUSTOM_GIT),y)
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION)$(BR_FMT_VERSION_git).tar.gz
LINUX_HEADERS_SITE = $(LINUX_HEADERS_REPO_URL)
LINUX_HEADERS_SITE_METHOD = git
else ifeq ($(LINUX_HEADERS_CUSTOM_HG),y)
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.gz
LINUX_HEADERS_SITE = $(LINUX_HEADERS_REPO_URL)
LINUX_HEADERS_SITE_METHOD = hg
else ifeq ($(LINUX_HEADERS_CUSTOM_SVN),y)
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION)$(BR_FMT_VERSION_svn).tar.gz
LINUX_HEADERS_SITE = $(LINUX_HEADERS_REPO_URL)
LINUX_HEADERS_SITE_METHOD = svn
else ifeq ($(LINUX_HEADERS_CIP),y)
LINUX_HEADERS_SOURCE = linux-cip-$(LINUX_HEADERS_VERSION).tar.gz
LINUX_HEADERS_SITE = https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git/snapshot
else ifneq ($(findstring -rc,$(LINUX_HEADERS_VERSION)),)
# Since 4.12-rc1, -rc kernels are generated from cgit. This also works for
# older -rc kernels.
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.gz
LINUX_HEADERS_SITE = https://git.kernel.org/torvalds/t
else
LINUX_HEADERS_SOURCE = linux-$(LINUX_HEADERS_VERSION).tar.xz
ifeq ($(findstring x2.6.,x$(LINUX_HEADERS_VERSION)),x2.6.)
LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v2.6
else
LINUX_HEADERS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v$(firstword $(subst ., ,$(LINUX_HEADERS_VERSION))).x
endif # x2.6
endif # LINUX_HEADERS_CUSTOM_TARBALL
# Apply any necessary patches if we are using the headers from a kernel
# build.
ifeq ($(BR2_KERNEL_HEADERS_AS_KERNEL),y)
LINUX_HEADERS_PATCHES = $(call qstrip,$(BR2_LINUX_KERNEL_PATCH)) \
$(wildcard $(addsuffix /linux,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))))
# 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
LINUX_HEADERS_POST_PATCH_HOOKS += LINUX_HEADERS_APPLY_LOCAL_PATCHES
endif # BR2_KERNEL_HEADERS_AS_KERNEL
# Skip hash checking for custom kernel headers.
ifeq ($(BR2_KERNEL_HEADERS_VERSION)$(BR2_KERNEL_HEADERS_CUSTOM_TARBALL)$(BR2_KERNEL_HEADERS_CUSTOM_GIT),y)
BR_NO_CHECK_HASH_FOR += $(LINUX_HEADERS_SOURCE)
endif
# linux-headers really is the same as the linux package
LINUX_HEADERS_DL_SUBDIR = linux
LINUX_HEADERS_LICENSE = GPL-2.0
ifeq ($(BR2_KERNEL_HEADERS_LATEST),y)
LINUX_HEADERS_LICENSE_FILES = \
COPYING \
LICENSES/preferred/GPL-2.0 \
LICENSES/exceptions/Linux-syscall-note
endif
LINUX_HEADERS_CPE_ID_VENDOR = linux
LINUX_HEADERS_CPE_ID_PRODUCT = linux_kernel
LINUX_HEADERS_INSTALL_STAGING = YES
# linux-headers is part of the toolchain so disable the toolchain dependency
LINUX_HEADERS_ADD_TOOLCHAIN_DEPENDENCY = NO
# 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.
# 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
(cd $(@D); \
$(TARGET_MAKE_ENV) $(MAKE) \
ARCH=$(KERNEL_ARCH) \
HOSTCC="$(HOSTCC)" \
HOSTCFLAGS="$(HOSTCFLAGS)" \
HOSTCXX="$(HOSTCXX)" \
INSTALL_HDR_PATH=$(@D)/usr \
headers_install)
endef
define LINUX_HEADERS_INSTALL_STAGING_CMDS
(cd $(@D); \
$(TARGET_MAKE_ENV) $(MAKE) \
ARCH=$(KERNEL_ARCH) \
HOSTCC="$(HOSTCC)" \
HOSTCFLAGS="$(HOSTCFLAGS)" \
HOSTCXX="$(HOSTCXX)" \
INSTALL_HDR_PATH=$(STAGING_DIR)/usr \
headers_install)
endef
ifeq ($(BR2_KERNEL_HEADERS_VERSION)$(BR2_KERNEL_HEADERS_AS_KERNEL)$(BR2_KERNEL_HEADERS_CUSTOM_TARBALL)$(BR2_KERNEL_HEADERS_CUSTOM_GIT),y)
# In this case, we must always do a 'loose' test, because they are all
# custom versions which may be later than what we know right now.
define LINUX_HEADERS_CHECK_VERSION
$(call check_kernel_headers_version,\
$(BUILD_DIR),\
$(STAGING_DIR),\
$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)),\
loose)
endef
LINUX_HEADERS_POST_INSTALL_STAGING_HOOKS += LINUX_HEADERS_CHECK_VERSION
endif
$(eval $(generic-package))