Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module)
@ 2015-08-24 12:27 Yann E. MORIN
  2015-08-24 12:27 ` [Buildroot] [PATCH 1/3] core/pkg-kernel-module: ensure linux supports modules Yann E. MORIN
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Yann E. MORIN @ 2015-08-24 12:27 UTC (permalink / raw)
  To: buildroot

Hello All!

This series fixes two standing issues with the way we handle packages
that build kernel modules:

  - first, the current check is broken, because $(LINUX_DIR) should be
    double-$ed, as it is used in a macro from an infra,

  - second, it is currently possible to (try to) build such packages
    without the kernel config havong CONFIG_MODULES set.

So, these three patches fix that:

  - introduce a new internal variable to tell the kernel to enable
    support for modules, LINUX_NEEDS_MODULES, that should be set whenever
    a package wants to build a kernel modules, and is automatically set
    by the kernel-module infra,

  - the (broken) check is no longer needed so removed,

  - a few packages that build kernel modules without using the
    kernel-module infra are fixed to manually set that variable.

I believe that should go into master, because:

  - it actually fixes build issues

  - the kernel-module infra is brand new in this release, and should be
    fixed and stable prior to being released to the wide hostile world
    ;-) 

Thanks to Peter for suggesting the solution, and to No? and Jan for
their previous attempts that eventually led to this series.

Regards,
Yann E. MORIN.


The following changes since commit 7deaa277fd4c89c67de39ea21b4cd081ab85366f:

  arch/arm: add missing arm1136j-s variant (2015-08-24 00:43:12 +0200)

are available in the git repository at:

  git://git.busybox.net/~ymorin/git/buildroot yem/kernel-module

for you to fetch changes up to 2af986ecd146d1dc6e7603bd93fac5420c459e41:

  packages: ensure linux supports modules even when not using kernel-module (2015-08-24 14:14:23 +0200)

----------------------------------------------------------------
Yann E. MORIN (3):
      core/pkg-kernel-module: ensure linux supports modules
      core/pkg-kernel-module: drop now-useles check for CONFIG_MODULES
      packages: ensure linux supports modules even when not using kernel-module

 linux/linux.mk                           | 2 ++
 package/linux-fusion/linux-fusion.mk     | 9 ++++++---
 package/nvidia-driver/nvidia-driver.mk   | 4 ++++
 package/pkg-kernel-module.mk             | 9 +++++----
 package/racehound/racehound.mk           | 4 ++++
 package/rtai/rtai.mk                     | 4 ++++
 package/ti-gfx/ti-gfx.mk                 | 5 +++++
 package/xtables-addons/xtables-addons.mk | 4 ++++
 8 files changed, 34 insertions(+), 7 deletions(-)

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 1/3] core/pkg-kernel-module: ensure linux supports modules
  2015-08-24 12:27 [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module) Yann E. MORIN
@ 2015-08-24 12:27 ` Yann E. MORIN
  2015-08-24 12:27 ` [Buildroot] [PATCH 2/3] core/pkg-kernel-module: drop now-useles check for CONFIG_MODULES Yann E. MORIN
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2015-08-24 12:27 UTC (permalink / raw)
  To: buildroot

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>
---
 linux/linux.mk               | 2 ++
 package/pkg-kernel-module.mk | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/linux/linux.mk b/linux/linux.mk
index 48f9c74..bbcc54b 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -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),
diff --git a/package/pkg-kernel-module.mk b/package/pkg-kernel-module.mk
index 6fb7704..f6730b8 100644
--- a/package/pkg-kernel-module.mk
+++ b/package/pkg-kernel-module.mk
@@ -44,6 +44,11 @@
 
 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
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 2/3] core/pkg-kernel-module: drop now-useles check for CONFIG_MODULES
  2015-08-24 12:27 [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module) Yann E. MORIN
  2015-08-24 12:27 ` [Buildroot] [PATCH 1/3] core/pkg-kernel-module: ensure linux supports modules Yann E. MORIN
@ 2015-08-24 12:27 ` Yann E. MORIN
  2015-08-24 12:27 ` [Buildroot] [PATCH 3/3] packages: ensure linux supports modules even when not using kernel-module Yann E. MORIN
  2015-08-24 14:11 ` [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module) Jan Viktorin
  3 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2015-08-24 12:27 UTC (permalink / raw)
  To: buildroot

Now that we force-enable support for modules in the kernel config, we
need not check it.

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>
---
 package/pkg-kernel-module.mk | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/package/pkg-kernel-module.mk b/package/pkg-kernel-module.mk
index f6730b8..200c91d 100644
--- a/package/pkg-kernel-module.mk
+++ b/package/pkg-kernel-module.mk
@@ -65,10 +65,6 @@ $(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) \
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 3/3] packages: ensure linux supports modules even when not using kernel-module
  2015-08-24 12:27 [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module) Yann E. MORIN
  2015-08-24 12:27 ` [Buildroot] [PATCH 1/3] core/pkg-kernel-module: ensure linux supports modules Yann E. MORIN
  2015-08-24 12:27 ` [Buildroot] [PATCH 2/3] core/pkg-kernel-module: drop now-useles check for CONFIG_MODULES Yann E. MORIN
@ 2015-08-24 12:27 ` Yann E. MORIN
  2015-08-24 15:29   ` Peter Korsgaard
  2015-08-24 14:11 ` [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module) Jan Viktorin
  3 siblings, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2015-08-24 12:27 UTC (permalink / raw)
  To: buildroot

Some packages build kernel modules without using the kernel-module infra
(because they use custom build systems); they do not automatically get
the kernel to support modules which is ensured when using the infra.

It must be done manually for all those packages.

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 <nrubinstein@aldebaran.com>
Cc: Jan Viktorin <viktorin@rehivetech.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/linux-fusion/linux-fusion.mk     | 9 ++++++---
 package/nvidia-driver/nvidia-driver.mk   | 4 ++++
 package/racehound/racehound.mk           | 4 ++++
 package/rtai/rtai.mk                     | 4 ++++
 package/ti-gfx/ti-gfx.mk                 | 5 +++++
 package/xtables-addons/xtables-addons.mk | 4 ++++
 6 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/package/linux-fusion/linux-fusion.mk b/package/linux-fusion/linux-fusion.mk
index 001388c..142f1d6 100644
--- a/package/linux-fusion/linux-fusion.mk
+++ b/package/linux-fusion/linux-fusion.mk
@@ -11,17 +11,20 @@ LINUX_FUSION_DEPENDENCIES = linux
 LINUX_FUSION_LICENSE = GPLv2+
 LINUX_FUSION_LICENSE_FILES = debian/copyright
 
-LINUX_FOR_FUSION = $(LINUX_VERSION_PROBED)
 LINUX_FUSION_ETC_DIR = $(TARGET_DIR)/etc/udev/rules.d
 
-LINUX_FUSION_MAKE_OPTS = KERNEL_VERSION=$(LINUX_FOR_FUSION)
+# We're building a kernel module without using the kernel-module infra,
+# so we need to tell we want module support in the kernel:
+LINUX_NEEDS_MODULES = y
+
+LINUX_FUSION_MAKE_OPTS = KERNEL_VERSION=$(LINUX_VERSION_PROBED)
 LINUX_FUSION_MAKE_OPTS += KERNEL_BUILD=$(LINUX_DIR)
 LINUX_FUSION_MAKE_OPTS += KERNEL_SOURCE=$(LINUX_DIR)
 
 LINUX_FUSION_MAKE_OPTS += SYSROOT=$(TARGET_DIR)
 LINUX_FUSION_MAKE_OPTS += ARCH=$(KERNEL_ARCH)
 LINUX_FUSION_MAKE_OPTS += CROSS_COMPILE=$(TARGET_CROSS)
-LINUX_FUSION_MAKE_OPTS += KERNEL_MODLIB=/lib/modules/$(LINUX_FOR_FUSION)/kernel
+LINUX_FUSION_MAKE_OPTS += KERNEL_MODLIB=/lib/modules/$(LINUX_VERSION_PROBED)/kernel
 
 define LINUX_FUSION_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) $(MAKE) $(LINUX_FUSION_MAKE_OPTS) -C $(@D)
diff --git a/package/nvidia-driver/nvidia-driver.mk b/package/nvidia-driver/nvidia-driver.mk
index 71babfb..373794a 100644
--- a/package/nvidia-driver/nvidia-driver.mk
+++ b/package/nvidia-driver/nvidia-driver.mk
@@ -91,6 +91,10 @@ ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_MODULE),y)
 
 NVIDIA_DRIVER_DEPENDENCIES += linux
 
+# We're building a kernel module without using the kernel-module infra,
+# so we need to tell we want module support in the kernel:
+LINUX_NEEDS_MODULES = y
+
 # NVidia uses the legacy naming scheme for the x86 architecture, when i386
 # and x86_64 were still considered two separate architectures in the Linux
 # kernel.
diff --git a/package/racehound/racehound.mk b/package/racehound/racehound.mk
index 7d8d1e3..982096d 100644
--- a/package/racehound/racehound.mk
+++ b/package/racehound/racehound.mk
@@ -12,6 +12,10 @@ RACEHOUND_SUPPORTS_IN_SOURCE_BUILD = NO
 
 RACEHOUND_DEPENDENCIES = elfutils linux
 
+# We're building a kernel module without using the kernel-module infra,
+# so we need to tell we want module support in the kernel:
+LINUX_NEEDS_MODULES = y
+
 # override auto detection (uses host parameters, not cross compile
 # ready)
 RACEHOUND_CONF_OPTS += \
diff --git a/package/rtai/rtai.mk b/package/rtai/rtai.mk
index dfd8e0c..5a96aea 100644
--- a/package/rtai/rtai.mk
+++ b/package/rtai/rtai.mk
@@ -18,6 +18,10 @@ RTAI_POST_INSTALL_STAGING_HOOKS += RTAI_POST_PATCH_FIXUP
 
 RTAI_DEPENDENCIES = linux
 
+# We're building a kernel module without using the kernel-module infra,
+# so we need to tell we want module support in the kernel:
+LINUX_NEEDS_MODULES = y
+
 RTAI_CONF_OPTS = \
 	--includedir=/usr/include/rtai \
 	--with-linux-dir=$(LINUX_DIR) 	\
diff --git a/package/ti-gfx/ti-gfx.mk b/package/ti-gfx/ti-gfx.mk
index 5339387..0abc824 100644
--- a/package/ti-gfx/ti-gfx.mk
+++ b/package/ti-gfx/ti-gfx.mk
@@ -21,6 +21,11 @@ TI_GFX_LICENSE_FILES = TSPA.txt
 TI_GFX_INSTALL_STAGING = YES
 
 TI_GFX_DEPENDENCIES = linux
+
+# We're building a kernel module without using the kernel-module infra,
+# so we need to tell we want module support in the kernel:
+LINUX_NEEDS_MODULES = y
+
 TI_GFX_PROVIDES = libegl libgles powervr
 
 ifeq ($(BR2_PACKAGE_TI_GFX_ES3),y)
diff --git a/package/xtables-addons/xtables-addons.mk b/package/xtables-addons/xtables-addons.mk
index 75e2a5a..e3b7535 100644
--- a/package/xtables-addons/xtables-addons.mk
+++ b/package/xtables-addons/xtables-addons.mk
@@ -16,6 +16,10 @@ XTABLES_ADDONS_CONF_OPTS = \
 	--with-xtables="$(STAGING_DIR)/usr" \
 	--with-xtlibdir="/usr/lib/xtables"
 
+# We're building a kernel module without using the kernel-module infra,
+# so we need to tell we want module support in the kernel:
+LINUX_NEEDS_MODULES = y
+
 # geoip helpers need perl with modules and unzip so disable
 define XTABLES_DISABLE_GEOIP_HELPERS
 	$(SED) 's/ geoip//' $(@D)/Makefile.in
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module)
  2015-08-24 12:27 [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module) Yann E. MORIN
                   ` (2 preceding siblings ...)
  2015-08-24 12:27 ` [Buildroot] [PATCH 3/3] packages: ensure linux supports modules even when not using kernel-module Yann E. MORIN
@ 2015-08-24 14:11 ` Jan Viktorin
  2015-08-24 15:33   ` Yann E. MORIN
  3 siblings, 1 reply; 8+ messages in thread
From: Jan Viktorin @ 2015-08-24 14:11 UTC (permalink / raw)
  To: buildroot

Hello Yann, all.

I've tried the patch series and it works. However, I've tried to do
this for xtables-addons:

-LINUX_NEEDS_MODULES = y
+#LINUX_NEEDS_MODULES = y

and the result is that it again compiles with CONFIG_MODULES=y (and it
shouldn't). I was investigating why and couldn't find the answer. It
just sets the CONFIG_MODULES=y everytime.

Simple test is possible:

1) $ make olimex_a20_olinuxino_lime_defconfig
2) $ make linux-menuconfig
3) Check "Enable loadable module support" is (un)checked.

* For origin/master (7deaa27), it works as expected (unchecked).
* After merge of morin-repo/yem/kernel-module (2af986e) it DOES NOT work
as expected (checked).

Can you reproduce it as well?

Regards
Jan Viktorin

On Mon, 24 Aug 2015 14:27:38 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> Hello All!
> 
> This series fixes two standing issues with the way we handle packages
> that build kernel modules:
> 
>   - first, the current check is broken, because $(LINUX_DIR) should be
>     double-$ed, as it is used in a macro from an infra,
> 
>   - second, it is currently possible to (try to) build such packages
>     without the kernel config havong CONFIG_MODULES set.
> 
> So, these three patches fix that:
> 
>   - introduce a new internal variable to tell the kernel to enable
>     support for modules, LINUX_NEEDS_MODULES, that should be set
> whenever a package wants to build a kernel modules, and is
> automatically set by the kernel-module infra,
> 
>   - the (broken) check is no longer needed so removed,
> 
>   - a few packages that build kernel modules without using the
>     kernel-module infra are fixed to manually set that variable.
> 
> I believe that should go into master, because:
> 
>   - it actually fixes build issues
> 
>   - the kernel-module infra is brand new in this release, and should
> be fixed and stable prior to being released to the wide hostile world
>     ;-) 
> 
> Thanks to Peter for suggesting the solution, and to No? and Jan for
> their previous attempts that eventually led to this series.
> 
> Regards,
> Yann E. MORIN.
> 
> 
> The following changes since commit
> 7deaa277fd4c89c67de39ea21b4cd081ab85366f:
> 
>   arch/arm: add missing arm1136j-s variant (2015-08-24 00:43:12 +0200)
> 
> are available in the git repository at:
> 
>   git://git.busybox.net/~ymorin/git/buildroot yem/kernel-module
> 
> for you to fetch changes up to
> 2af986ecd146d1dc6e7603bd93fac5420c459e41:
> 
>   packages: ensure linux supports modules even when not using
> kernel-module (2015-08-24 14:14:23 +0200)
> 
> ----------------------------------------------------------------
> Yann E. MORIN (3):
>       core/pkg-kernel-module: ensure linux supports modules
>       core/pkg-kernel-module: drop now-useles check for CONFIG_MODULES
>       packages: ensure linux supports modules even when not using
> kernel-module
> 
>  linux/linux.mk                           | 2 ++
>  package/linux-fusion/linux-fusion.mk     | 9 ++++++---
>  package/nvidia-driver/nvidia-driver.mk   | 4 ++++
>  package/pkg-kernel-module.mk             | 9 +++++----
>  package/racehound/racehound.mk           | 4 ++++
>  package/rtai/rtai.mk                     | 4 ++++
>  package/ti-gfx/ti-gfx.mk                 | 5 +++++
>  package/xtables-addons/xtables-addons.mk | 4 ++++
>  8 files changed, 34 insertions(+), 7 deletions(-)
> 



-- 
   Jan Viktorin                  E-mail: Viktorin at RehiveTech.com
   System Architect              Web:    www.RehiveTech.com
   RehiveTech
   Brno, Czech Republic

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 3/3] packages: ensure linux supports modules even when not using kernel-module
  2015-08-24 12:27 ` [Buildroot] [PATCH 3/3] packages: ensure linux supports modules even when not using kernel-module Yann E. MORIN
@ 2015-08-24 15:29   ` Peter Korsgaard
  2015-08-24 15:34     ` Yann E. MORIN
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2015-08-24 15:29 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Some packages build kernel modules without using the kernel-module infra
 > (because they use custom build systems); they do not automatically get
 > the kernel to support modules which is ensured when using the infra.

 > It must be done manually for all those packages.

 > 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 <nrubinstein@aldebaran.com>
 > Cc: Jan Viktorin <viktorin@rehivetech.com>
 > Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
 > ---
 >  package/linux-fusion/linux-fusion.mk     | 9 ++++++---
 >  package/nvidia-driver/nvidia-driver.mk   | 4 ++++
 >  package/racehound/racehound.mk           | 4 ++++
 >  package/rtai/rtai.mk                     | 4 ++++
 >  package/ti-gfx/ti-gfx.mk                 | 5 +++++
 >  package/xtables-addons/xtables-addons.mk | 4 ++++
 >  6 files changed, 27 insertions(+), 3 deletions(-)

 > +++ b/package/nvidia-driver/nvidia-driver.mk
 > @@ -91,6 +91,10 @@ ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_MODULE),y)
 
 >  NVIDIA_DRIVER_DEPENDENCIES += linux
 
 > +# We're building a kernel module without using the kernel-module infra,
 > +# so we need to tell we want module support in the kernel:
 > +LINUX_NEEDS_MODULES = y
 > +

Ehh, this should only be done if the package is enabled, E.G.

ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER),y)
LINUX_NEEDS_MODULES = y
endif

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module)
  2015-08-24 14:11 ` [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module) Jan Viktorin
@ 2015-08-24 15:33   ` Yann E. MORIN
  0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2015-08-24 15:33 UTC (permalink / raw)
  To: buildroot

Jan, All,

On 2015-08-24 16:11 +0200, Jan Viktorin spake thusly:
> Hello Yann, all.
> 
> I've tried the patch series and it works. However, I've tried to do
> this for xtables-addons:
> 
> -LINUX_NEEDS_MODULES = y
> +#LINUX_NEEDS_MODULES = y
> 
> and the result is that it again compiles with CONFIG_MODULES=y (and it
> shouldn't). I was investigating why and couldn't find the answer. It
> just sets the CONFIG_MODULES=y everytime.
> 
> Simple test is possible:
> 
> 1) $ make olimex_a20_olinuxino_lime_defconfig
> 2) $ make linux-menuconfig
> 3) Check "Enable loadable module support" is (un)checked.
> 
> * For origin/master (7deaa27), it works as expected (unchecked).
> * After merge of morin-repo/yem/kernel-module (2af986e) it DOES NOT work
> as expected (checked).
> 
> Can you reproduce it as well?

I haven't eventried, but I guess Peter nailed it in his reply.

I'll fix and respin.

Regards,
Yann E. MORIN.

> Regards
> Jan Viktorin
> 
> On Mon, 24 Aug 2015 14:27:38 +0200
> "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> 
> > Hello All!
> > 
> > This series fixes two standing issues with the way we handle packages
> > that build kernel modules:
> > 
> >   - first, the current check is broken, because $(LINUX_DIR) should be
> >     double-$ed, as it is used in a macro from an infra,
> > 
> >   - second, it is currently possible to (try to) build such packages
> >     without the kernel config havong CONFIG_MODULES set.
> > 
> > So, these three patches fix that:
> > 
> >   - introduce a new internal variable to tell the kernel to enable
> >     support for modules, LINUX_NEEDS_MODULES, that should be set
> > whenever a package wants to build a kernel modules, and is
> > automatically set by the kernel-module infra,
> > 
> >   - the (broken) check is no longer needed so removed,
> > 
> >   - a few packages that build kernel modules without using the
> >     kernel-module infra are fixed to manually set that variable.
> > 
> > I believe that should go into master, because:
> > 
> >   - it actually fixes build issues
> > 
> >   - the kernel-module infra is brand new in this release, and should
> > be fixed and stable prior to being released to the wide hostile world
> >     ;-) 
> > 
> > Thanks to Peter for suggesting the solution, and to No? and Jan for
> > their previous attempts that eventually led to this series.
> > 
> > Regards,
> > Yann E. MORIN.
> > 
> > 
> > The following changes since commit
> > 7deaa277fd4c89c67de39ea21b4cd081ab85366f:
> > 
> >   arch/arm: add missing arm1136j-s variant (2015-08-24 00:43:12 +0200)
> > 
> > are available in the git repository at:
> > 
> >   git://git.busybox.net/~ymorin/git/buildroot yem/kernel-module
> > 
> > for you to fetch changes up to
> > 2af986ecd146d1dc6e7603bd93fac5420c459e41:
> > 
> >   packages: ensure linux supports modules even when not using
> > kernel-module (2015-08-24 14:14:23 +0200)
> > 
> > ----------------------------------------------------------------
> > Yann E. MORIN (3):
> >       core/pkg-kernel-module: ensure linux supports modules
> >       core/pkg-kernel-module: drop now-useles check for CONFIG_MODULES
> >       packages: ensure linux supports modules even when not using
> > kernel-module
> > 
> >  linux/linux.mk                           | 2 ++
> >  package/linux-fusion/linux-fusion.mk     | 9 ++++++---
> >  package/nvidia-driver/nvidia-driver.mk   | 4 ++++
> >  package/pkg-kernel-module.mk             | 9 +++++----
> >  package/racehound/racehound.mk           | 4 ++++
> >  package/rtai/rtai.mk                     | 4 ++++
> >  package/ti-gfx/ti-gfx.mk                 | 5 +++++
> >  package/xtables-addons/xtables-addons.mk | 4 ++++
> >  8 files changed, 34 insertions(+), 7 deletions(-)
> > 
> 
> 
> 
> -- 
>    Jan Viktorin                  E-mail: Viktorin at RehiveTech.com
>    System Architect              Web:    www.RehiveTech.com
>    RehiveTech
>    Brno, Czech Republic

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 3/3] packages: ensure linux supports modules even when not using kernel-module
  2015-08-24 15:29   ` Peter Korsgaard
@ 2015-08-24 15:34     ` Yann E. MORIN
  0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2015-08-24 15:34 UTC (permalink / raw)
  To: buildroot

PEter, All,

On 2015-08-24 17:29 +0200, Peter Korsgaard spake thusly:
> >>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> 
>  > Some packages build kernel modules without using the kernel-module infra
>  > (because they use custom build systems); they do not automatically get
>  > the kernel to support modules which is ensured when using the infra.
> 
>  > It must be done manually for all those packages.
> 
>  > 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 <nrubinstein@aldebaran.com>
>  > Cc: Jan Viktorin <viktorin@rehivetech.com>
>  > Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
>  > ---
>  >  package/linux-fusion/linux-fusion.mk     | 9 ++++++---
>  >  package/nvidia-driver/nvidia-driver.mk   | 4 ++++
>  >  package/racehound/racehound.mk           | 4 ++++
>  >  package/rtai/rtai.mk                     | 4 ++++
>  >  package/ti-gfx/ti-gfx.mk                 | 5 +++++
>  >  package/xtables-addons/xtables-addons.mk | 4 ++++
>  >  6 files changed, 27 insertions(+), 3 deletions(-)
> 
>  > +++ b/package/nvidia-driver/nvidia-driver.mk
>  > @@ -91,6 +91,10 @@ ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_MODULE),y)
>  
>  >  NVIDIA_DRIVER_DEPENDENCIES += linux
>  
>  > +# We're building a kernel module without using the kernel-module infra,
>  > +# so we need to tell we want module support in the kernel:
>  > +LINUX_NEEDS_MODULES = y
>  > +
> 
> Ehh, this should only be done if the package is enabled, E.G.
> 
> ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER),y)
> LINUX_NEEDS_MODULES = y
> endif

Indeed. I just checked that when a module-building package was enabled,
that would turn CONFIG_MODULES on, but I did not check that it would not
touch it withour such a package.

Shame on me...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-08-24 15:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-24 12:27 [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module) Yann E. MORIN
2015-08-24 12:27 ` [Buildroot] [PATCH 1/3] core/pkg-kernel-module: ensure linux supports modules Yann E. MORIN
2015-08-24 12:27 ` [Buildroot] [PATCH 2/3] core/pkg-kernel-module: drop now-useles check for CONFIG_MODULES Yann E. MORIN
2015-08-24 12:27 ` [Buildroot] [PATCH 3/3] packages: ensure linux supports modules even when not using kernel-module Yann E. MORIN
2015-08-24 15:29   ` Peter Korsgaard
2015-08-24 15:34     ` Yann E. MORIN
2015-08-24 14:11 ` [Buildroot] [PATCH 0/3] core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module) Jan Viktorin
2015-08-24 15:33   ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox