summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel.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/kernel.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/kernel.bbclass')
-rw-r--r--meta/classes/kernel.bbclass30
1 files changed, 18 insertions, 12 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 78c8c7cf00..a60de8cc9e 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -230,28 +230,33 @@ kernel_do_install() {
230 [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION} 230 [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION}
231 install -d ${D}${sysconfdir}/modules-load.d 231 install -d ${D}${sysconfdir}/modules-load.d
232 install -d ${D}${sysconfdir}/modprobe.d 232 install -d ${D}${sysconfdir}/modprobe.d
233}
234do_install[prefuncs] += "package_get_auto_pr"
233 235
234 # 236addtask shared_workdir after do_compile before do_install
235 # Support for external module building - create a minimal copy of the 237
236 # kernel source tree. 238do_shared_workdir () {
237 # 239 cd ${B}
238 kerneldir=${D}${KERNEL_SRC_PATH} 240
241 kerneldir=${STAGING_KERNEL_BUILDDIR}
239 install -d $kerneldir 242 install -d $kerneldir
240 mkdir -p ${D}/lib/modules/${KERNEL_VERSION}
241 ln -sf ${KERNEL_SRC_PATH} "${D}/lib/modules/${KERNEL_VERSION}/build"
242 243
243 # 244 #
244 # Store the kernel version in sysroots for module-base.bbclass 245 # Store the kernel version in sysroots for module-base.bbclass
245 # 246 #
246 247
247 echo "${KERNEL_VERSION}" > $kerneldir/kernel-abiversion 248 echo "${KERNEL_VERSION}" > $kerneldir/kernel-abiversion
248 249
249 # Copy files required for module builds 250 # Copy files required for module builds
250 cp System.map $kerneldir/System.map-${KERNEL_VERSION} 251 cp System.map $kerneldir/System.map-${KERNEL_VERSION}
251 cp Module.symvers $kerneldir/ 252 cp Module.symvers $kerneldir/
252 cp .config $kerneldir/ 253 cp .config $kerneldir/
253 mkdir -p $kerneldir/include/config 254 mkdir -p $kerneldir/include/config
254 cp include/config/kernel.release $kerneldir/include/config/kernel.release 255 cp include/config/kernel.release $kerneldir/include/config/kernel.release
256
257 # We can also copy over all the generated files and avoid special cases
258 # like version.h, but we've opted to keep this small until file creep starts
259 # to happen
255 if [ -e include/linux/version.h ]; then 260 if [ -e include/linux/version.h ]; then
256 mkdir -p $kerneldir/include/linux 261 mkdir -p $kerneldir/include/linux
257 cp include/linux/version.h $kerneldir/include/linux/version.h 262 cp include/linux/version.h $kerneldir/include/linux/version.h
@@ -273,10 +278,11 @@ kernel_do_install() {
273 cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/ 278 cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
274 fi 279 fi
275} 280}
276do_install[prefuncs] += "package_get_auto_pr"
277 281
278python sysroot_stage_all () { 282# We have an empty sysroot_stage_all to keep the default routine from
279 oe.path.copyhardlinktree(d.expand("${D}${KERNEL_SRC_PATH}"), d.expand("${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}")) 283# package.bbclass from expanding the kernel source into the sysroot and
284# colliding with linux-firmware files
285sysroot_stage_all () {
280} 286}
281 287
282KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} oldnoconfig || yes '' | oe_runmake -C ${S} O=${B} oldconfig" 288KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} oldnoconfig || yes '' | oe_runmake -C ${S} O=${B} oldconfig"
@@ -467,7 +473,7 @@ kernel_do_deploy() {
467do_deploy[dirs] = "${DEPLOYDIR} ${B}" 473do_deploy[dirs] = "${DEPLOYDIR} ${B}"
468do_deploy[prefuncs] += "package_get_auto_pr" 474do_deploy[prefuncs] += "package_get_auto_pr"
469 475
470addtask deploy before do_build after do_install 476addtask deploy after do_populate_sysroot
471 477
472EXPORT_FUNCTIONS do_deploy 478EXPORT_FUNCTIONS do_deploy
473 479