]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
kernel.bbclass: Add shared_workdir_prepare task
authorJose Quaresma <quaresma.jose@gmail.com>
Wed, 20 Jul 2022 11:30:43 +0000 (12:30 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 8 Aug 2022 14:44:21 +0000 (15:44 +0100)
The task do_compile_kernelmodules runs after the shared_workdir and
is installing some files in STAGING_KERNEL_BUILDDIR, this can races
in other recipes that depends on "virtual/kernel:do_shared_workdir"
as the STAGING_KERNEL_BUILDDIR is not fully populated when the
shared_workdir task ends.

To address this issue a new task is added in place of the previows one
so the shared_workdir will run after the do_compile_kernelmodules and
the new shared_workdir_prepare will replce of the old shared_workdir.

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/classes/kernel.bbclass

index 61b3e8c95673e6ea863fa2993a342d177d3fb4c4..f41ac8e29b66b9f4405bee0139e22b5b6a0da32b 100644 (file)
@@ -504,7 +504,8 @@ do_kernel_version_sanity_check() {
        exit 0
 }
 
-addtask shared_workdir after do_compile before do_compile_kernelmodules
+addtask shared_workdir_prepare after do_compile before do_compile_kernelmodules
+addtask shared_workdir after do_compile_kernelmodules
 addtask shared_workdir_setscene
 
 do_shared_workdir_setscene () {
@@ -520,10 +521,16 @@ emit_depmod_pkgdata() {
 
 PACKAGEFUNCS += "emit_depmod_pkgdata"
 
-do_shared_workdir[cleandirs] += " ${STAGING_KERNEL_BUILDDIR}"
 do_shared_workdir () {
        cd ${B}
 
+       kerneldir=${STAGING_KERNEL_BUILDDIR}
+}
+
+do_shared_workdir_prepare[cleandirs] += " ${STAGING_KERNEL_BUILDDIR}"
+do_shared_workdir_prepare () {
+       cd ${B}
+
        kerneldir=${STAGING_KERNEL_BUILDDIR}
        install -d $kerneldir