package/linux-headers: Add support for custom license files

The linux-headers package was not providing any license file for any
version other than the latest one.

Fix this by adding a Kconfig option to specify the license file,
with a default value set to the commonly used license paths.

For the headers-as-kernel case, use LINUX_LICENSE_FILES and disable the
Kconfig option entirely.

Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
Arnout Vandecappelle
2026-02-02 18:30:21 +01:00
parent d9999aeec9
commit d94762640e
2 changed files with 11 additions and 6 deletions

View File

@@ -466,3 +466,13 @@ config BR2_DEFAULT_KERNEL_HEADERS
default "custom" if BR2_KERNEL_HEADERS_CUSTOM_TARBALL
default BR2_KERNEL_HEADERS_CUSTOM_REPO_VERSION \
if BR2_KERNEL_HEADERS_CUSTOM_GIT
config BR2_PACKAGE_HOST_LINUX_HEADERS_LICENSE_FILES
string "Kernel headers license files" if BR2_KERNEL_HEADERS_VERSION || \
BR2_KERNEL_HEADERS_CUSTOM_TARBALL || \
BR2_KERNEL_HEADERS_CUSTOM_GIT
default BR2_LINUX_KERNEL_LICENSE_FILES if BR2_KERNEL_HEADERS_AS_KERNEL
default "COPYING LICENSES/preferred/GPL-2.0 LICENSES/exceptions/Linux-syscall-note"
help
A space-separated list of license files related to the Linux
kernel headers.

View File

@@ -111,12 +111,7 @@ endif
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_LICENSE_FILES = $(call qstrip,$(BR2_PACKAGE_HOST_LINUX_HEADERS_LICENSE_FILES))
LINUX_HEADERS_CPE_ID_VENDOR = linux
LINUX_HEADERS_CPE_ID_PRODUCT = linux_kernel