summaryrefslogtreecommitdiffstats
path: root/meta/classes/module-base.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2015-01-15 11:54:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-16 23:08:18 +0000
commit46cdaf1c7bc597735d926af6a46f9483f7e57ce5 (patch)
treee3e9a582d734bc1c6b09dbc3d9af6f5cdd364dbd /meta/classes/module-base.bbclass
parent92725ad46f4d331bea6a2fa65964158d78a7add8 (diff)
downloadpoky-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/classes/module-base.bbclass')
-rw-r--r--meta/classes/module-base.bbclass12
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/classes/module-base.bbclass b/meta/classes/module-base.bbclass
index 9537ba9f43..3eb2e9226e 100644
--- a/meta/classes/module-base.bbclass
+++ b/meta/classes/module-base.bbclass
@@ -3,16 +3,24 @@ inherit kernel-arch
3export OS = "${TARGET_OS}" 3export OS = "${TARGET_OS}"
4export CROSS_COMPILE = "${TARGET_PREFIX}" 4export CROSS_COMPILE = "${TARGET_PREFIX}"
5 5
6export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion')}" 6# This points to the build artefacts from the main kernel build
7# such as .config and System.map
8# Confusingly it is not the module build output (which is ${B}) but
9# we didn't pick the name.
10export KBUILD_OUTPUT = "${STAGING_KERNEL_BUILDDIR}"
11
12export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}"
7KERNEL_OBJECT_SUFFIX = ".ko" 13KERNEL_OBJECT_SUFFIX = ".ko"
8 14
9# kernel modules are generally machine specific 15# kernel modules are generally machine specific
10PACKAGE_ARCH = "${MACHINE_ARCH}" 16PACKAGE_ARCH = "${MACHINE_ARCH}"
11 17
18do_configure[depends] += "virtual/kernel:do_shared_workdir"
19
12# Function to ensure the kernel scripts are created. Expected to 20# Function to ensure the kernel scripts are created. Expected to
13# be called before do_compile. See module.bbclass for an exmaple. 21# be called before do_compile. See module.bbclass for an exmaple.
14do_make_scripts() { 22do_make_scripts() {
15 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS 23 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
16 make CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \ 24 make CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
17 -C ${STAGING_KERNEL_DIR} scripts 25 -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts
18} 26}