[oe] [PATCH] kernel, linux-kernel-base classes: update for 2.6.33-rc1 and newer

Martin Jansa martin.jansa at gmail.com
Tue Dec 22 23:04:16 UTC 2009


* include/asm link was killed in
  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f7f16b7799ed68654850ab340ef812895aebcf4c
* utsrelease.h was moved in
  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=273b281fa22c293963ee3e6eec418f5dda2dbc83

Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
 classes/kernel.bbclass            |   19 +++++++++++++------
 classes/linux-kernel-base.bbclass |    3 +++
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index edeaa66..069dceb 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -95,13 +95,18 @@ kernel_do_compile() {
 kernel_do_compile[depends] = "${INITRAMFS_TASK}"
 
 kernel_do_stage() {
-	ASMDIR=`readlink include/asm`
+	if [ -e include/asm ] ; then
+		# This link is generated only in kernel before 2.6.33-rc1, don't stage it for newer kernels
+		ASMDIR=`readlink include/asm`
 
-	mkdir -p ${STAGING_KERNEL_DIR}/include/$ASMDIR
-	cp -fR include/$ASMDIR/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/
+		mkdir -p ${STAGING_KERNEL_DIR}/include/$ASMDIR
+		cp -fR include/$ASMDIR/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/
+	fi
 	# Kernel 2.6.27 moved headers from includes/asm-${ARCH} to arch/${ARCH}/include/asm	
 	if [ -e arch/${ARCH}/include/asm/ ] ; then 
-		cp -fR arch/${ARCH}/include/asm/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/
+		if [ -e include/asm ] ; then
+			cp -fR arch/${ARCH}/include/asm/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/
+		fi
 		install -d ${STAGING_KERNEL_DIR}/arch/${ARCH}/include
 		cp -fR arch/${ARCH}/* ${STAGING_KERNEL_DIR}/arch/${ARCH}/	
 
@@ -112,8 +117,10 @@ kernel_do_stage() {
 		cp -fR arch/x86/* ${STAGING_KERNEL_DIR}/arch/x86/
 	fi
 
-	rm -f ${STAGING_KERNEL_DIR}/include/asm
-	ln -sf $ASMDIR ${STAGING_KERNEL_DIR}/include/asm
+	if [ -e include/asm ] ; then
+		rm -f ${STAGING_KERNEL_DIR}/include/asm
+		ln -sf $ASMDIR ${STAGING_KERNEL_DIR}/include/asm
+	fi
 
 	mkdir -p ${STAGING_KERNEL_DIR}/include/asm-generic
 	cp -fR include/asm-generic/* ${STAGING_KERNEL_DIR}/include/asm-generic/
diff --git a/classes/linux-kernel-base.bbclass b/classes/linux-kernel-base.bbclass
index b3e0fda..510951a 100644
--- a/classes/linux-kernel-base.bbclass
+++ b/classes/linux-kernel-base.bbclass
@@ -4,6 +4,9 @@ def get_kernelversion(p):
 
     fn = p + '/include/linux/utsrelease.h'
     if not os.path.isfile(fn):
+        # after 2.6.33-rc1
+        fn = p + '/include/generated/utsrelease.h'
+    if not os.path.isfile(fn):
         fn = p + '/include/linux/version.h'
 
     import re
-- 
1.6.0.4





More information about the Openembedded-devel mailing list