pkg-kernel-module: die if kernel module support is disabled
authorNoé Rubinstein <noe.rubinstein@gmail.com>
Mon, 17 Aug 2015 07:10:44 +0000 (09:10 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 17 Aug 2015 14:29:52 +0000 (16:29 +0200)
Test the configuration of the kernel to see if loadable module support
is enabled, and error out otherwise. This makes build failures of
external kernel modules less confusing.

[Thomas: tweak the commit log.]

Signed-off-by: Noé Rubinstein <nrubinstein@aldebaran.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/pkg-kernel-module.mk

index 5fb19be8080300ff8b20e87af30a14e25c3f05de..6fb7704e3221bbc47685e96f1d8304d47bab4f9f 100644 (file)
@@ -60,6 +60,10 @@ $(2)_MODULE_SUBDIRS ?= .
 # includes and other support files (Booo!)
 define $(2)_KERNEL_MODULES_BUILD
        @$$(call MESSAGE,"Building kernel module(s)")
+       @if ! grep -Fqx 'CONFIG_MODULES=y' $(LINUX_DIR)/.config; then \
+               echo "ERROR: Kernel does not support loadable modules"; \
+               exit 1; \
+       fi
        $$(foreach d,$$($(2)_MODULE_SUBDIRS), \
                $$(LINUX_MAKE_ENV) $$($$(PKG)_MAKE) \
                        -C $$(LINUX_DIR) \