diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 14:31:25 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 16:43:26 +0000 |
commit | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch) | |
tree | ecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb | |
parent | e18c61205e0234b03697129c20cc69c9b3940efc (diff) | |
download | blackbird-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.gz blackbird-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.zip |
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to
hold all of the layers that we import with git-subtree.
Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb')
-rw-r--r-- | import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb b/import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb new file mode 100644 index 000000000..196c8c7a2 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-kernel/linux/kernel-devsrc.bb @@ -0,0 +1,76 @@ +SUMMARY = "Linux kernel Development Source" +DESCRIPTION = "Development source linux kernel. When built, this recipe packages the \ +source of the preferred virtual/kernel provider and makes it available for full kernel \ +development or external module builds" + +SECTION = "kernel" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +inherit linux-kernel-base + +# Whilst not a module, this ensures we don't get multilib extended (which would make no sense) +inherit module-base + +# We need the kernel to be staged (unpacked, patched and configured) before +# we can grab the source and make the source package. We also need the bits from +# ${B} not to change while we install, so virtual/kernel must finish do_compile. +do_install[depends] += "virtual/kernel:do_shared_workdir" +# Need the source, not just the output of populate_sysroot +do_install[depends] += "virtual/kernel:do_install" + +# There's nothing to do here, except install the source where we can package it +do_fetch[noexec] = "1" +do_unpack[noexec] = "1" +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_populate_sysroot[noexec] = "1" + +# Define where the kernel headers are installed on the target as well as where +# they are staged. +KERNEL_SRC_PATH = "/usr/src/kernel" +S = "${STAGING_KERNEL_DIR}" +B = "${STAGING_KERNEL_BUILDDIR}" + +KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +do_install() { + kerneldir=${D}${KERNEL_SRC_PATH} + install -d $kerneldir + + # + # Copy the staging dir source (and module build support) into the devsrc structure. + # We can keep this copy simple and take everything, since a we'll clean up any build + # artifacts afterwards, and the extra i/o is not significant + # + cd ${B} + find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir + cd ${S} + find . -type d -name '.git*' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir + + # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not + # The main build artifacts. We clean the directory to avoid QA errors on mismatched + # architecture (since scripts and helpers are native format). + KBUILD_OUTPUT="$kerneldir" + oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts + + # 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 + mkdir -p $kerneldir/arch/powerpc/lib/ + cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o + fi + + chown -R root:root ${D} +} +# Ensure we don't race against "make scripts" during cpio +do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock" + +PACKAGES = "kernel-devsrc" +FILES_${PN} = "${KERNEL_SRC_PATH}" +RDEPENDS_${PN} = "bc" |