diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2015-01-15 11:54:15 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-16 23:08:18 +0000 |
commit | 46cdaf1c7bc597735d926af6a46f9483f7e57ce5 (patch) | |
tree | e3e9a582d734bc1c6b09dbc3d9af6f5cdd364dbd /meta/recipes-kernel | |
parent | 92725ad46f4d331bea6a2fa65964158d78a7add8 (diff) | |
download | poky-46cdaf1c7bc597735d926af6a46f9483f7e57ce5.tar.gz |
kernel: move source and build output to work-shared
commit 3b3f7e785e279 [kernel: Rearrange for 1.8] began the process of
moving the kernel source and build artefacts out of sstate control and
into a shared location.
This changed triggered some workflow issues, as well as bugs related
to the kernel source containing build output, and hence being dirty and
breaking kernel rebuilds.
To solve these issues, and to make it clear that the kernel is not under
sstate control, we move the source and build outputs to:
work-shared/MACHINE/kernel-source
work-shared/MACHINE/kernel-build-artifacts
Where kernel-build-artifacts is the kernel build output and
kernel-source is kept "pristine". The build-artifacts contain everything
that is required to build external modules against the kernel source,
and includes the defconfig, the kernel-abiversion, System.map files and
output from "make scripts".
External module builds should either pass O= on the command line, or
set KBUILD_OUTPUT to point to the build-artifacts. module-base.bbclass
takes care of setting KBUILD_OUTPUT, so most existing external module
recipes are transparently adapted to the new source/build layout.
recipes that depend on the kernel source must have a depedency on the
do_shared_workdir task:
do_configure[depends] += "virtual/kernel:do_shared_workdir"
With this dependency added, the STAGING_KERNEL_DIR will be populated and
available to the rest of the build.
(From OE-Core rev: 6a1ff0e7eacef595738f2fed086986fd622ec32a)
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.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 | 14 | ||||
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-modules_2.5.2.bb | 2 | ||||
-rw-r--r-- | meta/recipes-kernel/perf/perf.bb | 2 |
3 files changed, 13 insertions, 5 deletions
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb index dbb3a5c581..a7395c46b9 100644 --- a/meta/recipes-kernel/linux/kernel-devsrc.bb +++ b/meta/recipes-kernel/linux/kernel-devsrc.bb | |||
@@ -15,7 +15,7 @@ inherit module-base | |||
15 | 15 | ||
16 | # We need the kernel to be staged (unpacked, patched and configured) before | 16 | # We need the kernel to be staged (unpacked, patched and configured) before |
17 | # we can grab the source and make the kernel-devsrc package | 17 | # we can grab the source and make the kernel-devsrc package |
18 | do_install[depends] += "virtual/kernel:do_populate_sysroot" | 18 | do_install[depends] += "virtual/kernel:do_shared_workdir" |
19 | # Need the source, not just the output of populate_sysroot | 19 | # Need the source, not just the output of populate_sysroot |
20 | do_install[depends] += "virtual/kernel:do_configure" | 20 | do_install[depends] += "virtual/kernel:do_configure" |
21 | 21 | ||
@@ -30,7 +30,8 @@ do_populate_sysroot[noexec] = "1" | |||
30 | # Define where the kernel headers are installed on the target as well as where | 30 | # Define where the kernel headers are installed on the target as well as where |
31 | # they are staged. | 31 | # they are staged. |
32 | KERNEL_SRC_PATH = "/usr/src/kernel" | 32 | KERNEL_SRC_PATH = "/usr/src/kernel" |
33 | S = "${STAGING_DIR_TARGET}/${KERNEL_SRC_PATH}" | 33 | S = "${STAGING_KERNEL_DIR}" |
34 | B = "${STAGING_KERNEL_BUILDDIR}" | ||
34 | 35 | ||
35 | KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}" | 36 | KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}" |
36 | 37 | ||
@@ -45,8 +46,15 @@ do_install() { | |||
45 | # We can keep this copy simple and take everything, since a we'll clean up any build | 46 | # We can keep this copy simple and take everything, since a we'll clean up any build |
46 | # artifacts afterwards, and the extra i/o is not significant | 47 | # artifacts afterwards, and the extra i/o is not significant |
47 | # | 48 | # |
49 | cd ${B} | ||
50 | find . -type d -name '.git*' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir | ||
48 | cd ${S} | 51 | cd ${S} |
49 | find . -type d -name '.git*' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir | 52 | find . -type d -name '.git*' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir |
53 | |||
54 | # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not | ||
55 | # The main build artifacts. We clean the directory to avoid QA errors on mismatched | ||
56 | # architecture (since scripts and helpers are native format). | ||
57 | KBUILD_OUTPUT="$kerneldir" | ||
50 | oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts | 58 | oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts |
51 | 59 | ||
52 | # As of Linux kernel version 3.0.1, the clean target removes | 60 | # As of Linux kernel version 3.0.1, the clean target removes |
@@ -54,7 +62,7 @@ do_install() { | |||
54 | # KBUILD_LDFLAGS_MODULE, making it required to build external modules. | 62 | # KBUILD_LDFLAGS_MODULE, making it required to build external modules. |
55 | if [ ${ARCH} = "powerpc" ]; then | 63 | if [ ${ARCH} = "powerpc" ]; then |
56 | mkdir -p $kerneldir/arch/powerpc/lib/ | 64 | mkdir -p $kerneldir/arch/powerpc/lib/ |
57 | cp ${S}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o | 65 | cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o |
58 | fi | 66 | fi |
59 | } | 67 | } |
60 | # Ensure we don't race against "make scripts" during cpio | 68 | # Ensure we don't race against "make scripts" during cpio |
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.5.2.bb b/meta/recipes-kernel/lttng/lttng-modules_2.5.2.bb index 55df07f632..6ec83d090a 100644 --- a/meta/recipes-kernel/lttng/lttng-modules_2.5.2.bb +++ b/meta/recipes-kernel/lttng/lttng-modules_2.5.2.bb | |||
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1412caf5a1aa90d6a48588a4794c0eac \ | |||
7 | file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad" | 7 | file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad" |
8 | 8 | ||
9 | DEPENDS = "virtual/kernel" | 9 | DEPENDS = "virtual/kernel" |
10 | do_configure[depends] += "virtual/kernel:do_install" | 10 | do_configure[depends] += "virtual/kernel:do_shared_workdir" |
11 | 11 | ||
12 | inherit module | 12 | inherit module |
13 | 13 | ||
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb index a42aa73c53..d2c9805412 100644 --- a/meta/recipes-kernel/perf/perf.bb +++ b/meta/recipes-kernel/perf/perf.bb | |||
@@ -32,7 +32,7 @@ DEPENDS = " \ | |||
32 | bison flex \ | 32 | bison flex \ |
33 | " | 33 | " |
34 | 34 | ||
35 | do_configure[depends] += "virtual/kernel:do_install" | 35 | do_configure[depends] += "virtual/kernel:do_shared_workdir" |
36 | 36 | ||
37 | PROVIDES = "virtual/perf" | 37 | PROVIDES = "virtual/perf" |
38 | 38 | ||