public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH v2] kernel: relocate copy of module.lds to module compilation task
@ 2020-11-18  4:56 Bruce Ashfield
  2020-11-18  5:26 ` [OE-core] " Khem Raj
  2020-11-30  7:38 ` Nicolas Dechesne
  0 siblings, 2 replies; 7+ messages in thread
From: Bruce Ashfield @ 2020-11-18  4:56 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

From: Bruce Ashfield <bruce.ashfield@gmail.com>

There were two copies of this patch floating around, and the merged
variant has the copy in the wrong place.

module.lds 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 module.lds
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 <bruce.ashfield@gmail.com>
---

v2:

I had done my test builds on a branch that didn't actually contain my
change, hence why 5.8 builds where blowing up.

I switched to the if [ ] model, since that doesn't run afoul of the
exit handler. I do find it curious that the compile task behaves so
differently than the install ones (even with set +e, I couldn't use
the [ ] method.

Anyway, this is tested against 5.8 and 5.10 + eternal module builds

Bruce

 meta/classes/kernel.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index ccd74e61e8..8b28ee626f 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -391,6 +391,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 module.lds that we need to copy for external module builds
+		if [ -e "${B}/scripts/module.lds" ]; then
+			install -Dm 0644 ${B}/scripts/module.lds ${STAGING_KERNEL_BUILDDIR}/scripts/module.lds
+		fi
 	else
 		bbnote "no modules to compile"
 	fi
@@ -494,7 +498,6 @@ do_shared_workdir () {
 	# Copy files required for module builds
 	cp System.map $kerneldir/System.map-${KERNEL_VERSION}
 	[ -e Module.symvers ] && cp Module.symvers $kerneldir/
-	[ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds $kerneldir/scripts/module.lds
 	cp .config $kerneldir/
 	mkdir -p $kerneldir/include/config
 	cp include/config/kernel.release $kerneldir/include/config/kernel.release
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-30 16:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-18  4:56 [PATCH v2] kernel: relocate copy of module.lds to module compilation task Bruce Ashfield
2020-11-18  5:26 ` [OE-core] " Khem Raj
2020-11-30  7:38 ` Nicolas Dechesne
2020-11-30 13:24   ` Bruce Ashfield
2020-11-30 14:36     ` Steve Sakoman
2020-11-30 15:33   ` Steve Sakoman
2020-11-30 16:45     ` Nicolas Dechesne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox