blob: 0fdd0ad5f633fab7b61e90c4f00de54614a76904 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Linux kernel Development Source"
2DESCRIPTION = "Development source linux kernel. When built, this recipe packages the \
3source of the preferred virtual/kernel provider and makes it available for full kernel \
4development or external module builds"
5
6SECTION = "kernel"
7
8LICENSE = "GPLv2"
9LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
10
11inherit linux-kernel-base
12
13# Whilst not a module, this ensures we don't get multilib extended (which would make no sense)
14inherit module-base
15
16# We need the kernel to be staged (unpacked, patched and configured) before
17# we can grab the source and make the source package. We also need the bits from
18# ${B} not to change while we install, so virtual/kernel must finish do_compile.
19do_install[depends] += "virtual/kernel:do_shared_workdir"
20# Need the source, not just the output of populate_sysroot
21do_install[depends] += "virtual/kernel:do_install"
22
23# There's nothing to do here, except install the source where we can package it
24do_fetch[noexec] = "1"
25do_unpack[noexec] = "1"
26do_patch[noexec] = "1"
27do_configure[noexec] = "1"
28do_compile[noexec] = "1"
29do_populate_sysroot[noexec] = "1"
30
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031S = "${STAGING_KERNEL_DIR}"
32B = "${STAGING_KERNEL_BUILDDIR}"
33
34KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}"
35
36PACKAGE_ARCH = "${MACHINE_ARCH}"
37
38do_install() {
39 kerneldir=${D}${KERNEL_SRC_PATH}
40 install -d $kerneldir
41
42 #
43 # Copy the staging dir source (and module build support) into the devsrc structure.
44 # We can keep this copy simple and take everything, since a we'll clean up any build
45 # artifacts afterwards, and the extra i/o is not significant
46 #
47 cd ${B}
48 find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
49 cd ${S}
50 find . -type d -name '.git*' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
51
52 # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not
53 # The main build artifacts. We clean the directory to avoid QA errors on mismatched
54 # architecture (since scripts and helpers are native format).
55 KBUILD_OUTPUT="$kerneldir"
56 oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts
57
58 # As of Linux kernel version 3.0.1, the clean target removes
59 # arch/powerpc/lib/crtsavres.o which is present in
60 # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
61 if [ ${ARCH} = "powerpc" ]; then
62 mkdir -p $kerneldir/arch/powerpc/lib/
63 cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
64 fi
65
66 chown -R root:root ${D}
67}
68# Ensure we don't race against "make scripts" during cpio
69do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
70
71PACKAGES = "kernel-devsrc"
72FILES_${PN} = "${KERNEL_SRC_PATH}"
73RDEPENDS_${PN} = "bc"