diff options
authorBruce Ashfield <>2020-11-17 23:56:33 -0500
committerRichard Purdie <>2020-11-18 13:59:22 +0000
commit7d94f9209ebaaf59ea001239a889dd7f928a0e7c (patch)
parentcf3305eb2d1d8cf38fdbcb75cd50fa523fbce006 (diff)
kernel: relocate copy of to module compilation task
There were two copies of this patch floating around, and the merged variant has the copy in the wrong place. is only created during modules_prepare, and that target is not invoked during our main build of the kernel. We aren't about to change the kernel build (there's no need), so we move the copy into the compile_kernelmodules task. After that runs, we have availble to copy. This has been tested against clean kernel + out of tree module builds, and the dependencies are correct that the file is copied before the out of tree module build starts. Signed-off-by: Bruce Ashfield <> Signed-off-by: Richard Purdie <>
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 681b0be4e1..1a444efabf 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -383,6 +383,10 @@ do_compile_kernelmodules() {
# other kernel modules and will look at this
# file to do symbol lookups
cp ${B}/Module.symvers ${STAGING_KERNEL_BUILDDIR}/
+ # 5.10+ kernels have that we need to copy for external module builds
+ if [ -e "${B}/scripts/" ]; then
+ install -Dm 0644 ${B}/scripts/ ${STAGING_KERNEL_BUILDDIR}/scripts/
+ fi
bbnote "no modules to compile"
@@ -486,7 +490,6 @@ do_shared_workdir () {
# Copy files required for module builds
cp $kerneldir/${KERNEL_VERSION}
[ -e Module.symvers ] && cp Module.symvers $kerneldir/
- [ -e scripts/ ] && install -Dm 0644 scripts/ $kerneldir/scripts/
cp .config $kerneldir/
mkdir -p $kerneldir/include/config
cp include/config/kernel.release $kerneldir/include/config/kernel.release