On 2025-11-19 11:47 a.m., [email protected] wrote:
From: Harish Sadineni<[email protected]>

Add initial support for building the Linux kernel with Rust enabled:

- Introduce `rust.cfg rust-samples.cfg rust-debug.cfg` to set Rust-related 
kernel config options, including:
   - `CONFIG_RUST=y`
   - Rust sample modules and developer checks (overflow/debug assertions)

- Update `linux-yocto_${PV}.bb` to:
   - Append `rust.scc rust-samples.scc` to `SRC_URI` and `KERNEL_FEATURES`

when sending non-RFC version, we will send kernel-config-fragment to the 
yocto-kenrel-cache

Signed-off-by: Harish Sadineni<[email protected]>
---
  meta/recipes-kernel/linux/files/rust-debug.cfg   | 1 +
  meta/recipes-kernel/linux/files/rust-debug.scc   | 3 +++
  meta/recipes-kernel/linux/files/rust-samples.cfg | 4 ++++
  meta/recipes-kernel/linux/files/rust-samples.scc | 3 +++
  meta/recipes-kernel/linux/files/rust.cfg         | 3 +++
  meta/recipes-kernel/linux/files/rust.scc         | 3 +++
  meta/recipes-kernel/linux/linux-yocto_6.16.bb    | 2 ++
  meta/recipes-kernel/linux/linux-yocto_6.17.bb    | 2 ++
  8 files changed, 21 insertions(+)
  create mode 100644 meta/recipes-kernel/linux/files/rust-debug.cfg
  create mode 100644 meta/recipes-kernel/linux/files/rust-debug.scc
  create mode 100644 meta/recipes-kernel/linux/files/rust-samples.cfg
  create mode 100644 meta/recipes-kernel/linux/files/rust-samples.scc
  create mode 100644 meta/recipes-kernel/linux/files/rust.cfg
  create mode 100644 meta/recipes-kernel/linux/files/rust.scc

>< snip ><
diff --git a/meta/recipes-kernel/linux/linux-yocto_6.16.bb 
b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
index 2188c7fed2..37cada11a5 100644
--- a/meta/recipes-kernel/linux/linux-yocto_6.16.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_6.16.bb
@@ -77,3 +77,5 @@ KERNEL_FEATURES:append:powerpc64le = " 
arch/powerpc/powerpc-debug.scc"
  # Check again during next major version upgrade
  KERNEL_FEATURES:remove:riscv32 = "features/debug/debug-kernel.scc"
  INSANE_SKIP:kernel-vmlinux:qemuppc64 = "textrel"
+SRC_URI +="${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' file://rust.scc file://rust-samples.scc file://rust-debug.scc', '', d)}"

I suspect that we want to pull in _only_ rust.scc by default.
Do you agree Harish?


This is fine for now and can be fixed once the fragments are merged in y-k-cache.

../Randy


+KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' 
rust.scc rust-samples.scc rust-debug.scc', '', d)}"
diff --git a/meta/recipes-kernel/linux/linux-yocto_6.17.bb 
b/meta/recipes-kernel/linux/linux-yocto_6.17.bb
index 5d10a17e70..f63405a3a0 100644
--- a/meta/recipes-kernel/linux/linux-yocto_6.17.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_6.17.bb
@@ -77,3 +77,5 @@ KERNEL_FEATURES:append:powerpc64le = " 
arch/powerpc/powerpc-debug.scc"
  # Check again during next major version upgrade
  KERNEL_FEATURES:remove:riscv32 = "features/debug/debug-kernel.scc"
  INSANE_SKIP:kernel-vmlinux:qemuppc64 = "textrel"
+SRC_URI +="${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' file://rust.scc file://rust-samples.scc file://rust-debug.scc', '', d)}"
+KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', ' 
rust.scc rust-samples.scc rust-debug.scc', '', d)}"


--
# Randy MacLeod
# Wind River Linux
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#226588): 
https://lists.openembedded.org/g/openembedded-core/message/226588
Mute This Topic: https://lists.openembedded.org/mt/116376809/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to