From: Harish.Sadineni@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: Randy.MacLeod@windriver.com, alistair.francis@wdc.com,
Sundeep.Kokkonda@windriver.com, bruce.ashfield@gmail.com,
richard.purdie@linuxfoundation.org, yoann.congal@smile.fr,
elmehdi.younes@smile.fr
Subject: [PATCH v4 12/16] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation
Date: Tue, 20 Jan 2026 10:29:43 -0800 [thread overview]
Message-ID: <20260120182947.857242-13-Harish.Sadineni@windriver.com> (raw)
In-Reply-To: <20260120182947.857242-1-Harish.Sadineni@windriver.com>
From: Yoann Congal <yoann.congal@smile.fr>
Publish artifacts from kernel compilation to allow out-of-tree Rust
compilation:
* scripts/target.json: target definition: architecture, ABI, compiler
options, ...
* rust/: the crates compiled by the kernel available to
out-of-tree-modules
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
meta/classes-recipe/kernel.bbclass | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 30a10b0801..dfb8604a68 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -632,6 +632,24 @@ do_shared_workdir () {
cp -r scripts/gcc-plugins ${kerneldir}/scripts
fi
+ if ${@bb.utils.contains("DISTRO_FEATURES", "rust-kernel", "true", "false", d)}; then
+ # Copy target.json file needed for out-of-tree rust modules
+ if [ -e scripts/target.json ]; then
+ bbnote "Copying scripts/target.json"
+ mkdir -p ${kerneldir}/scripts
+ cp scripts/target.json ${kerneldir}/scripts
+ else
+ bbwarn "scripts/target.json not found in compiled kernel. Out-of-tree rust modules will fail to build."
+ fi
+
+ # Copy rust/ needed by out-of-tree module (firstly for the core rust crate)
+ if [ -e rust/ ]; then
+ bbnote "Copying rust/"
+ cp -r rust ${kerneldir}/
+ else
+ bbwarn "rust/ not found in compiled kernel. Out-of-tree rust modules will fail to build."
+ fi
+ fi
}
# We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
--
2.49.0
next prev parent reply other threads:[~2026-01-20 18:31 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 18:29 [PATCH v4 00/16] Enable rust support for linux kernel Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 01/16] linux-yocto: conditionally add clang/rust/bindgen-cli-native to DEPENDS Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 02/16] rust: Install the Rust source Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 03/16] rust: install Rust library sources for target & sdk Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 04/16] kernel-yocto: enable Rust kernel support via 'make rustavailable' Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 05/16] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 06/16] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 07/16] make-mod-scripts: split `HOSTCC` flag to align with to linux-yocto Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 08/16] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 09/16] kernel-devsrc: copying rust-kernel source to $kerneldir/build Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 10/16] selftest/cases/runtime_test: Add test for Linux Rust sample Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 11/16] kernel.bbclass: Copy include/config/auto.conf in STAGING_KERNEL_BUILDDIR Harish.Sadineni
2026-01-20 18:29 ` Harish.Sadineni [this message]
2026-01-20 18:29 ` [PATCH v4 13/16] module.bbclass: Prepare out-of-tree rust module compilation Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 14/16] meta-skeleton: Add rust-out-of-tree-module recipe Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 15/16] make-mod-scripts: fix for buildpath issues with rust-out-of-tree compilation Harish.Sadineni
2026-01-20 18:29 ` [PATCH v4 16/16] runtime_test: Add rust-out-of-tree selftest Harish.Sadineni
2026-01-20 18:41 ` [PATCH v4 00/16] Enable rust support for linux kernel Sadineni, Harish
2026-01-21 15:16 ` [OE-core] " Antonin Godard
2026-01-22 11:53 ` Harish Sadineni
2026-01-22 14:24 ` Antonin Godard
2026-01-26 7:54 ` Antonin Godard
2026-01-28 17:34 ` Harish Sadineni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260120182947.857242-13-Harish.Sadineni@windriver.com \
--to=harish.sadineni@windriver.com \
--cc=Randy.MacLeod@windriver.com \
--cc=Sundeep.Kokkonda@windriver.com \
--cc=alistair.francis@wdc.com \
--cc=bruce.ashfield@gmail.com \
--cc=elmehdi.younes@smile.fr \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.org \
--cc=yoann.congal@smile.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox