[meta-intel] Intel Atom E3845: Kernel recipe problems

Prasant J pj0585 at gmail.com
Fri Feb 12 04:23:05 PST 2016


On Thu, Feb 11, 2016 at 7:48 PM, Saul Wold <saul.wold at intel.com> wrote:
> On Thu, 2016-02-11 at 11:43 +0530, Prasant J wrote:
>> Hi,
>>
>> I'm putting together my own yocto layer or the Intel Atom Board.
>>
>> I have a custom kernel recipe that pulls kernel code from my server
>> and builds it. I'm able to build the kernel, but I'm facing one
>> problem.
>>
> While you are using meta-intel, this is more of a generic Yocto Project
> question more appropriate on yocto at yoctoproject.org. Let's start here
> with maybe getting more information about your recipe, can you share a
> copy of the recipe?  Maybe redacted version if you need to.
>>
>> My problem:
>> After kernel build is complete and do_install is being executed, the
>> kernel source is copied to ${D}/usr/src/kernel. Apert from source
>> code, even build directories like, image, package, packages-split,
>> deploy-rpms, pkgdata, etc also get copied to ${D}/usr/src/kernel
>> directory.
> Without more information about what you are doing in your recipe, like
> which kernel related inherits or if you based this off the meta-
> skeleton example of doing a custom kernel. It's hard to know why the
> source is getting copied.
>
> Sau!
>
>> I currently work around this problem by deleting the unwanted dirs in
>> do_install_append() function in my recipe.
>>
>> The unnecessary copying increases the build time of the recipe.
>>
>> How can I avoid this?
>>

Hi Saul,

Thanks for your response!

My Kernel recipe is based on poky/meta/recipes-kernel/linux/linux-yocto.inc
But it is significantly simple as I'm using kernel.tar.gz as the
source instead of git.

When I was investigating I realised that: as the source is "tar.gz"
the source code gets unpacked in ${WORKDIR} and the symbolic link
${B}/source points to "${WORKDIR}, so it copies all the files.
I was forced to set ${S} to ${WORKDIR} as there was some build problem.


- Is there a way that tar can unpack in ${S} instead of ${WORKDIR}?
- Is it a problem is the kernel source is supplied as tar.gz instead
from a git repo?
- Is there a way to prevent copying the kernel source to the final
image? (If we skip this step during install then we can avoid this
problem?



Below is a cut down version of my kernel recipe:

==================================================================

DESCRIPTION = "Atom Kernel"
SECTION = "kernel"
LICENSE = "GPLv2"

INC_PR = "r4"

LINUX_KERNEL_TYPE ?= "standard"
LINUX_VERSION_EXTENSION ?= "-yocto-${LINUX_KERNEL_TYPE}"

# Pick up shared functions
inherit kernel

LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

LINUX_VERSION = "3.17.1"
COMPATIBLE_MACHINE = "mymachine"

SRC_URI           =
"http://dev.myserver.com/kernel/${PN}-${PV}.tar.gz;name=kernel"
SRC_URI_append    = " file://defconfig"
SRC_URI[kernel.md5sum] = "14763e78c9dcfb10090489c302efeae2"
SRC_URI[kernel.sha256sum] =
"ce6d3f5cafa1387ed8c4ba8aa19280075bb050db429d73054962c053d718058c"

S = "${WORKDIR}"

B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build"

KERNEL_CONFIG_COMMAND = "oe_runmake_call -C ${S} O=${B} oldnoconfig ||
yes '' | oe_runmake -C ${S} O=${B} oldconfig"

do_install_append(){
    if [ -n "${KMETA}" ]; then
            rm -rf ${STAGING_KERNEL_DIR}/${KMETA}
    fi
    if [ -e ${D}/usr/src/kernel/image ]; then
        rm -rf ${D}/usr/src/kernel/image
    fi
    if [ -e ${D}/usr/src/kernel/temp ]; then
        rm -rf ${D}/usr/src/kernel/temp
    fi
    if [ -e ${D}/usr/src/kernel/license-destdir ]; then
        rm -rf ${D}/usr/src/kernel/license-destdir
    fi
    if [ -e ${D}/usr/src/kernel/patches ]; then
        rm -rf ${D}/usr/src/kernel/patches
    fi
    if [ -e ${D}/usr/src/kernel/pseudo ]; then
        rm -rf ${D}/usr/src/kernel/pseudo
    fi
    if [ -e ${D}/usr/src/kernel/sstate-install-populate_lic ]; then
        rm -rf ${D}/usr/src/kernel/sstate-install-populate_lic
    fi
    BDIRNAME=`basename ${B}`
    if [ -e ${D}/usr/src/kernel/${BDIRNAME} ]; then
        rm -rf ${D}/usr/src/kernel/${BDIRNAME}
    fi
    if [ -e ${D}/usr/src/kernel/deploy-${PN} ]; then
        rm -rf ${D}/usr/src/kernel/deploy-${PN}
    fi
    if [ -e ${D}/usr/src/kernel/deploy-rpms ]; then
        rm -rf ${D}/usr/src/kernel/deploy-rpms
    fi
    if [ -e ${D}/usr/src/kernel/package ]; then
        rm -rf ${D}/usr/src/kernel/package
    fi
    if [ -e ${D}/usr/src/kernel/packages-split ]; then
        rm -rf ${D}/usr/src/kernel/packages-split
    fi
    if [ -e ${D}/usr/src/kernel/pkgdata ]; then
        rm -rf ${D}/usr/src/kernel/pkgdata
    fi
    if [ -e ${D}/usr/src/kernel/sysroot-destdir ]; then
        rm -rf ${D}/usr/src/kernel/sysroot-destdir
    fi
}

==================================================================


Regards, Pj


More information about the meta-intel mailing list