| Message ID | 20251119164804.256364-8-Harish.Sadineni@windriver.com |
|---|---|
| State | New |
| Headers | show |
| Series | Enable rust support for linux kernel | expand |
diff --git a/meta/recipes-kernel/linux/files/rust-debug.cfg b/meta/recipes-kernel/linux/files/rust-debug.cfg new file mode 100644 index 0000000000..d9aeeb4e91 --- /dev/null +++ b/meta/recipes-kernel/linux/files/rust-debug.cfg @@ -0,0 +1 @@ +CONFIG_RUST_DEBUG_ASSERTIONS=y diff --git a/meta/recipes-kernel/linux/files/rust-debug.scc b/meta/recipes-kernel/linux/files/rust-debug.scc new file mode 100644 index 0000000000..ef0ef3af6e --- /dev/null +++ b/meta/recipes-kernel/linux/files/rust-debug.scc @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT + +kconf non-hardware rust-debug.cfg diff --git a/meta/recipes-kernel/linux/files/rust-samples.cfg b/meta/recipes-kernel/linux/files/rust-samples.cfg new file mode 100644 index 0000000000..c6cc803702 --- /dev/null +++ b/meta/recipes-kernel/linux/files/rust-samples.cfg @@ -0,0 +1,4 @@ +CONFIG_SAMPLES_RUST=y +CONFIG_SAMPLE_RUST_MINIMAL=m +CONFIG_SAMPLE_RUST_PRINT=y +CONFIG_SAMPLE_RUST_HOSTPROGS=y diff --git a/meta/recipes-kernel/linux/files/rust-samples.scc b/meta/recipes-kernel/linux/files/rust-samples.scc new file mode 100644 index 0000000000..476cc92f93 --- /dev/null +++ b/meta/recipes-kernel/linux/files/rust-samples.scc @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT + +kconf non-hardware rust-samples.cfg diff --git a/meta/recipes-kernel/linux/files/rust.cfg b/meta/recipes-kernel/linux/files/rust.cfg new file mode 100644 index 0000000000..105eb0a14d --- /dev/null +++ b/meta/recipes-kernel/linux/files/rust.cfg @@ -0,0 +1,3 @@ +CONFIG_RUST=y +CONFIG_RUST_OVERFLOW_CHECKS=y +CONFIG_RUST_BUILD_ASSERT_ALLOW=y diff --git a/meta/recipes-kernel/linux/files/rust.scc b/meta/recipes-kernel/linux/files/rust.scc new file mode 100644 index 0000000000..51d9de1673 --- /dev/null +++ b/meta/recipes-kernel/linux/files/rust.scc @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT + +kconf non-hardware rust.cfg 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)}" +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)}"