diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-12-05 14:48:11 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-21 12:37:53 +0000 |
commit | a1c24ecbe84866e116e795f509b70124a4d9f730 (patch) | |
tree | a9bfe13b2e0a2e31ca162cf8bb51429e068b130d /meta/recipes-kernel | |
parent | d1aced444f565e580ccc362a360625baae4a0aef (diff) | |
download | poky-a1c24ecbe84866e116e795f509b70124a4d9f730.tar.gz |
kerneldev: create kernel-devsrc packaging
kernel-devsrc is responsible for creating and a packaging an environment
appropriate for kernel development (on or off target).
To create this support, we only need to copy/install the results of the
virtual/kernel providers build in the staging dir ... with some minor
manipulations to the source tree (.git removal and a clean up). This
produces a source tree that is capable of rebuilding the kernel on the
target.
Installing the kernel-devsrc package on a target (along with a
toolchain) is all that remains to be done.
$ cd /usr/src/kernel
$ make oldconfig
$ make -j2 bzImage
(From OE-Core rev: 6412dc1df434f774c434ec08bf9b3706edb756f2)
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r-- | meta/recipes-kernel/linux/kernel-devsrc.bb | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb new file mode 100644 index 0000000000..facc235e2d --- /dev/null +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb | |||
@@ -0,0 +1,50 @@ | |||
1 | SUMMARY = "Linux kernel Development Source" | ||
2 | DESCRIPTION = "Development source linux kernel. When built, this recipe packages the \ | ||
3 | source of the preferred virtual/kernel provider and makes it available for full kernel \ | ||
4 | development or external module builds" | ||
5 | |||
6 | SECTION = "kernel" | ||
7 | |||
8 | LICENSE = "GPLv2" | ||
9 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" | ||
10 | |||
11 | inherit linux-kernel-base | ||
12 | |||
13 | # We need the kernel to be staged (unpacked, patched and configured) before | ||
14 | # we can grab the source and make the kernel-devsrc package | ||
15 | do_install[depends] += "virtual/kernel:do_populate_sysroot" | ||
16 | |||
17 | # There's nothing to do here, except install the source where we can package it | ||
18 | do_fetch[noexec] = "1" | ||
19 | do_unpack[noexec] = "1" | ||
20 | do_patch[noexec] = "1" | ||
21 | do_configure[noexec] = "1" | ||
22 | do_compile[noexec] = "1" | ||
23 | do_populate_sysroot[noexec] = "1" | ||
24 | |||
25 | # Define where the kernel headers are installed on the target as well as where | ||
26 | # they are staged. | ||
27 | KERNEL_SRC_PATH = "/usr/src/kernel" | ||
28 | S = "${STAGING_DIR_TARGET}/${KERNEL_SRC_PATH}" | ||
29 | |||
30 | KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}" | ||
31 | |||
32 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
33 | |||
34 | do_install() { | ||
35 | kerneldir=${D}${KERNEL_SRC_PATH} | ||
36 | install -d $kerneldir | ||
37 | |||
38 | # | ||
39 | # Copy the staging dir source (and module build support) into the devsrc structure. | ||
40 | # We can keep this copy simple and take everything, since a we'll clean up any build | ||
41 | # artifacts afterwards, and the extra i/o is not significant | ||
42 | # | ||
43 | cd ${S} | ||
44 | find . -type d -name '.git*' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir | ||
45 | oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts | ||
46 | } | ||
47 | |||
48 | PACKAGES = "kernel-devsrc" | ||
49 | FILES_${PN} = "${KERNEL_SRC_PATH}" | ||
50 | RDEPENDS_${PN} = "bc" | ||