diff options
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r-- | meta/classes/kernel.bbclass | 91 |
1 files changed, 3 insertions, 88 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 70ed95bbe0..bca34f4698 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -3,6 +3,8 @@ inherit linux-kernel-base kernel-module-split PROVIDES += "virtual/kernel" DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native" +S = "${STAGING_DIR_TARGET}/${KERNEL_SRC_PATH}" + # we include gcc above, we dont need virtual/libc INHIBIT_DEFAULT_DEPS = "1" @@ -55,7 +57,7 @@ KERNEL_IMAGEDEST = "boot" # export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE",1) or "ttyS0"}" -KERNEL_VERSION = "${@get_kernelversion('${B}')}" +KERNEL_VERSION = "${@get_kernelversion_headers('${B}')}" KERNEL_LOCALVERSION ?= "" @@ -221,93 +223,6 @@ kernel_do_install() { # echo "${KERNEL_VERSION}" > $kerneldir/kernel-abiversion - - # - # Store kernel image name to allow use during image generation - # - - echo "${KERNEL_IMAGE_BASE_NAME}" >$kerneldir/kernel-image-name - - # - # Copy the entire source tree. In case an external build directory is - # used, copy the build directory over first, then copy over the source - # dir. This ensures the original Makefiles are used and not the - # redirecting Makefiles in the build directory. - # - find . -depth -not -name "*.cmd" -not -name "*.o" -not -name "*.so.dbg" -not -name "*.so" -not -path "./Documentation*" -not -path "./source*" -not -path "./.*" -print0 | cpio --null -pdlu $kerneldir - cp .config $kerneldir - if [ "${S}" != "${B}" ]; then - pwd="$PWD" - cd "${S}" - find . -depth -not -path "./Documentation*" -not -path "./.*" -print0 | cpio --null -pdlu $kerneldir - cd "$pwd" - fi - - # Test to ensure that the output file and image type are not actually - # the same file. If hardlinking is used, they will be the same, and there's - # no need to install. - ! [ ${KERNEL_OUTPUT} -ef $kerneldir/${KERNEL_IMAGETYPE} ] && install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE} - install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION} - - # Dummy Makefile so the clean below works - mkdir $kerneldir/Documentation - touch $kerneldir/Documentation/Makefile - - # - # Clean and remove files not needed for building modules. - # Some distributions go through a lot more trouble to strip out - # unecessary headers, for now, we just prune the obvious bits. - # - # We don't want to leave host-arch binaries in /sysroots, so - # we clean the scripts dir while leaving the generated config - # and include files. - # - oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts - - # hide directories that shouldn't have their .c, s and S files deleted - for d in tools scripts lib; do - mv $kerneldir/$d $kerneldir/.$d - done - - # delete .c, .s and .S files, unless we hid a directory as .<dir>. This technique is - # much faster than find -prune and -exec - find $kerneldir -not -path '*/\.*' -type f -name "*.[csS]" -delete - - # put the hidden dirs back - for d in tools scripts lib; do - mv $kerneldir/.$d $kerneldir/$d - done - - # As of Linux kernel version 3.0.1, the clean target removes - # arch/powerpc/lib/crtsavres.o which is present in - # KBUILD_LDFLAGS_MODULE, making it required to build external modules. - if [ ${ARCH} = "powerpc" ]; then - cp -l arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o - fi - - # Necessary for building modules like compat-wireless. - if [ -f include/generated/bounds.h ]; then - cp -l include/generated/bounds.h $kerneldir/include/generated/bounds.h - fi - if [ -d arch/${ARCH}/include/generated ]; then - mkdir -p $kerneldir/arch/${ARCH}/include/generated/ - cp -flR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/ - fi - - # Remove the following binaries which cause strip or arch QA errors - # during do_package for cross-compiled platforms - bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \ - arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \ - scripts/kconfig/conf.o scripts/kconfig/kxgettext.o" - for entry in $bin_files; do - rm -f $kerneldir/$entry - done - - # kernels <2.6.30 don't have $kerneldir/tools directory so we check if it exists before calling sed - if [ -f $kerneldir/tools/perf/Makefile ]; then - # Fix SLANG_INC for slang.h - sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile - fi } do_install[prefuncs] += "package_get_auto_pr" |