Skip to contentSkip to conversation

Bug in kernel-arch.bbclass

PATCH Henning Heinold 2 participants 2 messages Mar 24, 2009 – Mar 27, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

while compiling 2.6.28 for wrap board(geodegx) I noticed that the asm-headers didnt install into staging. After examine kernel-arch.bbclass and kernel.bblcass I found the following lines

kernel-arch.bbclass

def map_kernel_arch(a, d):
import bb, re

valid_archs = bb.data.getVar('valid_archs', d, 1).split()

if re.match('(i.86|athlon)$', a): return '386'
elif re.match('arm26$', a): return 'arm26'
elif re.match('armeb$', a): return 'arm'
elif re.match('mipsel$', a): return 'mips'
elif re.match('sh(3|4)$', a): return 'sh'
elif re.match('bfin', a): return 'blackfin'
elif a in valid_archs: return a
else:
bb.error("cannot map '%s' to a linux kernel architecture" % a)

export ARCH = "${@map_kernel_arch(bb.data.getVar('TARGET_ARCH', d, 1), d)}"

kernel.bbclass

kernel_do_stage() {
        ASMDIR=`readlink include/asm`

        mkdir -p ${STAGING_KERNEL_DIR}/include/$ASMDIR
        cp -fR include/$ASMDIR/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/
        # 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/
                install -d ${STAGING_KERNEL_DIR}/arch/${ARCH}/include
                cp -fR arch/${ARCH}/* ${STAGING_KERNEL_DIR}/arch/${ARCH}/

As you can see this can not work because the ARCH-variable is set to 386 and so the "-e arch/${ARCH}/include/asm/" is not true. For backward compatiblity I attached a patch, which covers this problem.

Is this okay for checkin?

Bye Henning

classes/kernel.bbclass +4 -0
index 4c1dbda..91bd640 100644
@@ -98,6 +98,10 @@ kernel_do_stage() {
 		cp -fR arch/${ARCH}/include/asm/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/
 		install -d ${STAGING_KERNEL_DIR}/arch/${ARCH}/include
 		cp -fR arch/${ARCH}/* ${STAGING_KERNEL_DIR}/arch/${ARCH}/	
+	elif [ -e arch/x86/include/asm/ ] ; then
+		cp -fR arch/x86/include/asm/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/
+                install -d ${STAGING_KERNEL_DIR}/arch/x86/include
+                cp -fR arch/x86/* ${STAGING_KERNEL_DIR}/arch/x86/
 	fi
 	rm -f $ASMDIR ${STAGING_KERNEL_DIR}/include/asm
 	ln -sf $ASMDIR ${STAGING_KERNEL_DIR}/include/asm
#1 lore raw
Quoted 38 lines · On Tuesday 24 March 2009 02:35:20 Henning Heinold wrote:

Hi,

while compiling 2.6.28 for wrap board(geodegx) I noticed that the asm-headers didnt install into staging. After examine kernel-arch.bbclass and kernel.bblcass I found the following lines

kernel-arch.bbclass

def map_kernel_arch(a, d):
import bb, re

valid_archs = bb.data.getVar('valid_archs', d, 1).split()

if re.match('(i.86|athlon)$', a): return '386'
elif re.match('arm26$', a): return 'arm26'
elif re.match('armeb$', a): return 'arm'
elif re.match('mipsel$', a): return 'mips'
elif re.match('sh(3|4)$', a): return 'sh'
elif re.match('bfin', a): return 'blackfin'
elif a in valid_archs: return a
else:
bb.error("cannot map '%s' to a linux kernel architecture" % a)

export ARCH = "${@map_kernel_arch(bb.data.getVar('TARGET_ARCH', d, 1), d)}"

kernel.bbclass

kernel_do_stage() {
        ASMDIR=`readlink include/asm`

        mkdir -p ${STAGING_KERNEL_DIR}/include/$ASMDIR
        cp -fR include/$ASMDIR/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/
        # 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/
                install -d ${STAGING_KERNEL_DIR}/arch/${ARCH}/include
                cp -fR arch/${ARCH}/* ${STAGING_KERNEL_DIR}/arch/${ARCH}/
Quoted 4 lines

As you can see this can not work because the ARCH-variable is set to 386 and so the "-e arch/${ARCH}/include/asm/" is not true. For backward compatiblity I attached a patch, which covers this problem.

Is this okay for checkin?

your patch installs like old dir structure, I wonder if it should install in arch/$ARCH/include too

Quoted 4 lines

Bye Henning

Signature · 1 line
Khem Raj