Bug in kernel-arch.bbclass
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
@@ -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
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'
elifre.match('arm26$', a): return 'arm26'
elifre.match('armeb$', a): return 'arm'
elifre.match('mipsel$', a): return 'mips'
elifre.match('sh(3|4)$', a): return 'sh'
elifre.match('bfin', a): return 'blackfin'
elif a invalid_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