]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
kernel-yocto-rust: enable Rust kernel support via 'make rustavailable'.
authorHarish Sadineni <Harish.Sadineni@windriver.com>
Fri, 13 Mar 2026 15:59:10 +0000 (08:59 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Mar 2026 10:16:08 +0000 (10:16 +0000)
This change adds support for Rust-enabled kernel builds by:

-Extending do_kernel_configme dependencies to include rust-native,
 clang-native, and bindgen-cli-native.

-Invoking make rustavailable during do_kernel_configme() to prepare the
 kernel build environment for Rust.

Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/kernel-yocto-rust.bbclass [new file with mode: 0644]
meta/classes-recipe/kernel-yocto.bbclass

diff --git a/meta/classes-recipe/kernel-yocto-rust.bbclass b/meta/classes-recipe/kernel-yocto-rust.bbclass
new file mode 100644 (file)
index 0000000..7acc817
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+RUST_KERNEL_TASK_DEPENDS ?=  "rust-native:do_populate_sysroot clang-native:do_populate_sysroot bindgen-cli-native:do_populate_sysroot"
+do_kernel_configme[depends] += "${RUST_KERNEL_TASK_DEPENDS}"
+
+do_kernel_configme:append () {
+        oe_runmake -C ${S} O=${B} rustavailable
+}
index a77f2214c207c39e70595728d6430699e5cc0377..e7fdeb5d4b100a13b655ad214b7870436283a751 100644 (file)
@@ -4,6 +4,8 @@
 # SPDX-License-Identifier: MIT
 #
 
+inherit_defer ${@bb.utils.contains('KERNEL_FEATURES', 'rust', 'kernel-yocto-rust', '', d)}
+
 # remove tasks that modify the source tree in case externalsrc is inherited
 SRCTREECOVEREDTASKS += "do_validate_branches do_kernel_configcheck do_kernel_checkout do_fetch do_unpack do_patch"
 PATCH_GIT_USER_EMAIL ?= "kernel-yocto@oe"