All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug in kernel-arch.bbclass
@ 2009-03-24  9:35 Henning Heinold
  2009-03-27  4:16 ` Khem Raj
  0 siblings, 1 reply; 2+ messages in thread
From: Henning Heinold @ 2009-03-24  9:35 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 1800 bytes --]

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

[-- Attachment #2: kernel_bbclass.patch --]
[-- Type: text/x-diff, Size: 753 bytes --]

diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index 4c1dbda..91bd640 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-27  4:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-24  9:35 Bug in kernel-arch.bbclass Henning Heinold
2009-03-27  4:16 ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.