Skip to contentSkip to conversation

Enable building modules on target

PATCH In review Darren Hart 1 participant 5 messages Jun 30, 2012

lore
Share & tools
lore
#0 lore raw

v3 cover Enable building modules on target

Note: As this is a major change that impacts every BSP, I suggest this
spend some time in MUT before being included into master.

This series simplifies the include mechanisms for the linux-yocto recipes and adds support for a kernel-headers package which enables the building of modules on the target.

Sending to both oe-core and poky as this series touches files in both and I didn't want to confuse the intent or the dependency by splitting them up.

V2:
o Add files to kernel-dev rather than create a new kernel-headers package
o Move the location to /usr/src/kernel from /usr/src/kernel-headers
o Eliminate the kernel-misc package as kernel-dev covers it now
o Fix a bug with linux-yocto-custom exposed during testing

V3:
o Fix tasl-core-sdk typo
o Rebase on origin/master where 2 patches had already been applied
o Correct the bitbake.conf STAGING_KERNEL_DIR path which I missed in V2

Testing Performed:
Built core-image-sato-sdk for qemux86 and copied over the hello-mod module sources. Built the scripts dir in /usr/src/kernel, then built the hello-mod module on the target, insmod, rmmod, dmesg -n 2. The output was correct.

The following changes since commit a5b2c1e4ce3ad4f2b9ea306c6d10f528c5ef8b66:

bitbake: Hob: change 'run image' and 'deploy' Gui and work flow for building detail page (2012-06-29 14:46:47 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib dvhart/modules-v3
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=dvhart/modules-v3

Darren Hart (3):
kernel: Add kernel headers to kernel-dev package
task-core-sdk: Add kernel-dev to task-core-sdk RDEPENDS
linux-yocto-custom: Remove linux-tools

 .../recipes-kernel/linux/linux-yocto-custom.bb          |    2 --
 meta/classes/kernel.bbclass                             |   15 +++++++--------
 meta/conf/bitbake.conf                                  |    2 +-
 meta/recipes-core/tasks/task-core-sdk.bb                |    5 +++--
 4 files changed, 11 insertions(+), 13 deletions(-)
Signature · 1 line
1.7.10.2
#1 lore raw

PATCH v3 1/3 kernel: Add kernel headers to kernel-dev package

[YOCTO #1614]

Add the kernel headers to the kernel-dev package. This packages what was already built and kept in sysroots for building modules with bitbake. Making this available on the target requires removing some additional host binaries.

Move the location to /usr/src/kernel

Before use on the target, the user will need to:

    # cd /usr/src/kernel
    # make scripts

This renders the kernel-misc recipe empty, so remove it.

---
 meta/classes/kernel.bbclass |   15 +++++++--------
 meta/conf/bitbake.conf      |    2 +-
 2 files changed, 8 insertions(+), 9 deletions(-)
meta/classes/kernel.bbclass +7 -8
index 31e633b..27e0033 100644
@@ -130,7 +130,7 @@ kernel_do_install() {
 	# Support for external module building - create a minimal copy of the
 	# kernel source tree.
 	#
-	kerneldir=${D}/kernel
+	kerneldir=${D}/usr/src/kernel
 	install -d $kerneldir
 
 	#
@@ -183,10 +183,11 @@ kernel_do_install() {
 		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
 	fi
 
-	# Remove the following binaries which cause strip errors
+	# Remove the following binaries which cause strip or arch QA errors
 	# during do_package for cross-compiled platforms
 	bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
-	           arch/powerpc/boot/mktree"
+	           arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \
+		   scripts/kconfig/conf.o"
 	for entry in $bin_files; do
 		rm -f $kerneldir/$entry
 	done
@@ -247,13 +248,11 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
 
 # kernel-base becomes kernel-${KERNEL_VERSION}
 # kernel-image becomes kernel-image-${KERNEL_VERISON}
-PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-misc"
+PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
 FILES = ""
 FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
-FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* /usr/src/kernel"
 FILES_kernel-vmlinux = "/boot/vmlinux*"
-# misc is a package to contain files we need in staging
-FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media"
 RDEPENDS_kernel = "kernel-base"
 # Allow machines to override this dependency if kernel image files are 
 # not wanted in images as standard
@@ -469,7 +468,7 @@ python populate_packages_prepend () {
 	metapkg = "kernel-modules"
 	d.setVar('ALLOW_EMPTY_' + metapkg, "1")
 	d.setVar('FILES_' + metapkg, "")
-	blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'kernel-misc' ]
+	blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux' ]
 	for l in module_deps.values():
 		for i in l:
 			pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))
meta/conf/bitbake.conf +1 -1
index 9377ee6..7e3de09 100644
@@ -381,7 +381,7 @@ SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
 ##################################################################
 
 OLDEST_KERNEL = "2.6.16"
-STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/kernel"
+STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/usr/src/kernel"
 
 ##################################################################
 # Specific image creation and rootfs population info.
Signature · 1 line
1.7.10.2
#2 lore raw

PATCH v3 2/3 task-core-sdk: Add kernel-dev to task-core-sdk RDEPENDS

Add kernel-dev to task-core-sdk so it will be included with core-image-sato-sdk and similar image recipes. This enables building Linux kernel modules on the target.

---
 meta/recipes-core/tasks/task-core-sdk.bb |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-core/tasks/task-core-sdk.bb +3 -2
index ec6cdcc..d65a53a 100644
@@ -7,7 +7,7 @@ LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
                     file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 DEPENDS = "task-core-console"
-PR = "r7"
+PR = "r8"
 
 ALLOW_EMPTY = "1"
 #PACKAGEFUNCS =+ 'generate_sdk_pkgs'
@@ -46,7 +46,8 @@ RDEPENDS_task-core-sdk = "\
     distcc \
     ldd \
     file \
-    tcl"
+    tcl \
+    kernel-dev"
 
 #python generate_sdk_pkgs () {
 #    poky_pkgs = read_pkgdata('task-core', d)['PACKAGES']
Signature · 1 line
1.7.10.2
#3 lore raw

PATCH v3 3/3 linux-yocto-custom: Remove linux-tools

In reply to Darren Hart

Remove the linux-tools include as perf is now packaged independently. Without this, including meta-skeleton in bblayers.conf results in a build failure as linux-tools.inc cannot be found.

---
 meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb |    2 --
 1 file changed, 2 deletions(-)
meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb +0 -2
index 1438ad8..55f0c38 100644
@@ -42,5 +42,3 @@ PR = "r0"
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
 COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemux86-64)"
-
-require recipes-kernel/linux/linux-tools.inc
Signature · 1 line
1.7.10.2
#4 lore raw
In reply to Darren Hart

scratch this series.... apologies, sent the wrong one.

Quoted 48 lines · Darren Hart

Note: As this is a major change that impacts every BSP, I suggest this
spend some time in MUT before being included into master.

This series simplifies the include mechanisms for the linux-yocto recipes and adds support for a kernel-headers package which enables the building of modules on the target.

Sending to both oe-core and poky as this series touches files in both and I didn't want to confuse the intent or the dependency by splitting them up.

V2:
o Add files to kernel-dev rather than create a new kernel-headers package
o Move the location to /usr/src/kernel from /usr/src/kernel-headers
o Eliminate the kernel-misc package as kernel-dev covers it now
o Fix a bug with linux-yocto-custom exposed during testing

V3:
o Fix tasl-core-sdk typo
o Rebase on origin/master where 2 patches had already been applied
o Correct the bitbake.conf STAGING_KERNEL_DIR path which I missed in V2

Testing Performed:
Built core-image-sato-sdk for qemux86 and copied over the hello-mod module sources. Built the scripts dir in /usr/src/kernel, then built the hello-mod module on the target, insmod, rmmod, dmesg -n 2. The output was correct.

The following changes since commit a5b2c1e4ce3ad4f2b9ea306c6d10f528c5ef8b66:

bitbake: Hob: change 'run image' and 'deploy' Gui and work flow for building detail page (2012-06-29 14:46:47 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib dvhart/modules-v3
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=dvhart/modules-v3

Darren Hart (3):
kernel: Add kernel headers to kernel-dev package
task-core-sdk: Add kernel-dev to task-core-sdk RDEPENDS
linux-yocto-custom: Remove linux-tools

 .../recipes-kernel/linux/linux-yocto-custom.bb          |    2 --
 meta/classes/kernel.bbclass                             |   15 +++++++--------
 meta/conf/bitbake.conf                                  |    2 +-
 meta/recipes-core/tasks/task-core-sdk.bb                |    5 +++--
 4 files changed, 11 insertions(+), 13 deletions(-)
Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel