From: Harish Sadineni Date: Fri, 13 Mar 2026 15:59:10 +0000 (-0700) Subject: kernel-yocto-rust: enable Rust kernel support via 'make rustavailable'. X-Git-Tag: yocto-6.0_M3~355 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c90097bebeffe7c5be35fc56e61b1994f03d6a9;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git kernel-yocto-rust: enable Rust kernel support via 'make rustavailable'. 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 Signed-off-by: Richard Purdie --- diff --git a/meta/classes-recipe/kernel-yocto-rust.bbclass b/meta/classes-recipe/kernel-yocto-rust.bbclass new file mode 100644 index 0000000000..7acc81764f --- /dev/null +++ b/meta/classes-recipe/kernel-yocto-rust.bbclass @@ -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 +} diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass index a77f2214c2..e7fdeb5d4b 100644 --- a/meta/classes-recipe/kernel-yocto.bbclass +++ b/meta/classes-recipe/kernel-yocto.bbclass @@ -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"