From affbcf320284f0c0b2c6b16739a9aec3ef2c175c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 19 Nov 2009 13:22:48 +0000 Subject: [PATCH] kernel.bbclass: Merge do_stage into do_install Signed-off-by: Richard Purdie --- meta/classes/kernel.bbclass | 131 ++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 74f1b7527f..0907a48fb2 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -77,68 +77,6 @@ kernel_do_compile() { fi } -kernel_do_stage() { - ASMDIR=`readlink include/asm` - - mkdir -p ${STAGING_KERNEL_DIR}/include/$ASMDIR - cp -fR include/$ASMDIR/* ${STAGING_KERNEL_DIR}/include/$ASMDIR/ - rm -f $ASMDIR ${STAGING_KERNEL_DIR}/include/asm - ln -sf $ASMDIR ${STAGING_KERNEL_DIR}/include/asm - - mkdir -p ${STAGING_KERNEL_DIR}/include/asm-generic - cp -fR include/asm-generic/* ${STAGING_KERNEL_DIR}/include/asm-generic/ - - mkdir -p ${STAGING_KERNEL_DIR}/include/linux - cp -fR include/linux/* ${STAGING_KERNEL_DIR}/include/linux/ - - mkdir -p ${STAGING_KERNEL_DIR}/include/net - cp -fR include/net/* ${STAGING_KERNEL_DIR}/include/net/ - - mkdir -p ${STAGING_KERNEL_DIR}/include/pcmcia - cp -fR include/pcmcia/* ${STAGING_KERNEL_DIR}/include/pcmcia/ - - for entry in drivers/crypto include/media include/acpi include/sound include/video; do - if [ -d $entry ]; then - mkdir -p ${STAGING_KERNEL_DIR}/$entry - cp -fR $entry/* ${STAGING_KERNEL_DIR}/$entry/ - fi - done - - if [ -d drivers/sound ]; then - # 2.4 alsa needs some headers from this directory - mkdir -p ${STAGING_KERNEL_DIR}/include/drivers/sound - cp -fR drivers/sound/*.h ${STAGING_KERNEL_DIR}/include/drivers/sound/ - fi - - install -m 0644 .config ${STAGING_KERNEL_DIR}/config-${KERNEL_VERSION} - ln -sf config-${KERNEL_VERSION} ${STAGING_KERNEL_DIR}/.config - ln -sf config-${KERNEL_VERSION} ${STAGING_KERNEL_DIR}/kernel-config - echo "${KERNEL_VERSION}" >${STAGING_KERNEL_DIR}/kernel-abiversion - echo "${S}" >${STAGING_KERNEL_DIR}/kernel-source - echo "${KERNEL_CCSUFFIX}" >${STAGING_KERNEL_DIR}/kernel-ccsuffix - echo "${KERNEL_LDSUFFIX}" >${STAGING_KERNEL_DIR}/kernel-ldsuffix - [ -e Rules.make ] && install -m 0644 Rules.make ${STAGING_KERNEL_DIR}/ - [ -e Makefile ] && install -m 0644 Makefile ${STAGING_KERNEL_DIR}/ - - # Check if arch/${ARCH}/Makefile exists and install it - if [ -e arch/${ARCH}/Makefile ]; then - install -d ${STAGING_KERNEL_DIR}/arch/${ARCH} - install -m 0644 arch/${ARCH}/Makefile* ${STAGING_KERNEL_DIR}/arch/${ARCH} - # Otherwise check arch/x86/Makefile for i386 and x86_64 on kernels >= 2.6.24 - elif [ -e arch/x86/Makefile ]; then - install -d ${STAGING_KERNEL_DIR}/arch/x86 - install -m 0644 arch/x86/Makefile* ${STAGING_KERNEL_DIR}/arch/x86 - fi - cp -fR include/config* ${STAGING_KERNEL_DIR}/include/ - # Install kernel images and system.map to staging - [ -e vmlinux ] && install -m 0644 vmlinux ${STAGING_KERNEL_DIR}/ - install -m 0644 ${KERNEL_OUTPUT} ${STAGING_KERNEL_DIR}/${KERNEL_IMAGETYPE} - install -m 0644 System.map ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION} - [ -e Module.symvers ] && install -m 0644 Module.symvers ${STAGING_KERNEL_DIR}/ - - cp -fR scripts ${STAGING_KERNEL_DIR}/ -} - kernel_do_install() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then @@ -163,10 +101,73 @@ kernel_do_install() { oe_runmake SUBDIRS="scripts/genksyms" fi - install -d ${STAGING_KERNEL_DIR} - cp -fR scripts ${STAGING_KERNEL_DIR}/ + kerneldir=${D}/kernel/ + ASMDIR=`readlink include/asm` + + mkdir -p $kerneldir/include/$ASMDIR + cp -fR include/$ASMDIR/* $kerneldir/include/$ASMDIR/ + rm -f $ASMDIR $kerneldir/include/asm + ln -sf $ASMDIR $kerneldir/include/asm + + 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 include/media include/acpi include/sound include/video; do + if [ -d $entry ]; then + mkdir -p $kerneldir/$entry + cp -fR $entry/* $kerneldir/$entry/ + fi + done + + if [ -d drivers/sound ]; then + # 2.4 alsa needs some headers from this directory + mkdir -p $kerneldir/include/drivers/sound + cp -fR drivers/sound/*.h $kerneldir/include/drivers/sound/ + fi + + install -m 0644 .config $kerneldir/config-${KERNEL_VERSION} + ln -sf config-${KERNEL_VERSION} $kerneldir/.config + ln -sf config-${KERNEL_VERSION} $kerneldir/kernel-config + echo "${KERNEL_VERSION}" >$kerneldir/kernel-abiversion + echo "${S}" >$kerneldir/kernel-source + echo "${KERNEL_CCSUFFIX}" >$kerneldir/kernel-ccsuffix + echo "${KERNEL_LDSUFFIX}" >$kerneldir/kernel-ldsuffix + [ -e Rules.make ] && install -m 0644 Rules.make $kerneldir/ + [ -e Makefile ] && install -m 0644 Makefile $kerneldir/ + + # Check if arch/${ARCH}/Makefile exists and install it + if [ -e arch/${ARCH}/Makefile ]; then + install -d $kerneldir/arch/${ARCH} + install -m 0644 arch/${ARCH}/Makefile* $kerneldir/arch/${ARCH} + # Otherwise check arch/x86/Makefile for i386 and x86_64 on kernels >= 2.6.24 + elif [ -e arch/x86/Makefile ]; then + install -d $kerneldir/arch/x86 + install -m 0644 arch/x86/Makefile* $kerneldir/arch/x86 + fi + cp -fR include/config* $kerneldir/include/ + # Install kernel images and system.map to staging + [ -e vmlinux ] && install -m 0644 vmlinux $kerneldir/ + install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE} + install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION} + [ -e Module.symvers ] && install -m 0644 Module.symvers $kerneldir/ + + cp -fR scripts $kerneldir/ } +sysroot_stage_all_append() { + sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}${STAGING_KERNEL_DIR} +} + + kernel_do_configure() { yes '' | oe_runmake oldconfig } @@ -193,7 +194,7 @@ pkg_postrm_kernel () { inherit cml1 -EXPORT_FUNCTIONS do_compile do_install do_stage do_configure +EXPORT_FUNCTIONS do_compile do_install do_configure # kernel-base becomes kernel-${KERNEL_VERSION} # kernel-image becomes kernel-image-${KERNEL_VERISON}