diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-19 13:22:48 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-19 13:22:48 +0000 |
commit | affbcf320284f0c0b2c6b16739a9aec3ef2c175c (patch) | |
tree | 263ca27aa43ca6f5bfcc7d5e8683bc58b74911e4 | |
parent | 3a2ad83b387319c5806b61bde4c6df87b9f35500 (diff) | |
download | openembedded-core-affbcf320284f0c0b2c6b16739a9aec3ef2c175c.tar.gz openembedded-core-affbcf320284f0c0b2c6b16739a9aec3ef2c175c.tar.bz2 openembedded-core-affbcf320284f0c0b2c6b16739a9aec3ef2c175c.zip |
kernel.bbclass: Merge do_stage into do_install
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r-- | meta/classes/kernel.bbclass | 127 |
1 files changed, 64 insertions, 63 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,96 +77,97 @@ kernel_do_compile() { fi } -kernel_do_stage() { +kernel_do_install() { + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE + if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then + oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install + else + oenote "no modules to install" + fi + + install -d ${D}/${KERNEL_IMAGEDEST} + install -d ${D}/boot + install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} + install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} + install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} + install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} + install -d ${D}/etc/modutils + if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then + install -d ${D}/etc/modprobe.d + fi + + # Check if scripts/genksyms exists and if so, build it + if [ -e scripts/genksyms/ ]; then + oe_runmake SUBDIRS="scripts/genksyms" + fi + + kerneldir=${D}/kernel/ 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 $kerneldir/include/$ASMDIR + cp -fR include/$ASMDIR/* $kerneldir/include/$ASMDIR/ + rm -f $ASMDIR $kerneldir/include/asm + ln -sf $ASMDIR $kerneldir/include/asm - mkdir -p ${STAGING_KERNEL_DIR}/include/asm-generic - cp -fR include/asm-generic/* ${STAGING_KERNEL_DIR}/include/asm-generic/ + mkdir -p $kerneldir/include/asm-generic + cp -fR include/asm-generic/* $kerneldir/include/asm-generic/ - mkdir -p ${STAGING_KERNEL_DIR}/include/linux - cp -fR include/linux/* ${STAGING_KERNEL_DIR}/include/linux/ + mkdir -p $kerneldir/include/linux + cp -fR include/linux/* $kerneldir/include/linux/ - mkdir -p ${STAGING_KERNEL_DIR}/include/net - cp -fR include/net/* ${STAGING_KERNEL_DIR}/include/net/ + mkdir -p $kerneldir/include/net + cp -fR include/net/* $kerneldir/include/net/ - mkdir -p ${STAGING_KERNEL_DIR}/include/pcmcia - cp -fR include/pcmcia/* ${STAGING_KERNEL_DIR}/include/pcmcia/ + 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 ${STAGING_KERNEL_DIR}/$entry - cp -fR $entry/* ${STAGING_KERNEL_DIR}/$entry/ + 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 ${STAGING_KERNEL_DIR}/include/drivers/sound - cp -fR drivers/sound/*.h ${STAGING_KERNEL_DIR}/include/drivers/sound/ + mkdir -p $kerneldir/include/drivers/sound + cp -fR drivers/sound/*.h $kerneldir/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}/ + 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 ${STAGING_KERNEL_DIR}/arch/${ARCH} - install -m 0644 arch/${ARCH}/Makefile* ${STAGING_KERNEL_DIR}/arch/${ARCH} + 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 ${STAGING_KERNEL_DIR}/arch/x86 - install -m 0644 arch/x86/Makefile* ${STAGING_KERNEL_DIR}/arch/x86 + install -d $kerneldir/arch/x86 + install -m 0644 arch/x86/Makefile* $kerneldir/arch/x86 fi - cp -fR include/config* ${STAGING_KERNEL_DIR}/include/ + cp -fR include/config* $kerneldir/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}/ + [ -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 ${STAGING_KERNEL_DIR}/ + cp -fR scripts $kerneldir/ } -kernel_do_install() { - unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE - if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then - oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install - else - oenote "no modules to install" - fi - - install -d ${D}/${KERNEL_IMAGEDEST} - install -d ${D}/boot - install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} - install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} - install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} - install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} - install -d ${D}/etc/modutils - if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then - install -d ${D}/etc/modprobe.d - fi - - # Check if scripts/genksyms exists and if so, build it - if [ -e scripts/genksyms/ ]; then - oe_runmake SUBDIRS="scripts/genksyms" - fi - - install -d ${STAGING_KERNEL_DIR} - cp -fR scripts ${STAGING_KERNEL_DIR}/ +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} |