From 5e07bc91281969d54896dd0a13e3d6134e432027 Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Tue, 18 May 2010 14:46:33 +0100 Subject: kernel.bbclass: fix installing of kernels 2.6.34 and above Changes merged from upstream to cope with changes to directory structures in recent kernels when building for x86 Signed-off-by: Joshua Lock --- meta/classes/kernel.bbclass | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'meta/classes/kernel.bbclass') diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 6f8ee31ffc..6963184881 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -107,45 +107,50 @@ kernel_do_install() { fi kerneldir=${D}/kernel/ - ASMDIR=`readlink include/asm` - mkdir -p $kerneldir/include/$ASMDIR - cp -fR include/$ASMDIR/* $kerneldir/include/$ASMDIR/ + 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 $kerneldir/include/$ASMDIR + cp -fR include/$ASMDIR/* $kerneldir/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/* $kerneldir/include/$ASMDIR/ + if [ -e include/asm ] ; then + cp -fR arch/${ARCH}/include/asm/* $kerneldir/include/$ASMDIR/ + fi install -d $kerneldir/arch/${ARCH}/include cp -fR arch/${ARCH}/* $kerneldir/arch/${ARCH}/ # Check for arch/x86 on i386 elif [ -d arch/x86/include/asm/ ]; then + mkdir -p $kerneldir/include/asm-x86/ cp -fR arch/x86/include/asm/* $kerneldir/include/asm-x86/ install -d $kerneldir/arch/x86/include cp -fR arch/x86/* $kerneldir/arch/x86/ fi - rm -f $kerneldir/include/asm - ln -sf $ASMDIR $kerneldir/include/asm + if [ -e include/asm ] ; then + rm -f $kerneldir/include/asm + ln -sf $ASMDIR $kerneldir/include/asm + fi mkdir -p $kerneldir/include/asm-generic cp -fR include/asm-generic/* $kerneldir/include/asm-generic/ - mkdir -p $kerneldir/include/linux - cp -fR include/linux/* $kerneldir/include/linux/ - - mkdir -p $kerneldir/include/net - cp -fR include/net/* $kerneldir/include/net/ - - mkdir -p $kerneldir/include/pcmcia - cp -fR include/pcmcia/* $kerneldir/include/pcmcia/ - - for entry in drivers/crypto drivers/media include/media include/acpi include/sound include/video include/scsi include/trace; do + for entry in drivers/crypto drivers/media include/generated include/linux include/net include/pcmcia include/media include/acpi include/sound include/video include/scsi include/trace include/mtd include/rdma include/drm include/xen; do if [ -d $entry ]; then mkdir -p $kerneldir/$entry cp -fR $entry/* $kerneldir/$entry/ fi done + if [ -f include/Kbuild ]; then + cp -fR include/Kbuild $kerneldir/include + fi + if [ -d drivers/sound ]; then # 2.4 alsa needs some headers from this directory mkdir -p $kerneldir/include/drivers/sound @@ -309,7 +314,7 @@ python populate_packages_prepend () { dvar = bb.data.getVar('PKGD', d, 1) if not dvar: - bb.error("D not defined") + bb.error("PKGD not defined") return kernelver = bb.data.getVar('KERNEL_VERSION', d, 1) -- cgit v1.2.3