From patchwork Sun Aug 2 10:28:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94194 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 E1EB4C55180 for ; Sun, 2 Aug 2026 10:29:06 +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.msgproc02-g2.21325.1785666539320277916 for ; Sun, 02 Aug 2026 03:28:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=CqEMhmYw; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.54, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4954df200ddso7049205e9.0 for ; Sun, 02 Aug 2026 03:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666537; x=1786271337; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=jJ+QrjzY32CMrCMTaBGNrLOBAx3pkPJkXyLAaTADVjo=; b=CqEMhmYwJr4AI6/DszbnP74RetF+JtVI6kvlODjxU4BHp651Ur8j+t4u87U6uNK/sd 6/MS6EzD6HzoHUULnTQEegcBlk0kxxz8hu/fCOJypoBwJLz/4pZ8ZOJ0eb6tgePUinO3 c3K6izQdaNHZO6qmsw5xLx//QokG+CHJ12ruE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666537; x=1786271337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=jJ+QrjzY32CMrCMTaBGNrLOBAx3pkPJkXyLAaTADVjo=; b=JFrkyF8wd3AQL3CGyn8c4MO3DQcIPAV4/1HhLR+KWnY6QYtu4tk9XE9OmkNEbQGBt/ lINAxnY9IKlvja6o+ox6wW5f5CImrCy92TPs6+ETut/A9u9y99Jak1YV6E4BEAU37Evx Eng40JCrioWzc6GBcIUL1fSZfgz0Z8YNtFYW5WgF58bJUKWMqm6zgDfgEPoH/XXWQYAh qxtShkQlpIG1yWe2tGdhnYpVYvSubOv6X3Xp2wuiowrBniAVEzEHMkvPNznYJ5aCkmhZ czscvBJveZqHr+Kl66VpwIUXg0rrAdqMczgicpkIO6RttqQmN0A180lPukBaXNlv1bux P+Lw== X-Gm-Message-State: AOJu0Yw+jNHPqlUp17AGIMCKBoe55H+K0rWxi/XP/ggLkx6myhzo8TJ2 Ck/usYAY9/Iv4E7a9yryXwfBW3p5dE+02JENFgnPh4zJnJM+BC5N9XvapGtQnN6Xd0w2ktp7Bht GlQDWq6A= X-Gm-Gg: AR+sD11OtcYVj2lY3P1GhmT1XKUXsXb3sn65qQzAx2l0sL2bJ99fxuQqcNhXHnwc3K8 GrLEjbdEkRBNEg24ltKUgX45oP87Gd6cZ8+MoAeA2S5rjaVOjQAuRqipLL3ZM/YVyJvU1IbxVcv eQRTwhLFQAsOpfGZAyMQXArRPwlw2OSsoqlx1Kwb78EsGKsuuwH1Dbwy6MDWA6GIYYQNBsxUlLB 90wZpy9/Jy584FYlD6FJq3EYSDSLB7KIAlIY02XY2sNRxXsuhEDdBsMygWflODoWiH1li8yZjwx 4UGGCPfVDlDwNM2Xx8u+veoA0tDbQDceS6NbMPb6qn7jqOj4gnl3T50dzQgrZdLQt4XTbrwk6rd OE12g0oRRUCg3ku0MsE2fb8k95P5o3lEIlwOdpHD5EXxtSHxHdeyw9kQibcTWPFQBn9Ha2QUM7r qcxqzGJXK6JPfWuPxOi8SFfJTWfIPZYjS6voRLFZdKQjU26U9qvFx/wPqB7VFR8uG2eniZBYHPl ilMNcmkw7xELJ+DJVCWZF2t2mxS X-Received: by 2002:a05:600c:840f:b0:493:b6ee:fcb7 with SMTP id 5b1f17b1804b1-4980c6507e7mr110130605e9.14.1785666537286; Sun, 02 Aug 2026 03:28:57 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.28.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:28:56 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 01/25] sstatesig: Use kernel.bbclass instead of linux-kernel-base.bbclass Date: Sun, 2 Aug 2026 11:28:30 +0100 Message-ID: <20260802102854.3952760-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:06 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242526 linux-kernel-base is nearly empty and about to be removed, switch to kernel.bbclass which should be similar. The main risk is other layers using that class name, but hopefully they'd still be kernels! Signed-off-by: Richard Purdie --- meta/lib/oe/sstatesig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index f016fc67704..bd509800726 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py @@ -19,7 +19,7 @@ def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCaches): return x.startswith("nativesdk-") def isKernel(mc, fn): inherits = " ".join(dataCaches[mc].inherits[fn]) - return inherits.find("/module-base.bbclass") != -1 or inherits.find("/linux-kernel-base.bbclass") != -1 + return inherits.find("/module-base.bbclass") != -1 or inherits.find("/kernel.bbclass") != -1 def isPackageGroup(mc, fn): inherits = " ".join(dataCaches[mc].inherits[fn]) return "/packagegroup.bbclass" in inherits From patchwork Sun Aug 2 10:28:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94193 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 C6D15C55175 for ; Sun, 2 Aug 2026 10:29:06 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.21326.1785666540007986726 for ; Sun, 02 Aug 2026 03:29:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=B4D8hi0f; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.52, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4956869750eso6660925e9.2 for ; Sun, 02 Aug 2026 03:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666538; x=1786271338; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=ro71Q/jpM+gmUSbHkEqkRXORIxLPSnnGSauvYAcXzvU=; b=B4D8hi0fqfwXjxM0J9FJy4mjqtmhM+nps7HzTlYjoYfPsWEFmrpm/0b1tXci44zWdg u4xyV0+Svx2HaFBnkuRXZ2he6+SpZxrJibsM7oJN7wNrxYs0jkIah+8RPGvluh0Q95BH g+OaNQh93mcnIt+r44T7h9QDkQulcnPeykyz0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666538; x=1786271338; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=ro71Q/jpM+gmUSbHkEqkRXORIxLPSnnGSauvYAcXzvU=; b=GyzugCF+mFpTmjn/5uKW5SXTOvqegY3vwbn2CzQUyUuYpuiDy9/eeLD+WVphxTzAXy uO+brgUcz/wIjFVAWbc1n6qEVVrO39TN4n1OAr6NattsMktx8Q05YjfWCwMt+7KGQ9ow 6k0Xx124vZRRioKdcYrmXx+e4mlDgtrHl3VnVd/bEEdfDFlFf7asW+eHRtdoAUvXLC5b NKWLI2lCaB5b9ikAgJyn0NhWcDP/ddmhYHFiYg+ERq6rPgeCrJKqkz4sVZ2ZJtaGCHfE HxxpPs/8gZn+zZIC6seDVCmxxlMkfJaEN7tbEizUL/PyTmQlaQBxAPeEdQGjdEmUb/TR 352w== X-Gm-Message-State: AOJu0YyM6uT6lMSeEfOsa+U7+ixeZH8lHOr6xISiYuogChb704VGxr/X 07YY1JX8Fx/jECkp8azGUTSyi9rSDTpvin6KwvcOtqemMfKpBpH6BXeH7/+Q53cqKsbTMN8LrLc rLNtkti4= X-Gm-Gg: AR+sD12fvNOR6fs567U2i4Ge3leiQkORj3U4zxDdHbqE2h77zMT6GVmvTvsgVDwA4XJ jQsF189XG8YP4PTDSZrfRpNqqJHvBxJgFtJUJgB28qpMJhUEqFLwQcQzDQYiAxaJUR/UfoazZDB mqKaBB4ti0dovKO+E7ZxUKTP+Sleoj805AkhAW4EvbabmkQZbT50TIG8O1hCuSz/y0qmZQM1hoJ IwUbzYJBwlCMK21tWjYxbTBBmo4X82CEQmXXzt6wJ8UiK53SkWF45VUhvK2dDunrwQ8+4plFlVE EQtIL1SvFcBYz8qdQ9EMGTWqlfYm4+jMdgomlf5ZG81rblHexrpUd9QMBpv9DFW9CWrOpk7bgQL E8yBBHiJz3SJ0fLf8BA4N7TVNsEcOFqRfN6wfHh9JhXsW88rs0T+UUgAgpcdMyTsUOgf+IS1Xbq l2lUKewGMBmilOLGqSycuiYxGKGYMAT+rDmLjtIWPjpQcgCfiZt+XXcwk6K4zTlnUVuECSQIg0R er0pB6fG3WSxpcznw== X-Received: by 2002:a05:600c:548d:b0:495:6134:6d61 with SMTP id 5b1f17b1804b1-4980c674de0mr132175855e9.19.1785666538253; Sun, 02 Aug 2026 03:28:58 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.28.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:28:57 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 02/25] linux-kernel-base: Delete unused function Date: Sun, 2 Aug 2026 11:28:31 +0100 Message-ID: <20260802102854.3952760-3-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:06 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242527 Drop a funciton which seems unused and a pointless comment. Signed-off-by: Richard Purdie --- meta/classes-recipe/linux-kernel-base.bbclass | 6 ------ 1 file changed, 6 deletions(-) diff --git a/meta/classes-recipe/linux-kernel-base.bbclass b/meta/classes-recipe/linux-kernel-base.bbclass index e2187a73f0e..76d8b4d4513 100644 --- a/meta/classes-recipe/linux-kernel-base.bbclass +++ b/meta/classes-recipe/linux-kernel-base.bbclass @@ -50,13 +50,7 @@ def get_kernellocalversion_file(p): return "" -def linux_module_packages(s, d): - suffix = "" - return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split())) - export KBUILD_BUILD_VERSION = "1" export KBUILD_BUILD_USER ?= "oe-user" export KBUILD_BUILD_HOST ?= "oe-host" -# that's all - From patchwork Sun Aug 2 10:28:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94196 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 04263C55183 for ; Sun, 2 Aug 2026 10:29:07 +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.21176.1785666540999244573 for ; Sun, 02 Aug 2026 03:29:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=WWCHVfuX; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.46, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4921eed3fa2so5988825e9.0 for ; Sun, 02 Aug 2026 03:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666539; x=1786271339; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=sQTQzgWJW0iOkR18nZdh3mOTnZcKQKKSMIZ8BpTY2AQ=; b=WWCHVfuX6OiBESGBg1SKyf5ajwyJ+okOa3lMQkJxSsSgEuW0xJ5pRKdfCzEc/h8GWH Ws0fbqUj8S8nKuznMiWGGjeNQwiCAij37vqaj60iEe69ipfvgIcftJdh0lBmfpg6k23k eC4RN+tu5fUW6PUyA746gU2p2AVXLmoBIMtbk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666539; x=1786271339; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=sQTQzgWJW0iOkR18nZdh3mOTnZcKQKKSMIZ8BpTY2AQ=; b=FQCeJDcSF3FmFa2F4zU5BURRFj5exLvY8SchqBhGDwASPVparslfmziikqlQabB7mP 1XBk1iy/J2ZfdNJUcyqGrUS44m9sMwsEV6V6kndxqgmVH9GV0oFs19rcCSFrVL60/SOB Rc1W+NerfIzxVpPtt/eWy2QO0ptCmhmwEMmcv2R4xtG/aWnhD/Zha0PLLd8m5/6EGVZW FTyuB/8yJzxa+Cnq/5ScbwVH8tV+RVqQeYLAeSgOTjzbfFZGvqeSNS0asrscrmuCcry4 AOnFIcNyfPlC2HBGk6AD/tIvAAKV5R3MC0j8jNscEP3jN5YlAB8MTJ3vk569h7V6xuXq o5/A== X-Gm-Message-State: AOJu0Yw61AoVDziXd94Dp97QkNZJX6U9lEtB0GSYPQImz5Qz1jML/sZJ tTKO1lmIEOE9kLyfQ9hbeNN9a/m46zeRtbEQ8dbDbtS1+/fOEm+tvfbEPV4yWJuJ6E8Dr2fxN/2 wtTCuqEs= X-Gm-Gg: AR+sD12Kl3Csd9V1RS1uu8q0rZPyPLvRGkuQLdLoPbo/DKMB/4lvpJPfRWOqX3To0aX SAFrtKcjv6QeD4T3wtOe527litRV4l6yHHiP5+I8KqppLX9fgmS2Ui713yAiy+7b4Xb49Vc1QCP JvndpXY4fiJek/uv78G50q7i+gHibwr8kx+yZrN0pt3MnkASLx5kcMGO3H8RWlKQExySii9XszT O/mmuDp8TGHu6237qk8PIBIuia+HkfFRERvLuhDZspmlWH6Tuoo0sUT1jKq4sheaabBAmahz63Y rfRiCcgyo40neL+7OwSQrwVsEZ5/vxGCqxcNoAENZ5DJms6CWjSGPfxt2QeCcNeQBAQ/cmnyDnL Rp+LKu660Mva9GiuymEMCCEIVa+F1vOSdiFFvX72XOvhN9W0jEuPP1BA8rq24VibflV/qbLBj/V TgAkD4FZy3ErvAjJ6TnopBeSzTHbo6RrKK0yQCPt1rCh8R8xos0+m40bYb1QSXA6x5kwd0P9JHp cs8yGxlVg8lbwvXVA== X-Received: by 2002:a05:600c:4504:b0:493:c194:4e7a with SMTP id 5b1f17b1804b1-4980c66c9a8mr115078355e9.3.1785666539176; Sun, 02 Aug 2026 03:28:59 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.28.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:28:58 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 03/25] lib/oe/kernel: Move python functions from linux-kernel-base to library code Date: Sun, 2 Aug 2026 11:28:32 +0100 Message-ID: <20260802102854.3952760-4-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:07 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242528 This means get_kernelXXX needs to become oe.kernel.get_XXX and means we can clear linux-kernel-base to allow it to be removed, starting to simplify the file structure. Signed-off-by: Richard Purdie --- meta/classes-recipe/kernel.bbclass | 4 +- meta/classes-recipe/kernelsrc.bbclass | 4 +- meta/classes-recipe/linux-kernel-base.bbclass | 46 ----------------- meta/lib/oe/__init__.py | 2 +- meta/lib/oe/kernel.py | 51 +++++++++++++++++++ .../linux/linux-yocto-fitimage.bb | 2 +- .../make-mod-scripts/make-mod-scripts_1.0.bb | 2 +- 7 files changed, 58 insertions(+), 53 deletions(-) create mode 100644 meta/lib/oe/kernel.py diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 91248467bef..aeaec8ccbd4 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -233,7 +233,7 @@ KERNEL_DTBVENDORED ?= "0" # # configuration # -KERNEL_VERSION = "${@get_kernelversion_headers('${B}')}" +KERNEL_VERSION = "${@oe.kernel.get_version_headers('${B}')}" # kernels are generally machine specific PACKAGE_ARCH = "${MACHINE_ARCH}" @@ -643,7 +643,7 @@ KERNEL_LOCALVERSION ??= "" # # Note: This class saves the value of localversion to a file # so other recipes like make-mod-scripts can restore it via the -# helper function get_kernellocalversion_file +# helper function oe.kernel.get_localversion_file export LOCALVERSION = "${KERNEL_LOCALVERSION}" kernel_do_configure() { diff --git a/meta/classes-recipe/kernelsrc.bbclass b/meta/classes-recipe/kernelsrc.bbclass index 93361842989..b105fc15990 100644 --- a/meta/classes-recipe/kernelsrc.bbclass +++ b/meta/classes-recipe/kernelsrc.bbclass @@ -10,8 +10,8 @@ deltask do_unpack do_patch[depends] += "virtual/kernel:do_shared_workdir" do_patch[noexec] = "1" do_package[depends] += "virtual/kernel:do_populate_sysroot" -KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}" -LOCAL_VERSION = "${@get_kernellocalversion_file("${STAGING_KERNEL_BUILDDIR}")}" +KERNEL_VERSION = "${@oe.kernel.get_version_file("${STAGING_KERNEL_BUILDDIR}")}" +LOCAL_VERSION = "${@oe.kernel.get_localversion_file("${STAGING_KERNEL_BUILDDIR}")}" inherit linux-kernel-base diff --git a/meta/classes-recipe/linux-kernel-base.bbclass b/meta/classes-recipe/linux-kernel-base.bbclass index 76d8b4d4513..566b2c96ba7 100644 --- a/meta/classes-recipe/linux-kernel-base.bbclass +++ b/meta/classes-recipe/linux-kernel-base.bbclass @@ -4,52 +4,6 @@ # SPDX-License-Identifier: MIT # -# parse kernel ABI version out of -def get_kernelversion_headers(p): - import re - - fn = p + '/include/linux/utsrelease.h' - if not os.path.isfile(fn): - # after 2.6.33-rc1 - fn = p + '/include/generated/utsrelease.h' - if not os.path.isfile(fn): - fn = p + '/include/linux/version.h' - - try: - f = open(fn, 'r') - except IOError: - return None - - l = f.readlines() - f.close() - r = re.compile("#define UTS_RELEASE \"(.*)\"") - for s in l: - m = r.match(s) - if m: - return m.group(1) - return None - - -def get_kernelversion_file(p): - fn = p + '/kernel-abiversion' - - try: - with open(fn, 'r') as f: - return f.readlines()[0].strip() - except IOError: - return None - -def get_kernellocalversion_file(p): - fn = p + '/kernel-localversion' - - try: - with open(fn, 'r') as f: - return f.readlines()[0].strip() - except IOError: - return "" - - return "" - export KBUILD_BUILD_VERSION = "1" export KBUILD_BUILD_USER ?= "oe-user" export KBUILD_BUILD_HOST ?= "oe-host" diff --git a/meta/lib/oe/__init__.py b/meta/lib/oe/__init__.py index 13d887a4aad..faa9987c8ca 100644 --- a/meta/lib/oe/__init__.py +++ b/meta/lib/oe/__init__.py @@ -12,4 +12,4 @@ __path__ = extend_path(__path__, __name__) BBIMPORTS = ["qa", "data", "path", "utils", "types", "package", "packagedata", \ "packagegroup", "sstatesig", "lsb", "cachedpath", "license", "qemu", \ "reproducible", "rust", "buildcfg", "go", "spdx30_tasks", "spdx_common", \ - "cve_check", "tune", "classextend", "purl"] + "cve_check", "tune", "classextend", "purl", "kernel"] diff --git a/meta/lib/oe/kernel.py b/meta/lib/oe/kernel.py new file mode 100644 index 00000000000..421debed9af --- /dev/null +++ b/meta/lib/oe/kernel.py @@ -0,0 +1,51 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +import re + +# parse kernel ABI version out of +def get_version_headers(p): + fn = p + '/include/linux/utsrelease.h' + if not os.path.isfile(fn): + # after 2.6.33-rc1 + fn = p + '/include/generated/utsrelease.h' + if not os.path.isfile(fn): + fn = p + '/include/linux/version.h' + + try: + f = open(fn, 'r') + except IOError: + return None + + l = f.readlines() + f.close() + r = re.compile("#define UTS_RELEASE \"(.*)\"") + for s in l: + m = r.match(s) + if m: + return m.group(1) + return None + + +def get_version_file(p): + fn = p + '/kernel-abiversion' + + try: + with open(fn, 'r') as f: + return f.readlines()[0].strip() + except IOError: + return None + +def get_localversion_file(p): + fn = p + '/kernel-localversion' + + try: + with open(fn, 'r') as f: + return f.readlines()[0].strip() + except IOError: + return "" + + return "" diff --git a/meta/recipes-kernel/linux/linux-yocto-fitimage.bb b/meta/recipes-kernel/linux/linux-yocto-fitimage.bb index 4dcffb62094..75dbcb2af5c 100644 --- a/meta/recipes-kernel/linux/linux-yocto-fitimage.bb +++ b/meta/recipes-kernel/linux/linux-yocto-fitimage.bb @@ -10,4 +10,4 @@ inherit linux-kernel-base kernel-fit-image # Set the version of this recipe to the version of the included kernel # (without taking the long way around via PV) -PKGV = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}" +PKGV = "${@oe.kernel.get_version_file("${STAGING_KERNEL_BUILDDIR}")}" diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb index 338a50de916..ab984f4bcfe 100644 --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb @@ -24,7 +24,7 @@ DEPENDS += "virtual/cross-cc virtual/cross-binutils" EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"" EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}" -KERNEL_LOCALVERSION = "${@get_kernellocalversion_file("${STAGING_KERNEL_BUILDDIR}")}" +KERNEL_LOCALVERSION = "${@oe.kernel.get_localversion_file("${STAGING_KERNEL_BUILDDIR}")}" export LOCALVERSION = "${KERNEL_LOCALVERSION}" # Build some host tools under work-shared. CC, LD, and AR are probably From patchwork Sun Aug 2 10:28:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94195 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 A30E5C55174 for ; Sun, 2 Aug 2026 10:29:06 +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.msgproc02-g2.21328.1785666542022393779 for ; Sun, 02 Aug 2026 03:29:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=K/pKl/JJ; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.49, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4954aff6088so9185715e9.3 for ; Sun, 02 Aug 2026 03:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666540; x=1786271340; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=LW9mBwKzGnkYBkEKC81AbVZCNEmnrXPcOi5LhBRmvPg=; b=K/pKl/JJNb4eE4cROsJtIw/96sXA7ka9o+4tRwIJ5GWe7fEbUom5mF+DuveANlUHg+ Hg8UAQdkkeo3u5HyWaa5ygfauGGhYhpjRw1cSrmhZYrtY7b7jprA4QSAf2oRjWBQyxvV bevm7uAKYLWirIH9IhrS7WC+EbJQjLDQtJ2O0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666540; x=1786271340; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=LW9mBwKzGnkYBkEKC81AbVZCNEmnrXPcOi5LhBRmvPg=; b=jej3LfOCosvBrBAQxYKtbS1CaUpMSy3F+WnnV979wZiTIKnrgXq/qOKqNgwubPsL4S 6Beo9OauNxcrwOC1IOMhbDZK+WPj0I2lMqP/OK5203iC0BUr0fLF0prjC60O5iFLcRBw IESIpOX3bGY/jC9QC3B+63P7JIm1HGQj3q4VtcOHVta3UzskZC+D4rZKdX2k1aG90WHV yVQMCRyn3jF6PXrF+jdykxVKg3ivPdKJ0OVVk027qjuIfgI3bRAdq8ZK5qnGGmKFGMMY 1JZJ9JA8+5YerYZO4ogE69sKpjy+8hsSzuLvNdhRndYuotxnRSK+jFk2kqZJWK0nGaoi KFgA== X-Gm-Message-State: AOJu0YwWscFYfnWZsK3h/QTf0lBgjCuFoyZ4URi16MqmMkfCRCNYWPmQ Nm5DkRV4t/qxSTbeN4VcZ62AgVDqWvIoecdBOy0KLuazBJP56wi48Ughit+Ax8O522Ke63J0+i8 WHaHpMTo= X-Gm-Gg: AR+sD136aUYsSKFv+DWBuYozYbzvlunTb9Ooef9s0OjDZJneeKCvY2YjTNQgSs9UERc 79VYwpYcsuunmZB56pIiO7GOyIM4Y+81nM8NBMQ1VCivYu6OZMFHBCFuej721dz9ggSPMIw6hRW W7IUQkc8fdeKDVAwRpUJ+IEHyRh4V4git11ICxRSLqiWL9Y650Ldv5qDI/gE8ubDUzJI/80jDFP PcdZTVucqiVp1JXjY9FsuQ6cGFN2CrzDQB91CmdTyPgcIKmohA3m89i9u2FlVWIkVFMkX3pUZta pfhT22aT/f5SI3U1bmSOpPLchMNIebj516IphdPdyrwcR8rVWRWi8oN/bXY4DTvfpPD6xrtTkI/ rRVg4yOR1WvLoXBypT7S8RrXtEHMaMf1ZUa2TkhRW1nQLWfZbEDiDS6ED6CCqGO8XxzMPTd6+2W AhsdXA7cSmSbmKCtzejPs/uSNwnu+JDDUaIOZCQmFpu+8M/Vm/2Bk+DAZt3Z9uC4dLESi3lPq3b IFWIcTMCl0cZsqzaA== X-Received: by 2002:a05:600c:3b23:b0:493:cc25:9c0e with SMTP id 5b1f17b1804b1-4980c679e43mr131749215e9.14.1785666540248; Sun, 02 Aug 2026 03:29:00 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.28.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:28:59 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 04/25] kernel-yocto: Simplify code for cleanliness and slight performance Date: Sun, 2 Aug 2026 11:28:33 +0100 Message-ID: <20260802102854.3952760-5-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:06 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242529 Checking "in d" is really slow, using getVar for a specific lookup is much much faster. The externalsrc issue can be resolved more simply by adding an extra constraint on the kernel_configme task. Signed-off-by: Richard Purdie --- meta/classes-recipe/kernel-yocto.bbclass | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass index 78a4a7ade74..5464aa11158 100644 --- a/meta/classes-recipe/kernel-yocto.bbclass +++ b/meta/classes-recipe/kernel-yocto.bbclass @@ -513,7 +513,7 @@ do_kernel_configme() { fi } -addtask kernel_configme before do_configure after do_patch +addtask kernel_configme before do_configure after do_patch do_unpack addtask config_analysis do_config_analysis[depends] = "virtual/kernel:do_configure" @@ -770,14 +770,8 @@ KBUILD_OUTPUT = "${B}" python () { # If diffconfig is available, ensure it runs after kernel_configme - if 'do_diffconfig' in d: + if d.getVar('do_diffconfig', False): bb.build.addtask('do_diffconfig', None, 'do_kernel_configme', d) - - externalsrc = d.getVar('EXTERNALSRC') - if externalsrc: - # If we deltask do_patch, do_kernel_configme is left without - # dependencies and runs too early - d.setVarFlag('do_kernel_configme', 'deps', (d.getVarFlag('do_kernel_configme', 'deps', False) or []) + ['do_unpack']) } # extra tasks From patchwork Sun Aug 2 10:28:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94192 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 B3194C55162 for ; Sun, 2 Aug 2026 10:29:05 +0000 (UTC) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.21330.1785666543328398713 for ; Sun, 02 Aug 2026 03:29:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=K9tDUSSc; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.53, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-495757ccbc1so10840095e9.2 for ; Sun, 02 Aug 2026 03:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666541; x=1786271341; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=mnMZ+r7I15cuzdS0AONnpIr99tLQpFNqv5IBe+yzhwk=; b=K9tDUSScLzit1FHvKFF5zNZvvepFxInI8sLFh5UEOYcprBwHj77pCO4lbg0h2f0LaO iFSTwVlIoFaF798hKkcPmPOzflvDvMYdcs3qy4eHXgOsGPqRg9WrqDcYl8jribaiTfqL FF059IPTxSuih/BAWquQErgEmwa0FhWaSmAbI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666541; x=1786271341; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=mnMZ+r7I15cuzdS0AONnpIr99tLQpFNqv5IBe+yzhwk=; b=VwDo7e/050xkq0D2mcBlmBSWuJC0seMcWlLlOpFES1wInSKWY1pye/IBKBMGEweoO7 OBGCgnJTXMagRi6q5qtCdINcPbxWo0W3APxbRjyp2FYGBOuFQdIpONVZNmzQZSuf+1ej T7J9rb2duuOt/HMxc+rXCjIs/HILbmyVlyU1C0IqroqQXuTXQpxVgy2V9mLllCdGZcPC 1hBHIUZQ+biJc+KChNWix7EdBS7UbfjEbBKL/6gBM1L7Ixp1N2f0XUbuFHgcQkomHxja C3w8uNRh8gntqAwY/mjxxLzw9ZitExMAttUaaTTJtvHpaFwzEZFxUnJ9ew2VTaRUbKZ1 tyAA== X-Gm-Message-State: AOJu0Yw8nqGl2tG5UNIRFOiYmeyzFLJjnmCwN4x23W9MvWLe0hs7NW1k w+Jt16DvOg8vYQsVTyAh6WANTKwnreX3QvKKDxbGUDrDQPrRJayq0gE4f7l1CpEs08hsr6qgZwC XqZ8e4Eg= X-Gm-Gg: AR+sD10xMoZPQndNRqFV/qN4QUAIgO7W2eUC2RVHwFd6X/K60KSdn0xQVOSAB0FH/a3 fNm6MvA3R9zv0w/a9K7VU+eqJ1HrSwXOVYOP4gqgYQr5FwVWL8g6aonFpmhQdUP4ygTCJbIgbuN KPg+/+nxOO4LI37F5LRKo6HMjmK2feCfEqghvcsdp/NmaHz++pI7BLkm6jNISae82+JDt9pRadg S6Iybfu79Q9ixXrei7jK8fhU8KsdsQq1NoXQthsm8hhZf3HPdHFEosBMRij0g1m1kn4TCeAaJq8 mw6YnvEaoMreSO8DtkQsrGOb0lqnGK6Hm0enGdlCJ42EUCpaO7J+Q3jxK7iuSCxlw7bKPNfCz38 kx5ekjNzbBVQQ5ZSzIkbCT4XQXq4rotPVyoFBSOxunmxmU1dnb+2as2j7lOZAL+abtxY4j+CjgV w+BJCIe70O37OGcH6HS0Y1OeWXBe5f6D5L4dAAZepfBouBH8Z5LP88+YmWGIqTWnFx9cIXuay3c Dvh/yTrunScwlAM1w== X-Received: by 2002:a05:600c:840f:b0:497:ff73:68d5 with SMTP id 5b1f17b1804b1-4980c6071c5mr104407645e9.0.1785666541419; Sun, 02 Aug 2026 03:29:01 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:00 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 05/25] kernel-arch: Move kernel and uboot arch functions to lib/oe/kernel.py Date: Sun, 2 Aug 2026 11:28:34 +0100 Message-ID: <20260802102854.3952760-6-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242530 Move the ARCH and UBOOT_ARCH python functions to the python library code. The ability to alter valid_archs is removed as: - the values should be long since established by now - non-linux targets have an escape in the code - the lower case variable name is not normal convention and should be replaced if we were to retain it By removing it we'll find out if anyone does actually need that (and we can probably fix the entries in the file if there is anything missing). The code itself is full of redundant codepaths but that is for another patch if we try and improve it. Signed-off-by: Richard Purdie --- meta/classes-recipe/kernel-arch.bbclass | 54 +------------------------ meta/lib/oe/kernel.py | 39 ++++++++++++++++++ 2 files changed, 41 insertions(+), 52 deletions(-) diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass index 5f8dbacc0c0..b00341c2180 100644 --- a/meta/classes-recipe/kernel-arch.bbclass +++ b/meta/classes-recipe/kernel-arch.bbclass @@ -4,61 +4,11 @@ # SPDX-License-Identifier: MIT # -# # set the ARCH environment variable for kernel compilation (including # modules). return value must match one of the architecture directories # in the kernel source "arch" directory -# - -valid_archs = "alpha cris ia64 \ - i386 x86 \ - m68knommu m68k ppc powerpc powerpc64 ppc64 \ - sparc sparc64 \ - arm aarch64 \ - m32r mips \ - sh sh64 um h8300 \ - parisc s390 v850 \ - avr32 blackfin \ - loongarch64 \ - microblaze \ - nios2 arc riscv xtensa" - -def map_kernel_arch(a, d): - import re - - valid_archs = d.getVar('valid_archs').split() - - if re.match('(i.86|athlon|x86.64)$', a): return 'x86' - elif re.match('arceb$', a): return 'arc' - elif re.match('armeb$', a): return 'arm' - elif re.match('aarch64$', a): return 'arm64' - elif re.match('aarch64_be$', a): return 'arm64' - elif re.match('aarch64_ilp32$', a): return 'arm64' - elif re.match('aarch64_be_ilp32$', a): return 'arm64' - elif re.match('loongarch(32|64|)$', a): return 'loongarch' - elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'mips' - elif re.match('mcf', a): return 'm68k' - elif re.match('riscv(32|64|)(eb|)$', a): return 'riscv' - elif re.match('p(pc|owerpc)(|64)', a): return 'powerpc' - elif re.match('sh(3|4)$', a): return 'sh' - elif re.match('bfin', a): return 'blackfin' - elif re.match('microblazee[bl]', a): return 'microblaze' - elif a in valid_archs: return a - else: - if not d.getVar("TARGET_OS").startswith("linux"): - return a - bb.error("cannot map '%s' to a linux kernel architecture" % a) - -export ARCH = "${@map_kernel_arch(d.getVar('TARGET_ARCH'), d)}" - -def map_uboot_arch(a, d): - import re - - if re.match('p(pc|owerpc)(|64)', a): return 'ppc' - elif re.match('i.86$', a): return 'x86' - return a - -export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH'), d)}" +export ARCH = "${@oe.kernel.map_kernel_arch(d)}" +export UBOOT_ARCH = "${@oe.kernel.map_uboot_arch(d)}" # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture # specific options necessary for building the kernel and modules. diff --git a/meta/lib/oe/kernel.py b/meta/lib/oe/kernel.py index 421debed9af..bab375c37ae 100644 --- a/meta/lib/oe/kernel.py +++ b/meta/lib/oe/kernel.py @@ -6,6 +6,45 @@ import re +# Return a value for the ARCH environment variable for kernel compilation (including +# modules). return value must match one of the architecture directories +# in the kernel source "arch" directory +def map_kernel_arch(d): + a = d.getVar('TARGET_ARCH') + + valid_archs = ["alpha", "cris", "ia64", "i386", "x86", "m68knommu", "m68k", "ppc", "powerpc", + "powerpc64", "ppc64", "sparc", "sparc64", "arm", "aarch64", "m32r", "mips", + "sh", "sh64", "um", "h8300", "parisc", "s390", "v850", "avr32", "blackfin", + "loongarch64", "microblaze", "nios2", "arc", "riscv", "xtensa"] + + if re.match('(i.86|athlon|x86.64)$', a): return 'x86' + elif re.match('arceb$', a): return 'arc' + elif re.match('armeb$', a): return 'arm' + elif re.match('aarch64$', a): return 'arm64' + elif re.match('aarch64_be$', a): return 'arm64' + elif re.match('aarch64_ilp32$', a): return 'arm64' + elif re.match('aarch64_be_ilp32$', a): return 'arm64' + elif re.match('loongarch(32|64|)$', a): return 'loongarch' + elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'mips' + elif re.match('mcf', a): return 'm68k' + elif re.match('riscv(32|64|)(eb|)$', a): return 'riscv' + elif re.match('p(pc|owerpc)(|64)', a): return 'powerpc' + elif re.match('sh(3|4)$', a): return 'sh' + elif re.match('bfin', a): return 'blackfin' + elif re.match('microblazee[bl]', a): return 'microblaze' + elif a in valid_archs: return a + else: + if not d.getVar("TARGET_OS").startswith("linux"): + return a + bb.error("cannot map '%s' to a linux kernel architecture" % a) + +def map_uboot_arch(d): + a = map_kernel_arch(d) + + if re.match('p(pc|owerpc)(|64)', a): return 'ppc' + elif re.match('i.86$', a): return 'x86' + return a + # parse kernel ABI version out of def get_version_headers(p): fn = p + '/include/linux/utsrelease.h' From patchwork Sun Aug 2 10:28:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94191 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 95A52C55171 for ; Sun, 2 Aug 2026 10:29:05 +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.msgproc02-g2.21333.1785666544360618050 for ; Sun, 02 Aug 2026 03:29:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=N7HcpfkO; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.49, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-490cf322ed0so5836435e9.1 for ; Sun, 02 Aug 2026 03:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666542; x=1786271342; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=zEYQ8jFeAM7ja+Z+jwW70nX4VmsbeT+wVpdNupbxLY0=; b=N7HcpfkOxqrbMtHPfDsUX25RlrVzJAswEDgzUdTq1cJUPfVj3V/lVeYxhTxIwEcJiP JJFKWEKQe6619edIt3HZGuqTPh2m/x5CY9t6WNCgFgIz6LchKqDsjzRw3Ip4xfi7Y244 kekt+02/P4dWV1JHtiIfm9e/ItlmNKV79Ac8k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666542; x=1786271342; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=zEYQ8jFeAM7ja+Z+jwW70nX4VmsbeT+wVpdNupbxLY0=; b=OW7M8zdoS4zwQt1BlZnrn055lgZtEYpXpsZrHJ5yldU+wtcTXZKbVOTEg9DdhlAH4Q N/ByZFpN/cX3sIy94D/yrKH1eawRvHHwJlwYdfA5SDcy7bk9yy6pl8gfhLCNWBMtbtY0 OOjNCuLNxfnRko6KzhFBSuR5N0xwbxMaXakRTlaTcN/7eZD6FTVptNozE3otXjJN1h9t fOHmKYBKImbP28n8T3n655TrPKUSOm56iI3Bv5KaOYYUF+2IzMC9Gj9rSrpGACgxqrCh Nzy1/R18h+CEyTo3bRoCOqDew/JK6HuvJlbOxYz+5stThKrBNXwAlOb9c9ypM2Lz9OB2 MYTg== X-Gm-Message-State: AOJu0YxgbqPXXnE5/xHfv0pd7v8JWXoZ8qAg6+6IJJFBBBEke1kaJVXD YlmhRVgLk31z5dkTsyZSbcOpVaST4ONrWp7NuADOlHgQ9uduIQ6KfPb8T2VTyPEjMW65rXjY3dD vF6NJZgY= X-Gm-Gg: AR+sD115osyG2y0BD31V34DA35+LSXNLvSFaYCm1GTmd/Cnpi8DUMzS9UMENMDGsB4t p73lVjq8SQo66/IgTya3Hq2IJ0ydiKEIYXoTUeSOTj2Ya27nL5/oFzRhJiIWF9FtS89cg8Mdfmi l3PmdgWAGHy8uuzzA0xDR5EOkw/rrBq+Hqshj8i9gm5nbsnJJZpFOVaDi3jZ3RJR9cK977yvvmx GNedrCVU4Y+uctLb+9Ugel26HzJyBqJ7pFqjHzyev/V0duMUCh2Uz3NHLuuzZy6cgITKT5NZbnL ZFFrVEvj7W6Co3dzHSCf4O/R61NuMrij5XhSHzRCMUolXVq8v6LUCcu58+bSYaUhPZ6dB/QMcTm HvIUrfvHhPMT/whWQLk780VUrOONyTxZcrFNZYZTHhswM4u+eaGfxdddhP65Mcrf1Nzo2qdNDIY atEvtNadn+yM2sz499vyP/h1JqkLJFu9G3q8V++suTcbmfrIN+KiY9NsW790sHY4sS//cZRCAH+ wQgV4o/lSbSEh1sgA== X-Received: by 2002:a05:600c:c490:b0:495:5858:8101 with SMTP id 5b1f17b1804b1-4980c6788d4mr105703125e9.15.1785666542559; Sun, 02 Aug 2026 03:29:02 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:01 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 06/25] kernel-arch: Simplify KERNEL_ARCH variable usage Date: Sun, 2 Aug 2026 11:28:35 +0100 Message-ID: <20260802102854.3952760-7-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:05 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242531 As far as I can tell, the HOST_*_KERNEL_ARCH variables only exist so we can have "HOST" alongside the other host variables. The BSPs would all use the TARGET_xxx syntax and as far as I know, nobody uses HOST any differently. Simplfy the code by dropping the intermediate variables which have been there since the code was introduced in c49f967384ccbfe131bbb33ee518014f3fc4b38f. Signed-off-by: Richard Purdie --- meta/classes-recipe/kernel-arch.bbclass | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass index b00341c2180..fd6bce11460 100644 --- a/meta/classes-recipe/kernel-arch.bbclass +++ b/meta/classes-recipe/kernel-arch.bbclass @@ -13,34 +13,30 @@ export UBOOT_ARCH = "${@oe.kernel.map_uboot_arch(d)}" # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture # specific options necessary for building the kernel and modules. TARGET_CC_KERNEL_ARCH ?= "" -HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}" TARGET_LD_KERNEL_ARCH ?= "" -HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" TARGET_AR_KERNEL_ARCH ?= "" -HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}" TARGET_OBJCOPY_KERNEL_ARCH ?= "" -HOST_OBJCOPY_KERNEL_ARCH ?= "${TARGET_OBJCOPY_KERNEL_ARCH}" -KERNEL_CC:toolchain-gcc = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} \ +KERNEL_CC:toolchain-gcc = "${CCACHE}${HOST_PREFIX}gcc ${TARGET_CC_KERNEL_ARCH} \ -fuse-ld=bfd ${DEBUG_PREFIX_MAP} \ -ffile-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} \ -ffile-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH} \ " -KERNEL_LD:toolchain-gcc = "${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" -KERNEL_AR:toolchain-gcc = "${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}" -KERNEL_OBJCOPY:toolchain-gcc = "${HOST_PREFIX}objcopy ${HOST_OBJCOPY_KERNEL_ARCH}" +KERNEL_LD:toolchain-gcc = "${HOST_PREFIX}ld.bfd ${TARGET_LD_KERNEL_ARCH}" +KERNEL_AR:toolchain-gcc = "${HOST_PREFIX}ar ${TARGET_AR_KERNEL_ARCH}" +KERNEL_OBJCOPY:toolchain-gcc = "${HOST_PREFIX}objcopy ${TARGET_OBJCOPY_KERNEL_ARCH}" # Code in package.py can't handle options on KERNEL_STRIP KERNEL_STRIP:toolchain-gcc = "${HOST_PREFIX}strip" -KERNEL_CC:toolchain-clang = "${CCACHE}clang ${HOST_CC_KERNEL_ARCH} \ +KERNEL_CC:toolchain-clang = "${CCACHE}clang ${TARGET_CC_KERNEL_ARCH} \ ${DEBUG_PREFIX_MAP} \ -ffile-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} \ -ffile-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH} \ " -KERNEL_LD:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', 'ld.lld', '${HOST_PREFIX}ld.bfd', d)} ${HOST_LD_KERNEL_ARCH}" -KERNEL_AR:toolchain-clang = "llvm-ar ${HOST_AR_KERNEL_ARCH}" -KERNEL_OBJCOPY:toolchain-clang = "llvm-objcopy ${HOST_OBJCOPY_KERNEL_ARCH}" +KERNEL_LD:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', 'ld.lld', '${HOST_PREFIX}ld.bfd', d)} ${TARGET_LD_KERNEL_ARCH}" +KERNEL_AR:toolchain-clang = "llvm-ar ${TARGET_AR_KERNEL_ARCH}" +KERNEL_OBJCOPY:toolchain-clang = "llvm-objcopy ${TARGET_OBJCOPY_KERNEL_ARCH}" KERNEL_STRIP:toolchain-clang = "llvm-strip" KERNEL_TOOLCHAIN ?= "gcc" TOOLCHAIN = "${KERNEL_TOOLCHAIN}" From patchwork Sun Aug 2 10:28:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94197 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 6F393C55184 for ; Sun, 2 Aug 2026 10:29:07 +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.21180.1785666545211013341 for ; Sun, 02 Aug 2026 03:29:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=FWNCSzYE; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.42, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4980dc26022so5706015e9.1 for ; Sun, 02 Aug 2026 03:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666543; x=1786271343; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=vqnrJlw+XNLZWtCYjz19Ps/HDwMSUWNsbciWs14/N8g=; b=FWNCSzYE63AsuyQOGYwG6TeQoST+IqrjDDXQx+sG9mvfpltWhsrc1gqk/Cot7yXaGj qVzaSo5YbyEaWPI2YubCiuF55ErdQsqfD2JU0iz+dpusRoB4Hoq2/457vb0JEW4tbNm8 OXM5j9VnG6+6Ucd9UwdLHjGnT/Zp2K7jqDFB8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666543; x=1786271343; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=vqnrJlw+XNLZWtCYjz19Ps/HDwMSUWNsbciWs14/N8g=; b=NxAYRLQQEHZJJF0dlreKnZwcfGcSVEfo3KlorFZmcV4EZcK1haCnuaZuh+KZqAmrqk hSPFICUVz53FOnxGd2Uz0SxHfXZVtmJmNH8x8gWqukfFdVvQjcoNc1MC3CoETpAgTGTr AaIMGFwNGGSP3fwy1lrBXln3iNr+TFF7Nj6Vz7srbq1094BVUBdHtqQBg3opyuk3d4lN 8FI1GeZ0g0tub1/ypXo+rEnVDPvzs5JTfs3ri9pbSJlQQq/XggQdQpnCZ9ZhyrZpZyTP zzqv1pbHc1mRFRYP0sFcFRIDjK4Ox9g/O9v2LFmZK4thBLF2ScNnwbtirSmBp9onQ7JL Cz0A== X-Gm-Message-State: AOJu0Yw6U8D+pyACQ6bKx+MuWq8V1UKZ9J6ODDd3dfaMfeseND1mY3nn Ug/6yy2UeJ9xkFIsEunOrd2hdVNwQJVi8aKiQz1cyi1Pg4X6wWPZwGqzT8bAJNebODbScaaSm59 M5B7B3q8= X-Gm-Gg: AR+sD13w+Y1MjK89oDg+NoUDJr0cuZhSo17+02jpzfE1D3zSo5Cg9ZD72W7+Zk/cGaI 5f3mJvsdhpxb2TnDBepfHHVv3SG4QfbsCVcAwSo7Mlhe1ISyHxa1w4Vq+ZmNgAWXCJaRZC5rUcA pOmrk+4ZW/RAp4ccUpJ9pk/C68wl+VWlnmnznfzEPmEDHVQDdirSvVfrpzEU4I5+IRNa4RlCekV n8eiVLuAwC73/cXnKGhE6B/7SiTleyyY7Z7ugdPlX/eiYu80g6nJP5Wp4bDfZSwTr4N9wH95akw hItsyCoLg1IMk+pxrPbJuiS3+Nv350zVhn+64naZIc/DnojyUWLsbFkvyzB16KC37JcrF4fG0dZ m1t4Q9vZOHED3nDhPxmZ0ZJRDfPbZmL+QaYCMdGPSWT6vSLDmyq7iNmTJgH8vz7QneimOvOfBSW HZ0bReVGKY9KbOqz3azBBl3kBWau55QmQ/CIqwR3JJHqDJo13iuHDUb9O5ALqKb9nTNHXwmQ/sB Fs30YtE6H3p4HoLpw== X-Received: by 2002:a05:600c:4e86:b0:493:e460:1f6 with SMTP id 5b1f17b1804b1-4980c5ec7a1mr104889265e9.0.1785666543510; Sun, 02 Aug 2026 03:29:03 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:02 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 07/25] kernel-arch: Don't export UBOOT_ARCH Date: Sun, 2 Aug 2026 11:28:36 +0100 Message-ID: <20260802102854.3952760-8-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:07 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242532 I think only our code uses this variable. For that we don't need to export to the environment, so stop doing it. Signed-off-by: Richard Purdie --- meta/classes-recipe/kernel-arch.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass index fd6bce11460..bc90e2e840b 100644 --- a/meta/classes-recipe/kernel-arch.bbclass +++ b/meta/classes-recipe/kernel-arch.bbclass @@ -8,7 +8,7 @@ # modules). return value must match one of the architecture directories # in the kernel source "arch" directory export ARCH = "${@oe.kernel.map_kernel_arch(d)}" -export UBOOT_ARCH = "${@oe.kernel.map_uboot_arch(d)}" +UBOOT_ARCH = "${@oe.kernel.map_uboot_arch(d)}" # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture # specific options necessary for building the kernel and modules. From patchwork Sun Aug 2 10:28:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94198 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 AFFCBC55189 for ; Sun, 2 Aug 2026 10:29:07 +0000 (UTC) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21181.1785666546724390410 for ; Sun, 02 Aug 2026 03:29:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=aynpD/PZ; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.54, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-47f71156e1aso1233587f8f.3 for ; Sun, 02 Aug 2026 03:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666545; x=1786271345; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=+AXtq9qbrXHA6SU3ELObusD7sVbpL57MgE2B0H/ni/M=; b=aynpD/PZKl6EMJM1vk0H4BOlt0pT2BTZ1/LuNHjBQFy4cPRhj0ncsZ0zvGWCRgUbKt 7RC1I5ZIGxzFPR0Q/67IAmTWNEcHlkE8dXemigextAgAYz3U3N8XuxLOSbrh27C5xbBx 5G1+jKOBQyw1lyS6luEt4eMcey7Z9TlFoBebM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666545; x=1786271345; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=+AXtq9qbrXHA6SU3ELObusD7sVbpL57MgE2B0H/ni/M=; b=ABxYsbpedO8DQmVldtn8PrPjIzPmv+7mTr6npYa37RMDPkj++gUrldxrWS5L4kmvCg 90+DYMJ79M9I5VZqFsmCitRxcWZ7BMQIHw8Ufgsgmh4SOZJNJm3NzCP3ca9FnTj7J+Ag 6DwAyJyy/zHbQEDozJ2BACpEONbIAigW1z7ldTTBSUAUR2U8V/zv/rmQl77mUKLiAq65 pfrzDPDDtFcyMhFf63QRrS1vuMw+LkMt2bDphkiKuSOfoBFcJYV42xQRt7+J+IIkqazQ 2w+L0H3N4F50UxAGSQXxnSe8z+S+uIzLo5BZIPLl9pQoMpKlpPP2YSCciM4qFIMGyT3k D9vA== X-Gm-Message-State: AOJu0YwzwAE6VEVYEsLHnAGgbc/EH0lePDfNk859hVHblRwEEZEU1fyG uAzA5L64/O0qkRCWjHGJ8gO6KJtPHIfgi2lE3j0shN3aiHm4QXbsIYf2mmCaS6SwKipIIULa5AD bWZxvgsg= X-Gm-Gg: AR+sD13HjmowI5fr35giu6ttX26pevDy7a1Y+YcEUjYsbwI0XcBogew5xUA8BTv+JWY 5TWYq+1iHxkijAxIeAnKzY5VazKbfeySUxsziS5fbCu1BIH6dT5GvfaVVv4j8zPpRNWE8cDw8K8 Th62G1irkLtiowCx+6sHULRR+cs7OP08KSS/21TfufphYHlwnO4YJZtwX9li+cQUhCh11QnxxR0 uE5yo9f+3N4kjHG02bTJsDsAfP/V3bFzzENkLDOH7eWf4WRMXcTb0ASkchofWnEBcWSJX98i3L3 POlCsloZeyH+9e6lfC6UR7S+rNj5+uIVGMmGB5cUTGj9OL3T0vIF2ne7n/3kw+1U1EJjScFRssD oSIFcfUbjVzn7ZMNCX3veb+E8A7OsN4l97s/WDyQpSYqH62iC85AZR9550Whm18QM6MVzmlHnaq XvgmLPX7mlorPU7BRwXcuaeP3WB+9JnCvoI/j/NK6dhceuGYD5Tip0PelVDIn5slbEA+brdirkq tBMldOOmFlKNXXGIw== X-Received: by 2002:a05:600c:3f0d:b0:495:4cb6:71cc with SMTP id 5b1f17b1804b1-4980c66b530mr126330925e9.5.1785666544840; Sun, 02 Aug 2026 03:29:04 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:03 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 08/25] u-boot: Separate out from kernel-arch.bbclass Date: Sun, 2 Aug 2026 11:28:37 +0100 Message-ID: <20260802102854.3952760-9-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:07 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242533 Move the UBOOT_ARCH usage into u-boot.inc and stop using kernel-arch.bbclass since there are things in there which u-boot might not want. This does mean the ARCH and UBOOT_ARCH variables are no longer in the environment but I hopefully covered the main uboot usages of the variables. Also document where these values are from and what they're supposed to mean explictly, including the difference between UBOOT_ARCH and UBOOT_ARCH_DIR. UBOOT_ARCH_DIR has issues which will need discussion with newer platforms which use dts/upstream. You might think we need to set ARCH in EXTRA_OEMAKE for u-boot but it turns out it was ignoring the value and setting it breaks builds. This patch therefore doesn't do that after confirmation from the u-boot devs: https://lists.u-boot-project.org/pipermail/u-boot/2026-July/627045.html This is confirmed by the UBOOT_DTB patch which added the kernel-arch inherit which is much later than when u-boot was established. Signed-off-by: Richard Purdie --- meta/lib/oe/kernel.py | 2 ++ meta/recipes-bsp/u-boot/u-boot.inc | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/meta/lib/oe/kernel.py b/meta/lib/oe/kernel.py index bab375c37ae..6c57ef402e8 100644 --- a/meta/lib/oe/kernel.py +++ b/meta/lib/oe/kernel.py @@ -38,6 +38,8 @@ def map_kernel_arch(d): return a bb.error("cannot map '%s' to a linux kernel architecture" % a) +# Return a value for the -A parameter to u-boot's mkimage +# This would be the value from the table in boot/image.c:uimage_arch def map_uboot_arch(d): a = map_kernel_arch(d) diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc index a75948dfc34..3e2f5aa1a5f 100644 --- a/meta/recipes-bsp/u-boot/u-boot.inc +++ b/meta/recipes-bsp/u-boot/u-boot.inc @@ -6,7 +6,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}" DEPENDS += "${@ 'u-boot-mkenvimage-native' if bb.utils.to_boolean(d.getVar('UBOOT_INITIAL_ENV_BINARY')) else ''}" -inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kernel-arch +inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native DEPENDS += "swig-native" @@ -34,6 +34,11 @@ UBOOT_INITIAL_ENV ?= "${PN}-initial-env" require u-boot-configure.inc +UBOOT_ARCH = "${@oe.kernel.map_uboot_arch(d)}" +# UBOOT_ARCH_DIR is the directory which contains the UBOOT_ARCH, i.e. the options are +# the directories listed by "ls arch/" in the u-boot source. It is broken for platforms which +# use dts/upstream. +# arm contains arm and arm64. UBOOT_ARCH_DIR = "${@'arm' if d.getVar('UBOOT_ARCH').startswith('arm') else d.getVar('UBOOT_ARCH')}" do_compile () { unset LDFLAGS From patchwork Sun Aug 2 10:28:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94205 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 DBF31C55184 for ; Sun, 2 Aug 2026 10:29:17 +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.21335.1785666548403466246 for ; Sun, 02 Aug 2026 03:29:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=LYsuKEAo; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.44, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-498028b3d5eso13324785e9.1 for ; Sun, 02 Aug 2026 03:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666547; x=1786271347; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=HINYp+1rNa12pmO3GGzCpHIEZMSWq138RVqVTJsiq/A=; b=LYsuKEAov7NEmQhPpI2aF1VgT6zhICRlDqP1TkaGp4PGxOmhhVg2Ev5Cm+OYdw2H+g vUVsEPQXUyiQldUVD4ERLvtWVsqNqLNm9SfKv8ZCZJ+83DcSxEHx9ImTlt0cCyVlwT2m 0R+cG2cMTwz+0GQQjgdkk9gsW9LpW51h8ziRg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666547; x=1786271347; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=HINYp+1rNa12pmO3GGzCpHIEZMSWq138RVqVTJsiq/A=; b=cVGYA2ubfUKLsllAhR9KCxEFAnvrsbVrknXik0qXm1bhQthsL3hmuULnEksujzodsr irz3EzaRp9460fUn324qLwsw4ATS23SjFeKnvtrqinmlk2XnwEbE8SwyUsRW/uzWnjqS ESq6FqrV199Ydq3bFkeowOE97UpUgYtod2oLzqlKCcg8Y3hs086QEgpup4LZ3Tke3Nar 8sCcbsVZbwRCtU+fviQF8UrpirueDVmDg70oipf2RWczmX5fMw1QV2EZTvM7zm1QnfCt 5N6X9gpuN0320FRW9w8qp8YLVNe+BsNsO5ftc7cROLdTm2RAZiwHcKqX/NDB8x/xpI6Y RHtg== X-Gm-Message-State: AOJu0YzOjjDfS1lu1ENPLvWb+xDqWNNlT/m8C0Ryig6kH20VlLxIfXPw tueQnT/tyxTvkYTt+36YpbgGK11Bxsd26Tn5zpTrdwVippe3LwwLqud5QWI6bdTF8SS7iLlsM7I RLumXdvk= X-Gm-Gg: AR+sD139FALn6YYbES8BhjblYaBj50Ung34XwOxLdzF/u2ysI7L3EL5eY2pwh6JtFNF hSumC7zXokprhYxr5Hr+o5khozD6gk/HALEflWuSceT5PhRTB4NoebwwQTmeIs43FPoM86an9Nn zTFv4/hy/EMX1a5pX2KmE1mAYEehtPHkgVSkcrCCbMjCABfdmJt+ON48/VXZBY5ZZ01ZcuywsOa itq4q6xzpccgxdJIxUHr1c/Sr+ht9kFWWlmnspHhuV4W4mjD/dtmxMxZsLXlHXhOxEwzTT91bbj Tvs4EweC8/shcplXbqY+GCkBKDbIvmg01MwblZAWbfM/+p1AMbRmw4ouOmCLIqEFdmfXf8VxV8O zTCIBBybIaUTxgldxzDRRcRjfX9KXJZAFsg+3YexGy+YdKySmpO8EOt+BxJXAH5b0oK947wiiAB ae4kh+LSMip6sm8XkuvwvxRXIKqqoj90cuQirc9oBonahzqOhbEWX5vvhAMVjruZrSwiNs/AwCh bTvYaXlha2xTCTuWg== X-Received: by 2002:a05:600c:4514:b0:496:bbce:f3 with SMTP id 5b1f17b1804b1-4980eb4e952mr121370035e9.6.1785666546685; Sun, 02 Aug 2026 03:29:06 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:05 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 09/25] barebox: Separate out from kernel-arch.bbclass Date: Sun, 2 Aug 2026 11:28:38 +0100 Message-ID: <20260802102854.3952760-10-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:17 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242534 Move the ARCH usage into barebox.bbclass and stop using kernel-arch.bbclass since there are things in there which barebox might not want. This does mean the variables ARCH and UBOOT_ARCH are no longer in the environment but I hopefully covered the main usages of the variables with alternatives. Signed-off-by: Richard Purdie --- meta/classes-recipe/barebox.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/barebox.bbclass b/meta/classes-recipe/barebox.bbclass index 2411fb5caa1..d8f56859484 100644 --- a/meta/classes-recipe/barebox.bbclass +++ b/meta/classes-recipe/barebox.bbclass @@ -4,7 +4,7 @@ # SPDX-License-Identifier: MIT # -inherit kernel-arch deploy cml1 pkgconfig +inherit deploy cml1 pkgconfig LICENSE ?= "GPL-2.0-only" @@ -49,7 +49,7 @@ BAREBOX_FIRMWARE_DIR[doc] = "Overwrite barebox' firmware blobs search directory BAREBOX_FIRMWARE_DIR ??= "${B}/firmware" EXTRA_OEMAKE = " \ - CROSS_COMPILE=${TARGET_PREFIX} -C ${S} O=${B} \ + ARCH=${@oe.kernel.map_kernel_arch(d)} CROSS_COMPILE=${TARGET_PREFIX} -C ${S} O=${B} \ BUILDSYSTEM_VERSION=${BAREBOX_BUILDSYSTEM_VERSION} \ CONFIG_EXTRA_FIRMWARE_DIR=${BAREBOX_FIRMWARE_DIR} \ PKG_CONFIG=pkg-config-native \ From patchwork Sun Aug 2 10:28:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94204 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 C27DEC55183 for ; Sun, 2 Aug 2026 10:29:17 +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.msgproc02-g2.21336.1785666550310865112 for ; Sun, 02 Aug 2026 03:29:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=GhjiqUdl; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.46, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4980fe6b3beso3651125e9.0 for ; Sun, 02 Aug 2026 03:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666548; x=1786271348; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=W5QsbDbC+XYTDpMBt/kEG0pLwqoau4rmJxBnA4cHvJs=; b=GhjiqUdlKS8FgSLctlAQNup4i6ESh2aeXzNv99QGEAhtRVNZK2tG06b3FE/CkFEX9s pDz1bN6m6oV1Haia17GbDSw+263tWnbXkoBJE+LHiXztoD6WU+Bd0Km9yvOmtm9W2GMF AXGHIgK1CRB2J+wVT5ML8gPqTa6QIMFuAGlUg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666548; x=1786271348; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=W5QsbDbC+XYTDpMBt/kEG0pLwqoau4rmJxBnA4cHvJs=; b=hQZN09H7qBd44CWHpuBWbqLhlECm65YaSf5A/AFzLldZvJv3IDYrvP84U3gBLfoQYs p7XzOea7rSrrsSNvAGRhuBdBg4CC+jztXTP+Jch02cqqYWFsjT899iLzq9CjrELRGDMr /babio5S7NxwO4iwKcQc71pJCyoSALvqx3ADgFrqn9Ceu5CDprQrt7wUHSh6S1nermmQ vVujatRp3klZYfew1IYPxwpp18hSiVWB+vSihmPgGqKGUKLKptiNycCVbLom/9mYgGrz URXI1RcER/qhcpOQ3rAu3sCyp8b2kCZ43q1FyBPCviLA1TRuMtjgpnh6cjK9ZGQ34gFJ 067w== X-Gm-Message-State: AOJu0YyN7JuthuB3oVcTGIsZKuVywQq/YGD+6h1ARWf2RgJxR3jthGzn 9RX8bTlD3UsAheDG6oHfwL/W8bUUpfwBAq++iBuRCmVNo9dukE5Lvu8DmIIwXVLoc9dwD8YxGWH w6jYBfH0= X-Gm-Gg: AR+sD10Mfh6TaLIKgt4lGXFOt1LMmBSR/rc2vShtYgY1j1g+1XukWY9BLqtxTqNd/Fr 1ECUUwj48ppFwbfklEnFmBjflsNPlsMmspSYtP96V1XERTAEDrTJupV9CZK3FxPSBnaRA0sE+Fj IrLZa0z9AQA75E68F4w2f5zGW4WfZogjZyFHvsdp5caTDrrQbZVR7HWNLQymvTECdo9PrfoZoBM kU+aqOYQWSUSr5hqhgaq57EonSHYQR7Mx0ppcFxf2+Hn3kIPgsHm8suHXcDdR0OC53kKkDTTvva P/h9lLoivRguYzBqDW0fGBJjEZhMVnk35Zt5LrW4i3KzwbLGynWu2wYuqb1ATSmllD8vC5Y0XW/ Ch89ngp/Us55WhqciafL7CITcX3CIqgguWgRlykZ0Ik4uStWycf3t/UnThbn5azMboU7NtlYdMI bOCRI+OnxhLY9bQd1BEBK72PyLes86cmq4WhELxta+37EVCuD+2d50i7n+X5dUmEXhbZNCg5xGU YPCkXonvBqRM3KJzA== X-Received: by 2002:a05:600c:5249:b0:495:3a52:71b1 with SMTP id 5b1f17b1804b1-4980eb9b2eemr79211385e9.5.1785666548576; Sun, 02 Aug 2026 03:29:08 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:06 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 10/25] lib/oe/kernel: Simplify map_uboot_arch Date: Sun, 2 Aug 2026 11:28:39 +0100 Message-ID: <20260802102854.3952760-11-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:17 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242535 The main kernel map function would already handle x86 correctly. Modern u-boot already handles both forms of powerpc and ppc correctly to so we don't need this legacy function mapping for it. Signed-off-by: Richard Purdie --- meta/lib/oe/kernel.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/meta/lib/oe/kernel.py b/meta/lib/oe/kernel.py index 6c57ef402e8..ff88c41b218 100644 --- a/meta/lib/oe/kernel.py +++ b/meta/lib/oe/kernel.py @@ -41,11 +41,7 @@ def map_kernel_arch(d): # Return a value for the -A parameter to u-boot's mkimage # This would be the value from the table in boot/image.c:uimage_arch def map_uboot_arch(d): - a = map_kernel_arch(d) - - if re.match('p(pc|owerpc)(|64)', a): return 'ppc' - elif re.match('i.86$', a): return 'x86' - return a + return map_kernel_arch(d) # parse kernel ABI version out of def get_version_headers(p): From patchwork Sun Aug 2 10:28:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94202 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 B5228C55180 for ; Sun, 2 Aug 2026 10:29:17 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.21338.1785666551698748242 for ; Sun, 02 Aug 2026 03:29:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=C08pA1w2; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.43, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4954afac04bso13805125e9.0 for ; Sun, 02 Aug 2026 03:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666550; x=1786271350; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=clyP23jhGEVuIxpzI20mP/bMfP5/D/zpdkPdJHUHOAE=; b=C08pA1w2YnbMSiyak97ghAILuTiC8lnPw4NNNKjuKwnHylxb8B3WDBxVrUeHSFzs67 a4NqFHbZ2qo8sWWJNcpravEVvGhz4+0GnoPX8szcXzBtu3dys41BgBmDaPnEjXON9gOD eOTaQ4kR50USNVVrfAbJTX/EUfUWxoGeL+oNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666550; x=1786271350; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=clyP23jhGEVuIxpzI20mP/bMfP5/D/zpdkPdJHUHOAE=; b=piPM5yDGEKUxdUxoyF1rZPJPXozSHoxFtgOgXbN5Wlx/mVGPo5kN3hZ9uCI8Gl3lqK tumf3rGhIgj5i9YtO09J9CcaxknpX6a6c9/e7qARP8c53YB+2XVaYdoCxlj6MFauD0Zf IlEbIMFa/BVF9ICRsLb9GNVwj18hITDNKNX2KJhYjP7mTtyiano/DI/AqcdcPQhLOZjt KFyZC4vdXF3KqNfmCPD+AbDNeZcfTOjWtiKqM1ot+WKCMg4XwBIs41zbOcBufP2oVgwa 9YJx2b25+nEMCdE+rKxg/etLSZsdE5OPhVf+H1KxSFfj37O/wPnEqdrsIdJ/Fp19CIZf uKbg== X-Gm-Message-State: AOJu0YwxsOUzJ6k7bDIUohUhG9mnuw6OQ01a0Us1AHbaKZA2819I8Ndc WJyM35i672qDzeyLYsiBiIyHriywdaF43ZAVu6X/MnfVZIgoVEh+KyZVTWUnkkYuX57lYjAFg04 7s4F5QK8= X-Gm-Gg: AR+sD13EzMTKrTQuKAreH37ILcS9c6Bi5XHQzYYsUvCXYDjST1CUCTW1sT387Hjj/iM 6i1MyNDrjuIeFIUFWLwVsEqfloiTV7qloM3zSqjIBHWnlc20Z2I/EVVh5tQhAexAF1NRHhIJFM9 0IKyWhMpWFzUF/S8koL4oz6dDfLXFlbIkYXaPX4Z1yrxn2Ee3dJQg+3nwo6WFy8R0HGp31qQOaY 5zhuuUaVOuSDu8n7crOwSw8xFIw0XTQgAZovkrTqgtBnZtPWhPQ8ab1MIjQRJvfuMzMEL/lePVe GjbaaKnFE4LbCvz9ZELCxdsD4+I/8Y9M/UeFVF1uPAs8BxQgeCyRGmpwz5yn4a30MZ7uL20/kQy v0qKKPFuTn4ypd+nxz+WPzFhxWY4uYZ582Uw1STAsDRuTpEM5tKgaNWmgYiXu5ZZHZitPdX0p3V j4SCrpbRtlbeao1VhBS/0aK+RPyXaJxs/vOjfquQqf+ymdVZlFcVm0urDLrEWquyM5Gm2IHT4Rw +lzSloTP3cjYv1heg== X-Received: by 2002:a05:600c:840f:b0:493:c42e:5be0 with SMTP id 5b1f17b1804b1-4980c60705amr111485785e9.0.1785666549950; Sun, 02 Aug 2026 03:29:09 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:08 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 11/25] image_types/kernel-uimage: Swap UBOOT_ARCH for oe.kernel.map_uboot_arch call Date: Sun, 2 Aug 2026 11:28:40 +0100 Message-ID: <20260802102854.3952760-12-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:17 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242536 We can just call the function directly, no need to use the inherit and variable. Signed-off-by: Richard Purdie --- meta/classes-recipe/image_types.bbclass | 4 ++-- meta/classes-recipe/kernel-uimage.bbclass | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/classes-recipe/image_types.bbclass b/meta/classes-recipe/image_types.bbclass index 326602d960b..ca137292257 100644 --- a/meta/classes-recipe/image_types.bbclass +++ b/meta/classes-recipe/image_types.bbclass @@ -270,7 +270,7 @@ IMAGE_CMD:f2fs () { EXTRA_IMAGECMD = "" -inherit siteinfo kernel-arch image-artifact-names +inherit siteinfo image-artifact-names JFFS2_ENDIANNESS ?= "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-l', '-b', d)}" JFFS2_ERASEBLOCK ?= "0x40000" @@ -355,7 +355,7 @@ CONVERSION_CMD:sha256sum = "sha256sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${ty CONVERSION_CMD:sha384sum = "sha384sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha384sum" CONVERSION_CMD:sha512sum = "sha512sum ${IMAGE_NAME}.${type} > ${IMAGE_NAME}.${type}.sha512sum" CONVERSION_CMD:bmap = "bmaptool create ${IMAGE_NAME}.${type} -o ${IMAGE_NAME}.${type}.bmap" -CONVERSION_CMD:u-boot = "mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C none -n ${IMAGE_NAME} -d ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.u-boot" +CONVERSION_CMD:u-boot = "mkimage -A ${@oe.kernel.map_uboot_arch(d)} -O linux -T ramdisk -C none -n ${IMAGE_NAME} -d ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.u-boot" CONVERSION_CMD:vmdk = "qemu-img convert -O vmdk ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vmdk" CONVERSION_CMD:vhdx = "qemu-img convert -O vhdx -o subformat=dynamic ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vhdx" CONVERSION_CMD:vhd = "qemu-img convert -O vpc -o subformat=fixed ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.vhd" diff --git a/meta/classes-recipe/kernel-uimage.bbclass b/meta/classes-recipe/kernel-uimage.bbclass index e353232a0e9..cda1b1a1a5d 100644 --- a/meta/classes-recipe/kernel-uimage.bbclass +++ b/meta/classes-recipe/kernel-uimage.bbclass @@ -37,6 +37,6 @@ do_uboot_mkimage() { awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'` fi - uboot-mkimage -A ${UBOOT_ARCH} -O linux -T ${UBOOT_MKIMAGE_KERNEL_TYPE} -C "$linux_comp" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage + uboot-mkimage -A ${@oe.kernel.map_uboot_arch(d)} -O linux -T ${UBOOT_MKIMAGE_KERNEL_TYPE} -C "$linux_comp" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage rm -f linux.bin } From patchwork Sun Aug 2 10:28:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94203 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 A42C6C55174 for ; Sun, 2 Aug 2026 10:29:17 +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.msgproc02-g2.21341.1785666553662793956 for ; Sun, 02 Aug 2026 03:29:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=HX0Zlg87; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.46, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4954a9e8490so10320625e9.1 for ; Sun, 02 Aug 2026 03:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666552; x=1786271352; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=pP1BxnE+RW+MLZbFW7bJq/AT5vxkhzgwGh6P+CjiMRw=; b=HX0Zlg87ZiepED9sSotlgo5B0t/R1FzSN2EEt/zmYdjKij1SlsGWHkEWRuCmaB4Oxr gcg6T8RoplP2kvl2M9BLpXgiKPtU+HR1/UgJH0oi/J31Y0rBbuWvg5WO9wzYEFdmxIls XvegX0RMElZLULsElxR8HWklLiWsPlHGhLL/Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666552; x=1786271352; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=pP1BxnE+RW+MLZbFW7bJq/AT5vxkhzgwGh6P+CjiMRw=; b=ojOKhT1rSLwiSoh1pw9/kPRehcWoR3FLJsTQJREy4Jx98j62iD4A5z2ejZVMUMAdxF IvelqxDDm5s0GSdYfYrVf0PibaBXhHUyKbMb3QXGwTwUXHrGnIvtEVEqJfcAheTWbpB0 u7L5G3KDHe6rluE4gbGGOCFYLwKEiwHx3iRqcdxl5JZQgam7sdsrJGid/nwA9VAMhOad uvyEjf3HxYFznRcdT30ATqvRVp5o96Wnk3eYU+OTaHjH7/4CAEZJLbpCyT5CmHLHyBC8 /epvA8CZzTibxLmS+hp5a2zKi+r+Xe6J6g3dolAWzWDCazzVZrYjbA19ywgEez3ktKmE OaGw== X-Gm-Message-State: AOJu0Yx43mK9ers8MYb30fMZHNUwcY2XYtH5tFkYW8GXg5uds0StPZQY N3n7ZPonER4QLBX3skamUyB6oYSQVRwjnjUN0CVaYZQriAddW/jk7gnc9iada3pGEDsOuoUVlMo EuiaDXgg= X-Gm-Gg: AR+sD10EHMTftUGFbGdMD7NomV/vPdYvITAgFyTxsOF6PRCM/Iwkxy3Ii/M9uHXsnRV zn58DXFwzSnePG0zdSCZ0uwDSuBn9kwyxNNvuHt9L84mq+lE+1km3ElYY1ka/K3bnLSOAaeuhXy moRrnzsurYxre3Ia+TNhz05zb/p1Bv4QZEoymK0V6I449zPdvPxBExugghuF5kKTVg3QB1tt1sp OIKhH3XzTbmj5rRqoHwDbsC6RDhaEApp2DNPbF5kjEyDql3Y8VZcH5jCNShNLbub888dBn+0Heq 8u5MKBFX6XdLj8pThYOIy+pm7H1Jz8pAOAFLmqp+Y2i6zqWZKI03WSN5WJkSV3nCORqrt8PtpNr zzzlE0stgEpTA2y95B4X6QIoYASGUkjZ0ltjnbPn8vfo/Vup3Ss8VEuKYEt7L1m9z6CQvPW887i qliYxhQXweDnQUUB3/sfJFuN1hQApRjM+RH/k4kGo6AfwvgNx40a3mFYW0B4DjQrJST4MjoGRA6 pomTYbzssWo78cqcA== X-Received: by 2002:a05:600c:3150:b0:495:3c6f:7c18 with SMTP id 5b1f17b1804b1-4980eb8c4c9mr88315255e9.3.1785666551916; Sun, 02 Aug 2026 03:29:11 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:10 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 12/25] kernel-fit-image: Swap UBOOT_ARCH for oe.kernel.map_uboot_arch call Date: Sun, 2 Aug 2026 11:28:41 +0100 Message-ID: <20260802102854.3952760-13-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:17 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242537 We can just call the function directly, no need to use the inherit and variable. Signed-off-by: Richard Purdie --- meta/classes-recipe/kernel-fit-image.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/kernel-fit-image.bbclass b/meta/classes-recipe/kernel-fit-image.bbclass index 3ace09ef5c9..7b2bcd46737 100644 --- a/meta/classes-recipe/kernel-fit-image.bbclass +++ b/meta/classes-recipe/kernel-fit-image.bbclass @@ -1,5 +1,5 @@ -inherit kernel-arch kernel-artifact-names uboot-config deploy +inherit kernel-artifact-names uboot-config deploy require conf/image-fitimage.conf S = "${UNPACKDIR}" @@ -76,7 +76,7 @@ python do_compile() { # Collect all the its nodes before the its file is generated and mkimage gets executed root_node = oe.fitimage.ItsNodeRootKernel( d.getVar("FIT_DESC"), d.getVar("FIT_ADDRESS_CELLS"), - d.getVar('HOST_PREFIX'), d.getVar('UBOOT_ARCH'), d.getVar('FIT_OS'), + d.getVar('HOST_PREFIX'), oe.kernel.map_uboot_arch(d), d.getVar('FIT_OS'), d.getVar("FIT_CONF_PREFIX"), oe.types.boolean(d.getVar('FIT_KERNEL_SIGN_ENABLE')), d.getVar("FIT_KERNEL_SIGN_KEYDIR"), d.getVar("UBOOT_MKIMAGE"), d.getVar("UBOOT_MKIMAGE_DTCOPTS"), From patchwork Sun Aug 2 10:28:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94201 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 94981C55175 for ; Sun, 2 Aug 2026 10:29:17 +0000 (UTC) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21185.1785666554762451024 for ; Sun, 02 Aug 2026 03:29:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Gy4LbvfQ; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.53, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4956869750eso6661705e9.2 for ; Sun, 02 Aug 2026 03:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666553; x=1786271353; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=esB94ZwwO3JHyChsFu6AvzKu1aM33cmO1iPXXDujpXQ=; b=Gy4LbvfQuKq5EjKJ3BC0FfO9MCZb8UpE/6yFYY+dSW7OhGOlUVD9ScT9avIBO5A9Qs GvJNGHHyFFQwV1mIyjePfbhwl7ENNLWJSOHcftK6ha0QcJdOcr+rAm85grjynw5/FAUY zMZgV9T9LGhwvH7kKda3uLj6q/hinhPVsMe98= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666553; x=1786271353; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=esB94ZwwO3JHyChsFu6AvzKu1aM33cmO1iPXXDujpXQ=; b=FZFiRHRt2mJv44wf2Ys75nMKqNR6H+wDGz4GYF7L9dKO4dFnB//PdM5ymj0xmJ6FEO IlzCs+mhfHz37TkVPBC+0WGW73NtDlFr4Rm6UN3qjKrM7TZbKcLK5AJswO3x5y3+7pJs UuDewCNWL6ljJd5jN7Q1woDlNFTRWmfXGXOQPFXkvgOOp5paQCeUFTal+QG+aW3oiMVk 01xv4002NDvVU/5xQEZEYD1SWnonnfOCBuf7i5A7KIDt8UHuFiOefbJmyiKDQqWqdlBx dIONkWmhr0v9Kmf5ZM0IN1B+XG0BF4apKjP9xXUwlmuFFI2jw2S8de0yw5D0I7C6WJ24 6kBA== X-Gm-Message-State: AOJu0YwMyR0hzAaiVReZ2hMMVCK6CGkMPqYtrD8noZmaMgelQfQ4unOq oqnyQJmjXmEYbpIMWyHAFoHw3F5nR4/Rs+LSYxi7Go6/FTOah8A8cvSadq8KWD8W1RzcM97HHv4 9Se8e9As= X-Gm-Gg: AR+sD12J19g8D5Pn63ERrhym8OddFciwP5cmssLFAHGVw48LX6Cuya9bvqT0PKaPCpE MN9vIs81FjejBcxCslXSFUT2qdCJfaUsW3vtYd8+3Re5/DO/LzYqkrKKCKN/j4SEe03g4WDNdr8 teWNu1Pbb0Y/JPpbOk/xIBjzrUvdc2eJ97mUUALOvt7Jig++oxgQEK7dAzC9YMrHMJciRkgjeB3 0DKPcrvhazRZR+Sm0BU1ar1h4+Rt1Mtu9B8nVd+kmAjEjBDQuTqhZnJ7A5n9eFJR0m2yjuQriKM 62MzAOoGSKJ/MGnbD9Ou946QEhUIltc4H8PW1DEdJEYlX7lgMHXxS+uLD7dw0Z9/BdLbTZDe/aM SGL3DdtDWTpxAnxYsLE2lAwWGgZm15GBZr96QPOtHVY7Tn/yo1MhXM+nJpSueZjs7nla1qApYRZ TvWZisC6U4piDnGhtwSumQ9npK42yW9XAwv2/Egcgq/HkvXZ+soDZHHQJDspACDrRgLjRtsvb30 fin0oQrsytorjRLnA== X-Received: by 2002:a05:600c:628d:b0:495:3f68:699b with SMTP id 5b1f17b1804b1-4980c64b868mr128670325e9.9.1785666553055; Sun, 02 Aug 2026 03:29:13 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:12 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 13/25] linux-yocto-fitimage: Set UBOOT_ARCH Date: Sun, 2 Aug 2026 11:28:42 +0100 Message-ID: <20260802102854.3952760-14-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:17 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242538 The tests that use this recipe need access to the UBOOT_ARCH variable from the recipe for testing purposes. Signed-off-by: Richard Purdie --- meta/recipes-kernel/linux/linux-yocto-fitimage.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/recipes-kernel/linux/linux-yocto-fitimage.bb b/meta/recipes-kernel/linux/linux-yocto-fitimage.bb index 75dbcb2af5c..1f95b9064e4 100644 --- a/meta/recipes-kernel/linux/linux-yocto-fitimage.bb +++ b/meta/recipes-kernel/linux/linux-yocto-fitimage.bb @@ -8,6 +8,8 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-with-L inherit linux-kernel-base kernel-fit-image +UBOOT_ARCH = "${@oe.kernel.map_uboot_arch(d)}" + # Set the version of this recipe to the version of the included kernel # (without taking the long way around via PV) PKGV = "${@oe.kernel.get_version_file("${STAGING_KERNEL_BUILDDIR}")}" From patchwork Sun Aug 2 10:28:43 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94199 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 88B9FC55171 for ; Sun, 2 Aug 2026 10:29:17 +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.msgproc01-g2.21186.1785666555660452555 for ; Sun, 02 Aug 2026 03:29:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=d11isjZ/; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.50, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-495757ccbc1so10840645e9.2 for ; Sun, 02 Aug 2026 03:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666554; x=1786271354; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=SHxMP1IylgVK87GfnxRqqY2fqlHeYJRHio0Tb+Egzis=; b=d11isjZ/JHt9CIUGCKXcnN28pga7sCwDqRj9Q7Tfiuh3lgB6tASCksakJllKfkPFGt +BMZ/mzn/2LT/iezXJ2GzwxVUr3FVYmvNX1+eNPJoGXidwpVFk1u8kvnjjfBShEV723/ f8D1gfivDeciwT7KX9Qi7tlwMfkBvb94jIAQM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666554; x=1786271354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=SHxMP1IylgVK87GfnxRqqY2fqlHeYJRHio0Tb+Egzis=; b=FQjfOgWC4E9Y+myRuYNXbgKQ7ZnraYr2Wet/c5w4OaaDX4I0KGyq6VtTQLlS7f50rv Y26ktiaL6C4jp5b+58LTIOYzrVvigoe2/8gPF06bnUh3Yml/TZASlQLRKbiUAv8oOCCl lg7ZOiy4LTK4wsLo2tPJHUU0u6uFJvkpHrBXjTK+Fk6bPAURd/zMC2ANPfjAoRQNbBbX kZwAwiNE4zKMwWGyChjSl2MjJG5HHson4KQycCciVczPKLpnzqMn7/TK/vZCLqcj0Lub pX+KzTfcv3m9Vs9idf0lHWkO59MZYMPUgP6jxMAZPFg0oMqQi2k3b7EdKEH9HiWlimgu q9bA== X-Gm-Message-State: AOJu0Yx2B/2Euz7dnWaGpZw3bcI1l/PIRBqat4yvaknjbFpwPwg9yeMw /LovmWguLF7YH0y8t4kGije/JFs7SUnZ+X+OpTI2xRlAObBLEsr5gAxK7WKNW9Qkyr6TGmHbGyG PKwI5gjw= X-Gm-Gg: AR+sD10No5evUNcKI/HTpGHmBq6EpkFUTtRu1oqiyxxNdlluTJ9Y0ZTY6aQIzH268jx FokKaHousAD95Cd2Te+kpLjIVSDgoqZh+Fvxx+uuP+ISeDPQfxeGZv9iGOlB1OziypwuZSIH6lC 59GPi3u5M/ZUrR/YZOwFcmZTP0Cwu9OG9NNv0eZ57C/xlycbaDQQqx2SshH8820ZfdppW+fwIwu ChhqyEPRahIsVHVeiW0at37bvc9IiJyWp657TwCjwshFaNdvZay8GqSGH665X4AJvhtsHUYk8vD REqL0MQ7em+iP6y0C5izXK9shnyTgZOOrbfXmMiIHDgjj6tEpExjTlZMLtiXw1OKajEuG+FhMhy m9vew6bPAdaucGSXdIKniijFyxbxTSjp3+TEFkPBEFK1I2t6Aup/2UsVPG3nAGo7vxE5LH8u1JC o9agShzAsAW1AOQjf4ecmIO9h3gqtBJwyluUjSTOtUfGCG5uO71UFg0v6PfOJ0BKXxTxunhpklU CwJfpkuOCkL8BwsWw== X-Received: by 2002:a05:600c:1553:b0:498:ee7:e40a with SMTP id 5b1f17b1804b1-4980ee7e62amr100343555e9.16.1785666553930; Sun, 02 Aug 2026 03:29:13 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:13 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 14/25] kernel-arch: Drop UBOOT_ARCH Date: Sun, 2 Aug 2026 11:28:43 +0100 Message-ID: <20260802102854.3952760-15-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:17 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242539 All OE-Core usages are now independent of kernel-arch. Signed-off-by: Richard Purdie --- meta/classes-recipe/kernel-arch.bbclass | 1 - 1 file changed, 1 deletion(-) diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass index bc90e2e840b..db708c35104 100644 --- a/meta/classes-recipe/kernel-arch.bbclass +++ b/meta/classes-recipe/kernel-arch.bbclass @@ -8,7 +8,6 @@ # modules). return value must match one of the architecture directories # in the kernel source "arch" directory export ARCH = "${@oe.kernel.map_kernel_arch(d)}" -UBOOT_ARCH = "${@oe.kernel.map_uboot_arch(d)}" # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture # specific options necessary for building the kernel and modules. From patchwork Sun Aug 2 10:28:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94200 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 75936C55162 for ; Sun, 2 Aug 2026 10:29:17 +0000 (UTC) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21187.1785666556760681093 for ; Sun, 02 Aug 2026 03:29:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Z5BCWJh0; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.48, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4955158f26aso7836665e9.3 for ; Sun, 02 Aug 2026 03:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666555; x=1786271355; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=QgZXB1fRUqPmXITCeZfJhaPeovk24c+NBPJrbuQ2Rx4=; b=Z5BCWJh0VO//kO3Ee57XKyhdZuDSPqZTIEJyt/ff5/IksHOc8xm4xtZxt0KpjbRtoo uefUFYElmEufw2Evnr5Rlo4f5WdgIIS48VIlX6PfGDU4ee9sJpLkKYatUHI0wdud9CQ0 wq5ZL2qpH1rEVlSwpPPc4dKW5a1IM6I9ms9QE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666555; x=1786271355; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=QgZXB1fRUqPmXITCeZfJhaPeovk24c+NBPJrbuQ2Rx4=; b=hMDhDBjrwiesecm9Zkwtd0yeEdd+mWfvASHmb6iBgeEkMnikDxWuLJ7xMw4bhhHipL l92VUucMnz2AGhF41oTtzON6WOJRg4UgBAXLIrbzhgi+9ncAQjHH7cPbLlbePt9DzR7M Yn9eIHDN8oTZIduJmrM5XR9P7W+omLRJ+ZuB9IMWvccaVsMWwAO3ioLh4NKMZ4CKB4G2 I7Yi7tjO1XQ01dL3mdAATUOVrU1VMWtl/MRsg7qahTBrwFFpkd5B7oSP+z4dprXvR1ti xnSKmbZYOoAU26RcTEAmu6sWxbn8hh6Y5zeiE7DtAokORcLUNjQB2UyjGifhgh8QK528 SgQw== X-Gm-Message-State: AOJu0YzOkmkdloG6e/zgzbPtDrmqSIa/IO+MEwPe4dMy47RKVnOhSelA mn+ZNuPz3ConAHkyjVXtz8nkDX5PrgLK+VPZqoJa+4dR81blXpFLgpOEW9feDf5sODjeFAlgczC Ev542WsI= X-Gm-Gg: AR+sD10zzmCLytb4B3ZipBcunFEYiLcHwll+j55jpW0a/yJev/TeDurQaWzoZZBZlKj fSFiPeGmLRgFZ09K7WW63mJ1NJHbWNL1sPAQLu7vSC4o2GMWYz80bmsuLx1hJwvTcNZS2/WDz/l A3EbVs6WohPUcfpRdmYnLBPI+EYH4o3CJO2IegG7BNBi/R52nx9ul+4DblFHZUs85WSoIV8Wqba Wfq/vXn+3aWX7rW7gb9WhlVSa78oJZ6QaZYDqd9JCGAAAnFHHyw4LZ6upKsJazdkjx4oHaci400 e/M3sfjE06XzpcY1sqvAx9ffjl6Kodd4iupU2iUDQdAaev+tL/4yVlQ593Xl8sFpyYgPsIqQyE2 sy5zsR0F+27VRgTZkYAeRTWB3oLUGKfswN0d80ep74K5cxEU2dDnWTfEcX4XjQ8UVDmWx7Uoxgm zA9A/a7s4F/pKmZa/27UB2qU6QNgQfimcqAI1z8WjhoNMWSUJZHLuCAo/lFbuC6nc9A9EXlSD+o p/3SOdlGqjiRXS7pQ== X-Received: by 2002:a05:600c:840f:b0:496:c379:b2a1 with SMTP id 5b1f17b1804b1-4980c66d7bbmr103918545e9.2.1785666554921; Sun, 02 Aug 2026 03:29:14 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:14 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 15/25] linux-libc-headers: Drop kernel-arch and set ARCH directly Date: Sun, 2 Aug 2026 11:28:44 +0100 Message-ID: <20260802102854.3952760-16-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:17 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242540 In the interests of teasing apart the kernel classes, set ARCH directly in the make commands and drop the then uneeded use of kernel-arch. Signed-off-by: Richard Purdie --- meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc index 1f5c47f4533..c93966e3709 100644 --- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc +++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc @@ -53,7 +53,7 @@ python __anonymous () { MAJ_VER = "${@oe.utils.trim_version("${PV}", 2).split('.')[0]}" MIN_VER = "${@oe.utils.trim_version("${PV}", 2).split('.')[1]}" -inherit kernel-arch pkgconfig multilib_header +inherit pkgconfig multilib_header KORG_ARCHIVE_COMPRESSION ?= "xz" @@ -62,7 +62,7 @@ UPSTREAM_CHECK_URI = "https://www.kernel.org/" S = "${UNPACKDIR}/linux-${PV}" -EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCPP="${BUILD_CPP}"" +EXTRA_OEMAKE = " ARCH="${@oe.kernel.map_kernel_arch(d)}" HOSTCC="${BUILD_CC}" HOSTCPP="${BUILD_CPP}"" do_configure[noexec] = "1" From patchwork Sun Aug 2 10:28:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94211 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 32D7FC55184 for ; Sun, 2 Aug 2026 10:29:28 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.21342.1785666558847824549 for ; Sun, 02 Aug 2026 03:29:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=grjvFWt/; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.43, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4955aa106b1so10772625e9.0 for ; Sun, 02 Aug 2026 03:29:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666557; x=1786271357; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=yTeNB4QesozJkXvrDsutqqLC6lSqlj8S7RMFHn67bik=; b=grjvFWt/hHRzj63ku32b6JEXjyVTO7+BrX/b/di3iZyInJmefXBIdfFCSdi4tp1z0s x9B4SUenHPqE/Zh2UkxM+U++rTEqmmDipl3gu7QJTvo+RtutJjJTy2OLegEsDyrGEVXS IWU/uGk0JKDAfXi5O6iP+63bD8b/EKPlSmr8k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666557; x=1786271357; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=yTeNB4QesozJkXvrDsutqqLC6lSqlj8S7RMFHn67bik=; b=NaTuL7KJp0APG96Vtfh3F8PJ11YY2RpFe9ocuLkdwhh9s7hAcJFl9j1aqEyaDL3v8b eB4n2KTN1rP4IJyGk2++m69MZcp+HjQJTMNseUN8mqEQu9ZNX0lwEa/KfbucLc7h62mA kP3N+xbg2+5SKS2iWHRFQAIHCPrqLYhDQvnWLX0K/W02mgWpnUGt8DL4ro93LLUohqIQ MLyQUOmoEfyWgYDr4be7rOl6q8m0CueYCz6S53okZjkgghOidYNuvBwz8u13lC6wzQ5N 7F7K53WHrQXTrX3ULLFDlw/JAnMj6WkfWewHLhbI3tNtIGowFtr03+pF91HYlIEjQnYW WUiw== X-Gm-Message-State: AOJu0Yy3rsUWLaE9sQThCJ0Vhro38/lCe+8yHfuZto2b/35wcNTRsISd a7qNOMN08M82l+Z9wKL8LyS1zUB56H9Zvdzu7kIyVlpz9EANgjb9xDx6iDiRG1tOYUO/zC6DNPQ wlisH73A= X-Gm-Gg: AR+sD132kqoQxoPpQ00Tx7j1eEIaBjNgjNH1nIOXRM0f8UXnT24FHMXzA2AGOLsN96n flSbqe47oFRwid8gSvkFy83ZAuDCwS1WwMkpZ9KmWJxfcGXAQh1shrnwJxC6uvYPhxDg3iBwZDo fjCWG829/3BoBnYFnGwB0NXwR4PbHCkdx47ErtB0bkut/0JYdyWcExcR0Ju64Foys3hvBEi1RCw 8Een2XgTQcefslUOO9sDYFzpTYcf4pvLn0wOctGPSIhgEziO8qFULpkq2tbfuEhFpC4t3hIuGON 9EjjD9+rzDc3oFxM4PLTryd2dwBjYA/TZK37WU6xwbFK3wl+awxeXgdBS6t3pxBfHXOlyPmVqt6 A17hyhMMbGybas/3SwyVKlGbhUJ9W+OYtQsKya082E3bUrjfMfOr/gXMaCR/obqrILj0/3aBa3C 6hmWcU1VMHCN7fKt+74iOnTnOpk5fSJ6dqei8wSuYHni5d9vpjE7y6wDfpQXo30aANjzbEJzhVE hafsCwSVL4T5mBXDw== X-Received: by 2002:a05:600c:4e52:b0:495:3f84:a792 with SMTP id 5b1f17b1804b1-4980c674dcamr147297345e9.12.1785666556923; Sun, 02 Aug 2026 03:29:16 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:15 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 16/25] toolchain-scripts: Drop usage of kernel-arch Date: Sun, 2 Aug 2026 11:28:45 +0100 Message-ID: <20260802102854.3952760-17-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242541 We can just access the function directly instead. Signed-off-by: Richard Purdie --- meta/classes-recipe/toolchain-scripts.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass index 8c062ef0e74..d94dcdee39b 100644 --- a/meta/classes-recipe/toolchain-scripts.bbclass +++ b/meta/classes-recipe/toolchain-scripts.bbclass @@ -4,7 +4,7 @@ # SPDX-License-Identifier: MIT # -inherit toolchain-scripts-base siteinfo kernel-arch meson-routines +inherit toolchain-scripts-base siteinfo meson-routines # We want to be able to change the value of MULTIMACH_TARGET_SYS, because it # doesn't always match our expectations... but we default to the stock value @@ -155,7 +155,7 @@ toolchain_shared_env_script () { echo 'export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"' >> $script echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script - echo 'export ARCH=${ARCH}' >> $script + echo 'export ARCH=${@oe.kernel.map_kernel_arch(d)}' >> $script echo 'export CROSS_COMPILE=${TARGET_PREFIX}' >> $script echo 'export OECORE_TUNE_CCARGS="${TUNE_CCARGS}"' >> $script From patchwork Sun Aug 2 10:28:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94212 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 2468BC55181 for ; Sun, 2 Aug 2026 10:29:28 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21188.1785666559867945833 for ; Sun, 02 Aug 2026 03:29:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=DX0JCkFH; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.51, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-498028b3d5eso13325455e9.1 for ; Sun, 02 Aug 2026 03:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666558; x=1786271358; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=G5FSlXmr0XbCZ5w/NaCEtPtYhfKQpc3M0FoexAaSwH4=; b=DX0JCkFHlaXRAONN5V2P6Lvlb2eS1ThMBdbqshuhOI/qTSq7OQuGZOw8SvYz4Fm8SA IzfJpbJTon/IsqwLcbqBtVsq6GX4l27qE0YcoHh9gUAlUrUZAxgcIR8mY+tL9vjBlnxI me4+NqFVZ9kcA+pFTu2GRixtWxk6DyZvz60No= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666558; x=1786271358; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=G5FSlXmr0XbCZ5w/NaCEtPtYhfKQpc3M0FoexAaSwH4=; b=cihSuHbBiMHk111idpmGqiSQPGHb7jAIk/3OKasMg3iYjyc6Ne97+yXehNJOHU4W9m IDtgM1NwW2q/pZrgHObuUEzl6GA0CUZNM5zYxChXtB+WyA9Y84W6Zgn8/ZRButOG11QA 8U3XzLoJL1+HuObgsLzMPwqvnciylOyuq9zOKA85q4yk9qCLVafMM9LTI2cU0gB0XhWO 5iZVuxxPmeZVxqqOcoURzsSg0e6UyTUA19lO8TXhudGJgr66C/HlzKGjfEQiSAH7sQ7+ BmLhfpMFAbOGcg+pkBk4Q756gXoxtiDSAi7QNNd/crwr/VagGRwIvZYpYuV31+/N8bXS dXpw== X-Gm-Message-State: AOJu0YwZd5ZrO/2c1/M4VQ7zpuiuvQzc+1c3KpMBSzps7maRWZiiS1AJ BIJcrkyDlZO4jT/qhTZM/Wm7IxnXM+SiUc52ozWCn1N4xnTymBc238IyDTqbJ25VxV0N8OsHqk6 jKPH+Ch4= X-Gm-Gg: AR+sD138GsSfEmO3fiJPCrSxag0q8V8P0/C5fZMXyl94z0VoJi/bP9iget5KjR72pQN rsXk3Fw4KGZnHp2P2/TStB5PmKPGuJ+bQ6r+8NsboeQROtT9c662u+zmFnFm+YSkgMzfp6JX0Tc I4z4G5hkQQ04ZD+mKVH0xKJ7UWg8kn9VFAdboYQD9dPX2P4ZUNUdlJZGDsClDtyLkspQsi8fr/x n0EkHVP0M7vIny5nGiLLJOWRMeGWrOuPj4J/fN+e+Wu5NdICZRdjKygXC01KH0iKPfm54nGMJLA Zf9sTBDNiWoICvrkROAS5m4byOHlpQ+6lOkGoY4ny0ZDfmyFJ0fko6ePvt9bHyajwLtj+8mKmrC ++13Rw7OznkxZLXRbQSsOzCmBPddpfSjWjbpckge9D3yIF7NrQBZpT7HwjJOTpxOwAvIgvz22ha GuI1xyAxhy68NTFHuuTvV+AcQum9aRV8SnymqUlQ2NyTlZ46xZBVQnf1ybEikKgHBxftZMbvc7g G9dn4u7R9fOTSWabw== X-Received: by 2002:a05:600c:218d:b0:495:4c74:6a14 with SMTP id 5b1f17b1804b1-4980c674e8dmr93227345e9.14.1785666558056; Sun, 02 Aug 2026 03:29:18 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:17 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 17/25] kernel-arch: Move ARCH usage into target classes Date: Sun, 2 Aug 2026 11:28:46 +0100 Message-ID: <20260802102854.3952760-18-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242542 Since ARCH is just a function now we can move it into the target class usages and drop it from the default environment. We still have to export in some cases where the usage is unknown but this does significatly reduce the scope and number of places exported to. Signed-off-by: Richard Purdie --- meta/classes-recipe/devicetree.bbclass | 4 +++- meta/classes-recipe/kernel-arch.bbclass | 5 ----- meta/classes-recipe/kernel.bbclass | 3 +++ meta/classes-recipe/module-base.bbclass | 1 + meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb | 3 ++- meta/recipes-kernel/perf/perf.bb | 2 ++ 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/meta/classes-recipe/devicetree.bbclass b/meta/classes-recipe/devicetree.bbclass index ce9d008aac1..4fe389bed83 100644 --- a/meta/classes-recipe/devicetree.bbclass +++ b/meta/classes-recipe/devicetree.bbclass @@ -29,7 +29,9 @@ LIC_FILES_CHKSUM ?= "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171 INHIBIT_DEFAULT_DEPS = "1" DEPENDS += "dtc-native" -inherit deploy kernel-arch +inherit deploy + +export ARCH = "${@oe.kernel.map_kernel_arch(d)}" COMPATIBLE_MACHINE ?= "^$" diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass index db708c35104..eb598d98b6e 100644 --- a/meta/classes-recipe/kernel-arch.bbclass +++ b/meta/classes-recipe/kernel-arch.bbclass @@ -4,11 +4,6 @@ # SPDX-License-Identifier: MIT # -# set the ARCH environment variable for kernel compilation (including -# modules). return value must match one of the architecture directories -# in the kernel source "arch" directory -export ARCH = "${@oe.kernel.map_kernel_arch(d)}" - # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture # specific options necessary for building the kernel and modules. TARGET_CC_KERNEL_ARCH ?= "" diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index aeaec8ccbd4..28460ce1cb9 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -6,6 +6,8 @@ inherit linux-kernel-base kernel-module-split features_check +ARCH = "${@oe.kernel.map_kernel_arch(d)}" + COMPATIBLE_HOST = ".*-linux" # Linux has a minimum ISA requires on riscv, see arch/riscv/Makefile @@ -245,6 +247,7 @@ UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" # Some Linux kernel configurations need additional parameters on the command line KERNEL_EXTRA_ARGS ?= "" +EXTRA_OEMAKE += ' ARCH="${@oe.kernel.map_kernel_arch(d)}"' EXTRA_OEMAKE += ' CC="${KERNEL_CC}" LD="${KERNEL_LD}" OBJCOPY="${KERNEL_OBJCOPY}" STRIP="${KERNEL_STRIP}"' EXTRA_OEMAKE += ' HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"' EXTRA_OEMAKE += ' HOSTCXX="${BUILD_CXX}" HOSTCXXFLAGS="${BUILD_CXXFLAGS}"' diff --git a/meta/classes-recipe/module-base.bbclass b/meta/classes-recipe/module-base.bbclass index 2a225881ba4..d52de45f4a5 100644 --- a/meta/classes-recipe/module-base.bbclass +++ b/meta/classes-recipe/module-base.bbclass @@ -10,6 +10,7 @@ inherit kernel-arch # in sstate, so we must force do_compile to run (once). do_configure[depends] += "make-mod-scripts:do_compile" +export ARCH = "${@oe.kernel.map_kernel_arch(d)}" export OS = "${TARGET_OS}" export CROSS_COMPILE = "${TARGET_PREFIX}" diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb index ab984f4bcfe..6e64918f5b5 100644 --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb @@ -21,7 +21,8 @@ DEPENDS += "gmp-native" INHIBIT_DEFAULT_DEPS = "1" DEPENDS += "virtual/cross-cc virtual/cross-binutils" -EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"" +EXTRA_OEMAKE = ' ARCH="${@oe.kernel.map_kernel_arch(d)}"' +EXTRA_OEMAKE += " HOSTCC="${BUILD_CC}" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}"" EXTRA_OEMAKE += " HOSTCXX="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_LDFLAGS}" CROSS_COMPILE=${TARGET_PREFIX}" KERNEL_LOCALVERSION = "${@oe.kernel.get_localversion_file("${STAGING_KERNEL_BUILDDIR}")}" diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb index e3e5d55e396..5fa98a0d94b 100644 --- a/meta/recipes-kernel/perf/perf.bb +++ b/meta/recipes-kernel/perf/perf.bb @@ -58,6 +58,8 @@ PROVIDES = "virtual/perf" inherit linux-kernel-base kernel-arch manpages pkgconfig +ARCH = "${@oe.kernel.map_kernel_arch(d)}" + # needed for building the tools/perf Python bindings inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} inherit python3-dir From patchwork Sun Aug 2 10:28:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94208 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 13696C55180 for ; Sun, 2 Aug 2026 10:29:28 +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.21343.1785666560746020120 for ; Sun, 02 Aug 2026 03:29:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=URva3O6h; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.44, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4953e04ef16so11825615e9.2 for ; Sun, 02 Aug 2026 03:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666559; x=1786271359; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=gYZgmlKidNtD+QNHdeB8qqdc1OhS2mW30CbeJu/h+tc=; b=URva3O6hu23H+Zdkr2RD0yF/otkelOACxiZiGGlWRpLYXKBGez/nuF8gpjZj+z6Q8o zKcHQEMYE3qZSkSDTzRrFahsAz0xyhapMKXBidS2NI7UDvHxilQh3y8vrDs/X0LhwMPm Crv8IDI/xNf1pxx8l+r4d6TqDVwfdjeh1C98Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666559; x=1786271359; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=gYZgmlKidNtD+QNHdeB8qqdc1OhS2mW30CbeJu/h+tc=; b=TL4OoVyNcIeVjyk603zGYV/rofIk/IEPBfE/SndHYIadJ0u58CvbV4ALaeLhO9bnfZ pyylPChmqluCQVdK6OiFB2SuVDJRUmQ8LlspiuHhuhj2QN2kFHObweQC8nGYBCXWZc92 Hz7BJXwrsehKKHT+XtmHiHCB756KaEwUDuycBZKS/JRcwgTecw/3GD+lAIQ5MkOZsedl 0y35m12TUlLSsK7+PkBuqf453Iv6Ja/+J4HDRxBvz8P3wXDwHT8lnIZDFeWEOM5DlGWe QyynpIVFIQOfFnSFhtyWYtFWqdOzuN1qmxGndf82Vd8GbIpCs+0H0dv8J6CvxRVEcjno XNWQ== X-Gm-Message-State: AOJu0YxFM/adW4BMPMd8MZLx0fnViKXFuoHMnYHKaF2BW2r23e9bcl8Y jZY9gPWAsXHH+gJlm0+KtyId7ldzdVkUd1CVHmm+fPBzHlramSEdV0Yhn9k6sd5jkK5lBcTEchl gilWYH9g= X-Gm-Gg: AR+sD11+n1szJK50zN6tJyFsjUHZ8kTiy7ZveymYsgBNAaH79AE91CqAhX8eq6difn3 /xcx0OFO+6X6mUltAPpLoVEZOHF9IECXYnFv4EbSSxmREY/sPi0g+AW0wUk4Gn9ycrVAQnZTnHv 92IT2vLkoKOH4hJWwJFdGYYhr2+Y0rQB74McxFyZg+ZVyT8OK8uuWF1WjV7VcDcI7n0ag4e1Kxo mEV4JiaOhIPLD6Fatp6+pXsLsvIhosA6AonaNkhja2UZCGP0JiDtk+8jNCamlCjLC7JWytiMxj/ KONrc8nlBdX7/PoceXNjeUS9Hl7ogpP1UFYPjO+soR6k5Yi2gc8vNlPkKF2XXP6zbNzXsCKAun7 +x3ZEQNfcK+JEC7LcJvztLnygEKMt+it0OO/lk9LixRSSRWtRlpoy9+/nmlaDPbBg9D+hvd3fXt QxbkC30Xn5FU3guyd5OqbCkXQYnY7nyAlV2VSHEY1yuN2UIF4hhzxFqFklxdwmXwUpa2SB72zea wwaU8vjO8dhavIZHQ== X-Received: by 2002:a05:600c:524a:b0:498:28b:1025 with SMTP id 5b1f17b1804b1-4980c66c838mr110717735e9.5.1785666559077; Sun, 02 Aug 2026 03:29:19 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:18 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 18/25] linux-yocto-fitimage: Drop obsolete dependency on linux-kernel-base Date: Sun, 2 Aug 2026 11:28:47 +0100 Message-ID: <20260802102854.3952760-19-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242543 Signed-off-by: Richard Purdie --- meta/recipes-kernel/linux/linux-yocto-fitimage.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-kernel/linux/linux-yocto-fitimage.bb b/meta/recipes-kernel/linux/linux-yocto-fitimage.bb index 1f95b9064e4..7d02b44c18c 100644 --- a/meta/recipes-kernel/linux/linux-yocto-fitimage.bb +++ b/meta/recipes-kernel/linux/linux-yocto-fitimage.bb @@ -6,7 +6,7 @@ SECTION = "kernel" LICENSE = "GPL-2.0-only WITH Linux-syscall-note" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-with-Linux-syscall-note;md5=0bad96c422c41c3a94009dcfe1bff992" -inherit linux-kernel-base kernel-fit-image +inherit kernel-fit-image UBOOT_ARCH = "${@oe.kernel.map_uboot_arch(d)}" From patchwork Sun Aug 2 10:28:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94209 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 0665AC55175 for ; Sun, 2 Aug 2026 10:29:28 +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.21190.1785666562346361668 for ; Sun, 02 Aug 2026 03:29:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=MzKA70jG; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.46, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4953de5be0aso7087305e9.0 for ; Sun, 02 Aug 2026 03:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666561; x=1786271361; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=NvoBsYNIPj5yGqfAQnWsYtQqlTCm8ld/O85sEsSpjHk=; b=MzKA70jG6Vt9gJRJcUMsK5Jucu4YisOJuqfzCx2QNKLyqSQ1riADNThdxeN6WOlG4q RqiX3NZnQ/zlomKgIhkgZf3YqcGWfkLneDg8ZT8E95qFM2GSe/096T4onScCVAqSjf9F 6h3QiywmnARrRQmNtp/7z8URGNNBH/fH8uaKI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666561; x=1786271361; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=NvoBsYNIPj5yGqfAQnWsYtQqlTCm8ld/O85sEsSpjHk=; b=nzbMUvUWBmrRuFcRlpYRCwyA8f4eGIs47g3lyUundx4ECwRqC3jfdnotQrHrsQh2yK LinYSjymOnFdJ5eZF4OPz8RpQxsu3PXGx5uWRYf19+J+/BnEDKTAgtCWLvArcZaj3JYl 3cnUxC5VidoLBtrrcDVufOuJgmcpbBKI5aH2rLwyNu7AMBXH9DP816m/XXo/BtyFO4MN 58uAlVdjMNLJglBR52dDUJLJ2FZa6Mtgm+YhlxsIBpVmixOqFWM/uf2SoZpspkiWr6jw nuTJjyJU66cMzwSqA7Mr0rptlg6Uw9Qcwl597xQCnYhbdC3jRVS5uhiILLCuoQQToghS mX+A== X-Gm-Message-State: AOJu0YyLHRIKRboOs0xulzOugQld15f5S7GlWmUPhK5nkET30Ts6PA6d Y+J0bi3p6HrwMiFsXlrGHR/KGpfcAjyeeb+aI0fbi9MSCxWm8MLH/Z++ZYUZCYpAXvAd6UpICrJ Ov9PCRMg= X-Gm-Gg: AR+sD104StTRvcT0wirQZyZTly+rNNI2NoZl8ZI3OAV/OndGfXEcDBiccC0oyrTqQxC rQkX24KNbRoVPc6M5hmEerR3iEQ3CebQ+v1NBtVhMCxjJx1XO920aBvMbdkw7xC65gjgyPf5iML CtX+CGqNiJQhR+eRkBNeXDy0GCodgY4jrAvzH1bADz+V18KeP/DB0j6lXDICt/Eqk+EMRP9/sXm /aEqi0fSpLC+8EZbmjclKt/mjwZXNt7OJaPOwoU+1NJOliwOcLHtilF+2yZzYRmbWrd9mdJhN1h A/PZmvaVsaHSYeNqiOqsyn7vVJOlnmXxKe6YvEohsrAw22jRrmPZ2I1usaLzHdbRLW/EJOOnJRu 0TsFzheKbVQOaAJN8vUhvI8YweuswtBNQJfF5H3YjMtIUtVLul1znNO6vWJiRsD+4EFOyfLp6oV yaqiDflq65VAiGXwQr7yySJNSvsPhQ3lyishEEGL107VuBlGX8l7XKW9ipsGh1H2yiegVHRCml/ K/eueOoF6mKASiMXQ== X-Received: by 2002:a05:600c:c8c:b0:493:f318:3bc6 with SMTP id 5b1f17b1804b1-4980c6564d5mr109007185e9.13.1785666560495; Sun, 02 Aug 2026 03:29:20 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:19 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 19/25] linux-kernel-base: Fold remainder into kernel-arch and drop Date: Sun, 2 Aug 2026 11:28:48 +0100 Message-ID: <20260802102854.3952760-20-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242544 The remaining usages can all work from kernel-arch so fold the class into there and drop linux-kernel-base since the name is an outlier anyway. Clean up some of the kernel class inherits to be in the same line to make it cleare which uses what. Signed-off-by: Richard Purdie --- meta/classes-recipe/kernel-arch.bbclass | 4 ++++ meta/classes-recipe/kernel.bbclass | 12 +++--------- meta/classes-recipe/kernelsrc.bbclass | 2 -- meta/classes-recipe/linux-kernel-base.bbclass | 10 ---------- .../make-mod-scripts/make-mod-scripts_1.0.bb | 3 +-- meta/recipes-kernel/perf/perf.bb | 2 +- 6 files changed, 9 insertions(+), 24 deletions(-) delete mode 100644 meta/classes-recipe/linux-kernel-base.bbclass diff --git a/meta/classes-recipe/kernel-arch.bbclass b/meta/classes-recipe/kernel-arch.bbclass index eb598d98b6e..26b8a1a67f9 100644 --- a/meta/classes-recipe/kernel-arch.bbclass +++ b/meta/classes-recipe/kernel-arch.bbclass @@ -34,3 +34,7 @@ KERNEL_OBJCOPY:toolchain-clang = "llvm-objcopy ${TARGET_OBJCOPY_KERNEL_ARCH}" KERNEL_STRIP:toolchain-clang = "llvm-strip" KERNEL_TOOLCHAIN ?= "gcc" TOOLCHAIN = "${KERNEL_TOOLCHAIN}" + +export KBUILD_BUILD_VERSION = "1" +export KBUILD_BUILD_USER ?= "oe-user" +export KBUILD_BUILD_HOST ?= "oe-host" diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 28460ce1cb9..a82bdf7ecba 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -4,7 +4,8 @@ # SPDX-License-Identifier: MIT # -inherit linux-kernel-base kernel-module-split features_check +inherit kernel-arch kernel-module-split kernel-devicetree kernel-artifact-names +inherit features_check deploy cml1 pkgconfig ARCH = "${@oe.kernel.map_kernel_arch(d)}" @@ -215,8 +216,6 @@ python do_symlink_kernsrc () { # do_configure on do_symlink_kernsrc. addtask symlink_kernsrc before do_patch do_configure after do_unpack -inherit kernel-arch deploy - PACKAGES_DYNAMIC += "^${KERNEL_PACKAGE_NAME}-module-.*" PACKAGES_DYNAMIC += "^${KERNEL_PACKAGE_NAME}-image-.*" PACKAGES_DYNAMIC += "^${KERNEL_PACKAGE_NAME}-firmware-.*" @@ -675,8 +674,6 @@ kernel_do_configure() { ${KERNEL_CONFIG_COMMAND} } -inherit cml1 pkgconfig - EXPORT_FUNCTIONS do_compile do_transform_kernel do_transform_bundled_initramfs do_install do_configure # kernel-base becomes kernel-${KERNEL_VERSION} @@ -789,8 +786,6 @@ do_sizecheck[dirs] = "${B}" addtask sizecheck before do_install after do_strip -inherit kernel-artifact-names - kernel_do_deploy() { deployDir="${DEPLOYDIR}" if [ -n "${KERNEL_DEPLOYSUBDIR}" ]; then @@ -915,5 +910,4 @@ do_create_spdx:append() { } do_create_spdx[depends] += "virtual/kernel:do_configure" -# Add using Device Tree support -inherit kernel-devicetree + diff --git a/meta/classes-recipe/kernelsrc.bbclass b/meta/classes-recipe/kernelsrc.bbclass index b105fc15990..fa204a007a3 100644 --- a/meta/classes-recipe/kernelsrc.bbclass +++ b/meta/classes-recipe/kernelsrc.bbclass @@ -13,8 +13,6 @@ do_package[depends] += "virtual/kernel:do_populate_sysroot" KERNEL_VERSION = "${@oe.kernel.get_version_file("${STAGING_KERNEL_BUILDDIR}")}" LOCAL_VERSION = "${@oe.kernel.get_localversion_file("${STAGING_KERNEL_BUILDDIR}")}" -inherit linux-kernel-base - # The final packages get the kernel version instead of the default 1.0 python do_package:prepend() { d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) diff --git a/meta/classes-recipe/linux-kernel-base.bbclass b/meta/classes-recipe/linux-kernel-base.bbclass deleted file mode 100644 index 566b2c96ba7..00000000000 --- a/meta/classes-recipe/linux-kernel-base.bbclass +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright OpenEmbedded Contributors -# -# SPDX-License-Identifier: MIT -# - -export KBUILD_BUILD_VERSION = "1" -export KBUILD_BUILD_USER ?= "oe-user" -export KBUILD_BUILD_HOST ?= "oe-host" - diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb index 6e64918f5b5..18768c1ec4a 100644 --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb @@ -3,8 +3,7 @@ HOMEPAGE = "https://www.yoctoproject.org/" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" -inherit kernel-arch linux-kernel-base -inherit pkgconfig +inherit kernel-arch pkgconfig PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb index 5fa98a0d94b..25852f8a22a 100644 --- a/meta/recipes-kernel/perf/perf.bb +++ b/meta/recipes-kernel/perf/perf.bb @@ -56,7 +56,7 @@ do_configure[depends] += "virtual/kernel:do_shared_workdir" PROVIDES = "virtual/perf" -inherit linux-kernel-base kernel-arch manpages pkgconfig +inherit kernel-arch manpages pkgconfig ARCH = "${@oe.kernel.map_kernel_arch(d)}" From patchwork Sun Aug 2 10:28:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94210 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 E9D02C55162 for ; Sun, 2 Aug 2026 10:29:27 +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.21344.1785666564906800672 for ; Sun, 02 Aug 2026 03:29:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Jxobq3AZ; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.50, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-49545ba3d4eso4648375e9.3 for ; Sun, 02 Aug 2026 03:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666563; x=1786271363; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=ltsO6fot+TGXGXgN2CjrYGDn4AD7nJ+1VLf0hoCmh3Q=; b=Jxobq3AZJm2UfjDdvoBI1mJOQ7QcdLMvgv8xnYzZ5Nvq/Q1pl42SmpkNvFxBWNi/kd OLBbOLdWkh31l4xAQxeHPLtLBx0CZQeuRwuh8CzEoMkac7JLWThbAvkix34U0srFd8nZ b4Nz0eywCnOe4ldez2xoHgFD/vqtaQbEshYaI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666563; x=1786271363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=ltsO6fot+TGXGXgN2CjrYGDn4AD7nJ+1VLf0hoCmh3Q=; b=qi9ZTma+MPPkdM6nKUaZ/qvItEpFaCjVkVy4LllW41A1bcD8BBGpZu9FvwWLzhDwWl 1Gd3sMnvtHM80pT8uOzVZr6dOhDhq/Mkco5NPJ/KCSz6ue/OIcXFCTxBXdMIj8x4Wdl/ A+NMinL7adojjQJhFxugX4xKF0mDJXZiM+JCPYp4X1Dg755zemOsVy2pHMazstlhExm2 2TKPzLPVlHcpGC05R5dPRel/s7ivrI4/+FaPLa4FsbqBj4yvJ1OrzMz0mLt4qh2XM1OQ kJaqOHpUZgoekua6pRIgyX8fYLRTnBYXb/MgRK8NzxUwD0kTWAXhP2ADHbEKEMlucV+N l9lw== X-Gm-Message-State: AOJu0Yzyu3/qJPU/5sj5EBAHckQWg8UMjcHS5tvCnfIJS6jBDzdsEu1C upLFXxA8GzGtAM92PETFOinIc3/PwT1iyKTTDEeko+efYtVWS31qQGuQ9otb3M1o2iIKAUjioyt Pmsy9l2Q= X-Gm-Gg: AR+sD13MdNqwKoz5sHmTNxntEVzH37+6hd9U/TM2CoWRtr3PnA/Rl0ViInsHTNdxfEc HDchVvjR7yoT7NasCevdm0V7/gj83NL8OlYq+rh/uZlffowxQrhaBlaxtY03qLlha+BvmOmXqs4 iYP6iSWSUfjgJmdxlXKTuyO0KPUF9xE3AByz39zuYS7LjTLjIm1oQnl6bUKtgcBIcRR0rVLzNXt WKtx6yUfoqWNw1pcV9RntmTwMEDyJ6fUZzQsAxGiBF+owYBcNJzx/d0+4R93Xf18jdJlLvfYEOg 0euBW4SCIQJk3/clQpcZm5nMrNhC3kydCPZd8gI/COFcnNMthayQ3xtbLnbf35K3PKjd8jQTbDf 3z+/p1v9/NcdKGH/vddm9ArXkCyV/rUWerFdBaQQHN9scIXzdDcXTWONAKocpSAp4jGt+ZWOQim wcDMYjggqaEUR/VW6TMyb0W87N5O3/4iVCZhkm1sIawcTojTWgHr/YE3H9HZIlhWo3EVQVSBroU hiqgE5BYMjkF9KhflUZrrktk2f6eA== X-Received: by 2002:a05:600c:8b14:b0:493:e983:806e with SMTP id 5b1f17b1804b1-4980c66d8e5mr125469105e9.3.1785666562578; Sun, 02 Aug 2026 03:29:22 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:20 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 20/25] kernel-devicetree: Add missing function prefixes Date: Sun, 2 Aug 2026 11:28:49 +0100 Message-ID: <20260802102854.3952760-21-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:27 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242545 There is an implicit ordering problem with this class and kernel.bbclass, since kernel.bbclass uses EXPORT_FUNCTIONS on these function and if the inherit ordering is wrong, the functions get broken. The class is always included and always wants to append them. Therefore target the real functions we want to change. This makes the inherit order less fragile. Signed-off-by: Richard Purdie --- meta/classes-recipe/kernel-devicetree.bbclass | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/classes-recipe/kernel-devicetree.bbclass b/meta/classes-recipe/kernel-devicetree.bbclass index eff052b4029..49c39e27ec1 100644 --- a/meta/classes-recipe/kernel-devicetree.bbclass +++ b/meta/classes-recipe/kernel-devicetree.bbclass @@ -44,7 +44,7 @@ get_real_dtb_path_in_kernel () { echo "$dtb_path" } -do_configure:append() { +kernel_do_configure:append() { if [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then if echo ${KERNEL_IMAGETYPE_FOR_MAKE} | grep -q 'zImage'; then case "${ARCH}" in @@ -66,7 +66,7 @@ do_configure:append() { fi } -do_compile:append() { +kernel_do_compile:append() { if [ -n "${KERNEL_DTC_FLAGS}" ]; then export DTC_FLAGS="${KERNEL_DTC_FLAGS}" fi @@ -77,7 +77,7 @@ do_compile:append() { done } -do_install:append() { +kernel_do_install:append() { install -d ${D}/${KERNEL_DTBDEST} for dtbf in ${KERNEL_DEVICETREE}; do dtb=`normalize_dtb "$dtbf"` @@ -91,7 +91,7 @@ do_install:append() { done } -do_deploy:append() { +kernel_do_deploy:append() { for dtbf in ${KERNEL_DEVICETREE}; do dtb=`normalize_dtb "$dtbf"` dtb_ext=${dtb##*.} From patchwork Sun Aug 2 10:28:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94206 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 D8624C55174 for ; Sun, 2 Aug 2026 10:29:27 +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.msgproc01-g2.21191.1785666565630401422 for ; Sun, 02 Aug 2026 03:29:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=a75EOIK7; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.41, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-49557167508so10458915e9.1 for ; Sun, 02 Aug 2026 03:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666564; x=1786271364; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=6rbzQa8EzZZ2lgPiWnhSu3EWSv59h31c1j4Y/YVixXM=; b=a75EOIK7OJpYhPN/CxIo4+ZKBAoC7s42RXWJyapeqGTMJPQNis5UlSuqr87Xt/MonP oizmG8VJiHx5cQ7FvOwrk2bqTbR1X6V1oBoYg0I90Z5ZvQxjT/Hbe6FGyXnLcsfPRAb0 DrtNnuyK+dqVLP/tZfAiBWy9Cj7Dt/o1hyEKE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666564; x=1786271364; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=6rbzQa8EzZZ2lgPiWnhSu3EWSv59h31c1j4Y/YVixXM=; b=C9bPWuUDs7hpnai71QvfgjCqW1Zfarvvx9Wff4nNsHaj/nEpXc2LXQcIJOsXN3cOTM NFwzUupJtXlWdgKzIb5RYk2q6HXf5MVtZf0/YilkEy1Wro5peuss1upuLF2Z6xnmGx7O xxjjtn4GYk6mTLiCWIlROX6IZG6ksOqTPYx6+93JinRbLlOeDTjsZe4imU2GSoDftbur 9bbujKM3hvYJBmKzYHNkmMZ3LnsVqO0CQSfx2QztYPO3qTXPf6tRGBN28AMM2+We1Yjk mM2Bf+/0knyyzAGtQNv99saCSZwrCESeIwAKxktRq/nEnPIWWF6L20Rg1RpynOjp3qAW nE9g== X-Gm-Message-State: AOJu0YzsXDyGG7B3c1chWHO9k9asT3/T2zUdQGKD6uVKokM/4s/mk2aw Fo2vYxpzHeblssdTGUn1KaH/sRgcFaKNv7A2giYPstbA9qnYFhLArWjKXM6iBUK4lKh5+PpyRh+ qBZfOueI= X-Gm-Gg: AR+sD11pB5Q4ICNr3joc0oxrJKGso8FvKy1ZWFyWewy4W9F7vCsEon1bRxPpIJxxFRv 68mX+tNsFsgY1DUmLopc6CnG1zg7Wv0c71/eEVLMsoiwDlgEJB8y0fj3F72QonIbp+Va0v8ncfb jmsvwzpP620zZAdcrgXxxojyR3YT3G+VQ1JYOcBaJEnkIocP9A/2JKzszwgTmTIe6W0xzUHOgyG fldCQV1yzcdBaI1azVM75Y/eG0ipVdwTA/VGAdROetf/QHcQmLRlITUwsRptzECoDSGtL8TSdZp q9dI31yYB9dWxkvRTLmCZBXHSoaKENeerCfR1HN6krckcnE+UhQ7fvF0nMpC8ufYptaDT74Hus+ GseVgaGRd33vUHCVpQL8Ww4nmum3BEwcoJLetGdiYmL0f+PEaFM9v0t4k7/MfvWkZgx+38qCzdn m2cotrdSWQ6nAKamDMYyb9Xobc07e1HQTDvbYJv1EtcjZ3eSvPSyPz1nOvtKg9ET5i5XqEQ5fHY RhKVV850HGpIoO5dbYaK/aAGXjQGw== X-Received: by 2002:a05:600c:354a:b0:490:b8c0:d470 with SMTP id 5b1f17b1804b1-4980c67d71emr118937815e9.19.1785666563844; Sun, 02 Aug 2026 03:29:23 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:22 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 21/25] utils: Drop explode_deps function Date: Sun, 2 Aug 2026 11:28:50 +0100 Message-ID: <20260802102854.3952760-22-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:27 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242546 This was just a wrapper around the bb.utils function, drop it in favour of that. Signed-off-by: Richard Purdie --- meta/classes-global/utils.bbclass | 3 --- meta/recipes-core/packagegroups/packagegroup-core-sdk.bb | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/meta/classes-global/utils.bbclass b/meta/classes-global/utils.bbclass index 530a490ea84..443f0c65560 100644 --- a/meta/classes-global/utils.bbclass +++ b/meta/classes-global/utils.bbclass @@ -271,9 +271,6 @@ def check_app_exists(app, d): path = d.getVar('PATH') return bool(bb.utils.which(path, app)) -def explode_deps(s): - return bb.utils.explode_deps(s) - def base_set_filespath(path, d): filespath = [] extrapaths = (d.getVar("FILESEXTRAPATHS") or "") diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb index e6d704b5bae..4a147c059e9 100644 --- a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb +++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb @@ -62,7 +62,7 @@ RRECOMMENDS:packagegroup-core-sdk = "\ # # the package depchain code # spkgdata = read_subpkgdata(pkg, d) # -# rdepends = explode_deps(spkgdata.get('RDEPENDS:%s' % pkg) or '') +# rdepends = bb.utils.explode_deps(spkgdata.get('RDEPENDS:%s' % pkg) or '') # rreclist = [] # # for depend in rdepends: @@ -72,7 +72,7 @@ RRECOMMENDS:packagegroup-core-sdk = "\ # rreclist.append('%s-dev' % name) # else: # deppkgdata = read_subpkgdata(name, d) -# rdepends2 = explode_deps(deppkgdata.get('RDEPENDS:%s' % name) or '') +# rdepends2 = bb.utils.explode_deps(deppkgdata.get('RDEPENDS:%s' % name) or '') # for depend in rdepends2: # split_depend = depend.split(' (') # name = split_depend[0].strip() From patchwork Sun Aug 2 10:28:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94207 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 C8755C55171 for ; Sun, 2 Aug 2026 10:29:27 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21192.1785666567050733877 for ; Sun, 02 Aug 2026 03:29:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=CQil/QsV; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.51, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4980dc26022so5707485e9.1 for ; Sun, 02 Aug 2026 03:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666565; x=1786271365; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=Qv+hgYGWi+d/k7yxW1dHkvrXF1GJ9mDSbRo1m9isgK8=; b=CQil/QsVe647PcHcxVkpy592r0phN+klq8nwA9fqXS7wWu1AblG7pzoGRDaPrxaZxU E+tsvJjKdXt5zV1vBFGgpdkVqH1orXpUtFsg1IFq6dUEyCGbKxCoudv93b4woe1SlPqx Nt8dM9EbA9tw7YKgbYX9whAbR7416o9rqm3fE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666565; x=1786271365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=Qv+hgYGWi+d/k7yxW1dHkvrXF1GJ9mDSbRo1m9isgK8=; b=mAVYui8/r6HAQZgdmrDu5dq0+bKvHjfU9lsvnIyfzK1TCT3LkfEYtBOJIHgguZVGfR EfvQstyz5jvSA8tm2ovb99OHoKa8DMqrL0SjOpDZMZEpWIloVfXoZpIZZcAsv3g0y4g0 cNpjoL8LzfwVlEKMPWZIzV9Oqf4XSlAXA/rAhW5SKAif6IrwjDW5ljDbrTrPkz50mcLm QInxDg5Ebe35mlDLZZSmbycbH27UOkzEOPqYG0RGZT4jKd25sIWcM/21ynzHeIdDa7Rz E3aOpioKIrT0ben7y6pAUw24RCHdetVzZOa89J9HU3xCiC+5o1nyC8GOgz3bYu53U2Qw M2Pw== X-Gm-Message-State: AOJu0YzFbU0+aNgkXTMcvCrQhM/u3UKn0DCTi242VdDs5B4KXxI2u4LE RmyLwf9Qts8QEqlez1wUdws+jr8BUJygC9PSgr3JvMR+qxpAiX+QK9VgL7qajkqwmaq30cEQgVy Z16vOOas= X-Gm-Gg: AR+sD12iJwJazzrnwceBJ8Q/1yWoEAJwHfpHcRrtW+tghN0ehI0I+Qo/+vP54+o2ltR fQxAvu1xQlv5aqR9uveROtVkaty/LQJKvkqC6gB6NOrka5TaasC67ZiyauHy5CrqsU3iP0HO/aT +/VMuHblbmd1lElA0T5/ijTWu/A+nW/KtU5g8N1SF9xg16GqDaSTP9NAm2S0d34B9DpxenCTxtb dr6L6Rnq/42soJF23dF28j3O288v8r/tkBqfav8RxbrLFwYYQxxvuLumN6v9UyS8EZMPX+lsGSE rXfm+B4lWnl4xOKtZGQAjs/b2+KW/D64ouuEhq7q4BoytXVMAFn08EjkBU0BA8HJaX2jxsDZyCB QSkiXevaHk86uvU7p7+VxpRA+IF4KVuoIAgEwigB+LY4stjIBX8DmgpQS2eTcE/DguE2zcYp8kw ejaxEMwVh2LCGZ+8tce9Ishlu7Edrc4Q+6zQY+lVUkaX48T6CNFzrBbsHiUlFnYxmVP9jilIBUr jLdf3LuV/Fkqk4d+w== X-Received: by 2002:a05:600c:840f:b0:493:aa0a:45ad with SMTP id 5b1f17b1804b1-4980c64520fmr106919075e9.2.1785666564863; Sun, 02 Aug 2026 03:29:24 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:24 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 22/25] utils: Move functions from utils.bbclass to utils.py Date: Sun, 2 Aug 2026 11:28:51 +0100 Message-ID: <20260802102854.3952760-23-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:27 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242547 Signed-off-by: Richard Purdie --- meta/classes-global/base.bbclass | 2 +- meta/classes-global/package.bbclass | 2 +- meta/classes-global/sanity.bbclass | 8 +- meta/classes-global/utils.bbclass | 90 ------------------- meta/classes-recipe/cross-canadian.bbclass | 2 +- meta/classes-recipe/image.bbclass | 4 +- meta/classes-recipe/populate_sdk_base.bbclass | 10 +-- meta/classes-recipe/populate_sdk_ext.bbclass | 2 +- meta/classes/multilib.bbclass | 2 +- meta/conf/multilib.conf | 2 +- meta/lib/oe/utils.py | 85 ++++++++++++++++++ meta/recipes-core/glibc/glibc-ld.inc | 2 +- meta/recipes-core/meta/dummy-sdk-package.inc | 2 +- meta/recipes-core/meta/meta-environment.bb | 2 +- meta/recipes-core/meta/meta-go-toolchain.bb | 2 +- .../packagegroup-cross-canadian.bb | 6 +- .../packagegroup-go-cross-canadian.bb | 2 +- .../packagegroup-rust-cross-canadian.bb | 2 +- 18 files changed, 111 insertions(+), 116 deletions(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 4684dbd60c8..8b4abe8f1e2 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -72,7 +72,7 @@ BASEDEPENDS:class-nativesdk = "${@get_base_dep(d)}" DEPENDS:prepend = "${BASEDEPENDS} " -FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}" +FILESPATH = "${@oe.utils.base_set_filespath(["${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}" # THISDIR only works properly with imediate expansion as it has to run # in the context of the location its used (:=) THISDIR = "${@os.path.dirname(d.getVar('FILE'))}" diff --git a/meta/classes-global/package.bbclass b/meta/classes-global/package.bbclass index cb92b495714..3d293dead77 100644 --- a/meta/classes-global/package.bbclass +++ b/meta/classes-global/package.bbclass @@ -54,7 +54,7 @@ PKGDEST = "${WORKDIR}/packages-split" LOCALE_SECTION ?= '' -ALL_MULTILIB_PACKAGE_ARCHS = "${@all_multilib_tune_values(d, 'PACKAGE_ARCHS')}" +ALL_MULTILIB_PACKAGE_ARCHS = "${@oe.utils.all_multilib_tune_values(d, 'PACKAGE_ARCHS')}" # rpm is used for the per-file dependency identification # dwarfsrcfiles is used to determine the list of debug source files diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass index 5c5cf311da1..91c22599bfe 100644 --- a/meta/classes-global/sanity.bbclass +++ b/meta/classes-global/sanity.bbclass @@ -720,13 +720,13 @@ def check_sanity_version_change(status, d): missing = "" - if not check_app_exists("${MAKE}", d): + if not oe.utils.check_app_exists("${MAKE}", d): missing = missing + "GNU make," - if not check_app_exists('gcc', d): + if not oe.utils.check_app_exists('gcc', d): missing = missing + "C Compiler (gcc)," - if not check_app_exists('g++', d): + if not oe.utils.check_app_exists('g++', d): missing = missing + "C++ Compiler (g++)," # installing emacs on Ubuntu 24.04 pulls in emacs-gtk -> libgcc-14-dev despite gcc being 13 @@ -737,7 +737,7 @@ def check_sanity_version_change(status, d): required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES') for util in required_utilities.split(): - if not check_app_exists(util, d): + if not oe.utils.check_app_exists(util, d): missing = missing + "%s," % util if missing: diff --git a/meta/classes-global/utils.bbclass b/meta/classes-global/utils.bbclass index 443f0c65560..cee847594ee 100644 --- a/meta/classes-global/utils.bbclass +++ b/meta/classes-global/utils.bbclass @@ -265,96 +265,6 @@ hardlinkdir () { (cd $from; find . -print0 | cpio --null -pdlu $to) } - -def check_app_exists(app, d): - app = d.expand(app).split()[0].strip() - path = d.getVar('PATH') - return bool(bb.utils.which(path, app)) - -def base_set_filespath(path, d): - filespath = [] - extrapaths = (d.getVar("FILESEXTRAPATHS") or "") - # Remove default flag which was used for checking - extrapaths = extrapaths.replace("__default:", "") - # Don't prepend empty strings to the path list - if extrapaths != "": - path = extrapaths.split(":") + path - # The ":" ensures we have an 'empty' override - overrides = (":" + (d.getVar("FILESOVERRIDES") or "")).split(":") - overrides.reverse() - for o in overrides: - for p in path: - if p != "": - filespath.append(os.path.join(p, o)) - return ":".join(filespath) - -def extend_variants(d, var, extend, delim=':'): - """Return a string of all bb class extend variants for the given extend""" - variants = [] - whole = d.getVar(var) or "" - for ext in whole.split(): - eext = ext.split(delim) - if len(eext) > 1 and eext[0] == extend: - variants.append(eext[1]) - return " ".join(variants) - -def multilib_pkg_extend(d, pkg): - variants = (d.getVar("MULTILIB_VARIANTS") or "").split() - if not variants: - return pkg - pkgs = pkg - for v in variants: - pkgs = pkgs + " " + v + "-" + pkg - return pkgs - -def get_multilib_datastore(variant, d): - return oe.utils.get_multilib_datastore(variant, d) - -def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' '): - """Return a string of all ${var} in all multilib tune configuration""" - values = [] - variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + [''] - for item in variants: - localdata = get_multilib_datastore(item, d) - # We need WORKDIR to be consistent with the original datastore - localdata.setVar("WORKDIR", d.getVar("WORKDIR")) - value = localdata.getVar(var) or "" - if value != "": - if need_split: - for item in value.split(delim): - values.append(item) - else: - values.append(value) - if unique: - #we do this to keep order as much as possible - ret = [] - for value in values: - if not value in ret: - ret.append(value) - else: - ret = values - return " ".join(ret) - -def all_multilib_tune_list(vars, d): - """ - Return a list of ${VAR} for each variable VAR in vars from each - multilib tune configuration. - Is safe to be called from a multilib recipe/context as it can - figure out the original tune and remove the multilib overrides. - """ - values = {} - for v in vars: - values[v] = [] - values['ml'] = [''] - - variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + [''] - for item in variants: - localdata = get_multilib_datastore(item, d) - values[v].append(localdata.getVar(v)) - values['ml'].append(item) - return values -all_multilib_tune_list[vardepsexclude] = "OVERRIDES" - # If the user hasn't set up their name/email, set some defaults check_git_config() { if ! git config user.email > /dev/null ; then diff --git a/meta/classes-recipe/cross-canadian.bbclass b/meta/classes-recipe/cross-canadian.bbclass index fe991f44bb5..25e67d9e079 100644 --- a/meta/classes-recipe/cross-canadian.bbclass +++ b/meta/classes-recipe/cross-canadian.bbclass @@ -94,7 +94,7 @@ python () { # Also need to handle multilib target vendors vendors = d.getVar("CANADIANEXTRAVENDOR") if not vendors: - vendors = all_multilib_tune_values(d, 'TARGET_VENDOR') + vendors = oe.utils.all_multilib_tune_values(d, 'TARGET_VENDOR') origvendor = d.getVar("TARGET_VENDOR_MULTILIB_ORIGINAL") if origvendor: d.setVar("TARGET_VENDOR", origvendor) diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass index 53f1a9dc45b..460e5ab39fa 100644 --- a/meta/classes-recipe/image.bbclass +++ b/meta/classes-recipe/image.bbclass @@ -33,7 +33,7 @@ PACKAGES = "" DEPENDS += "depmodwrapper-cross cross-localedef-native" RDEPENDS += "${PACKAGE_INSTALL} ${LINGUAS_INSTALL} ${IMAGE_INSTALL_DEBUGFS}" RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}" -PATH:prepend = "${@":".join(all_multilib_tune_values(d, 'STAGING_BINDIR_CROSS').split())}:" +PATH:prepend = "${@":".join(oe.utils.all_multilib_tune_values(d, 'STAGING_BINDIR_CROSS').split())}:" INHIBIT_DEFAULT_DEPS = "1" @@ -102,7 +102,7 @@ USE_DEPMOD ?= "1" PID = "${@os.getpid()}" PACKAGE_ARCH = "${MACHINE_ARCH}" -SSTATE_ARCHS_TUNEPKG = "${@all_multilib_tune_values(d, 'TUNE_PKGARCH')}" +SSTATE_ARCHS_TUNEPKG = "${@oe.utils.all_multilib_tune_values(d, 'TUNE_PKGARCH')}" LDCONFIGDEPEND ?= "ldconfig-native:do_populate_sysroot" LDCONFIGDEPEND:libc-musl = "" diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass index 1d9faecc16b..a321e7ef445 100644 --- a/meta/classes-recipe/populate_sdk_base.bbclass +++ b/meta/classes-recipe/populate_sdk_base.bbclass @@ -11,7 +11,7 @@ PACKAGES = "" # This exists as an optimization for SPDX processing to only run in image and # SDK processing context. This class happens to be common to these usages. -SPDX_MULTILIB_SSTATE_ARCHS = "${@all_multilib_tune_values(d, 'SSTATE_ARCHS')}" +SPDX_MULTILIB_SSTATE_ARCHS = "${@oe.utils.all_multilib_tune_values(d, 'SSTATE_ARCHS')}" inherit image-postinst-intercepts image-artifact-names nopackages @@ -77,9 +77,9 @@ TOOLCHAIN_HOST_TASK ?= " \ " TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= "" TOOLCHAIN_TARGET_TASK ?= " \ - ${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \ - ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', multilib_pkg_extend(d, 'packagegroup-go-sdk-target'), '', d)} \ - ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', multilib_pkg_extend(d, 'libstd-rs'), '', d)} \ + ${@oe.utils.multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \ + ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', oe.utils.multilib_pkg_extend(d, 'packagegroup-go-sdk-target'), '', d)} \ + ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', oe.utils.multilib_pkg_extend(d, 'libstd-rs'), '', d)} \ ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'kernel', 'kernel-devsrc', '', d)} \ target-sdk-provides-dummy \ " @@ -119,7 +119,7 @@ python () { SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}" SDK_DEPENDS = "virtual/fakeroot-native ${SDK_ARCHIVE_DEPENDS} cross-localedef-native" -PATH:prepend = "${WORKDIR}/recipe-sysroot/${SDKPATHNATIVE}${bindir}/crossscripts:${@":".join(all_multilib_tune_values(d, 'STAGING_BINDIR_CROSS').split())}:" +PATH:prepend = "${WORKDIR}/recipe-sysroot/${SDKPATHNATIVE}${bindir}/crossscripts:${@":".join(oe.utils.all_multilib_tune_values(d, 'STAGING_BINDIR_CROSS').split())}:" SDK_DEPENDS += "nativesdk-glibc-locale" # We want the MULTIARCH_TARGET_SYS to point to the TUNE_PKGARCH, not PACKAGE_ARCH as it diff --git a/meta/classes-recipe/populate_sdk_ext.bbclass b/meta/classes-recipe/populate_sdk_ext.bbclass index 7d28415ab37..8349e03db58 100644 --- a/meta/classes-recipe/populate_sdk_ext.bbclass +++ b/meta/classes-recipe/populate_sdk_ext.bbclass @@ -462,7 +462,7 @@ def prepare_locked_cache(d, baseoutpath, derivative, conf_initpath): # Filter the locked signatures file to just the sstate tasks we are interested in excluded_targets = get_sdk_install_targets(d, images_only=True) sdk_targets = d.getVar('SDK_TARGETS') - ext_sdk_target_set = set(multilib_pkg_extend(d, sdk_targets).split()) + ext_sdk_target_set = set(oe.utils.multilib_pkg_extend(d, sdk_targets).split()) excluded_set = set(excluded_targets.split()) # Ensure SDK_TARGETS and their image SPDX/SBOM tasks are included in the locked signatures, diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass index 6e90af261dc..7266f6661d9 100644 --- a/meta/classes/multilib.bbclass +++ b/meta/classes/multilib.bbclass @@ -32,7 +32,7 @@ python multilib_virtclass_handler () { d.setVar(name + "_MULTILIB_ORIGINAL", val) # We nearly don't need this but dependencies on NON_MULTILIB_RECIPES don't work without it - d.setVar("SSTATE_ARCHS_TUNEPKG", "${@all_multilib_tune_values(d, 'TUNE_PKGARCH')}") + d.setVar("SSTATE_ARCHS_TUNEPKG", "${@oe.utils.all_multilib_tune_values(d, 'TUNE_PKGARCH')}") overrides = e.data.getVar("OVERRIDES", False) pn = e.data.getVar("PN", False) diff --git a/meta/conf/multilib.conf b/meta/conf/multilib.conf index aff55c1e9da..d692723da3b 100644 --- a/meta/conf/multilib.conf +++ b/meta/conf/multilib.conf @@ -1,7 +1,7 @@ baselib = "${@d.getVar('BASE_LIB:tune-' + (d.getVar('DEFAULTTUNE') or 'INVALID')) or d.getVar('BASELIB')}" -MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}" +MULTILIB_VARIANTS = "${@oe.utils.extend_variants(d,'MULTILIBS','multilib')}" MULTILIB_VARIANTS[vardeps] += "MULTILIBS" MULTILIB_SAVE_VARNAME = "DEFAULTTUNE TARGET_ARCH TARGET_SYS TARGET_VENDOR" diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 082f6cef74f..d24f49b875a 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -553,3 +553,88 @@ def make_arch_independent(d): d.setVar("qemu_wrapper_cmdline", "def qemu_wrapper_cmdline(data, rootfs_path, library_paths):\n return 'false'") +def base_set_filespath(path, d): + filespath = [] + extrapaths = (d.getVar("FILESEXTRAPATHS") or "") + # Remove default flag which was used for checking + extrapaths = extrapaths.replace("__default:", "") + # Don't prepend empty strings to the path list + if extrapaths != "": + path = extrapaths.split(":") + path + # The ":" ensures we have an 'empty' override + overrides = (":" + (d.getVar("FILESOVERRIDES") or "")).split(":") + overrides.reverse() + for o in overrides: + for p in path: + if p != "": + filespath.append(os.path.join(p, o)) + return ":".join(filespath) + +def check_app_exists(app, d): + app = d.expand(app).split()[0].strip() + path = d.getVar('PATH') + return bool(bb.utils.which(path, app)) + +def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' '): + """Return a string of all ${var} in all multilib tune configuration""" + values = [] + variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + [''] + for item in variants: + localdata = get_multilib_datastore(item, d) + # We need WORKDIR to be consistent with the original datastore + localdata.setVar("WORKDIR", d.getVar("WORKDIR")) + value = localdata.getVar(var) or "" + if value != "": + if need_split: + for item in value.split(delim): + values.append(item) + else: + values.append(value) + if unique: + #we do this to keep order as much as possible + ret = [] + for value in values: + if not value in ret: + ret.append(value) + else: + ret = values + return " ".join(ret) + +def all_multilib_tune_list(vars, d): + """ + Return a list of ${VAR} for each variable VAR in vars from each + multilib tune configuration. + Is safe to be called from a multilib recipe/context as it can + figure out the original tune and remove the multilib overrides. + """ + values = {} + for v in vars: + values[v] = [] + values['ml'] = [''] + + variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + [''] + for item in variants: + localdata = oe.utils.get_multilib_datastore(item, d) + values[v].append(localdata.getVar(v)) + values['ml'].append(item) + return values + +def extend_variants(d, var, extend, delim=':'): + """Return a string of all bb class extend variants for the given extend""" + variants = [] + whole = d.getVar(var) or "" + for ext in whole.split(): + eext = ext.split(delim) + if len(eext) > 1 and eext[0] == extend: + variants.append(eext[1]) + return " ".join(variants) + +def multilib_pkg_extend(d, pkg): + variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + if not variants: + return pkg + pkgs = pkg + for v in variants: + pkgs = pkgs + " " + v + "-" + pkg + return pkgs + diff --git a/meta/recipes-core/glibc/glibc-ld.inc b/meta/recipes-core/glibc/glibc-ld.inc index da8fcc430b1..0fb8d090bc2 100644 --- a/meta/recipes-core/glibc/glibc-ld.inc +++ b/meta/recipes-core/glibc/glibc-ld.inc @@ -5,7 +5,7 @@ GLIBC_GETLOADER = "${@get_linuxloader(d)}" def glibc_dl_info(d): infos = {'ldconfig':set(), 'lddrewrite':set()} - loaders = all_multilib_tune_values(d, "GLIBC_GETLOADER").split() + loaders = oe.utils.all_multilib_tune_values(d, "GLIBC_GETLOADER").split() for loader in loaders: infos['ldconfig'].add('{"' + loader + '",' + "FLAG_ELF_LIBC6" + ' }') infos['lddrewrite'].add(loader) diff --git a/meta/recipes-core/meta/dummy-sdk-package.inc b/meta/recipes-core/meta/dummy-sdk-package.inc index 60dfe9f73bb..d2781a64643 100644 --- a/meta/recipes-core/meta/dummy-sdk-package.inc +++ b/meta/recipes-core/meta/dummy-sdk-package.inc @@ -24,7 +24,7 @@ PR[vardeps] += "DUMMYPROVIDES" PR[vardeps] += "DUMMYPROVIDES_PACKAGES" DUMMYPROVIDES_PACKAGES ??= "" -DUMMYPROVIDES_PACKAGES_MULTILIB = "${@' '.join([multilib_pkg_extend(d, pkg) for pkg in d.getVar('DUMMYPROVIDES_PACKAGES').split()])}" +DUMMYPROVIDES_PACKAGES_MULTILIB = "${@' '.join([oe.utils.multilib_pkg_extend(d, pkg) for pkg in d.getVar('DUMMYPROVIDES_PACKAGES').split()])}" DUMMYPROVIDES += "${DUMMYPROVIDES_PACKAGES_MULTILIB}" python populate_packages:prepend() { diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb index e2590993130..f8140612817 100644 --- a/meta/recipes-core/meta/meta-environment.bb +++ b/meta/recipes-core/meta/meta-environment.bb @@ -21,7 +21,7 @@ inherit cross-canadian do_generate_content[cleandirs] = "${SDK_OUTPUT}" do_generate_content[dirs] = "${SDK_OUTPUT}/${SDKPATH}" # Need to ensure we have the virtual mappings and site files for all multtilib variants -do_generate_content[depends] = "${@oe.utils.build_depends_string(all_multilib_tune_values(d, 'TOOLCHAIN_NEED_CONFIGSITE_CACHE'), 'do_populate_sysroot')}" +do_generate_content[depends] = "${@oe.utils.build_depends_string(oe.utils.all_multilib_tune_values(d, 'TOOLCHAIN_NEED_CONFIGSITE_CACHE'), 'do_populate_sysroot')}" python do_generate_content() { # Handle multilibs in the SDK environment, siteconfig, etc files... localdata = bb.data.createCopy(d) diff --git a/meta/recipes-core/meta/meta-go-toolchain.bb b/meta/recipes-core/meta/meta-go-toolchain.bb index 758963d1e58..cb2b11bb1eb 100644 --- a/meta/recipes-core/meta/meta-go-toolchain.bb +++ b/meta/recipes-core/meta/meta-go-toolchain.bb @@ -8,7 +8,7 @@ TOOLCHAIN_HOST_TASK:append = " \ " TOOLCHAIN_TARGET_TASK:append = " \ - ${@multilib_pkg_extend(d, 'packagegroup-go-sdk-target')} \ + ${@oe.utils.multilib_pkg_extend(d, 'packagegroup-go-sdk-target')} \ " # rv32/ppc32 do not support go COMPATIBLE_HOST:riscv32 = "null" diff --git a/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb index 49c075eb116..4b0499b1b97 100644 --- a/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb +++ b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb @@ -11,9 +11,9 @@ GCC = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}" GDB = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}" RDEPENDS:${PN} = "\ - ${@all_multilib_tune_values(d, 'BINUTILS')} \ - ${@all_multilib_tune_values(d, 'GCC')} \ - ${@all_multilib_tune_values(d, 'GDB')} \ + ${@oe.utils.all_multilib_tune_values(d, 'BINUTILS')} \ + ${@oe.utils.all_multilib_tune_values(d, 'GCC')} \ + ${@oe.utils.all_multilib_tune_values(d, 'GDB')} \ meta-environment-${MACHINE} \ " diff --git a/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb index d0596efe7a7..56c2a73f467 100644 --- a/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb +++ b/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb @@ -8,5 +8,5 @@ PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1" GO = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}" RDEPENDS:${PN} = " \ - ${@all_multilib_tune_values(d, 'GO')} \ + ${@oe.utils.all_multilib_tune_values(d, 'GO')} \ " diff --git a/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb index 7e220d2cce6..c73c8d33335 100644 --- a/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb +++ b/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb @@ -8,7 +8,7 @@ PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1" RUST = "rust-cross-canadian-${TRANSLATED_TARGET_ARCH}" RDEPENDS:${PN} = " \ - ${@all_multilib_tune_values(d, 'RUST')} \ + ${@oe.utils.all_multilib_tune_values(d, 'RUST')} \ nativesdk-binutils \ nativesdk-gcc \ nativesdk-glibc-dev \ From patchwork Sun Aug 2 10:28:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94214 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 5993CC55162 for ; Sun, 2 Aug 2026 10:29:38 +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.msgproc01-g2.21193.1785666569067426774 for ; Sun, 02 Aug 2026 03:29:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=KUwFZ57i; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.50, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-493f6de72faso7611465e9.0 for ; Sun, 02 Aug 2026 03:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666567; x=1786271367; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=ddYAr0LOj2W9ONC7hzoRsfgaSXp54yAhpBxkz7JtHW8=; b=KUwFZ57iOq6dl3jb/EGsEeub43EINjeUI4mb1DWAaZrmyXCPsALc0DHXmeMGHYRMFy kj89z6IG9JsWqZOoIFtefYDj5dXD8shwRb+P4y+yD+R9Zsff2n5/mdQ7sY82D3XU+k0J 0nsuEPWbDVfaQdlzygJRJSn/fMNauZWCjYfdA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666567; x=1786271367; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=ddYAr0LOj2W9ONC7hzoRsfgaSXp54yAhpBxkz7JtHW8=; b=EqWFBUKxjagLK5nbLgIBGRXH/UaGU587dPhbNTBUYicVjWrg3KwfXotoCK1mjzVgwo T+QymPv7yMWsQ25tbFklRjtezcoJUj8Vte73fyF1QeqL2X8oA/i5+EY7d591b4wIQEC+ sm3T6/5/ZwYK6yIqfsyAqOpK6uBuVFr1sn9eTvt3EPW2qakyQWC10PKVdQfpwE8qvS2x Y6I/01StbyWG1CfrGKejLLwMGldEcLJKZwm6PSa8fByzRxTFF/ha8b7A7i3EbtdUNvpX d1F094DYmgm00xL4TceikkGES2WCmcmCott1SUYmUnn71igucZYlDKI8xNBIYbjzE6zq 2LqA== X-Gm-Message-State: AOJu0Yz5EfblPG82ejNvbvYEwgudn25/UgJV5e+gh2lHD5Yzh32aIbcv a45TnG+xRsJNRP770KBRbfbhHtEa8Mne3P4R5FST1j0DbYFzrV1CHRZQMqxUhA4L5qceXnB04uP Xby1dsRM= X-Gm-Gg: AR+sD10uKtmJAuz0PIbIr4yowJ5PEUEq3nFXzBr829jDRCNsKlF+tnRdwNuOnLU5ROh TRs4LXS3exgtDUcA4mqvrNvPYQnxeWVYikI8KuDLBMcBklenXtNLAtu/0VvpoXSh31lC12wtR+R p469UUO1yto5MgXzNiUZMqjFEUyQ5E5u3U3adJimghIVJ0N6gflxlkxF8enKH5UGVvw5BCPQ7LB o0E7YhhFEHUNpFE1z/rtUxbqzQmScrlpgHZwY1ELCyrb+80z5CaibvG0N+WKyj+sRObgaiWE5gT WRD4xlt+pdNhK85IqGtzlszPg4Ne09cLJcJKQO25q2r7xA6iE4zU+C6MLGMsmQTknsKvalk/fsh zNtOD5hFTUYTtSyg/fCGI476qJoVjKjy20KNw/R9arWHrLeFNUEzb+Fpeh25QcAK0NWlcghUh5O LJ9VoUMLFA+8DBLuKpFmVxxLTDB6qN/IymJ49LXcrMtK/8d8bKrb22tgwy/IGtxXn2waIhWzpD9 SDcp7Ml5X3gcqo/qEF7nouNR55SXA== X-Received: by 2002:a05:600c:6298:b0:497:ff5a:38b9 with SMTP id 5b1f17b1804b1-4980ebc216amr105888735e9.9.1785666567052; Sun, 02 Aug 2026 03:29:27 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:25 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 23/25] lib/oe/lsb: Merge distro_identifier functions Date: Sun, 2 Aug 2026 11:28:52 +0100 Message-ID: <20260802102854.3952760-24-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:38 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242548 In order to access LSB_DISTRO_ADJUST fuctions, a portion of the lsb distro_indetifier code was left in base.bbclass. There is a way to handle this so merge the code into one function and use it from all call sites. This makes the code slightly less of a maze. Signed-off-by: Richard Purdie --- meta/classes-global/base.bbclass | 12 +----------- meta/classes-global/sanity.bbclass | 8 ++++---- meta/classes-recipe/testimage.bbclass | 2 +- meta/classes/report-error.bbclass | 2 +- meta/lib/oe/lsb.py | 10 +++++++++- meta/lib/oeqa/sdk/testsdk.py | 2 +- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 8b4abe8f1e2..5177179d572 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -35,16 +35,6 @@ TOOLCHAIN_NATIVE ??= "${PREFERRED_TOOLCHAIN_NATIVE}" inherit_defer toolchain/${TOOLCHAIN_NATIVE}-native inherit_defer toolchain/${TOOLCHAIN} -def lsb_distro_identifier(d): - adjust = d.getVar('LSB_DISTRO_ADJUST') - adjust_func = None - if adjust: - try: - adjust_func = globals()[adjust] - except KeyError: - pass - return oe.lsb.distro_identifier(adjust_func) - die() { bbfatal_log "$*" } @@ -313,7 +303,7 @@ python base_eventhandler() { if isinstance(e, bb.event.ConfigParsed): if not d.getVar("NATIVELSBSTRING", False): - d.setVar("NATIVELSBSTRING", lsb_distro_identifier(d)) + d.setVar("NATIVELSBSTRING", oe.lsb.distro_identifier(d)) d.setVar("ORIGNATIVELSBSTRING", d.getVar("NATIVELSBSTRING", False)) d.setVar('BB_VERSION', bb.__version__) diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass index 91c22599bfe..71cedea62c0 100644 --- a/meta/classes-global/sanity.bbclass +++ b/meta/classes-global/sanity.bbclass @@ -382,7 +382,7 @@ def check_supported_distro(sanity_data): return try: - distro = oe.lsb.distro_identifier() + distro = oe.lsb.distro_identifier(sanity_data) except Exception: distro = None @@ -463,7 +463,7 @@ def check_make_version(sanity_data): return "Please install a make version of %s or later.\n" % make_minimum_version if bb.utils.vercmp_string_op(version, "4.2.1", "=="): - distro = oe.lsb.distro_identifier() + distro = oe.lsb.distro_identifier(sanity_data) if "ubuntu" in distro or "debian" in distro or "linuxmint" in distro: return None return "make version 4.2.1 is known to have issues on Centos/OpenSUSE and other non-Ubuntu systems. Please use a buildtools-make-tarball or a newer version of make.\n" @@ -552,7 +552,7 @@ def check_tar_version(sanity_data): return "Unable to execute tar --help, exit code %d\n%s\n" % (e.returncode, e.output) try: - distro = oe.lsb.distro_identifier() + distro = oe.lsb.distro_identifier(sanity_data) except Exception: distro = None @@ -1161,7 +1161,7 @@ def check_sanity(sanity_data): network_error = False # NATIVELSBSTRING var may have been overridden with "universal", so # get actual host distribution id and version - nativelsbstr = lsb_distro_identifier(sanity_data) + nativelsbstr = oe.lsb.distro_identifier(sanity_data) if last_sanity_version < sanity_version or last_nativelsbstr != nativelsbstr: check_sanity_version_change(status, sanity_data) status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data)) diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass index 5f0ec0b3a05..419ad6dcb02 100644 --- a/meta/classes-recipe/testimage.bbclass +++ b/meta/classes-recipe/testimage.bbclass @@ -160,7 +160,7 @@ def get_testimage_configuration(d, test_type, machine): 'IMAGE_PKGTYPE': d.getVar("IMAGE_PKGTYPE"), 'STARTTIME': d.getVar("DATETIME"), 'TCLIBC': d.getVar("TCLIBC"), - 'HOST_DISTRO': oe.lsb.distro_identifier().replace(' ', '-'), + 'HOST_DISTRO': oe.lsb.distro_identifier(d).replace(' ', '-'), 'LAYERS': get_layers(d.getVar("BBLAYERS"))} return configuration get_testimage_configuration[vardepsexclude] = "DATETIME" diff --git a/meta/classes/report-error.bbclass b/meta/classes/report-error.bbclass index ad31ac25833..6989738fadd 100644 --- a/meta/classes/report-error.bbclass +++ b/meta/classes/report-error.bbclass @@ -60,7 +60,7 @@ python errorreport_handler () { nativelsbstr = e.data.getVar("NATIVELSBSTRING") # provide a bit more host info in case of uninative build if e.data.getVar('UNINATIVE_URL') != 'unset': - return '/'.join([nativelsbstr, lsb_distro_identifier(e.data)]) + return '/'.join([nativelsbstr, oe.lsb.distro_identifier(e.data)]) return nativelsbstr logpath = e.data.getVar('ERR_REPORT_DIR') diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py index 650fb0572d0..1dfc19be333 100644 --- a/meta/lib/oe/lsb.py +++ b/meta/lib/oe/lsb.py @@ -18,7 +18,7 @@ def get_os_release(): data[key.strip()] = val.strip('"\'') return data -def distro_identifier(adjust_hook=None): +def distro_identifier(d=None): """Return a distro identifier string based upon /etc/os-release with optional adjustment via a hook""" @@ -28,6 +28,14 @@ def distro_identifier(adjust_hook=None): distro_id = distro_data.get('ID') release = distro_data.get('VERSION_ID') + adjust_hook = None + if d: + adjust = d.getVar('LSB_DISTRO_ADJUST') + if adjust: + try: + adjust_hook = bb.utils.get_context()[adjust] + except KeyError: + pass if adjust_hook: distro_id, release = adjust_hook(distro_id, release) diff --git a/meta/lib/oeqa/sdk/testsdk.py b/meta/lib/oeqa/sdk/testsdk.py index 98ef9c71cd6..7b0765f2726 100644 --- a/meta/lib/oeqa/sdk/testsdk.py +++ b/meta/lib/oeqa/sdk/testsdk.py @@ -18,7 +18,7 @@ class TestSDKBase(object): 'IMAGE_BASENAME': d.getVar("IMAGE_BASENAME"), 'IMAGE_PKGTYPE': d.getVar("IMAGE_PKGTYPE"), 'STARTTIME': d.getVar("DATETIME"), - 'HOST_DISTRO': oe.lsb.distro_identifier().replace(' ', '-'), + 'HOST_DISTRO': oe.lsb.distro_identifier(d).replace(' ', '-'), 'LAYERS': get_layers(d.getVar("BBLAYERS"))} return configuration From patchwork Sun Aug 2 10:28:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94215 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 380C3C55171 for ; Sun, 2 Aug 2026 10:29:38 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.21347.1785666573412911363 for ; Sun, 02 Aug 2026 03:29:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=fd60X3mC; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.51, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4954a2e73a9so6915705e9.3 for ; Sun, 02 Aug 2026 03:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666572; x=1786271372; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=IxDlJ7XHAIVCJTXiu+y/eTsqjEmRdQuzHrjFevERgzE=; b=fd60X3mCnyKS0ZD6O99tkm5xBtDNeRy0IplY+vfS/ZmLjJqjTGfoJzpRiLSbj2p2Hk iZncug4OWZqq/8++7e/jeYfzoPNpvXx71eiN9pPJ+Qfc6iRLVdFyRVDUN8UyvryC1BPo J+o3UT2fT03nO+J02zX0aU6QQQmhH2KHMVdsg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666572; x=1786271372; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=IxDlJ7XHAIVCJTXiu+y/eTsqjEmRdQuzHrjFevERgzE=; b=A5spAxnCQ6f273VCvwbWV3siVnldFI7pVSkOnoUnoEkyohVjNsUannoPPSORYjQCD7 VgzaZXvVDw6ebdd0WrZTE5OMfQ8EsL8q0WtMfBG3136kj+tez/4LkLjvfaNCYVkwjnzX bTwwGtgeyQX5lehHfh7MS2YQj0GFHO2QRoPPkxy/6Yk4KrR/AHzqiX8DFMwPe7wKvXao o3IJ4mB2MpNKtJE+eNRUkHbw1CcBiWyjCQX6AzaOaiOXH38Teo64+mRGsV4H1eTz5emK 8nuqCEvLThh89vzrrEZuP0ldxhScaAhJ4OiHiu/Mr10UWU0oILyz2eoCHx1PZbbIojT6 rCJA== X-Gm-Message-State: AOJu0YzDvI36FflVzExNJVoAcaU6nWyINRZSMiJ+jVf0UK5yTaslIeYB j/rTsYIPkNf8kQik1D4ncBe6gNvAMSTo6DkraTDWp1BJZA1DNWro7jbpA7Y7nZO2jrTEKlTVXhE solyVhEg= X-Gm-Gg: AR+sD12I7rKnz2nxUwNiJg0n53E8VT+UcXOe+rEfQziqZotqkjcf85AMbev8CZA/sA0 9j1P06Squjz2XLxFeEX1xezQ0UNRccH9xwEIpXs781BTQ7M8zxVWHLp5Cx2Ykg4ngPDuib2kwKD H5gKg+0K1uJ9q3lADGUJi4WSI2GIs2ojbnYISjGduUtKzlshsQ3eG88OhsUPNcT+Mie7p5XlMJ6 E6WXkCS4AeoAFPCjyUmwax8g4aTkozxRfmEoBJSwjYdX+j3qogOwj5PppG2hVCxZxmZW94gIjO/ +R5Ftoum38UyqY5jclH6ZLhOJYM5cPvIh75oePurbFS5f1El8At8yCYn2RHxCuLvJgNWRVOmuTa UenpHTXQNhyP8iSvF0EcN2Z7PrU3VLjH1SEf0oAlbkbYVt3ih5oBT6LXGaeBdZKvKA0kyS4clHq gHyOil3fpalSvWHV6E6qvcazVTAHiBSJDg6Pg3l4fiuIZdNl9AWUHxn/gB44a6eRKB11sMlJpl7 EQUTHlnqAOR6a2KnA== X-Received: by 2002:a05:600c:5914:b0:495:5cda:52ec with SMTP id 5b1f17b1804b1-4980c662d03mr101049565e9.16.1785666569761; Sun, 02 Aug 2026 03:29:29 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:27 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 24/25] sanity: Move code to lib/oe Date: Sun, 2 Aug 2026 11:28:53 +0100 Message-ID: <20260802102854.3952760-25-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:38 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242550 Most of sanity.bbclass is a set of python functions. Move these to lib/oe/sanity.py Signed-off-by: Richard Purdie --- meta/classes-global/sanity.bbclass | 1048 +----------------------- meta/classes/sign_ipk.bbclass | 4 +- meta/classes/sign_package_feed.bbclass | 4 +- meta/classes/sign_rpm.bbclass | 6 +- meta/lib/oe/__init__.py | 2 +- meta/lib/oe/sanity.py | 1032 +++++++++++++++++++++++ 6 files changed, 1052 insertions(+), 1044 deletions(-) create mode 100644 meta/lib/oe/sanity.py diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass index 71cedea62c0..af9e2c3ef1a 100644 --- a/meta/classes-global/sanity.bbclass +++ b/meta/classes-global/sanity.bbclass @@ -11,26 +11,6 @@ SANITY_REQUIRED_UTILITIES ?= "patch diffstat git bzip2 tar \ gzip gawk chrpath wget cpio perl file which" -def bblayers_conf_file(d): - return os.path.join(d.getVar('TOPDIR'), 'conf/bblayers.conf') - -def sanity_conf_read(fn): - with open(fn, 'r') as f: - lines = f.readlines() - return lines - -def sanity_conf_find_line(pattern, lines): - import re - return next(((index, line) - for index, line in enumerate(lines) - if re.search(pattern, line)), (None, None)) - -def sanity_conf_update(fn, lines, version_var_name, new_version): - index, line = sanity_conf_find_line(r"^%s" % version_var_name, lines) - lines[index] = '%s = "%d"\n' % (version_var_name, new_version) - with open(fn, "w") as f: - f.write(''.join(lines)) - # Functions added to this variable MUST throw a NotImplementedError exception unless # they successfully changed the config version in the config file. Exceptions # are used since exec_func doesn't handle return values. @@ -104,12 +84,12 @@ is a good way to visualise the changes.""" if current_lconf < 4: raise NotImplementedError(failmsg) - bblayers_fn = bblayers_conf_file(d) - lines = sanity_conf_read(bblayers_fn) + bblayers_fn = oe.sanity.bblayers_conf_file(d) + lines = oe.sanity.sanity_conf_read(bblayers_fn) if current_lconf == 4 and lconf_version > 4: topdir_var = '$' + '{TOPDIR}' - index, bbpath_line = sanity_conf_find_line('BBPATH', lines) + index, bbpath_line = oe.sanity.sanity_conf_find_line('BBPATH', lines) if bbpath_line: start = bbpath_line.find('"') if start != -1 and (len(bbpath_line) != (start + 1)): @@ -123,21 +103,21 @@ is a good way to visualise the changes.""" else: raise NotImplementedError(failmsg) else: - index, bbfiles_line = sanity_conf_find_line('BBFILES', lines) + index, bbfiles_line = oe.sanity.sanity_conf_find_line('BBFILES', lines) if bbfiles_line: lines.insert(index, 'BBPATH = "' + topdir_var + '"\n') else: raise NotImplementedError(failmsg) current_lconf += 1 - sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) + oe.sanity.sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) bb.note("Your conf/bblayers.conf has been automatically updated.") return elif current_lconf == 5 and lconf_version > 5: # Null update, to avoid issues with people switching between poky and other distros current_lconf = 6 - sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) + oe.sanity.sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) bb.note("Your conf/bblayers.conf has been automatically updated.") return @@ -152,7 +132,7 @@ is a good way to visualise the changes.""" if 'meta-yocto' in layers: found = False while True: - index, meta_yocto_line = sanity_conf_find_line(r'.*meta-yocto[\'"\s\n]', lines) + index, meta_yocto_line = oe.sanity.sanity_conf_find_line(r'.*meta-yocto[\'"\s\n]', lines) if meta_yocto_line: lines[index] = meta_yocto_line.replace('meta-yocto', 'meta-poky') found = True @@ -160,7 +140,7 @@ is a good way to visualise the changes.""" break if not found: raise NotImplementedError(failmsg) - index, meta_yocto_line = sanity_conf_find_line('LCONF_VERSION.*\n', lines) + index, meta_yocto_line = oe.sanity.sanity_conf_find_line('LCONF_VERSION.*\n', lines) if meta_yocto_line: lines[index] = 'POKY_BBLAYERS_CONF_VERSION = "1"\n' else: @@ -170,1021 +150,17 @@ is a good way to visualise the changes.""" bb.note("Your conf/bblayers.conf has been automatically updated.") return current_lconf += 1 - sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) + oe.sanity.sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) bb.note("Your conf/bblayers.conf has been automatically updated.") return raise NotImplementedError(failmsg) } -def raise_sanity_error(msg, d, network_error=False): - if d.getVar("SANITY_USE_EVENTS") == "1": - try: - bb.event.fire(bb.event.SanityCheckFailed(msg, network_error), d) - except TypeError: - bb.event.fire(bb.event.SanityCheckFailed(msg), d) - return - - bb.fatal(""" OE-core's config sanity checker detected a potential misconfiguration. - Either fix the cause of this error or at your own risk disable the checker (see sanity.conf). - Following is the list of potential problems / advisories: - - %s""" % msg) - -# Check a single tune for validity. -def check_toolchain_tune(data, tune, multilib): - tune_errors = [] - if not tune: - return "No tuning found for %s multilib." % multilib - localdata = bb.data.createCopy(data) - if multilib != "default": - # Apply the overrides so we can look at the details. - overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + multilib - localdata.setVar("OVERRIDES", overrides) - bb.debug(2, "Sanity-checking tuning '%s' (%s) features:" % (tune, multilib)) - features = (localdata.getVar("TUNE_FEATURES:tune-%s" % tune) or "").split() - if not features: - return "Tuning '%s' has no defined features, and cannot be used." % tune - valid_tunes = localdata.getVarFlags('TUNEVALID') or {} - conflicts = localdata.getVarFlags('TUNECONFLICTS') or {} - # [doc] is the documentation for the variable, not a real feature - if 'doc' in valid_tunes: - del valid_tunes['doc'] - if 'doc' in conflicts: - del conflicts['doc'] - for feature in features: - if feature in conflicts: - for conflict in conflicts[feature].split(): - if conflict in features: - tune_errors.append("Feature '%s' conflicts with '%s'." % - (feature, conflict)) - if feature in valid_tunes: - bb.debug(2, " %s: %s" % (feature, valid_tunes[feature])) - else: - tune_errors.append("Feature '%s' is not defined." % feature) - if tune_errors: - return "Tuning '%s' has the following errors:\n" % tune + '\n'.join(tune_errors) - -def check_toolchain(data): - tune_error_set = [] - deftune = data.getVar("DEFAULTTUNE") - tune_errors = check_toolchain_tune(data, deftune, 'default') - if tune_errors: - tune_error_set.append(tune_errors) - - multilibs = (data.getVar("MULTILIB_VARIANTS") or "").split() - global_multilibs = (data.getVar("MULTILIB_GLOBAL_VARIANTS") or "").split() - - if multilibs: - seen_libs = [] - seen_tunes = [] - for lib in multilibs: - if lib in seen_libs: - tune_error_set.append("The multilib '%s' appears more than once." % lib) - else: - seen_libs.append(lib) - if not lib in global_multilibs: - tune_error_set.append("Multilib %s is not present in MULTILIB_GLOBAL_VARIANTS" % lib) - tune = data.getVar("DEFAULTTUNE:virtclass-multilib-%s" % lib) - if tune in seen_tunes: - tune_error_set.append("The tuning '%s' appears in more than one multilib." % tune) - else: - seen_libs.append(tune) - if tune == deftune: - tune_error_set.append("Multilib '%s' (%s) is also the default tuning." % (lib, deftune)) - else: - tune_errors = check_toolchain_tune(data, tune, lib) - if tune_errors: - tune_error_set.append(tune_errors) - if tune_error_set: - return "Toolchain tunings invalid:\n" + '\n'.join(tune_error_set) + "\n" - - return "" - -def check_conf_exists(fn, data): - bbpath = [] - fn = data.expand(fn) - vbbpath = data.getVar("BBPATH", False) - if vbbpath: - bbpath += vbbpath.split(":") - for p in bbpath: - currname = os.path.join(data.expand(p), fn) - if os.access(currname, os.R_OK): - return True - return False - -def check_create_long_filename(filepath, pathname): - import string, random - testfile = os.path.join(filepath, ''.join(random.choice(string.ascii_letters) for x in range(200))) - try: - if not os.path.exists(filepath): - bb.utils.mkdirhier(filepath) - f = open(testfile, "w") - f.close() - os.remove(testfile) - except IOError as e: - import errno - err, strerror = e.args - if err == errno.ENAMETOOLONG: - return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname - else: - return "Failed to create a file in %s: %s.\n" % (pathname, strerror) - except OSError as e: - errno, strerror = e.args - return "Failed to create %s directory in which to run long name sanity check: %s.\n" % (pathname, strerror) - return "" - -def check_path_length(filepath, pathname, limit): - if len(filepath) > limit: - return "The length of %s is longer than %s, this would cause unexpected errors, please use a shorter path.\n" % (pathname, limit) - return "" - -def check_non_ascii(filepath, pathname): - if(not filepath.isascii()): - return "Non-ASCII character(s) in %s path (\"%s\") detected. This would cause build failures as we build software that doesn't support this.\n" % (pathname, filepath) - return "" - -def get_filesystem_id(path): - import subprocess - try: - return subprocess.check_output(["stat", "-f", "-c", "%t", path]).decode('utf-8').strip() - except subprocess.CalledProcessError: - bb.warn("Can't get filesystem id of: %s" % path) - return None - -# Check that the path isn't located on nfs. -def check_not_nfs(path, name): - # The nfs' filesystem id is 6969 - if get_filesystem_id(path) == "6969": - return "The %s: %s can't be located on nfs.\n" % (name, path) - return "" - -# Check that the path is on a case-sensitive file system -def check_case_sensitive(path, name): - import tempfile - with tempfile.NamedTemporaryFile(prefix='TmP', dir=path) as tmp_file: - if os.path.exists(tmp_file.name.lower()): - return "The %s (%s) can't be on a case-insensitive file system.\n" % (name, path) - return "" - -# Check that path isn't a broken symlink -def check_symlink(lnk, data): - if os.path.islink(lnk) and not os.path.exists(lnk): - raise_sanity_error("%s is a broken symlink." % lnk, data) - -def check_connectivity(d): - # URI's to check can be set in the CONNECTIVITY_CHECK_URIS variable - # using the same syntax as for SRC_URI. If the variable is not set - # the check is skipped - test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS') or "").split() - retval = "" - - bbn = d.getVar('BB_NO_NETWORK') - if bbn not in (None, '0', '1'): - return 'BB_NO_NETWORK should be "0" or "1", but it is "%s"' % bbn - - # Only check connectivity if network enabled and the - # CONNECTIVITY_CHECK_URIS are set - network_enabled = not (bbn == '1') - check_enabled = len(test_uris) - if check_enabled and network_enabled: - # Take a copy of the data store and unset MIRRORS and PREMIRRORS - data = bb.data.createCopy(d) - data.delVar('PREMIRRORS') - data.delVar('MIRRORS') - try: - fetcher = bb.fetch2.Fetch(test_uris, data) - fetcher.checkstatus() - except Exception as err: - # Allow the message to be configured so that users can be - # pointed to a support mechanism. - msg = data.getVar('CONNECTIVITY_CHECK_MSG') or "" - if len(msg) == 0: - msg = "%s.\n" % err - msg += " Please ensure your host's network is configured correctly.\n" - msg += " Please ensure CONNECTIVITY_CHECK_URIS is correct and specified URIs are available.\n" - msg += " If your ISP or network is blocking the above URL,\n" - msg += " try with another domain name, for example by setting:\n" - msg += " CONNECTIVITY_CHECK_URIS = \"https://www.example.com/\"" - msg += " You could also set BB_NO_NETWORK = \"1\" to disable network\n" - msg += " access if all required sources are on local disk.\n" - else: - msg = "%s.\n%s" % (err, msg) - retval = msg - - return retval - -def check_supported_distro(sanity_data): - from fnmatch import fnmatch - - tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS') - if not tested_distros: - return - - try: - distro = oe.lsb.distro_identifier(sanity_data) - except Exception: - distro = None - - if not distro: - bb.warn('Host distribution could not be determined; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.') - - for supported in [x.strip() for x in tested_distros.split('\\n')]: - if fnmatch(distro, supported): - return - - bb.warn('Host distribution "%s" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.' % distro) - -# Checks we should only make if MACHINE is set correctly -def check_sanity_validmachine(sanity_data): - messages = "" - - # Check TUNE_ARCH is set - if sanity_data.getVar('TUNE_ARCH') == 'INVALID': - messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n' - - # Check TARGET_OS is set - if sanity_data.getVar('TARGET_OS') == 'INVALID': - messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n' - - # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS - pkgarchs = sanity_data.getVar('PACKAGE_ARCHS') - tunepkg = sanity_data.getVar('TUNE_PKGARCH') - defaulttune = sanity_data.getVar('DEFAULTTUNE') - tunefound = False - seen = {} - dups = [] - - for pa in pkgarchs.split(): - if seen.get(pa, 0) == 1: - dups.append(pa) - else: - seen[pa] = 1 - if pa == tunepkg: - tunefound = True - - if len(dups): - messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups) - - if tunefound == False: - messages = messages + "Error, the PACKAGE_ARCHS variable (%s) for DEFAULTTUNE (%s) does not contain TUNE_PKGARCH (%s)." % (pkgarchs, defaulttune, tunepkg) - - return messages - -# Patch before 2.7 can't handle all the features in git-style diffs. Some -# patches may incorrectly apply, and others won't apply at all. -def check_patch_version(sanity_data): - import re, subprocess - - patch_minimum_version = "2.7" - - try: - result = subprocess.check_output(["patch", "--version"], stderr=subprocess.STDOUT).decode('utf-8') - version = re.search(r"[0-9.]+", result.splitlines()[0]).group() - if bb.utils.vercmp_string_op(version, patch_minimum_version, "<"): - return ("Your version of patch is older than %s and has bugs which will break builds. " - "Please install a newer version of patch.\n" % patch_minimum_version) - else: - return None - except subprocess.CalledProcessError as e: - return "Unable to execute patch --version, exit code %d:\n%s\n" % (e.returncode, e.output) - -# Glibc needs make 4.0 or later, we may as well match at this point -def check_make_version(sanity_data): - make_minimum_version = "4.0" - import subprocess - - try: - result = subprocess.check_output(['make', '--version'], stderr=subprocess.STDOUT).decode('utf-8') - except subprocess.CalledProcessError as e: - return "Unable to execute make --version, exit code %d\n%s\n" % (e.returncode, e.output) - version = result.split()[2] - if bb.utils.vercmp_string_op(version, make_minimum_version, "<"): - return "Please install a make version of %s or later.\n" % make_minimum_version - - if bb.utils.vercmp_string_op(version, "4.2.1", "=="): - distro = oe.lsb.distro_identifier(sanity_data) - if "ubuntu" in distro or "debian" in distro or "linuxmint" in distro: - return None - return "make version 4.2.1 is known to have issues on Centos/OpenSUSE and other non-Ubuntu systems. Please use a buildtools-make-tarball or a newer version of make.\n" - return None - - -# Check if we're running on WSL (Windows Subsystem for Linux). -# WSLv1 is known not to work but WSLv2 should work properly as -# long as the VHDX file is optimized often, let the user know -# upfront. -# More information on installing WSLv2 at: -# https://docs.microsoft.com/en-us/windows/wsl/wsl2-install -def check_wsl(d): - with open("/proc/version", "r") as f: - verdata = f.readlines() - for l in verdata: - if "Microsoft" in l: - return "OpenEmbedded doesn't work under WSLv1, please upgrade to WSLv2 if you want to run builds on Windows" - elif "microsoft" in l: - bb.warn("You are running bitbake under WSLv2, this works properly but you should optimize your VHDX file eventually to avoid running out of storage space") - return None - -def check_userns(): - """ - Check that user namespaces are functional, as they're used for network isolation. - """ - - # There is a known failure case with AppAmrmor where the unshare() call - # succeeds (at which point the uid is nobody) but writing to the uid_map - # fails (so the uid isn't reset back to the user's uid). We can detect this. - parentuid = os.getuid() - if not bb.utils.is_local_uid(parentuid): - return None - pid = os.fork() - if not pid: - try: - bb.utils.disable_network() - except: - pass - os._exit(parentuid != os.getuid()) - - ret = os.waitpid(pid, 0)[1] - if ret: - bb.fatal("User namespaces are not usable by BitBake, possibly due to AppArmor.\n" - "See https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#unprivileged-user-namespace-restrictions for more information.") - - -# Require at least gcc version 10.1 -# -# A less invasive fix is with scripts/install-buildtools (or with user -# built buildtools-extended-tarball) -# -def check_gcc_version(sanity_data): - gcc_minimum_version = "10.1" - version = oe.utils.get_host_gcc_version(sanity_data) - if bb.utils.vercmp_string_op(version, gcc_minimum_version, "<"): - return ("Your version of gcc is older than %s and will break builds. Please install a newer " - "version of gcc (you could use the project's buildtools-extended-tarball or use " - "scripts/install-buildtools).\n" % gcc_minimum_version) - return None - -# Tar version 1.24 and onwards handle overwriting symlinks correctly -# but earlier versions do not; this needs to work properly for sstate -# Version 1.28 is needed so opkg-build works correctly when reproducible builds are enabled -# Gtar is assumed at to be used as tar in poky -def check_tar_version(sanity_data): - tar_minimum_version = "1.28" - import subprocess - try: - result = subprocess.check_output(["tar", "--version"], stderr=subprocess.STDOUT).decode('utf-8') - except subprocess.CalledProcessError as e: - return "Unable to execute tar --version, exit code %d\n%s\n" % (e.returncode, e.output) - if not "GNU" in result: - return "Your version of tar is not gtar. Please install gtar (you could use the project's buildtools-tarball from our last release or use scripts/install-buildtools).\n" - version = result.split()[3] - if bb.utils.vercmp_string_op(version, tar_minimum_version, "<"): - return ("Your version of tar is older than %s and does not have the support needed to enable reproducible " - "builds. Please install a newer version of tar (you could use the project's buildtools-tarball from " - "our last release or use scripts/install-buildtools).\n" % tar_minimum_version) - - try: - result = subprocess.check_output(["tar", "--help"], stderr=subprocess.STDOUT).decode('utf-8') - if "--xattrs" not in result: - return "Your tar doesn't support --xattrs, please use GNU tar.\n" - except subprocess.CalledProcessError as e: - return "Unable to execute tar --help, exit code %d\n%s\n" % (e.returncode, e.output) - - try: - distro = oe.lsb.distro_identifier(sanity_data) - except Exception: - distro = None - - if distro: - rhel9_alike_prefixes = ("rhel-9", "centos-9", "rocky-9", "almalinux-9") - rhel9_tar_minimum_version = "1.35" - for prefix in rhel9_alike_prefixes: - if distro.startswith(prefix) and bb.utils.vercmp_string_op(version, rhel9_tar_minimum_version, "<"): - return ("Your version of tar is older than %s and crashes when extracting read-only files with xattrs. " - "Your distro is %s which triggers this bug due to the presence of selinux attributes. " - "Please install a newer version of tar (you could use the project's buildtools-tarball from " - "our last release or use scripts/install-buildtools).\n" % (rhel9_tar_minimum_version, distro)) - - return None - -# We use git branch --show-current which was introduced in 2.22.0 -def check_git_version(sanity_data): - git_minimum_version = "2.22.0" - import subprocess - try: - result = subprocess.check_output(["git", "--version"], stderr=subprocess.DEVNULL).decode('utf-8') - except subprocess.CalledProcessError as e: - return "Unable to execute git --version, exit code %d\n%s\n" % (e.returncode, e.output) - version = result.split()[2] - if bb.utils.vercmp_string_op(version, git_minimum_version, "<"): - return ("Your version of git is older than %s and is missing functionality we use. " - "Please install a newer version of git.\n" % git_minimum_version) - return None - -# Check the required perl modules which may not be installed by default -def check_perl_modules(sanity_data): - import subprocess - ret = "" - modules = ( "Text::ParseWords", "Thread::Queue", "Data::Dumper", "File::Compare", "File::Copy", "open ':std'", "FindBin" ) - errresult = '' - for m in modules: - try: - subprocess.check_output(["perl", "-e", "use %s" % m]) - except subprocess.CalledProcessError as e: - errresult += bytes.decode(e.output) - ret += "%s " % m - if ret: - return "Required perl module(s) not found: %s\n\n%s\n" % (ret, errresult) - return None - -def sanity_check_conffiles(d): - funcs = d.getVar('BBLAYERS_CONF_UPDATE_FUNCS').split() - for func in funcs: - conffile, current_version, required_version, func = func.split(":") - if check_conf_exists(conffile, d) and d.getVar(current_version) is not None and \ - d.getVar(current_version) != d.getVar(required_version): - try: - bb.build.exec_func(func, d) - except NotImplementedError as e: - bb.fatal(str(e)) - d.setVar("BB_INVALIDCONF", True) - -def drop_v14_cross_builds(d): - import glob - indexes = glob.glob(d.expand("${SSTATE_MANIFESTS}/index-${BUILD_ARCH}_*")) - for i in indexes: - with open(i, "r") as f: - lines = f.readlines() - for l in reversed(lines): - try: - (stamp, manifest, workdir) = l.split() - except ValueError: - bb.fatal("Invalid line '%s' in sstate manifest '%s'" % (l, i)) - for m in glob.glob(manifest + ".*"): - if m.endswith(".postrm"): - continue - sstate_clean_manifest(m, d) - bb.utils.remove(stamp + "*") - bb.utils.remove(workdir, recurse = True) - -def check_cpp_toolchain_flag(d, flag, error_message=None): - """ - Checks if the g++ compiler supports the given flag - """ - import shlex - import subprocess - - cpp_code = """ - #include - int main() { - std::cout << "Hello, World!" << std::endl; - return 0; - } - """ - - cmd = ["g++", "-x", "c++","-", "-o", "/dev/null", flag] - try: - subprocess.run(cmd, input=cpp_code, capture_output=True, text=True, check=True) - return None - except subprocess.CalledProcessError as e: - return error_message or f"An unexpected issue occurred during the C++ toolchain check: {str(e)}" - -def sanity_handle_abichanges(status, d): - # - # Check the 'ABI' of TMPDIR - # - import subprocess - - current_abi = d.getVar('OELAYOUT_ABI') - abifile = d.getVar('SANITY_ABIFILE') - if os.path.exists(abifile): - with open(abifile, "r") as f: - abi = f.read().strip() - if not abi.isdigit(): - with open(abifile, "w") as f: - f.write(current_abi) - elif int(abi) <= 11 and current_abi == "12": - status.addresult("The layout of TMPDIR changed for Recipe Specific Sysroots.\nConversion doesn't make sense and this change will rebuild everything so please delete TMPDIR (%s).\n" % d.getVar("TMPDIR")) - elif int(abi) <= 13 and current_abi == "14": - status.addresult("TMPDIR changed to include path filtering from the pseudo database.\nIt is recommended to use a clean TMPDIR with the new pseudo path filtering so TMPDIR (%s) would need to be removed to continue.\n" % d.getVar("TMPDIR")) - elif int(abi) == 14 and current_abi == "15": - drop_v14_cross_builds(d) - with open(abifile, "w") as f: - f.write(current_abi) - elif (abi != current_abi): - # Code to convert from one ABI to another could go here if possible. - status.addresult("Error, TMPDIR has changed its layout version number (%s to %s) and you need to either rebuild, revert or adjust it at your own risk.\n" % (abi, current_abi)) - else: - with open(abifile, "w") as f: - f.write(current_abi) - -def check_sanity_sstate_dir_change(sstate_dir, data): - # Sanity checks to be done when the value of SSTATE_DIR changes - - # Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS) - testmsg = "" - if sstate_dir != "": - testmsg = check_create_long_filename(sstate_dir, "SSTATE_DIR") - # If we don't have permissions to SSTATE_DIR, suggest the user set it as an SSTATE_MIRRORS - try: - err = testmsg.split(': ')[1].strip() - if err == "Permission denied.": - testmsg = testmsg + "You could try using %s in SSTATE_MIRRORS rather than as an SSTATE_CACHE.\n" % (sstate_dir) - except IndexError: - pass - return testmsg - -def check_sanity_version_change(status, d): - import glob - - # Sanity checks to be done when SANITY_VERSION or NATIVELSBSTRING changes - # In other words, these tests run once in a given build directory and then - # never again until the sanity version or host distribution id/version changes. - - # Check the python install is complete. Examples that are often removed in - # minimal installations: glib-2.0-natives requires xml.parsers.expat - try: - import xml.parsers.expat - except ImportError as e: - status.addresult('Your Python 3 is not a full install. Please install the module %s (see the Getting Started guide for further information).\n' % e.name) - - status.addresult(check_gcc_version(d)) - status.addresult(check_make_version(d)) - status.addresult(check_patch_version(d)) - status.addresult(check_tar_version(d)) - status.addresult(check_git_version(d)) - status.addresult(check_perl_modules(d)) - status.addresult(check_wsl(d)) - status.addresult(check_userns()) - - missing = "" - - if not oe.utils.check_app_exists("${MAKE}", d): - missing = missing + "GNU make," - - if not oe.utils.check_app_exists('gcc', d): - missing = missing + "C Compiler (gcc)," - - if not oe.utils.check_app_exists('g++', d): - missing = missing + "C++ Compiler (g++)," - - # installing emacs on Ubuntu 24.04 pulls in emacs-gtk -> libgcc-14-dev despite gcc being 13 - # this breaks libcxx-native and compiler-rt-native builds so tell the user to fix things - if glob.glob("/usr/lib/gcc/*/14/libgcc_s.so") and not glob.glob("/usr/lib/gcc/*/14/libstdc++.so"): - status.addresult('libgcc-14-dev is installed and not libstdc++-14-dev which will break clang native compiles. Please remove one or install the other.') - - required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES') - - for util in required_utilities.split(): - if not oe.utils.check_app_exists(util, d): - missing = missing + "%s," % util - - if missing: - missing = missing.rstrip(',') - status.addresult("Please install the following missing utilities: %s\n" % missing) - - assume_provided = d.getVar('ASSUME_PROVIDED').split() - # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf - if "diffstat-native" not in assume_provided: - status.addresult('Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n') - - # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS) - import stat - tmpdir = d.getVar('TMPDIR') - topdir = d.getVar('TOPDIR') - status.addresult(check_create_long_filename(tmpdir, "TMPDIR")) - tmpdirmode = os.stat(tmpdir).st_mode - if (tmpdirmode & stat.S_ISGID): - status.addresult("TMPDIR is setgid, please don't build in a setgid directory") - if (tmpdirmode & stat.S_ISUID): - status.addresult("TMPDIR is setuid, please don't build in a setuid directory") - - # Check that a user isn't building in a path in PSEUDO_IGNORE_PATHS - pseudoignorepaths = (d.getVar('PSEUDO_IGNORE_PATHS', expand=True) or "").split(",") - workdir = d.getVar('WORKDIR', expand=True) - for i in pseudoignorepaths: - if i and workdir.startswith(i): - status.addresult("You are building in a path included in PSEUDO_IGNORE_PATHS " + str(i) + " please locate the build outside this path.\n") - - # Check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap - pseudoignorepaths = (d.getVar('PSEUDO_IGNORE_PATHS', expand=True) or "").split(",") - pseudo_control_dir = "${D},${PKGD},${PKGDEST},${IMAGEROOTFS},${SDK_OUTPUT}" - pseudocontroldir = d.expand(pseudo_control_dir).split(",") - for i in pseudoignorepaths: - for j in pseudocontroldir: - if i and j: - if j.startswith(i): - status.addresult("A path included in PSEUDO_IGNORE_PATHS " + str(i) + " and the path " + str(j) + " overlap and this will break pseudo permission and ownership tracking. Please set the path " + str(j) + " to a different directory which does not overlap with pseudo controlled directories. \n") - - # Some third-party software apparently relies on chmod etc. being suid root (!!) - import stat - suid_check_bins = "chown chmod mknod".split() - for bin_cmd in suid_check_bins: - bin_path = bb.utils.which(os.environ["PATH"], bin_cmd) - if bin_path: - bin_stat = os.stat(bin_path) - if bin_stat.st_uid == 0 and bin_stat.st_mode & stat.S_ISUID: - status.addresult('%s has the setuid bit set. This interferes with pseudo and may cause other issues that break the build process.\n' % bin_path) - - # Check that we can fetch from various network transports - netcheck = check_connectivity(d) - status.addresult(netcheck) - if netcheck: - status.network_error = True - - nolibs = d.getVar('NO32LIBS') - if not nolibs: - lib32path = '/lib' - if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ): - lib32path = '/lib32' - - if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'): - status.addresult("You have a 32-bit libc, but no 32-bit headers. You must install the 32-bit libc headers.\n") - - bbpaths = d.getVar('BBPATH').split(":") - if ("." in bbpaths or "./" in bbpaths or "" in bbpaths): - status.addresult("BBPATH references the current directory, either through " \ - "an empty entry, a './' or a '.'.\n\t This is unsafe and means your "\ - "layer configuration is adding empty elements to BBPATH.\n\t "\ - "Please check your layer.conf files and other BBPATH " \ - "settings to remove the current working directory " \ - "references.\n" \ - "Parsed BBPATH is" + str(bbpaths)); - - oes_bb_conf = d.getVar( 'OES_BITBAKE_CONF') - if not oes_bb_conf: - status.addresult('You are not using the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n') - - # The length of TMPDIR can't be longer than 400 - status.addresult(check_path_length(tmpdir, "TMPDIR", 400)) - - # Check that TOPDIR does not contain non ascii chars (perl_5.40.0, Perl-native and shadow-native build failures) - status.addresult(check_non_ascii(topdir, "TOPDIR")) - - # Check that TMPDIR isn't located on nfs - status.addresult(check_not_nfs(tmpdir, "TMPDIR")) - - # Check for case-insensitive file systems (such as Linux in Docker on - # macOS with default HFS+ file system) - status.addresult(check_case_sensitive(tmpdir, "TMPDIR")) - - # Check if linking with lstdc++ is failing - status.addresult(check_cpp_toolchain_flag(d, "-lstdc++")) - - # Check if the C++ toochain support the "--std=gnu++20" flag - status.addresult(check_cpp_toolchain_flag(d, "--std=gnu++20", - "An error occurred during checking the C++ toolchain for '--std=gnu++20' support. " - "Please use a g++ compiler that supports C++20 (e.g. g++ version 10 onwards).")) - - # Check there aren't obsolete wic/wks directories - for component in d.getVar("BBPATH").split(":") + d.getVar("BBLAYERS").split(): - for subcomponent in ['wic', 'scripts/lib/wic/canned-wks']: - testpath = os.path.join(component, subcomponent) - if os.path.exists(testpath): - status.addresult("wic/wks files at %s need to be moved to files/wic within the layer to be found/used\n" % testpath) - -def sanity_check_locale(d): - """ - Currently bitbake switches locale to en_US.UTF-8 so check that this locale actually exists. - """ - import locale - try: - locale.setlocale(locale.LC_ALL, "en_US.UTF-8") - except locale.Error: - raise_sanity_error("Your system needs to support the en_US.UTF-8 locale.", d) - -def check_cargo_config(d): - # Cargo merges .cargo/config[.toml] from every directory between CWD and - # the filesystem root. Warn for anything found in ancestor directories - # above BASE_WORKDIR that Cargo would pick up silently. - import os - - base_workdir = d.getVar('BASE_WORKDIR') - ancestor = os.path.dirname(base_workdir) - found = [] - last_ancestor = None - while True: - for name in ('config', 'config.toml'): - cfg = os.path.join(ancestor, '.cargo', name) - if os.path.exists(cfg): - found.append(cfg) - last_ancestor = ancestor - break - parent = os.path.dirname(ancestor) - if parent == ancestor: - break - ancestor = parent - - if found: - bb.warn("Cargo config file(s) found at %s which is/are outside the build " - "directory. Cargo will silently apply their settings during the " - "rust/cargo build and can override Yocto's settings like linker, " - "registry or compiler settings causing build failures. You can " - "either remove these file(s) or move your build directory outside " - "of %s to fix this. " - "See https://bugzilla.yoctoproject.org/show_bug.cgi?id=15637 for more details." - % (', '.join(found), last_ancestor)) - -def check_sanity_everybuild(status, d): - import os, stat - # Sanity tests which test the users environment so need to run at each build (or are so cheap - # it makes sense to always run them. - - if 0 == os.getuid(): - raise_sanity_error("Do not use Bitbake as root.", d) - - # Check the Python version, we now have a minimum of Python 3.9 - import sys - if sys.hexversion < 0x030900F0: - status.addresult('The system requires at least Python 3.9 to run. Please update your Python interpreter.\n') - - # Check the bitbake version meets minimum requirements - minversion = d.getVar('BB_MIN_VERSION') - if bb.utils.vercmp_string_op(bb.__version__, minversion, "<"): - status.addresult('Bitbake version %s is required and version %s was found\n' % (minversion, bb.__version__)) - - sanity_check_locale(d) - check_cargo_config(d) - - paths = d.getVar('PATH').split(":") - if "." in paths or "./" in paths or "" in paths: - status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") - - #Check if bitbake is present in PATH environment variable - bb_check = bb.utils.which(d.getVar('PATH'), 'bitbake') - if not bb_check: - bb.warn("bitbake binary is not found in PATH, did you source the script?") - - # Check whether 'inherit' directive is found (used for a class to inherit) - # in conf file it's supposed to be uppercase INHERIT - inherit = d.getVar('inherit') - if inherit: - status.addresult("Please don't use inherit directive in your local.conf. The directive is supposed to be used in classes and recipes only to inherit of bbclasses. Here INHERIT should be used.\n") - - # Check that the DISTRO is valid, if set - # need to take into account DISTRO renaming DISTRO - distro = d.getVar('DISTRO') - if distro and distro != "nodistro": - if not ( check_conf_exists("conf/distro/${DISTRO}.conf", d) or check_conf_exists("conf/distro/include/${DISTRO}.inc", d) ): - status.addresult("DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % d.getVar("DISTRO")) - - # Check that these variables don't use tilde-expansion as we don't do that - for v in ("TMPDIR", "DL_DIR", "SSTATE_DIR"): - if d.getVar(v).startswith("~"): - status.addresult("%s uses ~ but Bitbake will not expand this, use an absolute path or variables." % v) - - # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't - # set, since so much relies on it being set. - dldir = d.getVar('DL_DIR') - if not dldir: - status.addresult("DL_DIR is not set. Your environment is misconfigured, check that DL_DIR is set, and if the directory exists, that it is writable. \n") - if os.path.exists(dldir) and not os.access(dldir, os.W_OK): - status.addresult("DL_DIR: %s exists but you do not appear to have write access to it. \n" % dldir) - check_symlink(dldir, d) - - # Check that the MACHINE is valid, if it is set - machinevalid = True - if d.getVar('MACHINE'): - if not check_conf_exists("conf/machine/${MACHINE}.conf", d): - status.addresult('MACHINE=%s is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file.\n' % (d.getVar('MACHINE'))) - machinevalid = False - else: - status.addresult(check_sanity_validmachine(d)) - else: - status.addresult('Please set a MACHINE in your local.conf or environment\n') - machinevalid = False - if machinevalid: - status.addresult(check_toolchain(d)) - - # Check that the SDKMACHINE is valid, if it is set - if d.getVar('SDKMACHINE'): - if not check_conf_exists("conf/machine-sdk/${SDKMACHINE}.conf", d): - status.addresult('Specified SDKMACHINE value is not valid\n') - elif d.getVar('SDK_ARCH', False) == "${BUILD_ARCH}": - status.addresult('SDKMACHINE is set, but SDK_ARCH has not been changed as a result - SDKMACHINE may have been set too late (e.g. in the distro configuration)\n') - - # If SDK_VENDOR looks like "-my-sdk" then the triples are badly formed so fail early - sdkvendor = d.getVar("SDK_VENDOR") - if not (sdkvendor.startswith("-") and sdkvendor.count("-") == 1): - status.addresult("SDK_VENDOR should be of the form '-foosdk' with a single dash; found '%s'\n" % sdkvendor) - - check_supported_distro(d) - - omask = os.umask(0o022) - if omask & 0o755: - status.addresult("Please use a umask which allows a+rx and u+rwx\n") - os.umask(omask) - - # Ensure /tmp is NOT mounted with noexec - if os.statvfs("/tmp").f_flag & os.ST_NOEXEC: - raise_sanity_error("/tmp shouldn't be mounted with noexec.", d) - - if d.getVar('TARGET_ARCH') == "arm": - # This path is no longer user-readable in modern (very recent) Linux - try: - if os.path.exists("/proc/sys/vm/mmap_min_addr"): - f = open("/proc/sys/vm/mmap_min_addr", "r") - try: - if (int(f.read().strip()) > 65536): - status.addresult("/proc/sys/vm/mmap_min_addr is not <= 65536. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 65536 in /etc/sysctl.conf.\n") - finally: - f.close() - except: - pass - - for checkdir in ['COREBASE', 'TMPDIR']: - val = d.getVar(checkdir) - if val.find('..') != -1: - status.addresult("Error, you have '..' in your %s directory path. Please ensure the variable contains an absolute path as this can break some recipe builds in obtuse ways." % checkdir) - if val.find('+') != -1: - status.addresult("Error, you have an invalid character (+) in your %s directory path. Please move the installation to a directory which doesn't include any + characters." % checkdir) - if val.find('@') != -1: - status.addresult("Error, you have an invalid character (@) in your %s directory path. Please move the installation to a directory which doesn't include any @ characters." % checkdir) - if val.find(' ') != -1: - status.addresult("Error, you have a space in your %s directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this." % checkdir) - if val.find('%') != -1: - status.addresult("Error, you have an invalid character (%) in your %s directory path which causes problems with python string formatting. Please move the installation to a directory which doesn't include any % characters." % checkdir) - - # Redundant slashes (trailing slash or consecutive slashes) in TMPDIR - # break the sstate staging machinery which relies on exact string matching - # of manifest paths. Reject any TMPDIR that differs from its normalised form. - tmpdir = d.getVar('TMPDIR') - if tmpdir and tmpdir != os.path.normpath(tmpdir): - status.addresult("Error, TMPDIR (%s) contains redundant slashes. " - "Please set TMPDIR to a clean path with no trailing slash or " - "consecutive slashes (e.g. %s).\n" % (tmpdir, os.path.normpath(tmpdir))) - - # Check whether the SOURCE_MIRROR_URL variable, belonging to the 'own-mirrors' class, is defined - if oe.utils.inherits(d, 'own-mirrors') and not d.getVar('SOURCE_MIRROR_URL'): - status.addresult("own-mirrors is enabled, but SOURCE_MIRROR_URL is not defined") - - # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS - import re - mirror_vars = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS'] - protocols = ['http', 'ftp', 'file', 'https', \ - 'git', 'gitsm', 'hg', 'p4', 'svn', \ - 'npm', 'sftp', 'ssh', 's3', \ - 'az', 'ftps', 'crate', 'gs'] - for mirror_var in mirror_vars: - mirrors = (d.getVar(mirror_var) or '').replace('\\n', ' ').split() - - # Split into pairs - if len(mirrors) % 2 != 0: - bb.warn('Invalid mirror variable value for %s: %s, should contain paired members.' % (mirror_var, str(mirrors))) - continue - mirrors = list(zip(*[iter(mirrors)]*2)) - - for mirror_entry in mirrors: - pattern, mirror = mirror_entry - - decoded = bb.fetch2.decodeurl(pattern) - try: - pattern_scheme = re.compile(decoded[0]) - except re.error as exc: - bb.warn('Invalid scheme regex (%s) in %s; %s' % (pattern, mirror_var, mirror_entry)) - continue - - if not any(pattern_scheme.match(protocol) for protocol in protocols): - bb.warn('Invalid protocol (%s) in %s: %s' % (decoded[0], mirror_var, mirror_entry)) - continue - - if not any(mirror.startswith(protocol + '://') for protocol in protocols): - bb.warn('Invalid protocol in %s: %s' % (mirror_var, mirror_entry)) - continue - - if mirror.startswith('file://'): - import urllib - check_symlink(urllib.parse.urlparse(mirror).path, d) - # SSTATE_MIRROR ends with a /PATH string - if mirror.endswith('/PATH'): - # remove /PATH$ from SSTATE_MIRROR to get a working - # base directory path - mirror_base = urllib.parse.urlparse(mirror[:-1*len('/PATH')]).path - check_symlink(mirror_base, d) - - if d.getVar("BB_SIGNATURE_HANDLER") == "OEEquivHash": - # Check sstate mirrors aren't being used with a local hash server and no remote - hashserv = d.getVar("BB_HASHSERVE") - if d.getVar("SSTATE_MIRRORS") and hashserv and hashserv.startswith("unix://") and not d.getVar("BB_HASHSERVE_UPSTREAM"): - bb.warn("You are using a local hash equivalence server but have configured an sstate mirror. This will likely mean no sstate will match from the mirror. You may wish to disable the hash equivalence use (BB_HASHSERVE), or use a hash equivalence server alongside the sstate mirror.") - - # Check that when SSTATE_DIR is shared between builds, hashserve database is not private to a build - hashserv_proto,_,hashserv_path,_,_,_ = bb.fetch2.decodeurl(hashserv) - if hashserv_proto == "unix": - dbdir = d.getVar("BB_HASHSERVE_DB_DIR") or d.getVar("PERSISTENT_DIR") or d.getVar("CACHE") - topdir = d.getVar("TOPDIR") - sstatedir = d.getVar("SSTATE_DIR") - - if (hashserv_path.startswith(topdir) and dbdir.startswith(topdir) and not sstatedir.startswith(topdir)): - if bb.utils.is_path_on_nfs(sstatedir): - bb.warn("""Sstate directory is on a shared NFS (it is set via SSTATE_DIR to {}), - but hash equivalency database is inside this particular build directory {}. - - This will prevent sstate reuse, and it is recommended to set up a permanently running hash equivalency server - according to https://docs.yoctoproject.org/dev-manual/hashequivserver.html""".format(sstatedir, topdir)) - else: - bb.warn("""Sstate directory is shared between several builds (it is set via SSTATE_DIR to {}), - but hash equivalency database is inside this particular build directory {}. - - This will prevent sstate reuse, and it is recommended to set the location for the database to a common path - via BB_HASHSERVE_DB_DIR, for example: - - BB_HASHSERVE_DB_DIR = \"${{SSTATE_DIR}}\"""".format(sstatedir, topdir)) - - # Check that TMPDIR hasn't changed location since the last time we were run - tmpdir = d.getVar('TMPDIR') - checkfile = os.path.join(tmpdir, "saved_tmpdir") - if os.path.exists(checkfile): - with open(checkfile, "r") as f: - saved_tmpdir = f.read().strip() - if (saved_tmpdir != tmpdir): - status.addresult("Error, TMPDIR has changed location. You need to either move it back to %s or delete it and rebuild\n" % saved_tmpdir) - else: - bb.utils.mkdirhier(tmpdir) - # Remove setuid, setgid and sticky bits from TMPDIR - try: - os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISUID) - os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISGID) - os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISVTX) - except OSError as exc: - bb.warn("Unable to chmod TMPDIR: %s" % exc) - with open(checkfile, "w") as f: - f.write(tmpdir) - - # If /bin/sh is a symlink, check that it points to dash or bash - if os.path.islink('/bin/sh'): - real_sh = os.path.realpath('/bin/sh') - # Due to update-alternatives, the shell name may take various - # forms, such as /bin/dash, bin/bash, /bin/bash.bash ... - if '/dash' not in real_sh and '/bash' not in real_sh: - status.addresult("Error, /bin/sh links to %s, must be dash or bash\n" % real_sh) - -def check_sanity(sanity_data): - class SanityStatus(object): - def __init__(self): - self.messages = "" - self.network_error = False - - def addresult(self, message): - if message: - self.messages = self.messages + message - - status = SanityStatus() - - tmpdir = sanity_data.getVar('TMPDIR') - sstate_dir = sanity_data.getVar('SSTATE_DIR') - - check_symlink(sstate_dir, sanity_data) - - # Check saved sanity info - last_sanity_version = 0 - last_tmpdir = "" - last_sstate_dir = "" - last_nativelsbstr = "" - sanityverfile = sanity_data.expand("${TOPDIR}/cache/sanity_info") - if os.path.exists(sanityverfile): - with open(sanityverfile, 'r') as f: - for line in f: - if line.startswith('SANITY_VERSION'): - last_sanity_version = int(line.split()[1]) - if line.startswith('TMPDIR'): - last_tmpdir = line.split()[1] - if line.startswith('SSTATE_DIR'): - last_sstate_dir = line.split()[1] - if line.startswith('NATIVELSBSTRING'): - last_nativelsbstr = line.split()[1] - - check_sanity_everybuild(status, sanity_data) - - sanity_version = int(sanity_data.getVar('SANITY_VERSION') or 1) - network_error = False - # NATIVELSBSTRING var may have been overridden with "universal", so - # get actual host distribution id and version - nativelsbstr = oe.lsb.distro_identifier(sanity_data) - if last_sanity_version < sanity_version or last_nativelsbstr != nativelsbstr: - check_sanity_version_change(status, sanity_data) - status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data)) - else: - if last_sstate_dir != sstate_dir: - status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data)) - - if os.path.exists(os.path.dirname(sanityverfile)) and not status.messages: - with open(sanityverfile, 'w') as f: - f.write("SANITY_VERSION %s\n" % sanity_version) - f.write("TMPDIR %s\n" % tmpdir) - f.write("SSTATE_DIR %s\n" % sstate_dir) - f.write("NATIVELSBSTRING %s\n" % nativelsbstr) - - sanity_handle_abichanges(status, sanity_data) - - if status.messages != "": - raise_sanity_error(sanity_data.expand(status.messages), sanity_data, status.network_error) - addhandler config_reparse_eventhandler config_reparse_eventhandler[eventmask] = "bb.event.ConfigParsed" python config_reparse_eventhandler() { - sanity_check_conffiles(e.data) + oe.sanity.sanity_check_conffiles(e.data) } addhandler check_sanity_eventhandler @@ -1192,7 +168,7 @@ check_sanity_eventhandler[eventmask] = "bb.event.SanityCheck bb.event.NetworkTes python check_sanity_eventhandler() { if bb.event.getName(e) == "SanityCheck": sanity_data = bb.data.createCopy(e.data) - check_sanity(sanity_data) + oe.sanity.check_sanity(sanity_data) if e.generateevents: sanity_data.setVar("SANITY_USE_EVENTS", "1") bb.event.fire(bb.event.SanityCheckPassed(), e.data) @@ -1200,7 +176,7 @@ python check_sanity_eventhandler() { sanity_data = bb.data.createCopy(e.data) if e.generateevents: sanity_data.setVar("SANITY_USE_EVENTS", "1") - bb.event.fire(bb.event.NetworkTestFailed() if check_connectivity(sanity_data) else bb.event.NetworkTestPassed(), e.data) + bb.event.fire(bb.event.NetworkTestFailed() if oe.sanity.check_connectivity(sanity_data) else bb.event.NetworkTestPassed(), e.data) return } diff --git a/meta/classes/sign_ipk.bbclass b/meta/classes/sign_ipk.bbclass index 51c24b38b26..cb01f7353b4 100644 --- a/meta/classes/sign_ipk.bbclass +++ b/meta/classes/sign_ipk.bbclass @@ -36,11 +36,11 @@ python () { # Check configuration for var in ('IPK_GPG_NAME', 'IPK_GPG_PASSPHRASE_FILE'): if not d.getVar(var): - raise_sanity_error("You need to define %s in the config" % var, d) + oe.sanity.raise_sanity_error("You need to define %s in the config" % var, d) sigtype = d.getVar("IPK_GPG_SIGNATURE_TYPE") if sigtype.upper() != "ASC" and sigtype.upper() != "BIN": - raise_sanity_error("Bad value for IPK_GPG_SIGNATURE_TYPE (%s), use either ASC or BIN" % sigtype) + oe.sanity.raise_sanity_error("Bad value for IPK_GPG_SIGNATURE_TYPE (%s), use either ASC or BIN" % sigtype) } def sign_ipk(d, ipk_to_sign): diff --git a/meta/classes/sign_package_feed.bbclass b/meta/classes/sign_package_feed.bbclass index e9d664750c3..49ecd5bd9fe 100644 --- a/meta/classes/sign_package_feed.bbclass +++ b/meta/classes/sign_package_feed.bbclass @@ -42,11 +42,11 @@ python () { # Check sanity of configuration for var in ('PACKAGE_FEED_GPG_NAME', 'PACKAGE_FEED_GPG_PASSPHRASE_FILE'): if not d.getVar(var): - raise_sanity_error("You need to define %s in the config" % var, d) + oe.sanity.raise_sanity_error("You need to define %s in the config" % var, d) sigtype = d.getVar("PACKAGE_FEED_GPG_SIGNATURE_TYPE") if sigtype.upper() != "ASC" and sigtype.upper() != "BIN": - raise_sanity_error("Bad value for PACKAGE_FEED_GPG_SIGNATURE_TYPE (%s), use either ASC or BIN" % sigtype) + oe.sanity.raise_sanity_error("Bad value for PACKAGE_FEED_GPG_SIGNATURE_TYPE (%s), use either ASC or BIN" % sigtype) } do_package_index[depends] += "signing-keys:do_deploy" diff --git a/meta/classes/sign_rpm.bbclass b/meta/classes/sign_rpm.bbclass index b5b21b0db11..c6314db5313 100644 --- a/meta/classes/sign_rpm.bbclass +++ b/meta/classes/sign_rpm.bbclass @@ -43,16 +43,16 @@ RPM_GPG_SIGN_CHUNK ?= "${BB_NUMBER_THREADS}" python () { if d.getVar('RPM_GPG_PASSPHRASE_FILE'): - raise_sanity_error('RPM_GPG_PASSPHRASE_FILE is replaced by RPM_GPG_PASSPHRASE', d) + oe.sanity.raise_sanity_error('RPM_GPG_PASSPHRASE_FILE is replaced by RPM_GPG_PASSPHRASE', d) # Check configuration for var in ('RPM_GPG_NAME', 'RPM_GPG_PASSPHRASE'): if not d.getVar(var): - raise_sanity_error("You need to define %s in the config" % var, d) + oe.sanity.raise_sanity_error("You need to define %s in the config" % var, d) if d.getVar('RPM_SIGN_FILES') == '1': for var in ('RPM_FSK_PATH', 'RPM_FSK_PASSWORD'): if not d.getVar(var): - raise_sanity_error("You need to define %s in the config" % var, d) + oe.sanity.raise_sanity_error("You need to define %s in the config" % var, d) } python sign_rpm () { diff --git a/meta/lib/oe/__init__.py b/meta/lib/oe/__init__.py index faa9987c8ca..d8db84dc9aa 100644 --- a/meta/lib/oe/__init__.py +++ b/meta/lib/oe/__init__.py @@ -12,4 +12,4 @@ __path__ = extend_path(__path__, __name__) BBIMPORTS = ["qa", "data", "path", "utils", "types", "package", "packagedata", \ "packagegroup", "sstatesig", "lsb", "cachedpath", "license", "qemu", \ "reproducible", "rust", "buildcfg", "go", "spdx30_tasks", "spdx_common", \ - "cve_check", "tune", "classextend", "purl", "kernel"] + "cve_check", "tune", "classextend", "purl", "kernel", "sanity"] diff --git a/meta/lib/oe/sanity.py b/meta/lib/oe/sanity.py new file mode 100644 index 00000000000..292fbddbb2b --- /dev/null +++ b/meta/lib/oe/sanity.py @@ -0,0 +1,1032 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +import oe.utils + +def bblayers_conf_file(d): + return os.path.join(d.getVar('TOPDIR'), 'conf/bblayers.conf') + +def sanity_conf_read(fn): + with open(fn, 'r') as f: + lines = f.readlines() + return lines + +def sanity_conf_find_line(pattern, lines): + import re + return next(((index, line) + for index, line in enumerate(lines) + if re.search(pattern, line)), (None, None)) + +def sanity_conf_update(fn, lines, version_var_name, new_version): + index, line = sanity_conf_find_line(r"^%s" % version_var_name, lines) + lines[index] = '%s = "%d"\n' % (version_var_name, new_version) + with open(fn, "w") as f: + f.write(''.join(lines)) + +def raise_sanity_error(msg, d, network_error=False): + if d.getVar("SANITY_USE_EVENTS") == "1": + try: + bb.event.fire(bb.event.SanityCheckFailed(msg, network_error), d) + except TypeError: + bb.event.fire(bb.event.SanityCheckFailed(msg), d) + return + + bb.fatal(""" OE-core's config sanity checker detected a potential misconfiguration. + Either fix the cause of this error or at your own risk disable the checker (see sanity.conf). + Following is the list of potential problems / advisories: + + %s""" % msg) + +# Check a single tune for validity. +def check_toolchain_tune(data, tune, multilib): + tune_errors = [] + if not tune: + return "No tuning found for %s multilib." % multilib + localdata = bb.data.createCopy(data) + if multilib != "default": + # Apply the overrides so we can look at the details. + overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + multilib + localdata.setVar("OVERRIDES", overrides) + bb.debug(2, "Sanity-checking tuning '%s' (%s) features:" % (tune, multilib)) + features = (localdata.getVar("TUNE_FEATURES:tune-%s" % tune) or "").split() + if not features: + return "Tuning '%s' has no defined features, and cannot be used." % tune + valid_tunes = localdata.getVarFlags('TUNEVALID') or {} + conflicts = localdata.getVarFlags('TUNECONFLICTS') or {} + # [doc] is the documentation for the variable, not a real feature + if 'doc' in valid_tunes: + del valid_tunes['doc'] + if 'doc' in conflicts: + del conflicts['doc'] + for feature in features: + if feature in conflicts: + for conflict in conflicts[feature].split(): + if conflict in features: + tune_errors.append("Feature '%s' conflicts with '%s'." % + (feature, conflict)) + if feature in valid_tunes: + bb.debug(2, " %s: %s" % (feature, valid_tunes[feature])) + else: + tune_errors.append("Feature '%s' is not defined." % feature) + if tune_errors: + return "Tuning '%s' has the following errors:\n" % tune + '\n'.join(tune_errors) + +def check_toolchain(data): + tune_error_set = [] + deftune = data.getVar("DEFAULTTUNE") + tune_errors = check_toolchain_tune(data, deftune, 'default') + if tune_errors: + tune_error_set.append(tune_errors) + + multilibs = (data.getVar("MULTILIB_VARIANTS") or "").split() + global_multilibs = (data.getVar("MULTILIB_GLOBAL_VARIANTS") or "").split() + + if multilibs: + seen_libs = [] + seen_tunes = [] + for lib in multilibs: + if lib in seen_libs: + tune_error_set.append("The multilib '%s' appears more than once." % lib) + else: + seen_libs.append(lib) + if not lib in global_multilibs: + tune_error_set.append("Multilib %s is not present in MULTILIB_GLOBAL_VARIANTS" % lib) + tune = data.getVar("DEFAULTTUNE:virtclass-multilib-%s" % lib) + if tune in seen_tunes: + tune_error_set.append("The tuning '%s' appears in more than one multilib." % tune) + else: + seen_libs.append(tune) + if tune == deftune: + tune_error_set.append("Multilib '%s' (%s) is also the default tuning." % (lib, deftune)) + else: + tune_errors = check_toolchain_tune(data, tune, lib) + if tune_errors: + tune_error_set.append(tune_errors) + if tune_error_set: + return "Toolchain tunings invalid:\n" + '\n'.join(tune_error_set) + "\n" + + return "" + +def check_conf_exists(fn, data): + bbpath = [] + fn = data.expand(fn) + vbbpath = data.getVar("BBPATH", False) + if vbbpath: + bbpath += vbbpath.split(":") + for p in bbpath: + currname = os.path.join(data.expand(p), fn) + if os.access(currname, os.R_OK): + return True + return False + +def check_create_long_filename(filepath, pathname): + import string, random + testfile = os.path.join(filepath, ''.join(random.choice(string.ascii_letters) for x in range(200))) + try: + if not os.path.exists(filepath): + bb.utils.mkdirhier(filepath) + f = open(testfile, "w") + f.close() + os.remove(testfile) + except IOError as e: + import errno + err, strerror = e.args + if err == errno.ENAMETOOLONG: + return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname + else: + return "Failed to create a file in %s: %s.\n" % (pathname, strerror) + except OSError as e: + errno, strerror = e.args + return "Failed to create %s directory in which to run long name sanity check: %s.\n" % (pathname, strerror) + return "" + +def check_path_length(filepath, pathname, limit): + if len(filepath) > limit: + return "The length of %s is longer than %s, this would cause unexpected errors, please use a shorter path.\n" % (pathname, limit) + return "" + +def check_non_ascii(filepath, pathname): + if(not filepath.isascii()): + return "Non-ASCII character(s) in %s path (\"%s\") detected. This would cause build failures as we build software that doesn't support this.\n" % (pathname, filepath) + return "" + +def get_filesystem_id(path): + import subprocess + try: + return subprocess.check_output(["stat", "-f", "-c", "%t", path]).decode('utf-8').strip() + except subprocess.CalledProcessError: + bb.warn("Can't get filesystem id of: %s" % path) + return None + +# Check that the path isn't located on nfs. +def check_not_nfs(path, name): + # The nfs' filesystem id is 6969 + if get_filesystem_id(path) == "6969": + return "The %s: %s can't be located on nfs.\n" % (name, path) + return "" + +# Check that the path is on a case-sensitive file system +def check_case_sensitive(path, name): + import tempfile + with tempfile.NamedTemporaryFile(prefix='TmP', dir=path) as tmp_file: + if os.path.exists(tmp_file.name.lower()): + return "The %s (%s) can't be on a case-insensitive file system.\n" % (name, path) + return "" + +# Check that path isn't a broken symlink +def check_symlink(lnk, data): + if os.path.islink(lnk) and not os.path.exists(lnk): + raise_sanity_error("%s is a broken symlink." % lnk, data) + +def check_connectivity(d): + # URI's to check can be set in the CONNECTIVITY_CHECK_URIS variable + # using the same syntax as for SRC_URI. If the variable is not set + # the check is skipped + test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS') or "").split() + retval = "" + + bbn = d.getVar('BB_NO_NETWORK') + if bbn not in (None, '0', '1'): + return 'BB_NO_NETWORK should be "0" or "1", but it is "%s"' % bbn + + # Only check connectivity if network enabled and the + # CONNECTIVITY_CHECK_URIS are set + network_enabled = not (bbn == '1') + check_enabled = len(test_uris) + if check_enabled and network_enabled: + # Take a copy of the data store and unset MIRRORS and PREMIRRORS + data = bb.data.createCopy(d) + data.delVar('PREMIRRORS') + data.delVar('MIRRORS') + try: + fetcher = bb.fetch2.Fetch(test_uris, data) + fetcher.checkstatus() + except Exception as err: + # Allow the message to be configured so that users can be + # pointed to a support mechanism. + msg = data.getVar('CONNECTIVITY_CHECK_MSG') or "" + if len(msg) == 0: + msg = "%s.\n" % err + msg += " Please ensure your host's network is configured correctly.\n" + msg += " Please ensure CONNECTIVITY_CHECK_URIS is correct and specified URIs are available.\n" + msg += " If your ISP or network is blocking the above URL,\n" + msg += " try with another domain name, for example by setting:\n" + msg += " CONNECTIVITY_CHECK_URIS = \"https://www.example.com/\"" + msg += " You could also set BB_NO_NETWORK = \"1\" to disable network\n" + msg += " access if all required sources are on local disk.\n" + else: + msg = "%s.\n%s" % (err, msg) + retval = msg + + return retval + +def check_supported_distro(sanity_data): + from fnmatch import fnmatch + + tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS') + if not tested_distros: + return + + try: + distro = oe.lsb.distro_identifier(sanity_data) + except Exception: + distro = None + + if not distro: + bb.warn('Host distribution could not be determined; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.') + + for supported in [x.strip() for x in tested_distros.split('\\n')]: + if fnmatch(distro, supported): + return + + bb.warn('Host distribution "%s" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.' % distro) + +# Checks we should only make if MACHINE is set correctly +def check_sanity_validmachine(sanity_data): + messages = "" + + # Check TUNE_ARCH is set + if sanity_data.getVar('TUNE_ARCH') == 'INVALID': + messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n' + + # Check TARGET_OS is set + if sanity_data.getVar('TARGET_OS') == 'INVALID': + messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n' + + # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS + pkgarchs = sanity_data.getVar('PACKAGE_ARCHS') + tunepkg = sanity_data.getVar('TUNE_PKGARCH') + defaulttune = sanity_data.getVar('DEFAULTTUNE') + tunefound = False + seen = {} + dups = [] + + for pa in pkgarchs.split(): + if seen.get(pa, 0) == 1: + dups.append(pa) + else: + seen[pa] = 1 + if pa == tunepkg: + tunefound = True + + if len(dups): + messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups) + + if tunefound == False: + messages = messages + "Error, the PACKAGE_ARCHS variable (%s) for DEFAULTTUNE (%s) does not contain TUNE_PKGARCH (%s)." % (pkgarchs, defaulttune, tunepkg) + + return messages + +# Patch before 2.7 can't handle all the features in git-style diffs. Some +# patches may incorrectly apply, and others won't apply at all. +def check_patch_version(sanity_data): + import re, subprocess + + patch_minimum_version = "2.7" + + try: + result = subprocess.check_output(["patch", "--version"], stderr=subprocess.STDOUT).decode('utf-8') + version = re.search(r"[0-9.]+", result.splitlines()[0]).group() + if bb.utils.vercmp_string_op(version, patch_minimum_version, "<"): + return ("Your version of patch is older than %s and has bugs which will break builds. " + "Please install a newer version of patch.\n" % patch_minimum_version) + else: + return None + except subprocess.CalledProcessError as e: + return "Unable to execute patch --version, exit code %d:\n%s\n" % (e.returncode, e.output) + +# Glibc needs make 4.0 or later, we may as well match at this point +def check_make_version(sanity_data): + make_minimum_version = "4.0" + import subprocess + + try: + result = subprocess.check_output(['make', '--version'], stderr=subprocess.STDOUT).decode('utf-8') + except subprocess.CalledProcessError as e: + return "Unable to execute make --version, exit code %d\n%s\n" % (e.returncode, e.output) + version = result.split()[2] + if bb.utils.vercmp_string_op(version, make_minimum_version, "<"): + return "Please install a make version of %s or later.\n" % make_minimum_version + + if bb.utils.vercmp_string_op(version, "4.2.1", "=="): + distro = oe.lsb.distro_identifier(sanity_data) + if "ubuntu" in distro or "debian" in distro or "linuxmint" in distro: + return None + return "make version 4.2.1 is known to have issues on Centos/OpenSUSE and other non-Ubuntu systems. Please use a buildtools-make-tarball or a newer version of make.\n" + return None + + +# Check if we're running on WSL (Windows Subsystem for Linux). +# WSLv1 is known not to work but WSLv2 should work properly as +# long as the VHDX file is optimized often, let the user know +# upfront. +# More information on installing WSLv2 at: +# https://docs.microsoft.com/en-us/windows/wsl/wsl2-install +def check_wsl(d): + with open("/proc/version", "r") as f: + verdata = f.readlines() + for l in verdata: + if "Microsoft" in l: + return "OpenEmbedded doesn't work under WSLv1, please upgrade to WSLv2 if you want to run builds on Windows" + elif "microsoft" in l: + bb.warn("You are running bitbake under WSLv2, this works properly but you should optimize your VHDX file eventually to avoid running out of storage space") + return None + +def check_userns(): + """ + Check that user namespaces are functional, as they're used for network isolation. + """ + + # There is a known failure case with AppAmrmor where the unshare() call + # succeeds (at which point the uid is nobody) but writing to the uid_map + # fails (so the uid isn't reset back to the user's uid). We can detect this. + parentuid = os.getuid() + if not bb.utils.is_local_uid(parentuid): + return None + pid = os.fork() + if not pid: + try: + bb.utils.disable_network() + except: + pass + os._exit(parentuid != os.getuid()) + + ret = os.waitpid(pid, 0)[1] + if ret: + bb.fatal("User namespaces are not usable by BitBake, possibly due to AppArmor.\n" + "See https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#unprivileged-user-namespace-restrictions for more information.") + + +# Require at least gcc version 10.1 +# +# A less invasive fix is with scripts/install-buildtools (or with user +# built buildtools-extended-tarball) +# +def check_gcc_version(sanity_data): + gcc_minimum_version = "10.1" + version = oe.utils.get_host_gcc_version(sanity_data) + if bb.utils.vercmp_string_op(version, gcc_minimum_version, "<"): + return ("Your version of gcc is older than %s and will break builds. Please install a newer " + "version of gcc (you could use the project's buildtools-extended-tarball or use " + "scripts/install-buildtools).\n" % gcc_minimum_version) + return None + +# Tar version 1.24 and onwards handle overwriting symlinks correctly +# but earlier versions do not; this needs to work properly for sstate +# Version 1.28 is needed so opkg-build works correctly when reproducible builds are enabled +# Gtar is assumed at to be used as tar in poky +def check_tar_version(sanity_data): + tar_minimum_version = "1.28" + import subprocess + try: + result = subprocess.check_output(["tar", "--version"], stderr=subprocess.STDOUT).decode('utf-8') + except subprocess.CalledProcessError as e: + return "Unable to execute tar --version, exit code %d\n%s\n" % (e.returncode, e.output) + if not "GNU" in result: + return "Your version of tar is not gtar. Please install gtar (you could use the project's buildtools-tarball from our last release or use scripts/install-buildtools).\n" + version = result.split()[3] + if bb.utils.vercmp_string_op(version, tar_minimum_version, "<"): + return ("Your version of tar is older than %s and does not have the support needed to enable reproducible " + "builds. Please install a newer version of tar (you could use the project's buildtools-tarball from " + "our last release or use scripts/install-buildtools).\n" % tar_minimum_version) + + try: + result = subprocess.check_output(["tar", "--help"], stderr=subprocess.STDOUT).decode('utf-8') + if "--xattrs" not in result: + return "Your tar doesn't support --xattrs, please use GNU tar.\n" + except subprocess.CalledProcessError as e: + return "Unable to execute tar --help, exit code %d\n%s\n" % (e.returncode, e.output) + + try: + distro = oe.lsb.distro_identifier(sanity_data) + except Exception: + distro = None + + if distro: + rhel9_alike_prefixes = ("rhel-9", "centos-9", "rocky-9", "almalinux-9") + rhel9_tar_minimum_version = "1.35" + for prefix in rhel9_alike_prefixes: + if distro.startswith(prefix) and bb.utils.vercmp_string_op(version, rhel9_tar_minimum_version, "<"): + return ("Your version of tar is older than %s and crashes when extracting read-only files with xattrs. " + "Your distro is %s which triggers this bug due to the presence of selinux attributes. " + "Please install a newer version of tar (you could use the project's buildtools-tarball from " + "our last release or use scripts/install-buildtools).\n" % (rhel9_tar_minimum_version, distro)) + + return None + +# We use git branch --show-current which was introduced in 2.22.0 +def check_git_version(sanity_data): + git_minimum_version = "2.22.0" + import subprocess + try: + result = subprocess.check_output(["git", "--version"], stderr=subprocess.DEVNULL).decode('utf-8') + except subprocess.CalledProcessError as e: + return "Unable to execute git --version, exit code %d\n%s\n" % (e.returncode, e.output) + version = result.split()[2] + if bb.utils.vercmp_string_op(version, git_minimum_version, "<"): + return ("Your version of git is older than %s and is missing functionality we use. " + "Please install a newer version of git.\n" % git_minimum_version) + return None + +# Check the required perl modules which may not be installed by default +def check_perl_modules(sanity_data): + import subprocess + ret = "" + modules = ( "Text::ParseWords", "Thread::Queue", "Data::Dumper", "File::Compare", "File::Copy", "open ':std'", "FindBin" ) + errresult = '' + for m in modules: + try: + subprocess.check_output(["perl", "-e", "use %s" % m]) + except subprocess.CalledProcessError as e: + errresult += bytes.decode(e.output) + ret += "%s " % m + if ret: + return "Required perl module(s) not found: %s\n\n%s\n" % (ret, errresult) + return None + +def sanity_check_conffiles(d): + funcs = d.getVar('BBLAYERS_CONF_UPDATE_FUNCS').split() + for func in funcs: + conffile, current_version, required_version, func = func.split(":") + if check_conf_exists(conffile, d) and d.getVar(current_version) is not None and \ + d.getVar(current_version) != d.getVar(required_version): + try: + bb.build.exec_func(func, d) + except NotImplementedError as e: + bb.fatal(str(e)) + d.setVar("BB_INVALIDCONF", True) + +def drop_v14_cross_builds(d): + import glob + indexes = glob.glob(d.expand("${SSTATE_MANIFESTS}/index-${BUILD_ARCH}_*")) + for i in indexes: + with open(i, "r") as f: + lines = f.readlines() + for l in reversed(lines): + try: + (stamp, manifest, workdir) = l.split() + except ValueError: + bb.fatal("Invalid line '%s' in sstate manifest '%s'" % (l, i)) + for m in glob.glob(manifest + ".*"): + if m.endswith(".postrm"): + continue + sstate_clean_manifest(m, d) + bb.utils.remove(stamp + "*") + bb.utils.remove(workdir, recurse = True) + +def check_cpp_toolchain_flag(d, flag, error_message=None): + """ + Checks if the g++ compiler supports the given flag + """ + import shlex + import subprocess + + cpp_code = """ + #include + int main() { + std::cout << "Hello, World!" << std::endl; + return 0; + } + """ + + cmd = ["g++", "-x", "c++","-", "-o", "/dev/null", flag] + try: + subprocess.run(cmd, input=cpp_code, capture_output=True, text=True, check=True) + return None + except subprocess.CalledProcessError as e: + return error_message or f"An unexpected issue occurred during the C++ toolchain check: {str(e)}" + +def sanity_handle_abichanges(status, d): + # + # Check the 'ABI' of TMPDIR + # + import subprocess + + current_abi = d.getVar('OELAYOUT_ABI') + abifile = d.getVar('SANITY_ABIFILE') + if os.path.exists(abifile): + with open(abifile, "r") as f: + abi = f.read().strip() + if not abi.isdigit(): + with open(abifile, "w") as f: + f.write(current_abi) + elif int(abi) <= 11 and current_abi == "12": + status.addresult("The layout of TMPDIR changed for Recipe Specific Sysroots.\nConversion doesn't make sense and this change will rebuild everything so please delete TMPDIR (%s).\n" % d.getVar("TMPDIR")) + elif int(abi) <= 13 and current_abi == "14": + status.addresult("TMPDIR changed to include path filtering from the pseudo database.\nIt is recommended to use a clean TMPDIR with the new pseudo path filtering so TMPDIR (%s) would need to be removed to continue.\n" % d.getVar("TMPDIR")) + elif int(abi) == 14 and current_abi == "15": + drop_v14_cross_builds(d) + with open(abifile, "w") as f: + f.write(current_abi) + elif (abi != current_abi): + # Code to convert from one ABI to another could go here if possible. + status.addresult("Error, TMPDIR has changed its layout version number (%s to %s) and you need to either rebuild, revert or adjust it at your own risk.\n" % (abi, current_abi)) + else: + with open(abifile, "w") as f: + f.write(current_abi) + +def check_sanity_sstate_dir_change(sstate_dir, data): + # Sanity checks to be done when the value of SSTATE_DIR changes + + # Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS) + testmsg = "" + if sstate_dir != "": + testmsg = check_create_long_filename(sstate_dir, "SSTATE_DIR") + # If we don't have permissions to SSTATE_DIR, suggest the user set it as an SSTATE_MIRRORS + try: + err = testmsg.split(': ')[1].strip() + if err == "Permission denied.": + testmsg = testmsg + "You could try using %s in SSTATE_MIRRORS rather than as an SSTATE_CACHE.\n" % (sstate_dir) + except IndexError: + pass + return testmsg + +def check_sanity_version_change(status, d): + import glob + + # Sanity checks to be done when SANITY_VERSION or NATIVELSBSTRING changes + # In other words, these tests run once in a given build directory and then + # never again until the sanity version or host distribution id/version changes. + + # Check the python install is complete. Examples that are often removed in + # minimal installations: glib-2.0-natives requires xml.parsers.expat + try: + import xml.parsers.expat + except ImportError as e: + status.addresult('Your Python 3 is not a full install. Please install the module %s (see the Getting Started guide for further information).\n' % e.name) + + status.addresult(check_gcc_version(d)) + status.addresult(check_make_version(d)) + status.addresult(check_patch_version(d)) + status.addresult(check_tar_version(d)) + status.addresult(check_git_version(d)) + status.addresult(check_perl_modules(d)) + status.addresult(check_wsl(d)) + status.addresult(check_userns()) + + missing = "" + + if not oe.utils.check_app_exists("${MAKE}", d): + missing = missing + "GNU make," + + if not oe.utils.check_app_exists('gcc', d): + missing = missing + "C Compiler (gcc)," + + if not oe.utils.check_app_exists('g++', d): + missing = missing + "C++ Compiler (g++)," + + # installing emacs on Ubuntu 24.04 pulls in emacs-gtk -> libgcc-14-dev despite gcc being 13 + # this breaks libcxx-native and compiler-rt-native builds so tell the user to fix things + if glob.glob("/usr/lib/gcc/*/14/libgcc_s.so") and not glob.glob("/usr/lib/gcc/*/14/libstdc++.so"): + status.addresult('libgcc-14-dev is installed and not libstdc++-14-dev which will break clang native compiles. Please remove one or install the other.') + + required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES') + + for util in required_utilities.split(): + if not oe.utils.check_app_exists(util, d): + missing = missing + "%s," % util + + if missing: + missing = missing.rstrip(',') + status.addresult("Please install the following missing utilities: %s\n" % missing) + + assume_provided = d.getVar('ASSUME_PROVIDED').split() + # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf + if "diffstat-native" not in assume_provided: + status.addresult('Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n') + + # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS) + import stat + tmpdir = d.getVar('TMPDIR') + topdir = d.getVar('TOPDIR') + status.addresult(check_create_long_filename(tmpdir, "TMPDIR")) + tmpdirmode = os.stat(tmpdir).st_mode + if (tmpdirmode & stat.S_ISGID): + status.addresult("TMPDIR is setgid, please don't build in a setgid directory") + if (tmpdirmode & stat.S_ISUID): + status.addresult("TMPDIR is setuid, please don't build in a setuid directory") + + # Check that a user isn't building in a path in PSEUDO_IGNORE_PATHS + pseudoignorepaths = (d.getVar('PSEUDO_IGNORE_PATHS', expand=True) or "").split(",") + workdir = d.getVar('WORKDIR', expand=True) + for i in pseudoignorepaths: + if i and workdir.startswith(i): + status.addresult("You are building in a path included in PSEUDO_IGNORE_PATHS " + str(i) + " please locate the build outside this path.\n") + + # Check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap + pseudoignorepaths = (d.getVar('PSEUDO_IGNORE_PATHS', expand=True) or "").split(",") + pseudo_control_dir = "${D},${PKGD},${PKGDEST},${IMAGEROOTFS},${SDK_OUTPUT}" + pseudocontroldir = d.expand(pseudo_control_dir).split(",") + for i in pseudoignorepaths: + for j in pseudocontroldir: + if i and j: + if j.startswith(i): + status.addresult("A path included in PSEUDO_IGNORE_PATHS " + str(i) + " and the path " + str(j) + " overlap and this will break pseudo permission and ownership tracking. Please set the path " + str(j) + " to a different directory which does not overlap with pseudo controlled directories. \n") + + # Some third-party software apparently relies on chmod etc. being suid root (!!) + import stat + suid_check_bins = "chown chmod mknod".split() + for bin_cmd in suid_check_bins: + bin_path = bb.utils.which(os.environ["PATH"], bin_cmd) + if bin_path: + bin_stat = os.stat(bin_path) + if bin_stat.st_uid == 0 and bin_stat.st_mode & stat.S_ISUID: + status.addresult('%s has the setuid bit set. This interferes with pseudo and may cause other issues that break the build process.\n' % bin_path) + + # Check that we can fetch from various network transports + netcheck = check_connectivity(d) + status.addresult(netcheck) + if netcheck: + status.network_error = True + + nolibs = d.getVar('NO32LIBS') + if not nolibs: + lib32path = '/lib' + if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ): + lib32path = '/lib32' + + if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'): + status.addresult("You have a 32-bit libc, but no 32-bit headers. You must install the 32-bit libc headers.\n") + + bbpaths = d.getVar('BBPATH').split(":") + if ("." in bbpaths or "./" in bbpaths or "" in bbpaths): + status.addresult("BBPATH references the current directory, either through " \ + "an empty entry, a './' or a '.'.\n\t This is unsafe and means your "\ + "layer configuration is adding empty elements to BBPATH.\n\t "\ + "Please check your layer.conf files and other BBPATH " \ + "settings to remove the current working directory " \ + "references.\n" \ + "Parsed BBPATH is" + str(bbpaths)); + + oes_bb_conf = d.getVar( 'OES_BITBAKE_CONF') + if not oes_bb_conf: + status.addresult('You are not using the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n') + + # The length of TMPDIR can't be longer than 400 + status.addresult(check_path_length(tmpdir, "TMPDIR", 400)) + + # Check that TOPDIR does not contain non ascii chars (perl_5.40.0, Perl-native and shadow-native build failures) + status.addresult(check_non_ascii(topdir, "TOPDIR")) + + # Check that TMPDIR isn't located on nfs + status.addresult(check_not_nfs(tmpdir, "TMPDIR")) + + # Check for case-insensitive file systems (such as Linux in Docker on + # macOS with default HFS+ file system) + status.addresult(check_case_sensitive(tmpdir, "TMPDIR")) + + # Check if linking with lstdc++ is failing + status.addresult(check_cpp_toolchain_flag(d, "-lstdc++")) + + # Check if the C++ toochain support the "--std=gnu++20" flag + status.addresult(check_cpp_toolchain_flag(d, "--std=gnu++20", + "An error occurred during checking the C++ toolchain for '--std=gnu++20' support. " + "Please use a g++ compiler that supports C++20 (e.g. g++ version 10 onwards).")) + + # Check there aren't obsolete wic/wks directories + for component in d.getVar("BBPATH").split(":") + d.getVar("BBLAYERS").split(): + for subcomponent in ['wic', 'scripts/lib/wic/canned-wks']: + testpath = os.path.join(component, subcomponent) + if os.path.exists(testpath): + status.addresult("wic/wks files at %s need to be moved to files/wic within the layer to be found/used\n" % testpath) + +def sanity_check_locale(d): + """ + Currently bitbake switches locale to en_US.UTF-8 so check that this locale actually exists. + """ + import locale + try: + locale.setlocale(locale.LC_ALL, "en_US.UTF-8") + except locale.Error: + raise_sanity_error("Your system needs to support the en_US.UTF-8 locale.", d) + +def check_cargo_config(d): + # Cargo merges .cargo/config[.toml] from every directory between CWD and + # the filesystem root. Warn for anything found in ancestor directories + # above BASE_WORKDIR that Cargo would pick up silently. + import os + + base_workdir = d.getVar('BASE_WORKDIR') + ancestor = os.path.dirname(base_workdir) + found = [] + last_ancestor = None + while True: + for name in ('config', 'config.toml'): + cfg = os.path.join(ancestor, '.cargo', name) + if os.path.exists(cfg): + found.append(cfg) + last_ancestor = ancestor + break + parent = os.path.dirname(ancestor) + if parent == ancestor: + break + ancestor = parent + + if found: + bb.warn("Cargo config file(s) found at %s which is/are outside the build " + "directory. Cargo will silently apply their settings during the " + "rust/cargo build and can override Yocto's settings like linker, " + "registry or compiler settings causing build failures. You can " + "either remove these file(s) or move your build directory outside " + "of %s to fix this. " + "See https://bugzilla.yoctoproject.org/show_bug.cgi?id=15637 for more details." + % (', '.join(found), last_ancestor)) + +def check_sanity_everybuild(status, d): + import os, stat + # Sanity tests which test the users environment so need to run at each build (or are so cheap + # it makes sense to always run them. + + if 0 == os.getuid(): + raise_sanity_error("Do not use Bitbake as root.", d) + + # Check the Python version, we now have a minimum of Python 3.9 + import sys + if sys.hexversion < 0x030900F0: + status.addresult('The system requires at least Python 3.9 to run. Please update your Python interpreter.\n') + + # Check the bitbake version meets minimum requirements + minversion = d.getVar('BB_MIN_VERSION') + if bb.utils.vercmp_string_op(bb.__version__, minversion, "<"): + status.addresult('Bitbake version %s is required and version %s was found\n' % (minversion, bb.__version__)) + + sanity_check_locale(d) + check_cargo_config(d) + + paths = d.getVar('PATH').split(":") + if "." in paths or "./" in paths or "" in paths: + status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") + + #Check if bitbake is present in PATH environment variable + bb_check = bb.utils.which(d.getVar('PATH'), 'bitbake') + if not bb_check: + bb.warn("bitbake binary is not found in PATH, did you source the script?") + + # Check whether 'inherit' directive is found (used for a class to inherit) + # in conf file it's supposed to be uppercase INHERIT + inherit = d.getVar('inherit') + if inherit: + status.addresult("Please don't use inherit directive in your local.conf. The directive is supposed to be used in classes and recipes only to inherit of bbclasses. Here INHERIT should be used.\n") + + # Check that the DISTRO is valid, if set + # need to take into account DISTRO renaming DISTRO + distro = d.getVar('DISTRO') + if distro and distro != "nodistro": + if not ( check_conf_exists("conf/distro/${DISTRO}.conf", d) or check_conf_exists("conf/distro/include/${DISTRO}.inc", d) ): + status.addresult("DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % d.getVar("DISTRO")) + + # Check that these variables don't use tilde-expansion as we don't do that + for v in ("TMPDIR", "DL_DIR", "SSTATE_DIR"): + if d.getVar(v).startswith("~"): + status.addresult("%s uses ~ but Bitbake will not expand this, use an absolute path or variables." % v) + + # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't + # set, since so much relies on it being set. + dldir = d.getVar('DL_DIR') + if not dldir: + status.addresult("DL_DIR is not set. Your environment is misconfigured, check that DL_DIR is set, and if the directory exists, that it is writable. \n") + if os.path.exists(dldir) and not os.access(dldir, os.W_OK): + status.addresult("DL_DIR: %s exists but you do not appear to have write access to it. \n" % dldir) + check_symlink(dldir, d) + + # Check that the MACHINE is valid, if it is set + machinevalid = True + if d.getVar('MACHINE'): + if not check_conf_exists("conf/machine/${MACHINE}.conf", d): + status.addresult('MACHINE=%s is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file.\n' % (d.getVar('MACHINE'))) + machinevalid = False + else: + status.addresult(check_sanity_validmachine(d)) + else: + status.addresult('Please set a MACHINE in your local.conf or environment\n') + machinevalid = False + if machinevalid: + status.addresult(check_toolchain(d)) + + # Check that the SDKMACHINE is valid, if it is set + if d.getVar('SDKMACHINE'): + if not check_conf_exists("conf/machine-sdk/${SDKMACHINE}.conf", d): + status.addresult('Specified SDKMACHINE value is not valid\n') + elif d.getVar('SDK_ARCH', False) == "${BUILD_ARCH}": + status.addresult('SDKMACHINE is set, but SDK_ARCH has not been changed as a result - SDKMACHINE may have been set too late (e.g. in the distro configuration)\n') + + # If SDK_VENDOR looks like "-my-sdk" then the triples are badly formed so fail early + sdkvendor = d.getVar("SDK_VENDOR") + if not (sdkvendor.startswith("-") and sdkvendor.count("-") == 1): + status.addresult("SDK_VENDOR should be of the form '-foosdk' with a single dash; found '%s'\n" % sdkvendor) + + check_supported_distro(d) + + omask = os.umask(0o022) + if omask & 0o755: + status.addresult("Please use a umask which allows a+rx and u+rwx\n") + os.umask(omask) + + # Ensure /tmp is NOT mounted with noexec + if os.statvfs("/tmp").f_flag & os.ST_NOEXEC: + raise_sanity_error("/tmp shouldn't be mounted with noexec.", d) + + if d.getVar('TARGET_ARCH') == "arm": + # This path is no longer user-readable in modern (very recent) Linux + try: + if os.path.exists("/proc/sys/vm/mmap_min_addr"): + f = open("/proc/sys/vm/mmap_min_addr", "r") + try: + if (int(f.read().strip()) > 65536): + status.addresult("/proc/sys/vm/mmap_min_addr is not <= 65536. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 65536 in /etc/sysctl.conf.\n") + finally: + f.close() + except: + pass + + for checkdir in ['COREBASE', 'TMPDIR']: + val = d.getVar(checkdir) + if val.find('..') != -1: + status.addresult("Error, you have '..' in your %s directory path. Please ensure the variable contains an absolute path as this can break some recipe builds in obtuse ways." % checkdir) + if val.find('+') != -1: + status.addresult("Error, you have an invalid character (+) in your %s directory path. Please move the installation to a directory which doesn't include any + characters." % checkdir) + if val.find('@') != -1: + status.addresult("Error, you have an invalid character (@) in your %s directory path. Please move the installation to a directory which doesn't include any @ characters." % checkdir) + if val.find(' ') != -1: + status.addresult("Error, you have a space in your %s directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this." % checkdir) + if val.find('%') != -1: + status.addresult("Error, you have an invalid character (%) in your %s directory path which causes problems with python string formatting. Please move the installation to a directory which doesn't include any % characters." % checkdir) + + # Redundant slashes (trailing slash or consecutive slashes) in TMPDIR + # break the sstate staging machinery which relies on exact string matching + # of manifest paths. Reject any TMPDIR that differs from its normalised form. + tmpdir = d.getVar('TMPDIR') + if tmpdir and tmpdir != os.path.normpath(tmpdir): + status.addresult("Error, TMPDIR (%s) contains redundant slashes. " + "Please set TMPDIR to a clean path with no trailing slash or " + "consecutive slashes (e.g. %s).\n" % (tmpdir, os.path.normpath(tmpdir))) + + # Check whether the SOURCE_MIRROR_URL variable, belonging to the 'own-mirrors' class, is defined + if oe.utils.inherits(d, 'own-mirrors') and not d.getVar('SOURCE_MIRROR_URL'): + status.addresult("own-mirrors is enabled, but SOURCE_MIRROR_URL is not defined") + + # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS + import re + mirror_vars = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS'] + protocols = ['http', 'ftp', 'file', 'https', \ + 'git', 'gitsm', 'hg', 'p4', 'svn', \ + 'npm', 'sftp', 'ssh', 's3', \ + 'az', 'ftps', 'crate', 'gs'] + for mirror_var in mirror_vars: + mirrors = (d.getVar(mirror_var) or '').replace('\\n', ' ').split() + + # Split into pairs + if len(mirrors) % 2 != 0: + bb.warn('Invalid mirror variable value for %s: %s, should contain paired members.' % (mirror_var, str(mirrors))) + continue + mirrors = list(zip(*[iter(mirrors)]*2)) + + for mirror_entry in mirrors: + pattern, mirror = mirror_entry + + decoded = bb.fetch2.decodeurl(pattern) + try: + pattern_scheme = re.compile(decoded[0]) + except re.error as exc: + bb.warn('Invalid scheme regex (%s) in %s; %s' % (pattern, mirror_var, mirror_entry)) + continue + + if not any(pattern_scheme.match(protocol) for protocol in protocols): + bb.warn('Invalid protocol (%s) in %s: %s' % (decoded[0], mirror_var, mirror_entry)) + continue + + if not any(mirror.startswith(protocol + '://') for protocol in protocols): + bb.warn('Invalid protocol in %s: %s' % (mirror_var, mirror_entry)) + continue + + if mirror.startswith('file://'): + import urllib + check_symlink(urllib.parse.urlparse(mirror).path, d) + # SSTATE_MIRROR ends with a /PATH string + if mirror.endswith('/PATH'): + # remove /PATH$ from SSTATE_MIRROR to get a working + # base directory path + mirror_base = urllib.parse.urlparse(mirror[:-1*len('/PATH')]).path + check_symlink(mirror_base, d) + + if d.getVar("BB_SIGNATURE_HANDLER") == "OEEquivHash": + # Check sstate mirrors aren't being used with a local hash server and no remote + hashserv = d.getVar("BB_HASHSERVE") + if d.getVar("SSTATE_MIRRORS") and hashserv and hashserv.startswith("unix://") and not d.getVar("BB_HASHSERVE_UPSTREAM"): + bb.warn("You are using a local hash equivalence server but have configured an sstate mirror. This will likely mean no sstate will match from the mirror. You may wish to disable the hash equivalence use (BB_HASHSERVE), or use a hash equivalence server alongside the sstate mirror.") + + # Check that when SSTATE_DIR is shared between builds, hashserve database is not private to a build + hashserv_proto,_,hashserv_path,_,_,_ = bb.fetch2.decodeurl(hashserv) + if hashserv_proto == "unix": + dbdir = d.getVar("BB_HASHSERVE_DB_DIR") or d.getVar("PERSISTENT_DIR") or d.getVar("CACHE") + topdir = d.getVar("TOPDIR") + sstatedir = d.getVar("SSTATE_DIR") + + if (hashserv_path.startswith(topdir) and dbdir.startswith(topdir) and not sstatedir.startswith(topdir)): + if bb.utils.is_path_on_nfs(sstatedir): + bb.warn("""Sstate directory is on a shared NFS (it is set via SSTATE_DIR to {}), + but hash equivalency database is inside this particular build directory {}. + + This will prevent sstate reuse, and it is recommended to set up a permanently running hash equivalency server + according to https://docs.yoctoproject.org/dev-manual/hashequivserver.html""".format(sstatedir, topdir)) + else: + bb.warn("""Sstate directory is shared between several builds (it is set via SSTATE_DIR to {}), + but hash equivalency database is inside this particular build directory {}. + + This will prevent sstate reuse, and it is recommended to set the location for the database to a common path + via BB_HASHSERVE_DB_DIR, for example: + + BB_HASHSERVE_DB_DIR = \"${{SSTATE_DIR}}\"""".format(sstatedir, topdir)) + + # Check that TMPDIR hasn't changed location since the last time we were run + tmpdir = d.getVar('TMPDIR') + checkfile = os.path.join(tmpdir, "saved_tmpdir") + if os.path.exists(checkfile): + with open(checkfile, "r") as f: + saved_tmpdir = f.read().strip() + if (saved_tmpdir != tmpdir): + status.addresult("Error, TMPDIR has changed location. You need to either move it back to %s or delete it and rebuild\n" % saved_tmpdir) + else: + bb.utils.mkdirhier(tmpdir) + # Remove setuid, setgid and sticky bits from TMPDIR + try: + os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISUID) + os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISGID) + os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISVTX) + except OSError as exc: + bb.warn("Unable to chmod TMPDIR: %s" % exc) + with open(checkfile, "w") as f: + f.write(tmpdir) + + # If /bin/sh is a symlink, check that it points to dash or bash + if os.path.islink('/bin/sh'): + real_sh = os.path.realpath('/bin/sh') + # Due to update-alternatives, the shell name may take various + # forms, such as /bin/dash, bin/bash, /bin/bash.bash ... + if '/dash' not in real_sh and '/bash' not in real_sh: + status.addresult("Error, /bin/sh links to %s, must be dash or bash\n" % real_sh) + +def check_sanity(sanity_data): + class SanityStatus(object): + def __init__(self): + self.messages = "" + self.network_error = False + + def addresult(self, message): + if message: + self.messages = self.messages + message + + status = SanityStatus() + + tmpdir = sanity_data.getVar('TMPDIR') + sstate_dir = sanity_data.getVar('SSTATE_DIR') + + check_symlink(sstate_dir, sanity_data) + + # Check saved sanity info + last_sanity_version = 0 + last_tmpdir = "" + last_sstate_dir = "" + last_nativelsbstr = "" + sanityverfile = sanity_data.expand("${TOPDIR}/cache/sanity_info") + if os.path.exists(sanityverfile): + with open(sanityverfile, 'r') as f: + for line in f: + if line.startswith('SANITY_VERSION'): + last_sanity_version = int(line.split()[1]) + if line.startswith('TMPDIR'): + last_tmpdir = line.split()[1] + if line.startswith('SSTATE_DIR'): + last_sstate_dir = line.split()[1] + if line.startswith('NATIVELSBSTRING'): + last_nativelsbstr = line.split()[1] + + check_sanity_everybuild(status, sanity_data) + + sanity_version = int(sanity_data.getVar('SANITY_VERSION') or 1) + network_error = False + # NATIVELSBSTRING var may have been overridden with "universal", so + # get actual host distribution id and version + nativelsbstr = oe.lsb.distro_identifier(sanity_data) + if last_sanity_version < sanity_version or last_nativelsbstr != nativelsbstr: + check_sanity_version_change(status, sanity_data) + status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data)) + else: + if last_sstate_dir != sstate_dir: + status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data)) + + if os.path.exists(os.path.dirname(sanityverfile)) and not status.messages: + with open(sanityverfile, 'w') as f: + f.write("SANITY_VERSION %s\n" % sanity_version) + f.write("TMPDIR %s\n" % tmpdir) + f.write("SSTATE_DIR %s\n" % sstate_dir) + f.write("NATIVELSBSTRING %s\n" % nativelsbstr) + + sanity_handle_abichanges(status, sanity_data) + + if status.messages != "": + raise_sanity_error(sanity_data.expand(status.messages), sanity_data, status.network_error) + From patchwork Sun Aug 2 10:28:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 94213 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 4958BC55174 for ; Sun, 2 Aug 2026 10:29:38 +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.21346.1785666572919539218 for ; Sun, 02 Aug 2026 03:29:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=L8SSOr6t; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.44, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-495590dde14so11166635e9.0 for ; Sun, 02 Aug 2026 03:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1785666571; x=1786271371; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=qhs3J+cWjgbp2ZE5TacPQdFqlRcN1/Vl0cHF6OJfVO0=; b=L8SSOr6tiX/SM4ZU6qkYc3zS6p3D5T+zCbBZUbZIdl0i9+JaPsQ85rKZ3zmgf8ryGU IUYweKU2e+70IrjQQEEtqIbPVtCvcC0W/LhcHi33wue9bOvBmdV3hYUZTP/mz2LU1HBj E0c16oxPrBkUMbPJCOEmuv3yH1b/x/fTUErQQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785666571; x=1786271371; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=qhs3J+cWjgbp2ZE5TacPQdFqlRcN1/Vl0cHF6OJfVO0=; b=HT7rWXXyM5MR3AyZzHIvcPRqLNdjeH+tzzEGbqUMqd+bp8AcZ+cCqdDYz0eCBEyD81 j8qTEa9pJ2+yBu/xXIRjBf6Bc2bR+bVcrBvx2lnvQuXpFXiCqX3E8PenVBI+1rERl9Al u5BddKOuiTXf6YTcmXrLqU6XNXhaZA0p0iVDHaUs0nk146ni/46BBwT4pYIOk3VX562X ow2lR41Fd6iqvwAk8VvxCddXhcwgAYPe81mRec/pOEhW1hhpi6N6D4Z1a4Yu96uWj0vS GEL3cP4ep27XmgYQL3AAvad5sJ+uTUI72/Nus9MUTr058SdUPRZlNuQ4ePe4nKOBHqta Cbww== X-Gm-Message-State: AOJu0Yw6CZhdqLbsOzocuoWzH3Jiq5CDX+PLTXRa8Dgplekl0i8nIUWF BnnDcZg+3qRnhMAUhUesFuBGjT+CEWUs+sY3gm0TZJW5cduo+ZW4XgOFqiIoS3u4qf7vTSxhllk ul4QZjOs= X-Gm-Gg: AR+sD13lWD+JcTVHzpsjJMQp0CxIylqoz7bTPkqnNZaFeiRR5IcDqMHanSy5L4vgg/j N6N2vji2KvaD4R0y2O4zWW2VNPVWkYZrMw2KvdRHncIqUWzr2XONU4Kr7Q27Ubg6+1tRAQPugZT TVLfPHZNp706VBnI6+TnB/Geuz1gd2hQhDb/SMbkr3UP9+ZKFFvIjTn0aC/I4St7XxXq9VoKO57 xyRX15+8CcadQFBLRA76rqS/CFSCx4eluO9qgei470I/3fcySUnkpirvFHYRvBTSGSAI4DW2QGa 8FR4NLNgflF2exneaW2ltdtpHU4kf3g80jHohBgs1oPqkc9M2vb+iIoPafi3Htrw2rzeSDDIdkj Vbl8PckaalhPtFGjrqPljWwaX7fhxz8UiLIfxtRPwdIxlpKxVS/6ROZhoMNkkrexE7cKWRNQtAg v/Hi7GaDEufM1EHApJTRidmZoewrZYGrFAR5CP+mafs3QY5YoXEoXz38w2Si9Glx5AsUnC/Mwwn Uu3l2eAo+yq9cNxIQ== X-Received: by 2002:a05:600c:811b:b0:495:6934:414c with SMTP id 5b1f17b1804b1-4980c696c7emr114845455e9.19.1785666571230; Sun, 02 Aug 2026 03:29:31 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:11e3:e7fc:e526:8a64]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49807b8d04fsm167140375e9.3.2026.08.02.03.29.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 03:29:30 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 25/25] sanity: Drop unreachable code Date: Sun, 2 Aug 2026 11:28:54 +0100 Message-ID: <20260802102854.3952760-26-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> References: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org> 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 ; Sun, 02 Aug 2026 10:29:38 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242549 This code looks like a paste error and could never be reached. Drop. Signed-off-by: Richard Purdie --- meta/classes-global/sanity.bbclass | 2 -- 1 file changed, 2 deletions(-) diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass index af9e2c3ef1a..9514e7d2189 100644 --- a/meta/classes-global/sanity.bbclass +++ b/meta/classes-global/sanity.bbclass @@ -121,8 +121,6 @@ is a good way to visualise the changes.""" bb.note("Your conf/bblayers.conf has been automatically updated.") return - status.addresult() - elif current_lconf == 6 and lconf_version > 6: # Handle rename of meta-yocto -> meta-poky # This marks the start of separate version numbers but code is needed in OE-Core