Skip to contentSkip to conversation

core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module)

PATCH Superseded Yann E. MORIN 3 participants 10 messages Aug 24, 2015 – Aug 25, 2015

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover core/pkg-kernel-config: ensure linux supports modules (branch yem/kernel-module)

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.

Changes v1 -> v2:
- to not force CONFIG_MODULES if requesting package is not enabled (Peter, Jan)
- update commit log that the check was broken anyway
- add 4th patch to slightly improve linux-fusion

Regards,
Yann E. MORIN.

The following changes since commit 2c1e3a1a79e600ebb863aa67a2d06f4479e28b2a:

apitrace: bump to version 7.0 (2015-08-24 17:17:19 +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 96204099417c101327b357870e89386fe1757931:

package/linux-fusion: slight simplification (2015-08-24 18:45:25 +0200)

----------------------------------------------------------------
Yann E. MORIN (4):
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 package/linux-fusion: slight simplification

 linux/linux.mk                           |  2 ++
 package/linux-fusion/linux-fusion.mk     | 11 ++++++++---
 package/nvidia-driver/nvidia-driver.mk   |  4 ++++
 package/pkg-kernel-module.mk             |  9 +++++----
 package/racehound/racehound.mk           |  6 ++++++
 package/rtai/rtai.mk                     |  6 ++++++
 package/ti-gfx/ti-gfx.mk                 |  7 +++++++
 package/xtables-addons/xtables-addons.mk |  6 ++++++
 8 files changed, 44 insertions(+), 7 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v2 1/4 core/pkg-kernel-module: ensure linux supports modules

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).

Cc Peter Korsgaard <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc No? Rubinstein <[email protected]>
Cc Jan Viktorin <[email protected]>
Cc Gustavo Zacarias <[email protected]>
---
 linux/linux.mk               | 2 ++
 package/pkg-kernel-module.mk | 5 +++++
 2 files changed, 7 insertions(+)
linux/linux.mk +2 -0
index 48f9c74..bbcc54b 100644
@@ -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),
package/pkg-kernel-module.mk +5 -0
index 6fb7704..f6730b8 100644
@@ -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
 
Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 1/4 core/pkg-kernel-module: ensure linux supports modules

Quoted 9 lines · Yann E. MORIN

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).

Quoted 7 lines
Cc Peter Korsgaard <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc No? Rubinstein <[email protected]>
Cc Jan Viktorin <[email protected]>
Cc Gustavo Zacarias <[email protected]>

Regards,
Arnout

Quoted 35 lines
---
 linux/linux.mk               | 2 ++
 package/pkg-kernel-module.mk | 5 +++++
 2 files changed, 7 insertions(+)
linux/linux.mk +2 -0
index 48f9c74..bbcc54b 100644
@@ -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),
package/pkg-kernel-module.mk +5 -0
index 6fb7704..f6730b8 100644
@@ -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
 
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH v2 2/4 core/pkg-kernel-module: drop now-useles check for CONFIG_MODULES

In reply to Yann E. MORIN

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

Besides, the check was broken, because it did not use $$ to dereference LINUX_DIR, thus leading to systematic build failures when a package using the kernel-module infra was enabled.

Cc Peter Korsgaard <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc No? Rubinstein <[email protected]>
Cc Jan Viktorin <[email protected]>

---
Changes v1 -> v2:
- the check was broken anyway

---
 package/pkg-kernel-module.mk | 4 ----
 1 file changed, 4 deletions(-)
package/pkg-kernel-module.mk +0 -4
index f6730b8..200c91d 100644
@@ -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) \
Signature · 1 line
1.9.1
#4 lore raw

PATCH v2 2/4 core/pkg-kernel-module: drop now-useles check for CONFIG_MODULES

Quoted 6 lines · Yann E. MORIN

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

Besides, the check was broken, because it did not use $$ to dereference LINUX_DIR, thus leading to systematic build failures when a package using the kernel-module infra was enabled.

Would be nice to add:

This reverts commit 8df95d926e963601c727defeb4ab90ce2368da70 [pkg-kernel-module: die if kernel module support is disabled]

Otherwise:

Regards,
Arnout

Quoted 30 lines
Cc Peter Korsgaard <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc No? Rubinstein <[email protected]>
Cc Jan Viktorin <[email protected]>

---
Changes v1 -> v2:
- the check was broken anyway

---
 package/pkg-kernel-module.mk | 4 ----
 1 file changed, 4 deletions(-)
package/pkg-kernel-module.mk +0 -4
index f6730b8..200c91d 100644
@@ -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) \
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH v2 3/4 packages: ensure linux supports modules even when not using kernel-module

In reply to Yann E. MORIN

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, whenever they ar eenabled.

Note: the nvidia-driver case does not need the ifeq-block other packages use, because it is already enclosed in a more stringent ifeq-block.

Cc Peter Korsgaard <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc No? Rubinstein <[email protected]>
Cc Jan Viktorin <[email protected]>
Cc Gustavo Zacarias <[email protected]>

---
Changes v1 -> v2:
- only request kernel modules if package is actually built (Jan, Peter)

---
 package/linux-fusion/linux-fusion.mk     | 6 ++++++
 package/nvidia-driver/nvidia-driver.mk   | 4 ++++
 package/racehound/racehound.mk           | 6 ++++++
 package/rtai/rtai.mk                     | 6 ++++++
 package/ti-gfx/ti-gfx.mk                 | 7 +++++++
 package/xtables-addons/xtables-addons.mk | 6 ++++++
 6 files changed, 35 insertions(+)
package/linux-fusion/linux-fusion.mk +6 -0
index 001388c..21b6e42 100644
@@ -11,6 +11,12 @@ LINUX_FUSION_DEPENDENCIES = linux
 LINUX_FUSION_LICENSE = GPLv2+
 LINUX_FUSION_LICENSE_FILES = debian/copyright
 
+# We're building a kernel module without using the kernel-module infra,
+# so we need to tell we want module support in the kernel:
+ifeq ($(BR2_PACKAGE_LINUX_FUSION),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 LINUX_FOR_FUSION = $(LINUX_VERSION_PROBED)
 LINUX_FUSION_ETC_DIR = $(TARGET_DIR)/etc/udev/rules.d
 
package/nvidia-driver/nvidia-driver.mk +4 -0
index 71babfb..373794a 100644
@@ -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.
package/racehound/racehound.mk +6 -0
index 7d8d1e3..7058382 100644
@@ -12,6 +12,12 @@ 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:
+ifeq ($(BR2_PACKAGE_RACEHOUND),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 # override auto detection (uses host parameters, not cross compile
 # ready)
 RACEHOUND_CONF_OPTS += \
package/rtai/rtai.mk +6 -0
index dfd8e0c..4253dd0 100644
@@ -18,6 +18,12 @@ 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:
+ifeq ($(BR2_PACKAGE_RTAI),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 RTAI_CONF_OPTS = \
 	--includedir=/usr/include/rtai \
 	--with-linux-dir=$(LINUX_DIR) 	\
package/ti-gfx/ti-gfx.mk +7 -0
index 5339387..9ebb296 100644
@@ -21,6 +21,13 @@ 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:
+ifeq ($(BR2_PACKAGE_TI_GFX),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 TI_GFX_PROVIDES = libegl libgles powervr
 
 ifeq ($(BR2_PACKAGE_TI_GFX_ES3),y)
package/xtables-addons/xtables-addons.mk +6 -0
index 75e2a5a..114e4b0 100644
@@ -16,6 +16,12 @@ 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:
+ifeq ($(BR2_PACKAGE_XTABLES_ADDONS),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 # geoip helpers need perl with modules and unzip so disable
 define XTABLES_DISABLE_GEOIP_HELPERS
 	$(SED) 's/ geoip//' $(@D)/Makefile.in
Signature · 1 line
1.9.1
#6 lore raw

PATCH v2 3/4 packages: ensure linux supports modules even when not using kernel-module

Quoted 6 lines · Yann E. MORIN

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, whenever they ar eenabled.

are enabled

Quoted 10 lines

Note: the nvidia-driver case does not need the ifeq-block other packages use, because it is already enclosed in a more stringent ifeq-block.

Cc Peter Korsgaard <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc No? Rubinstein <[email protected]>
Cc Jan Viktorin <[email protected]>
Cc Gustavo Zacarias <[email protected]>

Minor nit:

[snip]

Review

Quoted 2 lines
(quoted diff) +2 -0
+# We're building a kernel module without using the kernel-module infra,
+# so we need to tell we want module support in the kernel:

The colon at the end of the line is not needed (same for all others).

Regards,
Arnout

Quoted 7 lines
package/linux-fusion/linux-fusion.mk +4 -0
+ifeq ($(BR2_PACKAGE_LINUX_FUSION),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 LINUX_FOR_FUSION = $(LINUX_VERSION_PROBED)
 LINUX_FUSION_ETC_DIR = $(TARGET_DIR)/etc/udev/rules.d

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#7 lore raw

PATCH v2 3/4 packages: ensure linux supports modules even when not using kernel-module

In reply to Yann E. MORIN

Hello Yann, all.

It is working as expected for me now.

Regards
Jan V.

Quoted 133 lines · On Mon, 24 Aug 2015 18:50:04 +0200 "Yann E. MORIN" <[email protected]>…

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, whenever they ar eenabled.

Note: the nvidia-driver case does not need the ifeq-block other packages use, because it is already enclosed in a more stringent ifeq-block.

Cc Peter Korsgaard <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc No? Rubinstein <[email protected]>
Cc Jan Viktorin <[email protected]>
Cc Gustavo Zacarias <[email protected]>

---
Changes v1 -> v2:
- only request kernel modules if package is actually built (Jan, Peter)

---
 package/linux-fusion/linux-fusion.mk     | 6 ++++++
 package/nvidia-driver/nvidia-driver.mk   | 4 ++++
 package/racehound/racehound.mk           | 6 ++++++
 package/rtai/rtai.mk                     | 6 ++++++
 package/ti-gfx/ti-gfx.mk                 | 7 +++++++
 package/xtables-addons/xtables-addons.mk | 6 ++++++
 6 files changed, 35 insertions(+)
(quoted diff) +0 -0

b/package/linux-fusion/linux-fusion.mk index 001388c..21b6e42 100644

package/linux-fusion/linux-fusion.mk +1 -0
@@ -11,6 +11,12 @@ LINUX_FUSION_DEPENDENCIES = linux
 LINUX_FUSION_LICENSE = GPLv2+
 LINUX_FUSION_LICENSE_FILES = debian/copyright
 
+# We're building a kernel module without using the kernel-module

infra, +# so we need to tell we want module support in the kernel:

package/linux-fusion/linux-fusion.mk +4 -0
+ifeq ($(BR2_PACKAGE_LINUX_FUSION),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 LINUX_FOR_FUSION = $(LINUX_VERSION_PROBED)
 LINUX_FUSION_ETC_DIR = $(TARGET_DIR)/etc/udev/rules.d
(quoted diff) +0 -0

b/package/nvidia-driver/nvidia-driver.mk index 71babfb..373794a 100644

package/nvidia-driver/nvidia-driver.mk +1 -0
@@ -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:

package/nvidia-driver/nvidia-driver.mk +2 -0
+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.

(quoted diff) +0 -0

b/package/racehound/racehound.mk index 7d8d1e3..7058382 100644

package/racehound/racehound.mk +1 -0
@@ -12,6 +12,12 @@ 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:

package/racehound/racehound.mk +4 -0
+ifeq ($(BR2_PACKAGE_RACEHOUND),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 # override auto detection (uses host parameters, not cross compile
 # ready)
 RACEHOUND_CONF_OPTS += \
package/rtai/rtai.mk +0 -0
index dfd8e0c..4253dd0 100644
@@ -18,6 +18,12 @@ 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:

package/rtai/rtai.mk +4 -0
+ifeq ($(BR2_PACKAGE_RTAI),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 RTAI_CONF_OPTS = \
 	--includedir=/usr/include/rtai \
 	--with-linux-dir=$(LINUX_DIR) 	\
package/ti-gfx/ti-gfx.mk +2 -0
index 5339387..9ebb296 100644
@@ -21,6 +21,13 @@ 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:

package/ti-gfx/ti-gfx.mk +4 -0
+ifeq ($(BR2_PACKAGE_TI_GFX),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 TI_GFX_PROVIDES = libegl libgles powervr
 
 ifeq ($(BR2_PACKAGE_TI_GFX_ES3),y)
(quoted diff) +0 -0

b/package/xtables-addons/xtables-addons.mk index 75e2a5a..114e4b0 100644 --- a/package/xtables-addons/xtables-addons.mk +++ b/package/xtables-addons/xtables-addons.mk

package/xtables-addons/xtables-addons.mk +1 -0
@@ -16,6 +16,12 @@ 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:

package/xtables-addons/xtables-addons.mk +4 -0
+ifeq ($(BR2_PACKAGE_XTABLES_ADDONS),y)
+LINUX_NEEDS_MODULES = y
+endif
+
 # geoip helpers need perl with modules and unzip so disable
 define XTABLES_DISABLE_GEOIP_HELPERS
 	$(SED) 's/ geoip//' $(@D)/Makefile.in
Signature · 4 lines
   Jan Viktorin                  E-mail: Viktorin at RehiveTech.com
   System Architect              Web:    www.RehiveTech.com
   RehiveTech
   Brno, Czech Republic
#8 lore raw

PATCH v2 4/4 package/linux-fusion: slight simplification

In reply to Yann E. MORIN

Using an intermediate variable to "store" LINUX_VERSION_PROBED is un-ncessary, because They are both recursively-expanded variables, and the make kernel-version code will anyway be used in both places it is needed; storing in an intermediate variable will not make that a single expansion of the sub-shell.

---
 package/linux-fusion/linux-fusion.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
package/linux-fusion/linux-fusion.mk +2 -3
index 21b6e42..5f9e44e 100644
@@ -17,17 +17,16 @@ ifeq ($(BR2_PACKAGE_LINUX_FUSION),y)
 LINUX_NEEDS_MODULES = y
 endif
 
-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)
+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)
Signature · 1 line
1.9.1
#9 lore raw

PATCH v2 4/4 package/linux-fusion: slight simplification

Quoted 2 lines · Yann E. MORIN

Using an intermediate variable to "store" LINUX_VERSION_PROBED is un-ncessary, because They are both recursively-expanded variables, and

unnecessary they

Quoted 5 lines

the make kernel-version code will anyway be used in both places it is needed; storing in an intermediate variable will not make that a single expansion of the sub-shell.

Regards,
Arnout

Quoted 29 lines
---
 package/linux-fusion/linux-fusion.mk | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
package/linux-fusion/linux-fusion.mk +2 -3
index 21b6e42..5f9e44e 100644
@@ -17,17 +17,16 @@ ifeq ($(BR2_PACKAGE_LINUX_FUSION),y)
 LINUX_NEEDS_MODULES = y
 endif
 
-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)
+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)
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF