core/pkg-kernel-module: ensure linux supports modules
authorYann E. MORIN <yann.morin.1998@free.fr>
Thu, 3 Sep 2015 12:54:19 +0000 (14:54 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 4 Sep 2015 11:13:52 +0000 (13:13 +0200)
When a package wants to build a kernel module, we should ensure that the
kernel does support modules.

This patch does it automatically for packages using the kernel-module
infrastructure.

Packages that do not use it will have to set it manually (to be done in
a followup patch).

Suggested-by: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: NoƩ Rubinstein <noe.rubinstein@gmail.com>
Cc: Jan Viktorin <viktorin@rehivetech.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
linux/linux.mk
package/pkg-kernel-module.mk

index 48f9c740f4c07d8df00f7226ad4704134ab6bdc5..bbcc54bfd123fe7fd9389c4c99d1b99697a20295 100644 (file)
@@ -175,6 +175,8 @@ LINUX_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
 LINUX_KCONFIG_OPTS = $(LINUX_MAKE_FLAGS)
 
 define LINUX_KCONFIG_FIXUP_CMDS
+       $(if $(LINUX_NEEDS_MODULES),
+               $(call KCONFIG_ENABLE_OPT,CONFIG_MODULES,$(@D)/.config))
        $(if $(BR2_arm)$(BR2_armeb),
                $(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config))
        $(if $(BR2_TARGET_ROOTFS_CPIO),
index 6fb7704e3221bbc47685e96f1d8304d47bab4f9f..f6730b882ddf310333fd967f17ad38969995f0ce 100644 (file)
 
 define inner-kernel-module
 
+# If the package is enabled, ensure the kernel will support modules
+ifeq ($$(BR2_PACKAGE_$(2)),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 # The kernel must be built first.
 $(2)_DEPENDENCIES += linux