Skip to contentSkip to conversation

kernel.bbclass: fix external module building

PATCH In review Khem Raj 4 participants 6 messages Jul 20, 2012 – Jul 27, 2012

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/2 kernel.bbclass: fix external module building

From: Denis Carikli <[email protected]>

Without that fix we have the following while compiling compat-wireless.
include/linux/mmzone.h:18:30: fatal error: generated/bounds.h: No such file or directory

Note that the compat-wireless recipe will be added in another commit.

make -C $kerneldir _mrproper_scripts deleted this file along with other things so we resurrect it with this patch.

---
 meta/classes/kernel.bbclass |    3 +++
 1 file changed, 3 insertions(+)
meta/classes/kernel.bbclass +3 -0
index 08b5e61..ce4d7de 100644
@@ -187,6 +187,9 @@ kernel_do_install() {
 		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
 	fi
 
+	# Necessary for building modules like compat-wireless.
+	cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
+
 	# 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 \
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v2 2/2 kernel bbclass: Recreate uImage only when KEEPUIMAGE != "yes"

From: Koen Kooi <[email protected]>

The intent of the uImage code in this class includes the following

1) be able to specify custom load addresses without needing to patch the kernel
2) add better information to the uImage description field

The current state is a NOP anyway, the kernel will always build a uImage when you tell it to 'make uImage'.

weakly Set KEEPUIMAGE to 'yes' in default-distrovars.inc which preserve the current OE-Core behavior. Machines which are being ported from oe.dev and need to regenerate uImage can set this to be empty

xx

---
 meta/classes/kernel.bbclass                     |    2 +-
 meta/conf/distro/include/default-distrovars.inc |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +1 -1
index ce4d7de..ab984e3 100644
@@ -507,7 +507,7 @@ KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
 
 do_uboot_mkimage() {
 	if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then 
-		if test ! -e arch/${ARCH}/boot/uImage ; then
+		if test "x${KEEPUIMAGE}" != "xyes" ; then
 			ENTRYPOINT=${UBOOT_ENTRYPOINT}
 			if test -n "${UBOOT_ENTRYSYMBOL}"; then
 				ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
meta/conf/distro/include/default-distrovars.inc +1 -0
index f770919..b72221f 100644
@@ -2,6 +2,7 @@ QA_LOGFILE = "${TMPDIR}/qa.log"
 
 OEINCLUDELOGS ?= "yes"
 KERNEL_CONSOLE ?= "ttyS0"
+KEEPUIMAGE ?? = "yes"
 
 PCMCIA_MANAGER ?= "pcmciautils"
 
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH V2 2/2] kernel bbclass: Recreate uImage only when KEEPUIMAGE != "yes"

Quoted 9 lines · Khem Raj

From: Koen Kooi <[email protected]>

The intent of the uImage code in this class includes the following

1) be able to specify custom load addresses without needing to patch the kernel
2) add better information to the uImage description field

The current state is a NOP anyway, the kernel will always build a uImage when you tell it to 'make uImage'.

Quoted 9 lines

weakly Set KEEPUIMAGE to 'yes' in default-distrovars.inc which preserve the current OE-Core behavior. Machines which are being ported from oe.dev and need to regenerate uImage can set this to be empty

xx

????

Quoted 24 lines
---
  meta/classes/kernel.bbclass                     |    2 +-
  meta/conf/distro/include/default-distrovars.inc |    1 +
  2 files changed, 2 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +1 -1
index ce4d7de..ab984e3 100644
@@ -507,7 +507,7 @@ KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
 
  do_uboot_mkimage() {
  	if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
-		if test ! -e arch/${ARCH}/boot/uImage ; then
+		if test "x${KEEPUIMAGE}" != "xyes" ; then
  			ENTRYPOINT=${UBOOT_ENTRYPOINT}
  			if test -n "${UBOOT_ENTRYSYMBOL}"; then
  				ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
meta/conf/distro/include/default-distrovars.inc +0 -0
index f770919..b72221f 100644

meta/conf/distro/include/default-distrovars.inc QA_LOGFILE = "${TMPDIR}/qa.log" · line 6

Quoted 5 lines
meta/conf/distro/include/default-distrovars.inc +1 -0
@@ -2,6 +2,7 @@ QA_LOGFILE = "${TMPDIR}/qa.log"
 
  OEINCLUDELOGS ?= "yes"
  KERNEL_CONSOLE ?= "ttyS0"
+KEEPUIMAGE ?? = "yes"
 

this really worked? (note the space between ?? = )

Quoted 3 lines
meta/conf/distro/include/default-distrovars.inc +0 -0
  PCMCIA_MANAGER ?= "pcmciautils"
 
author
#3 lore raw

Re: [PATCH V2 2/2] kernel bbclass: Recreate uImage only when KEEPUIMAGE != "yes"

Quoted 4 lines · Saul Wold
Quoted 3 lines

+KEEPUIMAGE ?? = "yes"

this really worked? (note the space between ?? = )

No it did not once I switched the testing branch to really what I wanted to test. Thanks I will send out a v3 soon

Acked-by on v2 1/2
#4 lore raw
In reply to Khem Raj
Quoted 5 lines · Khem Raj

From: Denis Carikli <[email protected]>

Without that fix we have the following while compiling compat-wireless.
include/linux/mmzone.h:18:30: fatal error: generated/bounds.h: No such file or directory

Quoted 7 lines

Note that the compat-wireless recipe will be added in another commit.

make -C $kerneldir _mrproper_scripts deleted this file along with other things so we resurrect it with this patch.

This addresses my concerns and incorporates Paul's request for documentation in the commit header.

Quoted 19 lines
---
 meta/classes/kernel.bbclass |    3 +++
 1 file changed, 3 insertions(+)
meta/classes/kernel.bbclass +3 -0
index 08b5e61..ce4d7de 100644
@@ -187,6 +187,9 @@ kernel_do_install() {
 		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
 	fi
 
+	# Necessary for building modules like compat-wireless.
+	cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
+
 	# 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 \
Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel
#5 lore raw
In reply to Khem Raj
Quoted 31 lines · Khem Raj

From: Denis Carikli <[email protected]>

Without that fix we have the following while compiling compat-wireless.
include/linux/mmzone.h:18:30: fatal error: generated/bounds.h: No such file or directory

Note that the compat-wireless recipe will be added in another commit.

make -C $kerneldir _mrproper_scripts deleted this file along with other things so we resurrect it with this patch.

---
 meta/classes/kernel.bbclass |    3 +++
 1 file changed, 3 insertions(+)
meta/classes/kernel.bbclass +3 -1
index 08b5e61..ce4d7de 100644
@@ -187,6 +187,9 @@ kernel_do_install() {
                cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
        fi
 
+       # Necessary for building modules like compat-wireless.
+       cp include/generated/bounds.h $kerneldir/include/generated/bounds.h
+
        # 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 \
--
Quoted 1 line

1.7.9.5

As an fyi, this seems to have broken compatibility with 2.6 kernel recipes, as bounds.h doesn't live in generated/ there.

Signature · 1 line
Christopher Larson