From patchwork Wed Nov 19 19:55:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 75036 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC9F1CF58DF for ; Wed, 19 Nov 2025 19:56:20 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16291.1763582174457447264 for ; Wed, 19 Nov 2025 11:56:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=ehzJGdmc; spf=pass (domain: smile.fr, ip: 209.85.128.42, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4779a637712so988035e9.1 for ; Wed, 19 Nov 2025 11:56:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1763582170; x=1764186970; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2SggtuzizRJqiBmfnNmzPm/NWZK3z5oaZfrEGGUEz4A=; b=ehzJGdmcB7RPxM5iGDvFIOizA6AngPkSnavbF3qEahPrOAbfTyqAKntwRsJfV6szAM 38rzS1bf4q5QiQexreroH0DdsnCVUk1SPpDV+Da1CpzcI+pkMYpz/ul5n0RBN4WUI5Vn 5QE/oOPOm8+etXuvGQdbjOxNsEZ6mQx22fBMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763582170; x=1764186970; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=2SggtuzizRJqiBmfnNmzPm/NWZK3z5oaZfrEGGUEz4A=; b=quyBVha1DRUjIYM0k90rlPHv6RMCHFwKisdx+epdSolAM2H/uaUsVijMgIwY05bX7F w1A8Odb3MtFJxLWysAIoDnyveGmHDmpRnIe5B+NOFWdJGFVI1uc5YlP5//1XPq0EO7l7 Lcp13wX0evA56pfyG4NbJPMf5fzWwz8HY7uMlbRQyrPSQtSGU5YPt5MqC06s7Y/eWHiD UjeNUx2b3d7U53uTQYLkaKHQ6foT2UAOzyZ6CcUaeg84HrawnRt8sNO2RuP1aUVRs5P5 kI2fuBZzlb2JoxJgRwxhg8euXGCzVFX4ohIzAYvAQhzkM/jB6es2bJEIf7MUWmW7ggK0 1q1g== X-Gm-Message-State: AOJu0YzEfgNDhXkw+Z67esie0SHi/5ZYrH6CeIPjAtgh4wzPyJVzaNAp QuVl1tmGJmxhDm3hms5b79ix9g28igWNZD842bU072XWUdPH03JMY/0g5ldB8FIcw4RL9q+I/XG bEc27oww= X-Gm-Gg: ASbGncvd59XZW57VayLj8qXiK1b+WM2qG/qCykzgNLMT+zWw+CS2v4k4iJx7Wa2r9Ye LEUC0nbUxEcJlaF8uHYVciUy9kQ5u3AZmzs1qfcILcqoSD1bzCZKLvBUAPBZgvY3IhjOyNzzbrz ws2kQCLkaWUsRyLyCU/WRoQigP8YuxR0IK1p27VHDepMiP6k4/htmBxev94I/6yagBI6hBiKFZg iX8S7oG7REQseXbXZwvxg5DnFF2jAsxVDYcOQKYobsfRa/tZF48xVYKmmAvXehbQDLp5NVjIeWD W1CO5Vo63NcCeaB/x0OOrT5pZ08bxpXYGPKIa0TAN/cEVbfFbXM0m0/FYgS6TvkU03XYcqpvrhd QfcS+xVNLXwb9FVPhO1NRWboHVnM8qqDtrqxBu8PYKirrXoU2Vnu0fZoqHj6QSJhoZxDnw0zz93 z1nRv1EscGn4fACyHvADtix2STScoDoNgXD9lWWjRUmi7Xg8iuG7ckijHoG0iK5RjkQJIIZK47U j9Gl59EZC7rpOtEtUt+/gzKDSHgU4oJ X-Google-Smtp-Source: AGHT+IHuOm7pq7uQndJXkCcJVm+Hm8M8LRyQ3btuRNrTvICWJUo9lGMdNrkIJirz7OVdF/xgViLR5g== X-Received: by 2002:a05:600c:1c15:b0:471:672:3486 with SMTP id 5b1f17b1804b1-477b8a63477mr5638535e9.15.1763582170432; Wed, 19 Nov 2025 11:56:10 -0800 (PST) Received: from P-ASN-ECS-830T8C3.home (2a01cb001331aa0017b58d8bf04048c3.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:17b5:8d8b:f040:48c3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477a96a58c5sm50519895e9.0.2025.11.19.11.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 11:56:09 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH 1/5] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation Date: Wed, 19 Nov 2025 20:55:36 +0100 Message-Id: <20251119195540.2671856-2-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251119195540.2671856-1-yoann.congal@smile.fr> References: <20251119195540.2671856-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 19 Nov 2025 19:56:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226582 From: Yoann Congal 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 --- 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 003a155e794..a9a25b9819a 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -631,6 +631,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 From patchwork Wed Nov 19 19:55:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 75033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0B9CCF58DD for ; Wed, 19 Nov 2025 19:56:20 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16290.1763582173508908852 for ; Wed, 19 Nov 2025 11:56:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=r5L+0JVC; spf=pass (domain: smile.fr, ip: 209.85.128.54, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-477b1cc8fb4so1041945e9.1 for ; Wed, 19 Nov 2025 11:56:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1763582171; x=1764186971; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SMvc5Xe2AV5XWfpViGz8eSZbZ3+Nll5/dIvunCLsye8=; b=r5L+0JVCi/mzq6sBsO9il6omC2YtwFrPG9mXFNVPJmF8tVE1D2YrDkZViKY4Sfr8CP JSUczMWn470awHKBGCx92KjUcQSkUFY6KvLp645VC4laLsRjm4wO7uTjZxiKk/W88lRA 3Qq70LeicLiKYLM9VI3TlSz64bknazCOoZ8Ys= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763582171; x=1764186971; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SMvc5Xe2AV5XWfpViGz8eSZbZ3+Nll5/dIvunCLsye8=; b=AlpjKS99DoUtdS774KIQ885gaB/sgE4Md2qUDTnjqskLeaaHW+mzh7HHUrqiRQfZqJ yKTjkmbOvTvhoNOaf9TXJv9ufOnHh6xwKKqHImMJU7jB8zww8mLAy0oeRPTUmJ2a2dhr qVqS8zRleS21DCjpe8F3EJZE6/70gWaqsJKwgqclUp09UiAn9D/Q6a8ZQEtGAZmdajOl IqptY6J6h01vb2QoYzVu09Qdcx4zfnRMnrO5J2z84xL6fpKmsTvDb+HQXjXINLmUqSD8 Yw8Fzi1uvQWbDwE/i/b2iJjmAwCjFX3IEGZjsvAaQyQzCeWzGALfnMIGwZKvkyN0xC98 XkYQ== X-Gm-Message-State: AOJu0YyAx/HPWigXO9uMijCXjxeUq8GmmwcOAxqL0CqT4kIvEu2z6OMI E4LGLsB4Hov/rqOrfiwS5LMAIx4UNmyiIfoxfkyE4KyAl4BXiUqxv0NIfi9vNO93dslcBQ0dp4z gpsr+1EM= X-Gm-Gg: ASbGncuwcQXSInhEEfiuTCK+TByu53t2ehCDaMV4CnjafJHG68K/1ZCT882BRnwROX/ ofPltCYIVwhdFBWzxdzRpmcc4pp8tIS6hfa+UhUCkbcJgXugsD0raV2k/iW4LHGfr0pF77vP1U9 SJ8WWkpuQNl6BXg2P0/XX0FTR9WT94eLWECGws8cJ76zdlT5flAy5xddc0QxdkozujjV/Q06wyC OJmxI/oyLTjHxlCmqjdpEnM8ipHNuCyIU60F2kbfp+g9sqi+PnU5NX2COhksxWd5IYS0Jym4JRg 4LLUFhx2/fWPRL/XcC9ESyTCwZGnEKG25RcjPYfzABK9iIyChFLO1G3SVqYrRjiVfL/9A/9Urp9 Yv/BkHGz4x0H6LuT0Eq7fF8wEpkzA90GnDENbuBpaSKlZ8eVVIVkt10+evIrZ2hooxThJnxcaMW /0fPyl8v1BrrvtHbJA/hAztNvyM1KRcw0z9K4CBtEL1oBUC/XPMA2CxUQ0giSudifgZ/ox1Fh/y BR5+jvPAR0c5u8o7f7BMvpm8DsLwBmR X-Google-Smtp-Source: AGHT+IHKdWTY/cxcUsn+i8NR+qlPPLcSa2bQXmpJ7vdqw5PYV7JGJ/G7GLRebIdioy/swxUAG6PzDA== X-Received: by 2002:a05:600c:444c:b0:45d:e28c:875a with SMTP id 5b1f17b1804b1-477b8aa06c0mr4687085e9.31.1763582171443; Wed, 19 Nov 2025 11:56:11 -0800 (PST) Received: from P-ASN-ECS-830T8C3.home (2a01cb001331aa0017b58d8bf04048c3.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:17b5:8d8b:f040:48c3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477a96a58c5sm50519895e9.0.2025.11.19.11.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 11:56:10 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH 2/5] module.bbclass: Prepare out-of-tree rust module compilation Date: Wed, 19 Nov 2025 20:55:37 +0100 Message-Id: <20251119195540.2671856-3-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251119195540.2671856-1-yoann.congal@smile.fr> References: <20251119195540.2671856-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 19 Nov 2025 19:56:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226581 From: Yoann Congal Conditioned to the "rust-linux" DISTRO_FEATURES: * Add dependency to rust-native * Remap ${S} in compiled output to avoid buildpath errors Signed-off-by: Yoann Congal --- meta/classes-recipe/module.bbclass | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meta/classes-recipe/module.bbclass b/meta/classes-recipe/module.bbclass index 4948e995c5d..7dbd4194d17 100644 --- a/meta/classes-recipe/module.bbclass +++ b/meta/classes-recipe/module.bbclass @@ -87,3 +87,11 @@ EXPORT_FUNCTIONS do_compile do_install KERNEL_MODULES_META_PACKAGE = "${PN}" FILES:${PN} = "" ALLOW_EMPTY:${PN} = "1" + +# Rust module support +DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'rust-native', '', d)}" + +RUST_DEBUG_REMAP ?= "--remap-path-prefix=${S}=${TARGET_DBGSRC_DIR}" +KRUSTFLAGS:append = " ${RUST_DEBUG_REMAP}" +EXTRA_OEMAKE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', \ + ' KRUSTFLAGS="${KRUSTFLAGS}"', '',d)}" From patchwork Wed Nov 19 19:55:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 75032 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B490ACF58D6 for ; Wed, 19 Nov 2025 19:56:20 +0000 (UTC) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.16221.1763582175073414108 for ; Wed, 19 Nov 2025 11:56:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=MStL7h0q; spf=pass (domain: smile.fr, ip: 209.85.128.44, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4779cb0a33fso1663675e9.0 for ; Wed, 19 Nov 2025 11:56:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1763582173; x=1764186973; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TWL6Mv6zSYOBj3OQBzFLXoZBK3mW1Gn2TmDcDMnnqXg=; b=MStL7h0qyN1H8MtXW2KY2anWUp+KY7M8kulrlYeCW18RVey7q6JORKzh1IW5xPW4z0 QRWK0V5SYQGOgLYRYnGVUbq8jT6k+BKlv+y3NSOJRIXvyuBKwX2uFfZ1FQDh3vsFYAIZ bksM4IxNrhOm+BZ6+ys5Yh8qVYE/9iY7BfQMs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763582173; x=1764186973; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TWL6Mv6zSYOBj3OQBzFLXoZBK3mW1Gn2TmDcDMnnqXg=; b=ZiYiPM+kkW+tF03aPXNERBD49enyXD5Vwkh7MfBVhAha38SN0ETDq7qUAZ/u6sylnQ jF6nBddsKXq4NeNfWZTQseR43txCYjbnzi13A/qVS44Wua9kJ4hCBBCgGdOK4voB4s1M RVrzmAiS7FHZR4F7jKQ78ns7DAz+mtHtC2kRpUcYXP7LH+mDEIIh0fp0vmCEMmxCtL94 n1MTH8KNSUfADtyQgWv4Ra7R5SLlSZzHGanm2qS7qrcgc3RcWgx/o1eFG6hHSl0q3Bxj tbd5ewJ84BXfhkVNkTRxgYUw4mVMLo+wqgu6Qkhi0vWs7uKvmuisYjrZ2vClQnHYsh5w DPNg== X-Gm-Message-State: AOJu0Yz6lks7x6/PDLKzhNPFczQzgtOgtjQfUKH+A8jt068pZ5YOz15s ZnGA1md79vf6+Ki2UjYLSYPWqt/B1G5XOSNrDO4jONzT9hLbMjG75hL+94gt0uiCGf5y0SdxZNk ejRdKkoM= X-Gm-Gg: ASbGncvWC8F1x/87VeZ3naYXtp6yMfHJPp9box8NiBJnocPrydKjTylEUmAdN2E0qYX pTZpxbozb2pskIjDjACIJ5IQavK2PRi3wfslSr3YdbHC9Yjln968VRHg+G+ImcqMvQhwVKrYJUc nOWQBaQBMGWDpaOjgw/07eFXJNplltOAn08X0/MzlylsTK2QIGnTYt+1JbM4ECxFJ6znVEuKUEO Lc5zW5k93uRoDbMqcDePmtzrjhXhcAZ+gfGUouukvN7kadB02MpgPthHSkRkfpUU3UJcneM6LzQ 1bpP2Fm8Ki3u3kYZ9fh1U/k2XETffCcQvhR13gjoAT5DoLTg8zlxO9JOw2PcB8z+mxsDa+zeNmc DzFEJGLSwog3B40KuvsOwbcHEXx/01h2wraWPYBP5tZCyIxJ+NyKeudYeNIoF3O5aU+lMf6i5Av GXy6elOITJXWuGPZ27bBoT377Oj/8Dt2/lqJ/1qhnnxMiAgEmGolBggT1K+aPeg5P+AibVNYOGo dA4zvxBenUSVp9o0oXGTeYHExZO11Ix X-Google-Smtp-Source: AGHT+IGIOoDFEsrcpxhUZ9WEBjlGC7EJCyHZoUrHZc++NWDGqzu4CtEXHzMGkOeF53w26E0Drb52+A== X-Received: by 2002:a05:600c:3586:b0:477:63b5:7148 with SMTP id 5b1f17b1804b1-477b866e362mr4179205e9.6.1763582172524; Wed, 19 Nov 2025 11:56:12 -0800 (PST) Received: from P-ASN-ECS-830T8C3.home (2a01cb001331aa0017b58d8bf04048c3.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:17b5:8d8b:f040:48c3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477a96a58c5sm50519895e9.0.2025.11.19.11.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 11:56:11 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH 3/5] meta-skeleton: Add rust-out-of-tree-module recipe Date: Wed, 19 Nov 2025 20:55:38 +0100 Message-Id: <20251119195540.2671856-4-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251119195540.2671856-1-yoann.congal@smile.fr> References: <20251119195540.2671856-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 19 Nov 2025 19:56:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226583 From: Yoann Congal Basic template for an out-of-tree Linux kernel module written in Rust. Mainly to test Rust integration into the kernel. Signed-off-by: Yoann Congal --- .../rust-out-of-tree-module_git.bb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 meta-skeleton/recipes-kernel/rust-out-of-tree-module/rust-out-of-tree-module_git.bb diff --git a/meta-skeleton/recipes-kernel/rust-out-of-tree-module/rust-out-of-tree-module_git.bb b/meta-skeleton/recipes-kernel/rust-out-of-tree-module/rust-out-of-tree-module_git.bb new file mode 100644 index 00000000000..642fa80319a --- /dev/null +++ b/meta-skeleton/recipes-kernel/rust-out-of-tree-module/rust-out-of-tree-module_git.bb @@ -0,0 +1,18 @@ +SUMMARY = "Basic template for an out-of-tree Linux kernel module written in Rust" +HOMEPAGE = "https://github.com/Rust-for-Linux/rust-out-of-tree-module" + +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +inherit module features_check +REQUIRED_DISTRO_FEATURES = "rust-kernel" + +SRC_URI = "git://github.com/Rust-for-Linux/rust-out-of-tree-module.git;protocol=https;branch=main" +SRCREV = "00b5a8ee2bf53532d115004d7636b61a54f49802" +UPSTREAM_CHECK_COMMITS = "1" + +EXTRA_OEMAKE += "KDIR=${STAGING_KERNEL_DIR}" + +# The inherit of module.bbclass will automatically name module packages with +# "kernel-module-" prefix as required by the oe-core build environment. +RPROVIDES:${PN} += "kernel-module-rust-out-of-tree" From patchwork Wed Nov 19 19:55:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 75034 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4754CF58D9 for ; Wed, 19 Nov 2025 19:56:20 +0000 (UTC) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.16222.1763582175561750933 for ; Wed, 19 Nov 2025 11:56:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=K0f6stOw; spf=pass (domain: smile.fr, ip: 209.85.128.41, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-477a219db05so1011495e9.2 for ; Wed, 19 Nov 2025 11:56:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1763582174; x=1764186974; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wf2Xa/AVNsz0beYpW5OyGShz8OKCeZpSOiyECianV68=; b=K0f6stOwbFLdZnJTv90yMHvXuGPCEzS2lz2N2fNf8SFY+CeCWKm9iU171a6o1knohz 4gFYbBp1Qb/mxvs5ZKdNCX4sFycmZg89iXp7KekjZTA1DWJ2EA/Yzd/tv8C8WyDC53WN Gts93LYwhCJpYfwsA3Dmvd0jNTEHkI9guvH18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763582174; x=1764186974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wf2Xa/AVNsz0beYpW5OyGShz8OKCeZpSOiyECianV68=; b=XnEo89gu7EN1mM/LsrkJlQX+ALGDmbkHcyhElYi6gUGbRg5wmt5zRqdyz9flew/ffu frtTGSHxcGdVTb3+ku1YTJsgFEpqjSCDkpcqHJiNEjAe53WkCNFseOI5uZDs63sWWYIl 455d/JtIWpF294zfasU/JAGJNqXmMtQlKa68nuUhj77Y6x23njKzt+XuDLpf3Bzzn68E PsT3/4NhTnQtamWSDuMpIxHR2EmYzMSWTzF47NKW4ysPcB92TZy2QexlyQi9gCnRpQfS 3z/fVQvDWS4dSJcLO5X8lPGkBXKyBD2RQqou2UvTIafgggEHebZtQBAS1JX1xjKapHeZ JXTQ== X-Gm-Message-State: AOJu0YxaTQieOwjmLgzVnBuRVcCDmxC+GVclQH2U/q1odEtIJPG8I1Y2 f2wPgGMIn40ThF6Wp3gN3m4arWrKi5GcMRbdfZD87Sb2l9wC5GkI986Vv7ng2QaKlC6kqDFU7cd vzES0Rf8= X-Gm-Gg: ASbGncuRVgkGFmqFR0zk2qEom1oNU0lgOwuM6yTInK74nuI3S6oTVKD0LhrPF3SOEAS B+WKm1Sra18ZysL7lJlx0qvFqRKNxgx2r7fZsA4nVRAg/xa3fgIrPb+Su0jXMyE69Aq20lPh2qz pzx57YQC5Fnyic+klsTAoByhV7aNe/PcI+r2oLfd8OKwIcfYhcAQzYV5Srm3YNcdYC4RMznCAE2 0QfxZSvd1lbItde4RKu3W4o44Bm8708ZfE6IUVb7RiIO1iFrbHfJDofBLVikDz3PTjzHdLkXI32 PCuThEgP7vqEohLQ3A9fuoY8f4fgchTHn6yOgWIJW8Q+jnAw3OZJAvo3xJc+bl+xxM4qqAj8yiB t2nZTKR5ohdzBP0H22Bp8eXWFmenl01F37tggAt7B2IKVwqJhKjHe0Oi9zkGYVnCqW0rS9Hvsza sYESkmC/1Pb9Rw7GjfW1Hxs8x/t6PjInHGXxSI4Pd/RQfpo5d9DenX/Yq7ItGyx+LdAbtT8agOB 0+G+eJfAsM1pg4gJboaKlFIh7omJ2Fq X-Google-Smtp-Source: AGHT+IHCjgmNdbBo/dwHAh8yrvgWuTTRV3fcZT+s2lGS7SKkGa2ksJT2kFhbIuA8dq8u0SSB5ie3Vg== X-Received: by 2002:a05:600c:444f:b0:45c:4470:271c with SMTP id 5b1f17b1804b1-477b8a8ea8bmr4294385e9.18.1763582173602; Wed, 19 Nov 2025 11:56:13 -0800 (PST) Received: from P-ASN-ECS-830T8C3.home (2a01cb001331aa0017b58d8bf04048c3.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:17b5:8d8b:f040:48c3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477a96a58c5sm50519895e9.0.2025.11.19.11.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 11:56:12 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH 4/5] rust-out-of-tree-module: Add myself as maintainer Date: Wed, 19 Nov 2025 20:55:39 +0100 Message-Id: <20251119195540.2671856-5-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251119195540.2671856-1-yoann.congal@smile.fr> References: <20251119195540.2671856-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 19 Nov 2025 19:56:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226584 From: Yoann Congal Signed-off-by: Yoann Congal --- meta/conf/distro/include/maintainers.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 6c3174cbb72..7204a5e5992 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -774,6 +774,7 @@ RECIPE_MAINTAINER:pn-ruby = "Ross Burton " RECIPE_MAINTAINER:pn-run-postinsts = "Ross Burton " RECIPE_MAINTAINER:pn-rust = "Randy MacLeod " RECIPE_MAINTAINER:pn-rust-cross-canadian-${TRANSLATED_TARGET_ARCH} = "Randy MacLeod " +RECIPE_MAINTAINER:pn-rust-out-of-tree-module = "Yoann Congal " RECIPE_MAINTAINER:pn-rxvt-unicode = "Unassigned " RECIPE_MAINTAINER:pn-sassc = "Simone Weiß " RECIPE_MAINTAINER:pn-sato-screenshot = "Ross Burton " From patchwork Wed Nov 19 19:55:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 75035 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D19D4CF58DB for ; Wed, 19 Nov 2025 19:56:20 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16300.1763582176437903313 for ; Wed, 19 Nov 2025 11:56:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=oMbbT2uV; spf=pass (domain: smile.fr, ip: 209.85.128.46, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4779aa4f928so1556695e9.1 for ; Wed, 19 Nov 2025 11:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1763582174; x=1764186974; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9iEgafwrIe56jtSGJIYYT7k7FUWUlLpQ0yw82CUXxlc=; b=oMbbT2uVrMBgAH/zWtBT2R9rCiRAPn6r58CicWBndt24MAvPSt9rSTit78waglxkpT 2I+70Nba0NBwDbWRw9hzG1vpcax/jx0BVNHAplyA8rLtbeWxwDqjzi+k6uV+ro0Dgzxr HgYuuEGJZIlACEhS7jHBaZoTKJwPkUTL/24zo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763582174; x=1764186974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9iEgafwrIe56jtSGJIYYT7k7FUWUlLpQ0yw82CUXxlc=; b=kHP+hUQCVpPkjmiIJZXM1w6J+7C/FmBWVVGvJ2kpacUY5WC5024RdQV1olHYwt9EIm f2YjJavxeFTcgFOjE35ohWhv8KPM/5awMJoUkmCQssN2DrSHyQvZz4QB6iCvv3JpyaEY a2KDlx3Q5Y4EDKHz/8z4wGGrli6aWFNIX1PUZb4ouEUrF9ZhMg1kvc1MYLraFCx3gqUy 5L4VMag9sYxzjErhoILh8SmqPYUgM3Ok4dRI0Iw5vmZunKQnaoPWY+maTk8rLtKt/VR1 ggBedEnRYOjyg88GNQAxjcwJ8D9HxMVJpe3xYvtW6ZOf+uB9DquV2wN8PRXQI94Aw/BH rPrw== X-Gm-Message-State: AOJu0YxcpMaojyPujhoiWYt5JBJEpkR//OORg7uhe7OrAjU6BQHEqzuq tzQ2OYiZD5VlExkKagq4KRqEVGC8bvqBhv4B91mim+c/Exf9am0njZBNVWMID4b2yAj4UWSQqDA gAt3xC1I= X-Gm-Gg: ASbGncsGedIl0IlMXvMS7WkkCfILdx32GumJI85MdUnAJXTBKK6CUF/0CL9QXwJOF36 SPiD+0S5Shhjo2SWrsB76VEygeyqXUFhSRf4qeA2PQX2SZIWWaYjFQqtpHAB4TS2KxWbt/iIQ2Q XUVVT4jeY4lgETCAuE9agIVIUqWZe+qOog6C1Rih72PYV06YqhQWB2sz+gvYu5T/3cXUBbHWrRb P1MmfsRU4s72I1m83PmMcEqCNdqXbod2u5jXyDqf/vksu01FcGCcjUdo07Ges9ByYtmKWPM3DCM Baf2+CIR8r2mzsaMYGySgqPeSb+nUnX8TW/tMb4epGqCsJTJTsZzvO4n32gXpsw7B9HRFvpqqCB N7PUjDqsAJ8z49alk6xyHST31Vn+0RdmpdEwBuKkpefuDhvCogJmaidWe0pGEMMf+pXvJr1TLEw AI5qD9OAFOVhyf1t3bygQQV6QpAEu2trc+jp0+q1iKmsFQ3Va3oQ3hQFbBxKXGsHjfok1NndBcR nmOicTNdB5l7lEoWTzLnQ== X-Google-Smtp-Source: AGHT+IEPXckLwJSxTEiAe/h368bT6+EGAXKBB2IksJrASqwqcNhy9gY6WBRhKttzwOW2MEEsMIWy9w== X-Received: by 2002:a05:600c:46c3:b0:477:58:7cf4 with SMTP id 5b1f17b1804b1-477b8954d83mr5312945e9.4.1763582174543; Wed, 19 Nov 2025 11:56:14 -0800 (PST) Received: from P-ASN-ECS-830T8C3.home (2a01cb001331aa0017b58d8bf04048c3.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:17b5:8d8b:f040:48c3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477a96a58c5sm50519895e9.0.2025.11.19.11.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 11:56:13 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH 5/5] runtime_test: Add rust-out-of-tree selftest Date: Wed, 19 Nov 2025 20:55:40 +0100 Message-Id: <20251119195540.2671856-6-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251119195540.2671856-1-yoann.congal@smile.fr> References: <20251119195540.2671856-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 19 Nov 2025 19:56:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226585 From: Yoann Congal This new case tests that the rust-out-of-tree-module recipe compiles and run properly: check that the dmesg output is as expected. Signed-off-by: Yoann Congal --- meta/lib/oeqa/selftest/cases/runtime_test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py index 66cb112a7c1..a6f75c1e29f 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py @@ -493,7 +493,7 @@ class RustKernel(OESelftestTestCase): import textwrap self.write_config(textwrap.dedent(""" DISTRO_FEATURES:append = ' rust-kernel' - CORE_IMAGE_EXTRA_INSTALL += "kernel-module-rust-minimal" + CORE_IMAGE_EXTRA_INSTALL += "kernel-module-rust-minimal kernel-module-rust-out-of-tree" """)) bitbake(self.image) @@ -505,3 +505,10 @@ class RustKernel(OESelftestTestCase): self.logger.debug(f"rust_minimal dmesg output:\n" + textwrap.indent(output, " ")) self.assertIn("Rust minimal sample", output, "Kernel Rust sample expected output not found in dmesg") + qemu.run_serial("dmesg -c > /dev/null") + status, _ = qemu.run_serial("modprobe rust_out_of_tree") + self.assertEqual(status, 1, "Loading rust_out_of_tree module failed!") + _, output = qemu.run_serial("dmesg") + self.logger.debug(f"rust_out_of_tree dmesg output:\n" + textwrap.indent(output, " ")) + self.assertIn("Rust out-of-tree sample", output, "Out-of-tree Rust sample expected output not found in dmesg") +