diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt index ed1e6acf57..568daaeb8d 100644 --- a/docs/manual/adding-packages-generic.txt +++ b/docs/manual/adding-packages-generic.txt @@ -577,6 +577,14 @@ different steps of the build process. This is seldom used, as packages rarely have custom rules. *Do not use this variable*, unless you really know that you need to print help. +* +LIBFOO_LINUX_CONFIG_FIXUPS+ lists the Linux kernel configuration + options that are needed to build and use this package, and without + which the package is fundamentally broken. This shall be a set of + calls to one of the kconfig tweaking option: `KCONFIG_ENABLE_OPT`, + `KCONFIG_DISABLE_OPT`, or `KCONFIG_SET_OPT`. + This is seldom used, as package usually have no strict requirements on + the kernel options. + The preferred way to define these variables is: ---------------------- diff --git a/linux/linux.mk b/linux/linux.mk index 9a618db0e0..eb13920d57 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -421,6 +421,7 @@ define LINUX_KCONFIG_FIXUP_CMDS $(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY) $(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_NETWORK) $(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_SELINUX)) + $(PACKAGES_LINUX_CONFIG_FIXUPS) endef ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 8cd5a7ff62..946dc6d561 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -1083,6 +1083,9 @@ endif ifneq ($$($(2)_USERS),) PACKAGES_USERS += $$($(2)_USERS)$$(sep) endif +ifneq ($$($(2)_LINUX_CONFIG_FIXUPS),) +PACKAGES_LINUX_CONFIG_FIXUPS += $$($(2)_LINUX_CONFIG_FIXUPS)$$(sep) +endif TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS) ROOTFS_PRE_CMD_HOOKS += $$($(2)_ROOTFS_PRE_CMD_HOOKS) KEEP_PYTHON_PY_FILES += $$($(2)_KEEP_PY_FILES)