From patchwork Thu Dec 4 11:30:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 75875 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 39C43D1F9C5 for ; Thu, 4 Dec 2025 11:31:25 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.41208.1764847878952440086 for ; Thu, 04 Dec 2025 03:31:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=28qwQtBm; spf=pass (domain: smile.fr, ip: 209.85.128.45, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4779a4fc95aso13984655e9.1 for ; Thu, 04 Dec 2025 03:31:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1764847877; x=1765452677; 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=Af1cUIN4Iq8jV9kc0nUpUxBmQmMHW8x9o/SffsUS1Ms=; b=28qwQtBmg5dCxrAv0V6U1BsuGIAYVe3cr6XnnAq4I1SzJJpArlakbOM6pYFY8qiPvZ ikoezLCfVzlFc1IACGlLIdXLk3uBVFs4rKk0T/f1B+aCPGOIyx5bIVz6B2reTStTOMUp +LAmE/HT66wVTdU+XEx8xRjy9osDTxVLEKFEI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764847877; x=1765452677; 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=Af1cUIN4Iq8jV9kc0nUpUxBmQmMHW8x9o/SffsUS1Ms=; b=eVD//uZYW+2uF0cygnxIXF0aitOJfEYwNOI4LJ2xh2r3HbAJU2oA6U9lWuwi96LwP1 RQ7PPn9Gkm27ZKYAIj3VkrwI8T+OAGb/HsuDb7o+tQckj5GhZNIRlXMumajF9s13UkUs ejQCIvOOrJ1LtBp6ZFchg+K7cCFLtAmr/fo62HOHvSVlwwDczszqc4mCapkdouLCyRHI JmMkSB0sfyYf+UfzNrlBP1YUXuUPo3J4PCJg0b2ypdp84QIV8+1MkQvLwSHwJcP2tztS Oh1LWkQibEETYSQGW2qEc4ZLFESrndTDPQNMwNh0HPpIKjR3KUZJJWbM15FivKmrYh1B Erng== X-Gm-Message-State: AOJu0YxpFyW3X0GYBfJ47HcIUPolSp1dXOC1xcGmsIxVlsgBvgSc43XR wI+nHZwwOIe7HtbOZSF1Eh8J3Oa4T7MCWZ2qJuPBt708Qvgt+eb3oQbiUH8pagRks0KwKpZOD2i 60WzF X-Gm-Gg: ASbGncsZPj2/Ce27XjBpZre54le3mYP8lxh4hv/mdaN+VjbvOxXWZxqyFJeBdvwG+W/ iW3x61UXbP7INhKN8QLwlt1taTYgRox5up/P9WhdqGsnxAkj4t49pFDmjioJqy2ZmbTSfwABJHQ MubI9yYyok5VpfuN1xYxsZZM2Lpr+E7JdQEEEJTB8qW083lcipbCtGwkcazQUpbS0zGDCLY1Z8f XF7Sw/jamsjCykyhCcxaL3NpwQz+ll2arz0FgmwZ5VD3vv1rv6eiqM3O+xKqNOx7GaCBSRfoOz4 GKapd9im3a0MQxQJvY0sfAPPTeRGoNm0sGY4zhECCv1avJARvTW2AYp2H/RWLEtdhfsfTqwBh7E ojqPg7GYLF86qI9ST7VAiN1BfpLwBpS1nY3C/WX4juktTJldAYGrEok6AhT1UKzGNU3jvral4/a VKntZHiEsKPSHiOBtD2qidpldFhPVuYBi5LQ6y9gMNDlWd20GuXmIpaCvQ511PJX6teZ7puB3m9 URlhIQo/MMPDgk= X-Google-Smtp-Source: AGHT+IEJsxBMynhxD6vFn844nbE3vrcD7dPM8jCGo29zdsGDve0LotDO8NVdfT6GUKVAyDTfl9sfRQ== X-Received: by 2002:a05:600c:4691:b0:46f:a2ba:581f with SMTP id 5b1f17b1804b1-4792eb4cfcfmr32048645e9.16.1764847876818; Thu, 04 Dec 2025 03:31:16 -0800 (PST) Received: from FRSMI25-LASER.home (2a01cb001331aa00a2e4fb7b0d887544.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:a2e4:fb7b:d88:7544]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-479308cd87csm29385885e9.0.2025.12.04.03.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 03:31:16 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH v2 1/5] kernel.bbclass: Copy include/config/auto.conf in STAGING_KERNEL_BUILDDIR Date: Thu, 4 Dec 2025 12:30:54 +0100 Message-ID: <20251204113058.948115-2-yoann.congal@smile.fr> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251204113058.948115-1-yoann.congal@smile.fr> References: <20251204113058.948115-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 ; Thu, 04 Dec 2025 11:31:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/227282 From: Yoann Congal Linux commit aaed5c7739be ("kbuild: slim down package for building external modules")[0] states that include/config/auto.conf is also a file needed for out-of-tree build. This avoids this error when building an out-of-tree Rust kernel module: | make -C .../tmp/work-shared/qemux86-64/kernel-source M=$PWD | make[1]: Entering directory '.../tmp/work-shared/qemux86-64/kernel-source' | make[2]: Entering directory '.../tmp/work/qemux86_64-poky-linux/rust-out-of-tree-module/git/sources/rust-out-of-tree-module-git' | .../tmp/work-shared/qemux86-64/kernel-source/Makefile:779: .../tmp/work-shared/qemux86-64/kernel-build-artifacts/include/config/auto.conf: No such file or directory [0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aaed5c7739be81ebdd6008aedc8befd98c88e67a Signed-off-by: Yoann Congal --- meta/classes-recipe/kernel.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 003a155e794..32d8fc78686 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -570,6 +570,7 @@ do_shared_workdir () { cp .config $kerneldir/ mkdir -p $kerneldir/include/config cp include/config/kernel.release $kerneldir/include/config/kernel.release + cp include/config/auto.conf $kerneldir/include/config/auto.conf if [ -e certs/signing_key.x509 ]; then # The signing_key.* files are stored in the certs/ dir in # newer Linux kernels From patchwork Thu Dec 4 11:30:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 75878 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 455F0D1F9C8 for ; Thu, 4 Dec 2025 11:31:25 +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.41209.1764847879811260735 for ; Thu, 04 Dec 2025 03:31:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=llwjYlP3; 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-477632d9326so5744865e9.1 for ; Thu, 04 Dec 2025 03:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1764847878; x=1765452678; 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=ijzFzvIOTzYNLrrv+D1BO0Ab1J/Zt0A7l7GsSGDJq8I=; b=llwjYlP3IhRCle7XfZhMP6vU8qZOLqV1vrK8ilHAt5bSlM5l+Hrz/l6cmMitfcgp6/ HvHGT2lHJZYSvnQdRBW1X8+YXr2wOi784ZgV94z6G91pPV+RB84DQjhhY11qwpcgkxWw umKSPYW7fN4LXGeFDcHIc4wBarUg0ms/XzYvw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764847878; x=1765452678; 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=ijzFzvIOTzYNLrrv+D1BO0Ab1J/Zt0A7l7GsSGDJq8I=; b=rB8xbD4Ocfw3TYSjEDSUxL4x+7ghK/LQy75ZEijjJgnR1Q13jMuEgggnQSxchgTxqQ lZgtlA1aE0Wf+dBnpR1StXlvUGY390D5dW5dI2Jbbkz+7mUevQq+KrmXdDZ7kATSMqgi ZFHS145NFBK0KZFgMFMxS7V9zCx4Uyn1zJmo2Ld+8bz9GNB/KyRpT5FnWnOc/36I7aKS W7JIM8Tim7o/fZ6jpti86+tmbIaYdZ7EzXGrShWprCXshywPFk7klRoAfmpFIiuhpHrX RT2DPpaKqajHwvED5tuB2a4fR81FdJuAPy5Bt1ocr9TjXzz/cb3Lv4S6GEG/84ozsteF A5IQ== X-Gm-Message-State: AOJu0Yyu1Ax/NQchoY+6AKBljZ0QhLDZuTg15kGHJtlkL/RRQAMT0AbR jB6XDAwNbdrdJ87xhAHMTqa24vD+VKKxLpSxjgdSYpc+AuFgv2jKD1yh7Pa0uNLkevpnPXYcflT NEQ81 X-Gm-Gg: ASbGncvAtrte8Uc0v1e51zBODgzgnX7a/sUXNAq97GS3Nnquf0Y3KkR2AfpnWMOfjnF qz7q6bd0Ht8XN29ugryByfZPnoKAfA9RPnn/2SrLwUZpXF5ievJ6TgkJK00aSxpgGc/qziWWbD2 Qk233HXMCuLft4oDktbU2tjs5VvQLJkKDO+A7T8MZCi/XuHkf8Ufe9Uo5KPYDDkSFd7tPPSkgmr akpFrLVR72L4yMhRYfWgjhoQcwo9ELnGnDI8iJ7xBmxwnk9dJcYUmX20YPh6eAGVNjH3U5h+R21 JtpBrxo2Jg4iO05qy2y/jmDbHhP6OlYUc3XF+u9Os8Dr3OLC+80QAcLQvPDnj+5n/eGTZiMFGGN KaLn5KVi80+rJOsgiqNjShpjDo17+ZPJWYakGOg7cfyoHFwEJYSKI7S01YLGSfLDCm89FpXSzIr n6BAik47gb/xEMJfRSNy6qaWwzoIqv+YsR9UskqvHqEo8R70Zs9FmkumF1HLz0TavQP93/YEmVx wUUENNbqP0nfGw= X-Google-Smtp-Source: AGHT+IH7JNkwfhJkav3Pyhm4bkFkkigSEXIDSdw8s4INdO8SXSizdACkUAuusGixQW2qpENcmla+pA== X-Received: by 2002:a05:600c:4615:b0:477:df3:1453 with SMTP id 5b1f17b1804b1-4792af3d3b7mr32523565e9.28.1764847877909; Thu, 04 Dec 2025 03:31:17 -0800 (PST) Received: from FRSMI25-LASER.home (2a01cb001331aa00a2e4fb7b0d887544.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:a2e4:fb7b:d88:7544]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-479308cd87csm29385885e9.0.2025.12.04.03.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 03:31:17 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH v2 2/5] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation Date: Thu, 4 Dec 2025 12:30:55 +0100 Message-ID: <20251204113058.948115-3-yoann.congal@smile.fr> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251204113058.948115-1-yoann.congal@smile.fr> References: <20251204113058.948115-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 ; Thu, 04 Dec 2025 11:31:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/227283 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 --- v1->v2: * indentation spaces -> tabs --- 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 32d8fc78686..9b12a8b58f1 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -632,6 +632,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 Thu Dec 4 11:30:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 75876 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 4CA5DD1F9C9 for ; Thu, 4 Dec 2025 11:31:25 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.41210.1764847880794696932 for ; Thu, 04 Dec 2025 03:31:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=H/Mcm2TK; spf=pass (domain: smile.fr, ip: 209.85.128.50, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-47774d3536dso8167375e9.0 for ; Thu, 04 Dec 2025 03:31:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1764847879; x=1765452679; 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=H/Mcm2TK+9Pt6YdaKk+uBRufytNBzrN8Vb0jeyhyDSWUjShaZ03WMJTs65byjhgKWm fVUhVe3G/qGIvmG2aWtPX1fzX9nXgqcDU/OHlGI6LbOCAprCuWHazI1SqOPde9+eXqap 2Ty/RbfMI1tcRyNWoNT18I5VbmUGiTeDqhjAs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764847879; x=1765452679; 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=QA05aB2SlJFoFDVkX5VYkr1a0ldl79xZWfaOcESI272sskiekftdr63xxD3I0RfC97 IUdDgyRhgSsFG+luKDsED40miA5VvcmchILHjG6ua+DawrwJ6P5gHVDetjgEHv9qM6Xk j0fOZchTA+VJ446XBbIJbaKi26hyu+s9f4SME7A3KlnlIgnEOXFKNKTo1CYDsy1Kwwng 5tduRegqtlMb9YBwsQzjN+v5SWNImNKx++p+VkGq0N/njr66Vbseru/6HkkGPlD5Dinu PWjBk+EzClcrKNpHcmr+CGUMmC/RRs3Qu3TOJ80Nzl8nZvIYzeixPMfmS1yhyONxf96L syLA== X-Gm-Message-State: AOJu0Yz3Ep7JdpPeIMvffohkOiuFgdj/ySlinpxeGM4rUc+4eSpJIuEQ VZ/yCc/yMvxy1hd80Ss2zRK682+AsBoqR/NAwq0gW94qF8mDRGaoFbjoL3r3TUCnqNWKLsY+01p +l6Tm X-Gm-Gg: ASbGncsRF1+0ZV8+5eWfawShBUbTfW1Ddk+riF5Vy/vXgIm/STN2Q+HkRaEPeUgXMmQ +d1yInv9mfoCnZG1J+BsUoPsuKnHqHdUJQjQQB48Y+pZ/cMykyOm3A7JMoDaaaIBdmPXi4Wg261 6Boz3eP9dnZ3z9RJPDutF7yOIWz1Fp4xxGLX+gMyJn81QwkI6zQEZT+uLV57MUXgkfJkP/JLLgw Sl5tfB3dk26/pTkd/XACTQ8AVwsQm7vKgVrHIWH5f0E1QJhx85ayri3LLNZtNKIFT8sMbKTi/k7 KlmiNW+hDZTUDqaRnbfswvqgABvYzr7xqwvri5a4EAoG8QguwAzk0rbLAlLGFP1Iz3N3zYEDrzK yhQ4QxsnXSBL0ENfGlAg9qf/VM96p94t2rYenKRXT2bGXUbToMximv5yVOumEUrKXolxlBEUWbq g8y30IVNTMFQmawIejFYXptMA61FfXiLn8eUS7KZVEyHwdfOh84ACBuGfhDwlJMct9RRMKF1kus WuVUUmppxTYQWDFZ2lQk7qToiUtaCMhX04t X-Google-Smtp-Source: AGHT+IEoOwqmXLSWJrfFGPq1X/lqU7lmgJSDFE3cyed9v3FPDU7TwAhBSs+jRZT7+wJPuPjM/D62Fw== X-Received: by 2002:a05:600c:21d5:b0:477:991c:a17c with SMTP id 5b1f17b1804b1-4792eb19cedmr20933495e9.6.1764847878888; Thu, 04 Dec 2025 03:31:18 -0800 (PST) Received: from FRSMI25-LASER.home (2a01cb001331aa00a2e4fb7b0d887544.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:a2e4:fb7b:d88:7544]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-479308cd87csm29385885e9.0.2025.12.04.03.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 03:31:18 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH v2 3/5] module.bbclass: Prepare out-of-tree rust module compilation Date: Thu, 4 Dec 2025 12:30:56 +0100 Message-ID: <20251204113058.948115-4-yoann.congal@smile.fr> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251204113058.948115-1-yoann.congal@smile.fr> References: <20251204113058.948115-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 ; Thu, 04 Dec 2025 11:31:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/227284 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 Thu Dec 4 11:30:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 75877 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 52F33D1F9CB for ; Thu, 4 Dec 2025 11:31:25 +0000 (UTC) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.41400.1764847881842921815 for ; Thu, 04 Dec 2025 03:31:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=pFgAIqWM; spf=pass (domain: smile.fr, ip: 209.85.128.49, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-477b198f4bcso6599395e9.3 for ; Thu, 04 Dec 2025 03:31:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1764847880; x=1765452680; 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=pFgAIqWMblYRA/hODF0+UAAGmvNQG29HtZRLdaVpBflp9yMktXMro5QAgWNxNGQ/uJ i6ZmyNwJhKP1FQ1oxCIP9jjAhiXiC2pTe7n2Y+58YLE3S6hPiWqYAwTRRK3OTiqSHDa5 t6r8h9c3+vWPo9p6Q8ljhy5emQMMQoHjPVv4s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764847880; x=1765452680; 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=qvAv6XfZkLbPC+6k6rYDLgKrRNM/ChEF+hMSIqD4NV5g+KzOGFI7O7wKgehbvnYCx4 p52szR/piW6kFSlnAdoHOxTIKiQ8pDIgol0Uf8nxKUAu4JtZLmWIflc3Fow4uLJzsEze CTcJv4HW70awqTFlOy7iTYf3XOK6IbBfDJNa3tkgjNOfmP4OwjCE0IyU281sap+NpFJp IYUTwT8CRZGpocydSoOXmB8gO9sK3iflfgh9BXgxJo8mN7Qj16XNSeD4YCZOPwWiDSNv 3IEqIbyXLqUP2h11BLd1C7wFTOnK2JTmGFml4dMINFJQ/3m8Mt1WkSjja9OOfiJ3HwBk Janw== X-Gm-Message-State: AOJu0Ywk7j9IlRWEtnAIsawG4LxXlDUlHDB9Zhi7xkuWhwH13DQCWaRO lxrQKYBH1Yoh2Tx2O5ZqrLwqiVWWd0eeBxiytQqGSQeKbPL9+xmUY7Fz7d7903DoL6XUqEtd3iV lq06E X-Gm-Gg: ASbGncsvTS9nKBJW6oHQZTyASej5UKmkdarNxnIYOH3jWZlTrP/GZVS0lJq0OHecgmZ MCK8FSpulDhHn76m6MPRWALwMHlQdtdnKWLmcd9scjTuZ5w5z9aIC51oel0U0Vpiiu0fB2H/Y6C X+a+OddzPF2Vs10ETcfRVCB/sVCsw+SHkK4M8hIbCqFRq4HJtAU4yuxSX4rHG3G4giru0iAHAhm grEGFliE1YWZCN8hf62WgERDTs9fepPmca/Hx5mi+iEcFTirr8NKuSMl3LXarCipmuUBK+p1Rtn 3owN1QvnIE8KEWcEg49H1W0VNGn+tI+QpficvaDvrpFAStzIynrQa48h69MPWGHTJfFDLQqpaYD JTVkyaRSB3fCrSYNc2cJR/WuL809g0dId19ENyBIIWmOVEnMWJ/hCidRBpzP/tAH0WORW3xUpAI ZD7nDXLbGTLnfBQ5K2O5Hj7nhOiqmzLNpsdHOOlldDf+rVW3bz1D8dsKhywF8RAYDX9NEpSaE0G ZRSqRPRdcbC6wjtCHZte74V+g== X-Google-Smtp-Source: AGHT+IFh0W4EolbIaiMVji0ZTZmK/phJDW6ojlT9vPKn8hna6HlH9ZqdH7u+llPesqvEOg/DjuAuEA== X-Received: by 2002:a05:600c:548e:b0:477:b642:9dc9 with SMTP id 5b1f17b1804b1-4792af3de68mr46397705e9.28.1764847879896; Thu, 04 Dec 2025 03:31:19 -0800 (PST) Received: from FRSMI25-LASER.home (2a01cb001331aa00a2e4fb7b0d887544.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:a2e4:fb7b:d88:7544]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-479308cd87csm29385885e9.0.2025.12.04.03.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 03:31:19 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH v2 4/5] meta-skeleton: Add rust-out-of-tree-module recipe Date: Thu, 4 Dec 2025 12:30:57 +0100 Message-ID: <20251204113058.948115-5-yoann.congal@smile.fr> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251204113058.948115-1-yoann.congal@smile.fr> References: <20251204113058.948115-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 ; Thu, 04 Dec 2025 11:31:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/227285 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 Thu Dec 4 11:30:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 75879 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 5EF5FD1F9CD for ; Thu, 4 Dec 2025 11:31:25 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.41401.1764847883084584838 for ; Thu, 04 Dec 2025 03:31:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=3TB7sotJ; spf=pass (domain: smile.fr, ip: 209.85.128.47, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-47796a837c7so6478325e9.0 for ; Thu, 04 Dec 2025 03:31:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1764847881; x=1765452681; 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=4na1mr8VM9FscKTpuTWGYDFWbdgW1jXc3QTFA55KMXE=; b=3TB7sotJN9zjGXj6Nw+bT6PfPi9bfDPggQ0dOeeyMHyuhckiqy88wj6nua1lK4VY5c 8KB2KAU19GVG6UWNIgaVKctYCkwxxbu4zBDgL9NRBgzLeBmV81hfO9xgNweh+WcMqGM3 01h3VGQIyYizCiLMhGydDqQBWtXSf5NkpD1RM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764847881; x=1765452681; 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=4na1mr8VM9FscKTpuTWGYDFWbdgW1jXc3QTFA55KMXE=; b=JAoigmRYpeASqwVnBn+1Yb7pKArJscM/H4K+gWlha/rblkejebAHNaoB2vdw3sZ3+b izLeHfo4okTcgQjL3B2YOyjLMXUOZVtVrsv5rGk+PL15ERSz5WAWgkvQwVlvgNvcqBIR a84bf8Uu4qcMh1PDY6beC9IRmB70eB4EhmoWDhfJVAwF8Z8WDnGO3R/sG/ZZ7ciVZ9hN Nfj+8hrjcYC9ATniShPGvlKFbof/7io3BMtWN7aBgdGG4Ht3g3PApczgN3WaSCQUJmGV I3ss7YrnMQCyGYN70UMffGxpLjxI20i35txG17eMorft3yE/Xgb4BBjt5hj4CexLyGt0 sa7A== X-Gm-Message-State: AOJu0YzMn8mqKU78NtgfiL+f4urgOzmeaklq76Or8DQbYtXPjowyvtaO OZDvuAc08vUnNMwVni2c1PvLaaTQXvShHYCWxnrTOofJvcQE/yQ+VEZsKeN3BqGstjhF6Y/qt5+ ZMiyq X-Gm-Gg: ASbGncsBzyqkxEj4YFXZDsqks25jW2q5X/klo3/T7yxF/IqgKBscg0Mn+i1FyOeWHLV GzKUSQti503QooNPzJsHXMLdXL5R9ZjKEoIK/OJL5TMUXYNAWsIoewlRfMzB9nLeBN6YFNxRo+M cJPlx7tjUTmCkH+f8NNy1zOA0DM07n9CDvO9asvGQNaIcHkSZVyEAoUATPALY5/b+Qqfgiv6UbX N/zTKMZCvz9zSGCAIdEJ6iQukxTFRdOQ611Z8hJLsPrcWI7vrcoYvk8o55REE69VNiZECXYRgzw WaeEzw6ANxzMnPC6KV3LdTG27fLvwtfulzDFp57T7BF5XaUczORY4U3utqRwRjyHaZirksiSdNd /tUEsZyiUNXR45m0epQvgA++gwa3Rf2naP74J9aE9WZ+nXSQFQTrDtE6fbi29/CXjy4D3oc0eDH XIAZ7OAxKvAvFQe+I4EylHJGA2pPkCmRSIPn2bb68rec5fJSgBlR8slWd4LJsKu+gm+uF70OWPU f5Ou2tJxVIdPvc= X-Google-Smtp-Source: AGHT+IFjmZAryN3Nx2jAdie4DNT2AsOiE0Dgb+4DO6AFEF7yXH+8szU88OTNW1MkQf1HpO4kQ0AoTw== X-Received: by 2002:a05:600c:3b13:b0:471:9da:524c with SMTP id 5b1f17b1804b1-4792aef1bd5mr66033405e9.12.1764847880914; Thu, 04 Dec 2025 03:31:20 -0800 (PST) Received: from FRSMI25-LASER.home (2a01cb001331aa00a2e4fb7b0d887544.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:a2e4:fb7b:d88:7544]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-479308cd87csm29385885e9.0.2025.12.04.03.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 03:31:20 -0800 (PST) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH v2 5/5] runtime_test: Add rust-out-of-tree selftest Date: Thu, 4 Dec 2025 12:30:58 +0100 Message-ID: <20251204113058.948115-6-yoann.congal@smile.fr> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251204113058.948115-1-yoann.congal@smile.fr> References: <20251204113058.948115-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 ; Thu, 04 Dec 2025 11:31:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/227286 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 --- v1->v2: * Add the needed layer meta-skeleton for the test --- meta/lib/oeqa/selftest/cases/runtime_test.py | 12 +++++++++++- 1 file changed, 11 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..b519cf30cdd 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py @@ -493,8 +493,11 @@ 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" """)) + + runCmd('bitbake-layers add-layer %s' % os.path.join(get_bb_var("COREBASE"), 'meta-skeleton')) + self.add_command_to_tearDown('bitbake-layers remove-layer */meta-skeleton') bitbake(self.image) with runqemu(self.image, runqemuparams = "nographic") as qemu: @@ -505,3 +508,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") +