Skip to contentSkip to conversation

A bugfix to enable external module building on target

PATCH Superseded [email protected] 3 participants 5 messages Sep 30, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#2 lore raw

Re: [PATCH 1/1] kernel.bbclass: enable a link for external module building

In reply to [email protected]
Quoted 7 lines · On 2014-09-30, 4:57 PM, [email protected] wrote:

From: Nitin A Kamble <[email protected]>

To build external modules, the link /lib/modules/<kernel-version>/build must exist, and point to the proper kernel source area.

The kernel-dev package already provides the needed source files. Now putting a link in place to unblock the external module building.

This description is not entirely accurate, at least from my point of view.

You can build external modules on the target without this link .. it is that many scripts and utilities look in this location for the kernel source.

We are fixing that case, not the general case of building an external module.

Cheers,

Bruce

Quoted 31 lines

Fixes Bug:
[YOCTO #2968]

---
  meta/classes/kernel.bbclass | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +2 -1
index 78b33ce..5ac4ff4 100644
@@ -213,6 +213,7 @@ kernel_do_install() {
  	#
  	kerneldir=${D}${KERNEL_SRC_PATH}
  	install -d $kerneldir
+	ln -sf ${KERNEL_SRC_PATH} "${D}/lib/modules/${KERNEL_VERSION}/build"
 
  	#
  	# Store the kernel version in sysroots for module-base.bbclass
@@ -346,7 +347,7 @@ PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-mod
  FILES_${PN} = ""
  FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin"
  FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
  FILES_kernel-vmlinux = "/boot/vmlinux*"
  FILES_kernel-modules = ""
  RDEPENDS_kernel = "kernel-base"
#0 lore raw

cover A bugfix to enable external module building on target

From: Nitin A Kamble <[email protected]>

The path /lib/modules/<kernel-version>/build was missing on the target. It is required to build external modules on the target. The kernel-dev package provides all the needed support files for building the external kernel modules. This commit creates the required missing link on the target, which enables the external modules building.

This has been tested with a simple external module on the qemux86-64 machine with the core-image-sato-sdk image.

See this bug for more details:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=2968

Thanks,
Nitin

The following changes since commit c34775f8864f9bf9a2b32af1e3a803f7d84e11ba:

deb_packaging: Added support for multilib (2014-09-30 14:33:31 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib nitin/misc
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=nitin/misc

Nitin A Kamble (1):
kernel.bbclass: enable a link for external module building

 meta/classes/kernel.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 kernel.bbclass: enable a link for external module building

From: Nitin A Kamble <[email protected]>

To build external modules, the link /lib/modules/<kernel-version>/build must exist, and point to the proper kernel source area.

The kernel-dev package already provides the needed source files. Now putting a link in place to unblock the external module building.

Fixes Bug:
[YOCTO #2968]

---
 meta/classes/kernel.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +2 -1
index 78b33ce..5ac4ff4 100644
@@ -213,6 +213,7 @@ kernel_do_install() {
 	#
 	kerneldir=${D}${KERNEL_SRC_PATH}
 	install -d $kerneldir
+	ln -sf ${KERNEL_SRC_PATH} "${D}/lib/modules/${KERNEL_VERSION}/build"
 
 	#
 	# Store the kernel version in sysroots for module-base.bbclass
@@ -346,7 +347,7 @@ PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-mod
 FILES_${PN} = ""
 FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin"
 FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
 FILES_kernel-vmlinux = "/boot/vmlinux*"
 FILES_kernel-modules = ""
 RDEPENDS_kernel = "kernel-base"
Signature · 1 line
1.8.1.4
#3 lore raw

Re: [PATCH 1/1] kernel.bbclass: enable a link for external module building

In reply to Bruce Ashfield
Quoted 14 lines · Bruce Ashfield
Quoted 8 lines · On 2014-09-30, 4:57 PM, [email protected] wrote:

From: Nitin A Kamble <[email protected]>

To build external modules, the link /lib/modules/<kernel-version>/build must exist, and point to the proper kernel source area.

The kernel-dev package already provides the needed source files. Now putting a link in place to unblock the external module building.

This description is not entirely accurate, at least from my point of view.

Quoted 6 lines

You can build external modules on the target without this link .. it is that many scripts and utilities look in this location for the kernel source.

We are fixing that case, not the general case of building an external module.

I forgot to say, that outside of my nit picking on the commit message, I don't see any significant issues with the patch.

Cheers,

Bruce

Quoted 48 lines

Cheers,

Bruce

Quoted 27 lines

Fixes Bug:
[YOCTO #2968]

---
  meta/classes/kernel.bbclass | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +1 -0
index 78b33ce..5ac4ff4 100644
@@ -213,6 +213,7 @@ kernel_do_install() {
        #
        kerneldir=${D}${KERNEL_SRC_PATH}
        install -d $kerneldir
+       ln -sf ${KERNEL_SRC_PATH}

"${D}/lib/modules/${KERNEL_VERSION}/build"

#
# Store the kernel version in sysroots for module-base.bbclass

meta/classes/kernel.bbclass +0 -0
@@ -346,7 +347,7 @@ PACKAGES = "kernel kernel-base kernel-vmlinux

kernel-image kernel-dev kernel-mod
FILES_${PN} = ""
FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order
/lib/modules/${KERNEL_VERSION}/modules.builtin"

Quoted 9 lines

FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
FILES_kernel-vmlinux = "/boot/vmlinux*"
FILES_kernel-modules = ""
RDEPENDS_kernel = "kernel-base"

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
#4 lore raw

Re: [PATCH 1/1] kernel.bbclass: enable a link for external module building

In reply to Bruce Ashfield
Quoted 12 lines · Bruce Ashfield
Quoted 7 lines · On 2014-09-30, 4:57 PM, [email protected] wrote:

From: Nitin A Kamble <[email protected]>

To build external modules, the link /lib/modules/<kernel-version>/build must exist, and point to the proper kernel source area.

The kernel-dev package already provides the needed source files. Now putting a link in place to unblock the external module building.

This description is not entirely accurate, at least from my point of view.

Quoted 6 lines

You can build external modules on the target without this link .. it is that many scripts and utilities look in this location for the kernel source.

We are fixing that case, not the general case of building an external module.

I see. Thanks for pointing it out. I guess, the bug entry missed this information. I will fix the commit log and resend it.

Nitin

Quoted 41 lines

Cheers,

Bruce

Quoted 35 lines

Fixes Bug:
[YOCTO #2968]

---
  meta/classes/kernel.bbclass | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +1 -0
index 78b33ce..5ac4ff4 100644
@@ -213,6 +213,7 @@ kernel_do_install() {
  	#
  	kerneldir=${D}${KERNEL_SRC_PATH}
  	install -d $kerneldir
+	ln -sf ${KERNEL_SRC_PATH} "${D}/lib/modules/${KERNEL_VERSION}/build"
 
  	#
  	# Store the kernel version in sysroots for module-base.bbclass
@@ -346,7 +347,7 @@ PACKAGES = "kernel kernel-base kernel-vmlinux

kernel-image kernel-dev kernel-mod
FILES_${PN} = ""
FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order
/lib/modules/${KERNEL_VERSION}/modules.builtin"
FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
FILES_kernel-vmlinux = "/boot/vmlinux*" FILES_kernel-modules = ""
RDEPENDS_kernel = "kernel-base"