From patchwork Sat Mar 28 09:48:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 84683 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 5BA1E10F3DD9 for ; Sat, 28 Mar 2026 09:49:20 +0000 (UTC) Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.8246.1774691354667948964 for ; Sat, 28 Mar 2026 02:49:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@pbarker.dev header.s=fm3 header.b=tjI22ZPJ; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=KONttv39; spf=pass (domain: pbarker.dev, ip: 103.168.172.146, mailfrom: paul@pbarker.dev) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id E678CEC0227; Sat, 28 Mar 2026 05:49:13 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Sat, 28 Mar 2026 05:49:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pbarker.dev; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1774691353; x=1774777753; bh=/swMbxnWzcCJdWbVT/EyohKAydsvvEoGA0SZnwGXgnc=; b= tjI22ZPJUfe9nYFs3BuKkG3UokBRUviye/ozL0dXrhu0Zqdl5Glz5sxfh4Y7lqll gFi8Qi6US1HyKoTdN8HBh+yrtAV6pMQCT21LUOZVEdvx+mjQXzKHqbf0a7x5pMxe /VHPBDwZkyIOiEUPNUkJCvIWjaWDP2F350iwJVfDk30gKdtd2GCfNc5gtIAKtnI8 BOXAQxoWYzPh5fwHNVCvZqlrCvE3fILCmMLoZrGJryYoUgBJ3scno3OdNWjIHPI4 4FdwkklDBVBs1xF1gOv62Otu52/TIYNkn0utxaIUHxb6gjP8ekRmfdICVm7OBxGm TrynTh3aZrFj/NxPA9qcPQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1774691353; x= 1774777753; bh=/swMbxnWzcCJdWbVT/EyohKAydsvvEoGA0SZnwGXgnc=; b=K ONttv39TBz0Qx6aIhCDfgFrJqZQ8DJn7cdSG5CAsSypT9HeVZ6I9RfbTS3NaFjOn Cxx51Uj67I6Xj4NUMhDBSqfzsfANhJLk4zMap8kwnDqsbDkQO4ooCeq6Br+20h6g wEna55M4Cdeo9pwNr+C3QwKEg1kFHerOkYBYPqe3sH0znPCmpf9VZ/bqwP0GmkMA 7A2e2HrFsRnh7cmuvXEOWtOZ3wAu8ktkvybBHR2M7hk9bhxm53TJXhojFlVjHWB9 5uhRIsIjoSyFxurxtO12pNirqX7jC92VG4P8iAoDYF12imQ+727nbtONalCgIYTa VJeAPe0ttFhpywLycQryQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeffedvkeehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhfffugggtgffkfhgjvfevofesthejre dtredtjeenucfhrhhomheprfgruhhluceurghrkhgvrhcuoehprghulhesphgsrghrkhgv rhdruggvvheqnecuggftrfgrthhtvghrnheptdffvdffjeevhfelieegudfgieefleefue efffelvdehfeeviedtieeukefhleeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepphgruhhlsehpsggrrhhkvghrrdguvghvpdhnsggprhgtph htthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehprghulhesphgsrghr khgvrhdruggvvhdprhgtphhtthhopehophgvnhgvmhgsvgguuggvugdqtghorhgvsehlih hsthhsrdhophgvnhgvmhgsvgguuggvugdrohhrgh X-ME-Proxy: Feedback-ID: i51494658:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 28 Mar 2026 05:49:13 -0400 (EDT) From: Paul Barker Date: Sat, 28 Mar 2026 09:48:59 +0000 Subject: [PATCH 1/4] oelib: utils: Support filtering default features MIME-Version: 1.0 Message-Id: <20260328-default-features-v1-1-90790864d734@pbarker.dev> References: <20260328-default-features-v1-0-90790864d734@pbarker.dev> In-Reply-To: <20260328-default-features-v1-0-90790864d734@pbarker.dev> To: openembedded-core@lists.openembedded.org Cc: Paul Barker X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4530; i=paul@pbarker.dev; h=from:subject:message-id; bh=9++4ZQ3mBiIAeyV27S+Hjj+A7Su2VdmDxAjOxLUxkA0=; b=owGbwMvMwCW2OjnkzdxdX/IYT6slMWQeXyKxqz6K4+q5Jx+aTiaf4GrW1r62a6Os8cakkriII xOi989K6ihlYRDjYpAVU2TZ3PP1/tNeR96MkFsKMHNYmUCGMHBxCsBEBEMYGaY+ZNArueScU3Xh h9zFz8fe39lio/u2t+L57Q/2Klks/A2MDLPN2XlELB9N0l/U2b/FfXno72Vf1jdPtBOdlPl52sw zCxgA X-Developer-Key: i=paul@pbarker.dev; a=openpgp; fpr=98B2AAC100AC3F82BB5D546774975C81B7E66BAC 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 ; Sat, 28 Mar 2026 09:49:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234123 The new library function filter_default_features() allows us to support opting out of any default features without having to use :remove. Signed-off-by: Paul Barker --- meta/lib/oe/utils.py | 35 +++++++++++++++++++++++++++++ meta/lib/oeqa/selftest/cases/oelib/utils.py | 31 ++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index afcfeda0c6d5..928b38c64cf9 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -83,6 +83,31 @@ def set_intersect(variable1, variable2, d): val2 = set(d.getVar(variable2).split()) return " ".join(val1 & val2) +def set_difference(variable1, variable2, d): + """ + Expand both variables, interpret them as lists of strings, and return the + intersection as a flattened string. + + For example: + s1 = "a b c" + s2 = "b c d" + s3 = set_difference(s1, s2) + => s3 = "a" + """ + val1 = d.getVar(variable1) + if not val1: + return "" + val2 = d.getVar(variable2) + if not val2: + return val1 + + val1 = set(val1.split()) + val2 = set(val2.split()) + + # Return a sorted string to ensure that the result is consistent between + # parser runs. + return " ".join(sorted(val1 - val2)) + def prune_suffix(var, suffixes, d): # See if var ends with any of the suffixes listed and # remove it if found @@ -133,6 +158,16 @@ def features_backfill(var,d): if addfeatures: d.appendVar(var, " " + " ".join(addfeatures)) +def filter_default_features(varname, d): + # Process default features to exclude features which the user has opted out + # of. This should be called from an anonymous Python function and uses + # d.setVar() to avoid unnecessarily evaluating this on every data store + # update. + default_features = set_difference(varname + "_DEFAULT_RAW", + varname + "_OPTED_OUT", + d) + d.setVar(varname + "_DEFAULT", default_features) + def all_distro_features(d, features, truevalue="1", falsevalue=""): """ Returns truevalue if *all* given features are set in DISTRO_FEATURES, diff --git a/meta/lib/oeqa/selftest/cases/oelib/utils.py b/meta/lib/oeqa/selftest/cases/oelib/utils.py index 0cb46425a02d..4ba4b14f3742 100644 --- a/meta/lib/oeqa/selftest/cases/oelib/utils.py +++ b/meta/lib/oeqa/selftest/cases/oelib/utils.py @@ -8,7 +8,7 @@ import sys from unittest.case import TestCase from contextlib import contextmanager from io import StringIO -from oe.utils import packages_filter_out_system, trim_version, multiprocess_launch +from oe.utils import packages_filter_out_system, trim_version, multiprocess_launch, filter_default_features class TestPackagesFilterOutSystem(TestCase): def test_filter(self): @@ -102,3 +102,32 @@ class TestMultiprocessLaunch(TestCase): with captured_output() as (out, err): self.assertRaises(bb.BBHandledException, multiprocess_launch, testfunction, ["1", "2", "3", "4", "5", "6"], d, extraargs=(d,)) self.assertIn("KeyError: 'Invalid number 2'", out.getvalue()) + + +class TestDefaultFeatures(TestCase): + def test_filter_default_features(self): + try: + import bb + d = bb.data_smart.DataSmart() + except ImportError: + self.skipTest("Cannot import bb") + + # Test with nothing opted out + d.setVar("DISTRO_FEATURES_DEFAULT_RAW", "alpha beta gamma") + filter_default_features("DISTRO_FEATURES", d) + self.assertEqual(d.getVar("DISTRO_FEATURES_DEFAULT"), "alpha beta gamma") + + # opt out of a single feature + d.setVar("DISTRO_FEATURES_OPTED_OUT", "beta") + filter_default_features("DISTRO_FEATURES", d) + self.assertEqual(d.getVar("DISTRO_FEATURES_DEFAULT"), "alpha gamma") + + # opt out of everything + d.setVar("DISTRO_FEATURES_OPTED_OUT", "gamma alpha beta") + filter_default_features("DISTRO_FEATURES", d) + self.assertEqual(d.getVar("DISTRO_FEATURES_DEFAULT"), "") + + # opt out of something that isn't in our defaults + d.setVar("DISTRO_FEATURES_OPTED_OUT", "omega") + filter_default_features("DISTRO_FEATURES", d) + self.assertEqual(d.getVar("DISTRO_FEATURES_DEFAULT"), "alpha beta gamma") From patchwork Sat Mar 28 09:49:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 84685 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 6AF8310F3DDB for ; Sat, 28 Mar 2026 09:49:20 +0000 (UTC) Received: from fhigh-a7-smtp.messagingengine.com (fhigh-a7-smtp.messagingengine.com [103.168.172.158]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.8247.1774691355467538859 for ; Sat, 28 Mar 2026 02:49:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@pbarker.dev header.s=fm3 header.b=l0WbQdFW; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=YIFZ21iW; spf=pass (domain: pbarker.dev, ip: 103.168.172.158, mailfrom: paul@pbarker.dev) Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id A047314001E0; Sat, 28 Mar 2026 05:49:14 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Sat, 28 Mar 2026 05:49:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pbarker.dev; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1774691354; x=1774777754; bh=2KQgZXPTpGGsLCvqFGyTjSgNWQoFFYCZYUfYXU56IX0=; b= l0WbQdFWRD/X3CZJqi0lrFynLUwnsiicDGvd7m+ynMEEIDP9cOOVXQhK3Sm1HGP4 gcbSj2bbMR+w/ppz5ZDk/6gultnYI8nlLeZ2KUIvnaTxylM1oJFl/EUNdHhxjueq hl1JhlpcG7Oq0mlAvOk9Y27sAIirdWX3gg3U60iZgBspJrLBhFSDncar5aSTOwbT DuVDuLslhL4Vf8/xKAaqvDN6aQ92e7ZEQAuZ6zRCgzyyJoaXBLrSzzmGTjK6ebep oXrYXKKrEQ80m9RHOcnAX4ABnmgRKDG7UbsiTu90PhhnIV7atlwVrh2irWKai+rS ZQaFdOjZQRri8wUrNC0KaQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1774691354; x= 1774777754; bh=2KQgZXPTpGGsLCvqFGyTjSgNWQoFFYCZYUfYXU56IX0=; b=Y IFZ21iWUdt2OotT+0wLncvZlpXuIckF1UMxG+hy7AZujUZSLbYU1hMaxm/ZtcXrE jbRxD3ObfnZ+j/RmqxSOPIvO8kkaNUzexm8hazYABWOY2pSbfOslZ/ixVme4KAsi pSRplKnz4QmEMXrezl7Ar5j3m61yfoecEyOfDhvqjnZjtK4LTT1HUoyR1rdUvJz9 s7n84XHSp0Rw1+70hT/zQyyn1uuDoAOVffOSir9NyBQSiKlKP73IBAavyf2kJe+2 ZuJ+wAU/Oo9/HDvEs+x0jiE030xMS8qpGwLjg9wFoLrOZQs9WBorAvkIdJs/iSkQ 8wQHHVnygDXjoBLnx0aRg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeffedvkeehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhfffugggtgffkfhgjvfevofesthejre dtredtjeenucfhrhhomheprfgruhhluceurghrkhgvrhcuoehprghulhesphgsrghrkhgv rhdruggvvheqnecuggftrfgrthhtvghrnheptdffvdffjeevhfelieegudfgieefleefue efffelvdehfeeviedtieeukefhleeknecuvehluhhsthgvrhfuihiivgepudenucfrrghr rghmpehmrghilhhfrhhomhepphgruhhlsehpsggrrhhkvghrrdguvghvpdhnsggprhgtph htthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehprghulhesphgsrghr khgvrhdruggvvhdprhgtphhtthhopehophgvnhgvmhgsvgguuggvugdqtghorhgvsehlih hsthhsrdhophgvnhgvmhgsvgguuggvugdrohhrgh X-ME-Proxy: Feedback-ID: i51494658:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 28 Mar 2026 05:49:14 -0400 (EDT) From: Paul Barker Date: Sat, 28 Mar 2026 09:49:00 +0000 Subject: [PATCH 2/4] meta: Support opting out of any distro features MIME-Version: 1.0 Message-Id: <20260328-default-features-v1-2-90790864d734@pbarker.dev> References: <20260328-default-features-v1-0-90790864d734@pbarker.dev> In-Reply-To: <20260328-default-features-v1-0-90790864d734@pbarker.dev> To: openembedded-core@lists.openembedded.org Cc: Paul Barker X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=12794; i=paul@pbarker.dev; h=from:subject:message-id; bh=X3JWYU4/qOK4ICsn155vFJXi0btygwN/RH/ehxRqdvI=; b=kA0DAAoWq2NU7J269G4ByyZiAGnHpBigxMKBlyE/yNa2YWSVmqLcH2mpUhsVUq395yz+ldcec Yh1BAAWCgAdFiEEs4z13+WNQQ1oVNogq2NU7J269G4FAmnHpBgACgkQq2NU7J269G6VtAD/TTzD 0PtJB7F5bVzpb7T9hoFqBazHHw7u6avSCwW2dhgA+wXhEtQKNyn2FX++8n298kpNDbyiCqtd3DS CMHO9ZJ4K X-Developer-Key: i=paul@pbarker.dev; a=openpgp; fpr=98B2AAC100AC3F82BB5D546774975C81B7E66BAC 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 ; Sat, 28 Mar 2026 09:49:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234124 Construct DISTRO_FEATURES_DEFAULT from DISTRO_FEATURES_DEFAULT_RAW using the new filter_default_features() function. This change obsoletes the variables DISTRO_FEATURES_BACKFILL and DISTRO_FEATURES_BACKFILL_CONSIDERED. Instead, all defaults are added to DISTRO_FEATURES_DEFAULT_RAW and users can opt out of any of these using DISTRO_FEATURES_OPTED_OUT. Hopefully the variable naming here is easier for people to understand and remember. DISTRO_FEATURES is now weakly set to DISTRO_FEATURES_DEFAULT in bitbake.conf, after inclusion of local, DISTRO and MACHINE conf files. This means that all assignments in conf files will need to use :append instead of += to preserve the defaults but this is in line with how other global variables are modified in conf files. Migration notes: - If you have previously extended DISTRO_FEATURES using :append, or set DISTRO_FEATURES to a new value including ${DISTRO_FEATURES_DEFAULT}, you shouldn't need to make any changes there. E.g. usage in poky.conf is ok, it doesn't need any change: DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}" - If you have previously set DISTRO_FEATURES, but did not include ${DISTRO_FEATURES_DEFAULT}, you will lose the features which were previously in DISTRO_FEATURES_BACKFILL: pulseaudio gobject-introspection-data ldconfig opengl ptest multiarch wayland vulkan You will need to add these to your DISTRO_FEATURES or include ${DISTRO_FEATURES_DEFAULT} as in the example above. - If you previously set DISTRO_FEATURES_BACKFILL_CONSIDERED, use the new variable DISTRO_FEATURES_OPTED_OUT instead. - If you previously modified DISTRO_FEATURES_BACKFILL, don't do that. Signed-off-by: Paul Barker --- meta/classes-global/base.bbclass | 5 ++++- meta/classes-recipe/crosssdk.bbclass | 7 +++---- meta/classes-recipe/native.bbclass | 7 +++---- meta/classes-recipe/nativesdk.bbclass | 7 +++---- meta/conf/bitbake.conf | 3 +-- meta/conf/distro/include/default-distrovars.inc | 15 +++++++++------ meta/conf/distro/include/tclibc-musl.inc | 2 +- meta/conf/distro/include/tclibc-newlib.inc | 2 +- meta/conf/distro/include/tclibc-picolibc.inc | 2 +- meta/conf/documentation.conf | 7 ++++--- 10 files changed, 30 insertions(+), 27 deletions(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 22b427a5211b..0a4cfd594c72 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -454,8 +454,11 @@ def set_packagetriplet(d): python () { import string, re + # Filter default features to allow users to opt out of features they don't + # want. + oe.utils.filter_default_features("DISTRO_FEATURES", d) + # Handle backfilling - oe.utils.features_backfill("DISTRO_FEATURES", d) oe.utils.features_backfill("MACHINE_FEATURES", d) # To add a recipe to the skip list , set: diff --git a/meta/classes-recipe/crosssdk.bbclass b/meta/classes-recipe/crosssdk.bbclass index a2853e6a9201..c2a49773c696 100644 --- a/meta/classes-recipe/crosssdk.bbclass +++ b/meta/classes-recipe/crosssdk.bbclass @@ -16,13 +16,12 @@ PACKAGE_ARCH = "${SDK_ARCH}" python () { # set TUNE_PKGARCH to SDK_ARCH d.setVar('TUNE_PKGARCH', d.getVar('SDK_ARCH')) - # Set features here to prevent appends and distro features backfill - # from modifying nativesdk distro features + # Set features here to prevent DISTRO_FEATURES modifications from affecting + # crosssdk distro features features = set(d.getVar("DISTRO_FEATURES_NATIVESDK").split()) - oe.utils.features_backfill("DISTRO_FEATURES", d) + oe.utils.filter_default_features("DISTRO_FEATURES", d) filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVESDK"), d).split()) d.setVar("DISTRO_FEATURES", " ".join(sorted(features | filtered))) - d.setVar("DISTRO_FEATURES_BACKFILL", "") } STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}" diff --git a/meta/classes-recipe/native.bbclass b/meta/classes-recipe/native.bbclass index 5aa9c8e4145e..45f20c239b8b 100644 --- a/meta/classes-recipe/native.bbclass +++ b/meta/classes-recipe/native.bbclass @@ -126,13 +126,12 @@ python native_virtclass_handler () { return bpn = d.getVar("BPN") - # Set features here to prevent appends and distro features backfill - # from modifying native distro features + # Set features here to prevent DISTRO_FEATURES modifications from affecting + # native distro features features = set(d.getVar("DISTRO_FEATURES_NATIVE").split()) - oe.utils.features_backfill("DISTRO_FEATURES", d) + oe.utils.filter_default_features("DISTRO_FEATURES", d) filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVE"), d).split()) d.setVar("DISTRO_FEATURES", " ".join(sorted(features | filtered))) - d.setVar("DISTRO_FEATURES_BACKFILL", "") classextend = d.getVar('BBCLASSEXTEND') or "" if "native" not in classextend: diff --git a/meta/classes-recipe/nativesdk.bbclass b/meta/classes-recipe/nativesdk.bbclass index 5adb7515bf14..47e81ecf95f6 100644 --- a/meta/classes-recipe/nativesdk.bbclass +++ b/meta/classes-recipe/nativesdk.bbclass @@ -78,13 +78,12 @@ python nativesdk_virtclass_handler () { if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")): return - # Set features here to prevent appends and distro features backfill - # from modifying nativesdk distro features + # Set features here to prevent DISTRO_FEATURES modifications from affecting + # nativesdk distro features features = set(d.getVar("DISTRO_FEATURES_NATIVESDK").split()) - oe.utils.features_backfill("DISTRO_FEATURES", d) + oe.utils.filter_default_features("DISTRO_FEATURES", d) filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVESDK"), d).split()) d.setVar("DISTRO_FEATURES", " ".join(sorted(features | filtered))) - d.setVar("DISTRO_FEATURES_BACKFILL", "") e.data.setVar("MLPREFIX", "nativesdk-") e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-nativesdk", "").replace("nativesdk-", "")) diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 6b3443695a04..4bf56fe2a9ae 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -889,7 +889,7 @@ OES_BITBAKE_CONF = "1" MACHINE_FEATURES ?= "" SDK_MACHINE_FEATURES ?= "" -DISTRO_FEATURES ?= "" +DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT}" DISTRO_EXTRA_RDEPENDS ?= "" DISTRO_EXTRA_RRECOMMENDS ?= "" @@ -912,7 +912,6 @@ DISTRO_FEATURES_NATIVESDK:mingw32 = "x11 ipv6" DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opencl opengl wayland" DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opencl opengl wayland" -DISTRO_FEATURES_BACKFILL = "pulseaudio gobject-introspection-data ldconfig opengl ptest multiarch wayland vulkan" MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode" COMBINED_FEATURES = "${@oe.utils.set_intersect('DISTRO_FEATURES', 'MACHINE_FEATURES', d)}" diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc index 7adcdfad4ff4..24adbbc4417f 100644 --- a/meta/conf/distro/include/default-distrovars.inc +++ b/meta/conf/distro/include/default-distrovars.inc @@ -14,19 +14,22 @@ LOCALE_UTF8_IS_DEFAULT ?= "1" LOCALE_UTF8_IS_DEFAULT:class-nativesdk = "0" # seccomp is not yet ported to rv32 -DISTRO_FEATURES_DEFAULT:remove:riscv32 = "seccomp" +DISTRO_FEATURES_OPTED_OUT:append:riscv32 = "seccomp" # seccomp is not yet ported to ARC -DISTRO_FEATURES_DEFAULT:remove:arc = "seccomp" +DISTRO_FEATURES_OPTED_OUT:append:arc = "seccomp" # seccomp is not yet ported to microblaze -DISTRO_FEATURES_DEFAULT:remove:microblaze = "seccomp" +DISTRO_FEATURES_OPTED_OUT:append:microblaze = "seccomp" # seccomp is not yet ported to loongarch64 -DISTRO_FEATURES_DEFAULT:remove:loongarch64 = "seccomp" +DISTRO_FEATURES_OPTED_OUT:append:loongarch64 = "seccomp" -DISTRO_FEATURES_DEFAULT ?= "acl alsa bluetooth debuginfod ext2 ipv4 ipv6 pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 vfat seccomp" -DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT}" +DISTRO_FEATURES_DEFAULT_RAW ?= " \ + acl alsa bluetooth debuginfod ext2 ipv4 ipv6 pcmcia usbgadget usbhost \ + wifi xattr nfs zeroconf pci 3g nfc x11 vfat seccomp pulseaudio \ + gobject-introspection-data ldconfig opengl ptest multiarch wayland vulkan \ + " IMAGE_FEATURES ?= "" COMMERCIAL_AUDIO_PLUGINS ?= "" diff --git a/meta/conf/distro/include/tclibc-musl.inc b/meta/conf/distro/include/tclibc-musl.inc index 98d7a801ac84..23696d119af1 100644 --- a/meta/conf/distro/include/tclibc-musl.inc +++ b/meta/conf/distro/include/tclibc-musl.inc @@ -14,7 +14,7 @@ PREFERRED_PROVIDER_virtual/libc-locale ?= "musl-locales" PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc" PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc" -DISTRO_FEATURES_BACKFILL_CONSIDERED += "ldconfig" +DISTRO_FEATURES_OPTED_OUT:append = "ldconfig" #USE_NLS ?= "no" diff --git a/meta/conf/distro/include/tclibc-newlib.inc b/meta/conf/distro/include/tclibc-newlib.inc index 34318b24549c..a6e5b6adba0e 100644 --- a/meta/conf/distro/include/tclibc-newlib.inc +++ b/meta/conf/distro/include/tclibc-newlib.inc @@ -11,7 +11,7 @@ PREFERRED_PROVIDER_virtual/libintl ?= "newlib" PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc" PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc" -DISTRO_FEATURES_BACKFILL_CONSIDERED += "ldconfig" +DISTRO_FEATURES_OPTED_OUT:append = "ldconfig" #USE_NLS ?= "no" diff --git a/meta/conf/distro/include/tclibc-picolibc.inc b/meta/conf/distro/include/tclibc-picolibc.inc index 2cd26cfd7dcd..0096c236be17 100644 --- a/meta/conf/distro/include/tclibc-picolibc.inc +++ b/meta/conf/distro/include/tclibc-picolibc.inc @@ -11,7 +11,7 @@ PREFERRED_PROVIDER_virtual/libintl ?= "picolibc" PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc" PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc" -DISTRO_FEATURES_BACKFILL_CONSIDERED += "ldconfig" +DISTRO_FEATURES_OPTED_OUT:append = "ldconfig" IMAGE_LINGUAS = "" diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf index 1853676fa060..7545e8da0c67 100644 --- a/meta/conf/documentation.conf +++ b/meta/conf/documentation.conf @@ -140,9 +140,10 @@ DESCRIPTION[doc] = "The package description used by package managers. If not set DISTRO[doc] = "The short name of the distribution. If the variable is blank, meta/conf/distro/defaultsetup.conf will be used." DISTRO_EXTRA_RDEPENDS[doc] = "Specifies a list of distro-specific packages to add to all images. The variable only applies to the images that include packagegroup-base." DISTRO_EXTRA_RRECOMMENDS[doc] = "Specifies a list of distro-specific packages to add to all images if the packages exist. The list of packages are automatically installed but you can remove them." -DISTRO_FEATURES[doc] = "The features enabled for the distribution." -DISTRO_FEATURES_BACKFILL[doc] = "Features to be added to DISTRO_FEATURES if not also present in DISTRO_FEATURES_BACKFILL_CONSIDERED. This variable is set in the meta/conf/bitbake.conf file and it is not intended to be user-configurable." -DISTRO_FEATURES_BACKFILL_CONSIDERED[doc] = "Features from DISTRO_FEATURES_BACKFILL that should not be backfilled (i.e. added to DISTRO_FEATURES) during the build." +DISTRO_FEATURES[doc] = "The features enabled for the distribution. Defaults to DISTRO_FEATURES_DEFAULT." +DISTRO_FEATURES_DEFAULT_RAW[doc] = "The default set of distribution features, prior to any filtering. Usually you should leave this alone and modify DISTRO_FEATURES and/or DISTRO_FEATURES_OPTED_OUT." +DISTRO_FEATURES_DEFAULT[doc] = "The set of default distribution features, after filtering out features listed in DISTRO_FEATURES_OPTED_OUT." +DISTRO_FEATURES_OPTED_OUT[doc] = "The set of default distribtion features to disable. Prefer opting out of features using this variable instead of using DISTRO_FEATURES:remove." DISTRO_NAME[doc] = "The long name of the distribution." DISTRO_PN_ALIAS[doc] = "Alias names used for the recipe in various Linux distributions." DISTRO_VERSION[doc] = "The version of the distribution." From patchwork Sat Mar 28 09:49:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 84684 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 8877210F3DDE for ; Sat, 28 Mar 2026 09:49:20 +0000 (UTC) Received: from fhigh-a7-smtp.messagingengine.com (fhigh-a7-smtp.messagingengine.com [103.168.172.158]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.8098.1774691356110172287 for ; Sat, 28 Mar 2026 02:49:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@pbarker.dev header.s=fm3 header.b=cKOgvyzg; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=xpYjX+zi; spf=pass (domain: pbarker.dev, ip: 103.168.172.158, mailfrom: paul@pbarker.dev) Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 7954A14001E1; Sat, 28 Mar 2026 05:49:15 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Sat, 28 Mar 2026 05:49:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pbarker.dev; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1774691355; x=1774777755; bh=iCGxtJazm4Z/jwvo0UkGKn6PT4AxD5utS1BRaeIEBpk=; b= cKOgvyzgT7vJ7ZTtgRqoCn6wBMopwEBqpbsXCSuW1fPPBq2jcwSRZWwER0RoC4Wf P3eWuaHcMF1YhrEWV36rzLRwdUcTKBpY2t0AN9sIDZPAO5Cz1hOpcKodhj+D4FGC sJi6STd8VjZZfnqa+tsMYq+m4sbsseWOW6PfhqcH9Mzfd3C5n98w/4nwJnrWuaGp up6a2wXKNg8zdkKzY+piMZfPuXLuAKixlkvByuZft6iZaCsD2pYA1dw3on9oIurj M7YZ/rswziQx49XMMsmrB3aQWzdohdfqlY+/Uw0Rj41AS3hPiEn94o67eyN7ibMY ESBeQbKybIj+Ko5rIwYKrQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1774691355; x= 1774777755; bh=iCGxtJazm4Z/jwvo0UkGKn6PT4AxD5utS1BRaeIEBpk=; b=x pYjX+zioMzxF+35A/tNTjdYV5ZqXn/HKpyFx3a/IDfUbC99ihiFaIEXcA+37DcG3 yAJuUrr2Y+uH6QAFbDzqwxuHSjT85FhAFMCDihg7436Ix1miZAjJIC8Fgm1SMttJ DpYWZ+TwpMlQU4mDSJflWXtM7xgm/TobLi9Pg7kLiWbTdAFHqbAOvBA15SdEv7aM NMZ7miLhaL8M7pPG/cNzkU+wknisS+zsvq8fbrBhOcPQYosgfD7P1baevL5bAemb owyHXTNlmBc9Mbpv0k8aw1Q+ZytuI1SQXgovwnsXNBg8r0XvpAsCoFVYBzURehHz +zR1VEH3bvyyFx6iEZzEw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeffedvkeehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhfffugggtgffkfhgjvfevofesthejre dtredtjeenucfhrhhomheprfgruhhluceurghrkhgvrhcuoehprghulhesphgsrghrkhgv rhdruggvvheqnecuggftrfgrthhtvghrnheptdffvdffjeevhfelieegudfgieefleefue efffelvdehfeeviedtieeukefhleeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepphgruhhlsehpsggrrhhkvghrrdguvghvpdhnsggprhgtph htthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehprghulhesphgsrghr khgvrhdruggvvhdprhgtphhtthhopehophgvnhgvmhgsvgguuggvugdqtghorhgvsehlih hsthhsrdhophgvnhgvmhgsvgguuggvugdrohhrgh X-ME-Proxy: Feedback-ID: i51494658:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 28 Mar 2026 05:49:14 -0400 (EDT) From: Paul Barker Date: Sat, 28 Mar 2026 09:49:01 +0000 Subject: [PATCH 3/4] meta: Support opting out of any machine features MIME-Version: 1.0 Message-Id: <20260328-default-features-v1-3-90790864d734@pbarker.dev> References: <20260328-default-features-v1-0-90790864d734@pbarker.dev> In-Reply-To: <20260328-default-features-v1-0-90790864d734@pbarker.dev> To: openembedded-core@lists.openembedded.org Cc: Paul Barker X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=16343; i=paul@pbarker.dev; h=from:subject:message-id; bh=Gaah9xegRTR/v06w9A/w/egs7GBK52PCCNgMDm+HHk4=; b=owGbwMvMwCW2OjnkzdxdX/IYT6slMWQeXyKRNXFyKffGzNudmfMmf50Tt6e7+uDpc0n90vuO/ 5E8Yzd7W0cpC4MYF4OsmCLL5p6v95/2OvJmhNxSgJnDygQyhIGLUwAmwrOR4X/EVAGGXLPzjRmV sZsW7uhqrL1WJKn2vf/EomS5rXbRASkM/1Q359c+0uypUJPa775p4USV4NTmS0yvZLfkuh+5L25 6hQUA X-Developer-Key: i=paul@pbarker.dev; a=openpgp; fpr=98B2AAC100AC3F82BB5D546774975C81B7E66BAC 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 ; Sat, 28 Mar 2026 09:49:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234125 Construct MACHINE_FEATURES_DEFAULT from MACHINE_FEATURES_DEFAULT_RAW using the new filter_default_features() function. This change obsoletes the variables MACHINE_FEATURES_BACKFILL and MACHINE_FEATURES_BACKFILL_CONSIDERED. Instead, all defaults are added to MACHINE_FEATURES_DEFAULT_RAW and users can opt out of any of these using MACHINE_FEATURES_OPTED_OUT. Hopefully the variable naming here is easier for people to understand and remember. MACHINE_FEATURES is now weakly set to MACHINE_FEATURES_DEFAULT in bitbake.conf, after inclusion of local, DISTRO and MACHINE conf files. This means that all assignments in conf files will need to use :append instead of += to preserve the defaults but this is in line with how other global variables are modified in conf files. Migration notes: - If you have previously extended MACHINE_FEATURES using :append, or set MACHINE_FEATURES to a new value including ${MACHINE_FEATURES_DEFAULT}, you shouldn't need to make any changes there. - If you have previously set MACHINE_FEATURES, but did not include ${MACHINE_FEATURES_DEFAULT}, you will lose the features which were previously in MACHINE_FEATURES_BACKFILL: rtc qemu-usermode You will need to add these to your MACHINE_FEATURES or include ${MACHINE_FEATURES_DEFAULT}. For example in meta-yocto-bsp, the MACHINE_FEATURES assignment for beaglebone-yocto must be modified to become: MACHINE_FEATURES = "${MACHINE_FEATURES_DEFAULT} usbgadget usbhost vfat alsa" - If you previously set MACHINE_FEATURES_BACKFILL_CONSIDERED, use the new variable MACHINE_FEATURES_OPTED_OUT instead. - If you previously modified MACHINE_FEATURES_BACKFILL, don't do that. Signed-off-by: Paul Barker --- meta/classes-global/base.bbclass | 4 +--- meta/classes-recipe/nativesdk.bbclass | 1 - meta/conf/bitbake.conf | 4 ++-- meta/conf/documentation.conf | 7 ++++--- meta/conf/machine/include/loongarch/qemuloongarch.inc | 3 ++- meta/conf/machine/include/mips/arch-mips.inc | 2 +- meta/conf/machine/include/powerpc/tune-power5.inc | 2 +- meta/conf/machine/include/powerpc/tune-power6.inc | 2 +- meta/conf/machine/include/powerpc/tune-power7.inc | 2 +- meta/conf/machine/include/powerpc/tune-ppce5500.inc | 2 +- meta/conf/machine/include/powerpc/tune-ppce6500.inc | 2 +- meta/conf/machine/include/qemu.inc | 4 +++- meta/conf/machine/include/riscv/qemuriscv.inc | 2 +- meta/conf/machine/include/x86/arch-x86.inc | 2 +- meta/conf/machine/include/x86/x86-base.inc | 5 +++-- meta/conf/machine/qemux86-64.conf | 2 +- meta/conf/machine/qemux86.conf | 2 +- 17 files changed, 25 insertions(+), 23 deletions(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 0a4cfd594c72..76fd0ac046a9 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -457,9 +457,7 @@ python () { # Filter default features to allow users to opt out of features they don't # want. oe.utils.filter_default_features("DISTRO_FEATURES", d) - - # Handle backfilling - oe.utils.features_backfill("MACHINE_FEATURES", d) + oe.utils.filter_default_features("MACHINE_FEATURES", d) # To add a recipe to the skip list , set: # SKIP_RECIPE[pn] = "message" diff --git a/meta/classes-recipe/nativesdk.bbclass b/meta/classes-recipe/nativesdk.bbclass index 47e81ecf95f6..2c00a7d96724 100644 --- a/meta/classes-recipe/nativesdk.bbclass +++ b/meta/classes-recipe/nativesdk.bbclass @@ -17,7 +17,6 @@ CLASSOVERRIDE = "class-nativesdk" MACHINEOVERRIDES = "" MACHINE_FEATURES = "${SDK_MACHINE_FEATURES}" -MACHINE_FEATURES_BACKFILL = "" MULTILIBS = "" diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 4bf56fe2a9ae..08a80a20fdbc 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -886,7 +886,7 @@ OES_BITBAKE_CONF = "1" # Machine properties and packagegroup-base stuff ################################################################## -MACHINE_FEATURES ?= "" +MACHINE_FEATURES ?= "${MACHINE_FEATURES_DEFAULT}" SDK_MACHINE_FEATURES ?= "" DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT}" @@ -912,7 +912,7 @@ DISTRO_FEATURES_NATIVESDK:mingw32 = "x11 ipv6" DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opencl opengl wayland" DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opencl opengl wayland" -MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode" +MACHINE_FEATURES_DEFAULT_RAW = "rtc qemu-usermode" COMBINED_FEATURES = "${@oe.utils.set_intersect('DISTRO_FEATURES', 'MACHINE_FEATURES', d)}" COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES" diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf index 7545e8da0c67..46f5c038abac 100644 --- a/meta/conf/documentation.conf +++ b/meta/conf/documentation.conf @@ -277,9 +277,10 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS[doc] = "A list of required machine-specific pac MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS[doc] = "A list of recommended machine-specific packages to install as part of the image being built. Because this is a 'machine essential' variable, the list of packages are essential for the machine to boot." MACHINE_EXTRA_RDEPENDS[doc] = "A list of machine-specific packages to install as part of the image being built that are not essential for the machine to boot. However, the build process for more fully-featured images depends on the packages being present." MACHINE_EXTRA_RRECOMMENDS[doc] = "A list of machine-specific packages to install as part of the image being built that are not essential for booting the machine. The image being built has no build dependencies on the packages in this list." -MACHINE_FEATURES[doc] = "Specifies the list of hardware features the MACHINE supports." -MACHINE_FEATURES_BACKFILL[doc] = "Features to be added to MACHINE_FEATURES if not also present in MACHINE_FEATURES_BACKFILL_CONSIDERED. This variable is set in the meta/conf/bitbake.conf file and is not intended to be user-configurable." -MACHINE_FEATURES_BACKFILL_CONSIDERED[doc] = "Features from MACHINE_FEATURES_BACKFILL that should not be backfilled (i.e. added to MACHINE_FEATURES) during the build." +MACHINE_FEATURES[doc] = "Specifies the list of hardware features the MACHINE supports. Defaults to MACHINE_FEATURES_DEFAULT" +MACHINE_FEATURES_DEFAULT_RAW[doc] = "The default set of machine features, prior to any filtering. Usually you should leave this alone and modify MACHINE_FEATURES and/or MACHINE_FEATURES_OPTED_OUT." +MACHINE_FEATURES_DEFAULT[doc] = "The set of default machine features, after filtering out features listed in MACHINE_FEATURES_OPTED_OUT." +MACHINE_FEATURES_OPTED_OUT[doc] = "The set of default machine features to disable. Prefer opting out of features using this variable instead of using MACHINE_FEATURES:remove." MACHINEOVERRIDES[doc] = "Lists overrides specific to the current machine. By default, this list includes the value of MACHINE." MAINTAINER[doc] = "The email address of the distribution maintainer." MIRRORS[doc] = "Specifies additional paths from which the OpenEmbedded build system gets source code." diff --git a/meta/conf/machine/include/loongarch/qemuloongarch.inc b/meta/conf/machine/include/loongarch/qemuloongarch.inc index e1bcfabc4301..3084c7a92729 100644 --- a/meta/conf/machine/include/loongarch/qemuloongarch.inc +++ b/meta/conf/machine/include/loongarch/qemuloongarch.inc @@ -3,7 +3,8 @@ PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" require conf/machine/include/qemu.inc require conf/machine/include/loongarch/tune-loongarch.inc -MACHINE_FEATURES = "screen keyboard ext2 ext3 serial" +MACHINE_FEATURES:append = " keyboard ext2 ext3 serial" +MACHINE_FEATURES_OPTED_OUT:append = " alsa bluetooth usbgadget vfat" KERNEL_IMAGETYPE = "vmlinuz" KERNEL_IMAGETYPES += "vmlinuz" diff --git a/meta/conf/machine/include/mips/arch-mips.inc b/meta/conf/machine/include/mips/arch-mips.inc index baadc61d652c..2691535ee7ac 100644 --- a/meta/conf/machine/include/mips/arch-mips.inc +++ b/meta/conf/machine/include/mips/arch-mips.inc @@ -21,7 +21,7 @@ ABIEXTENSION .= "${@bb.utils.filter('TUNE_FEATURES', 'n32', d)}" TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n32', ' -mabi=n32', '', d)}" # user mode qemu doesn't support mips64 n32: "Invalid ELF image for this architecture" -MACHINE_FEATURES_BACKFILL_CONSIDERED:append = " ${@bb.utils.contains('TUNE_FEATURES', 'n32', 'qemu-usermode', '', d)}" +MACHINE_FEATURES_OPTED_OUT:append = " ${@bb.utils.contains('TUNE_FEATURES', 'n32', 'qemu-usermode', '', d)}" TUNEVALID[n64] = "MIPS64 n64 ABI" TUNECONFLICTS[n64] = "o32 n32" diff --git a/meta/conf/machine/include/powerpc/tune-power5.inc b/meta/conf/machine/include/powerpc/tune-power5.inc index e70e4012176c..79b0d37f6823 100644 --- a/meta/conf/machine/include/powerpc/tune-power5.inc +++ b/meta/conf/machine/include/powerpc/tune-power5.inc @@ -21,4 +21,4 @@ GLIBC_EXTRA_OECONF:powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'power5', GLIBC_EXTRA_OECONF:powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'power5', '--with-cpu=power5', '', d)}" # QEMU usermode fails with invalid instruction error -MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'power5', ' qemu-usermode', '', d)}" +MACHINE_FEATURES_OPTED_OUT:append = "${@bb.utils.contains('TUNE_FEATURES', 'power5', ' qemu-usermode', '', d)}" diff --git a/meta/conf/machine/include/powerpc/tune-power6.inc b/meta/conf/machine/include/powerpc/tune-power6.inc index eaf89515cad7..aa9ff5168562 100644 --- a/meta/conf/machine/include/powerpc/tune-power6.inc +++ b/meta/conf/machine/include/powerpc/tune-power6.inc @@ -21,4 +21,4 @@ GLIBC_EXTRA_OECONF:powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'power6', GLIBC_EXTRA_OECONF:powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'power6', '--with-cpu=power6', '', d)}" # QEMU usermode fails with invalid instruction error -MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'power6', ' qemu-usermode', '', d)}" +MACHINE_FEATURES_OPTED_OUT:append = "${@bb.utils.contains('TUNE_FEATURES', 'power6', ' qemu-usermode', '', d)}" diff --git a/meta/conf/machine/include/powerpc/tune-power7.inc b/meta/conf/machine/include/powerpc/tune-power7.inc index 4531ddd85f48..be4b07de3a75 100644 --- a/meta/conf/machine/include/powerpc/tune-power7.inc +++ b/meta/conf/machine/include/powerpc/tune-power7.inc @@ -21,4 +21,4 @@ GLIBC_EXTRA_OECONF:powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'power7', GLIBC_EXTRA_OECONF:powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'power7', '--with-cpu=power7', '', d)}" # QEMU usermode fails with invalid instruction error -MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'power7', ' qemu-usermode', '', d)}" +MACHINE_FEATURES_OPTED_OUT:append = "${@bb.utils.contains('TUNE_FEATURES', 'power7', ' qemu-usermode', '', d)}" diff --git a/meta/conf/machine/include/powerpc/tune-ppce5500.inc b/meta/conf/machine/include/powerpc/tune-ppce5500.inc index 446b344c3d25..113e52925012 100644 --- a/meta/conf/machine/include/powerpc/tune-ppce5500.inc +++ b/meta/conf/machine/include/powerpc/tune-ppce5500.inc @@ -19,4 +19,4 @@ PACKAGE_EXTRA_ARCHS:tune-ppc64e5500 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc64} ppc QEMU_EXTRAOPTIONS:tune-ppc64e5500 = " -cpu e500mc" # QEMU usermode fails with invalid instruction error (YOCTO: #10304) -MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'e5500', ' qemu-usermode', '', d)}" +MACHINE_FEATURES_OPTED_OUT:append = "${@bb.utils.contains('TUNE_FEATURES', 'e5500', ' qemu-usermode', '', d)}" diff --git a/meta/conf/machine/include/powerpc/tune-ppce6500.inc b/meta/conf/machine/include/powerpc/tune-ppce6500.inc index 4444705b2d6d..a93e81e728bf 100644 --- a/meta/conf/machine/include/powerpc/tune-ppce6500.inc +++ b/meta/conf/machine/include/powerpc/tune-ppce6500.inc @@ -19,4 +19,4 @@ PACKAGE_EXTRA_ARCHS:tune-ppc64e6500 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc64} ppc QEMU_EXTRAOPTIONS:tune-ppc64e6500 = " -cpu e500mc" # QEMU usermode fails with invalid instruction error (YOCTO: #10304) -MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'e6500', ' qemu-usermode', '', d)}" +MACHINE_FEATURES_OPTED_OUT:append = "${@bb.utils.contains('TUNE_FEATURES', 'e6500', ' qemu-usermode', '', d)}" diff --git a/meta/conf/machine/include/qemu.inc b/meta/conf/machine/include/qemu.inc index 79016ad9cce1..7ef1c2beaaf4 100644 --- a/meta/conf/machine/include/qemu.inc +++ b/meta/conf/machine/include/qemu.inc @@ -4,7 +4,9 @@ XSERVER ?= "xserver-xorg \ xf86-video-modesetting \ " -MACHINE_FEATURES = "alsa bluetooth usbgadget screen vfat" +# Extend the raw default features here so that individual architectures can +# easily opt-out of what they don't support. +MACHINE_FEATURES_DEFAULT_RAW:append = " alsa bluetooth usbgadget screen vfat" MACHINEOVERRIDES =. "qemuall:" diff --git a/meta/conf/machine/include/riscv/qemuriscv.inc b/meta/conf/machine/include/riscv/qemuriscv.inc index bac376ce5a80..27254edf04d9 100644 --- a/meta/conf/machine/include/riscv/qemuriscv.inc +++ b/meta/conf/machine/include/riscv/qemuriscv.inc @@ -3,7 +3,7 @@ PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" require conf/machine/include/qemu.inc require conf/machine/include/riscv/tune-riscv.inc -MACHINE_FEATURES += "keyboard ext2 ext3 serial" +MACHINE_FEATURES:append = " keyboard ext2 ext3 serial" KERNEL_IMAGETYPE = "Image" KERNEL_IMAGETYPES += "uImage" diff --git a/meta/conf/machine/include/x86/arch-x86.inc b/meta/conf/machine/include/x86/arch-x86.inc index 28742e794d63..4b8d7adea100 100644 --- a/meta/conf/machine/include/x86/arch-x86.inc +++ b/meta/conf/machine/include/x86/arch-x86.inc @@ -25,7 +25,7 @@ TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'mx32', ' -mx32', '', d)}" TUNE_LDARGS += "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '-m elf32_x86_64', '', d)}" TUNE_ASARGS += "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '-x32', '', d)}" # user mode qemu doesn't support x32 -MACHINE_FEATURES_BACKFILL_CONSIDERED:append = " ${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'qemu-usermode', '', d)}" +MACHINE_FEATURES_OPTED_OUT:append = " ${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'qemu-usermode', '', d)}" MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'x86-x32:', '', d)}" # ELF64 ABI diff --git a/meta/conf/machine/include/x86/x86-base.inc b/meta/conf/machine/include/x86/x86-base.inc index fc8200d8f097..1c099c4edf0a 100644 --- a/meta/conf/machine/include/x86/x86-base.inc +++ b/meta/conf/machine/include/x86/x86-base.inc @@ -5,8 +5,9 @@ # # common settings for X86 machines # -MACHINE_FEATURES += "screen keyboard pci usbhost ext2 ext3 x86 \ - acpi serial usbgadget alsa" +MACHINE_FEATURES:append = " \ + screen keyboard pci usbhost ext2 ext3 x86 acpi serial usbgadget alsa \ + " IMAGE_FSTYPES ?= "wic.zst" diff --git a/meta/conf/machine/qemux86-64.conf b/meta/conf/machine/qemux86-64.conf index 8aac7634b753..350b6f5e474a 100644 --- a/meta/conf/machine/qemux86-64.conf +++ b/meta/conf/machine/qemux86-64.conf @@ -27,7 +27,7 @@ XSERVER = "xserver-xorg \ xserver-xorg-module-libint10 \ " -MACHINE_FEATURES += "x86 pci" +MACHINE_FEATURES:append = " x86 pci" MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d" diff --git a/meta/conf/machine/qemux86.conf b/meta/conf/machine/qemux86.conf index 51f080bd2a51..978e01c10735 100644 --- a/meta/conf/machine/qemux86.conf +++ b/meta/conf/machine/qemux86.conf @@ -23,7 +23,7 @@ XSERVER = "xserver-xorg \ xserver-xorg-module-libint10 \ " -MACHINE_FEATURES += "x86 pci" +MACHINE_FEATURES:append = " x86 pci" MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d" From patchwork Sat Mar 28 09:49:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 84682 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 5D2BD10F3DDA for ; Sat, 28 Mar 2026 09:49:20 +0000 (UTC) Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.8248.1774691356769729304 for ; Sat, 28 Mar 2026 02:49:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@pbarker.dev header.s=fm3 header.b=SNHZg+rH; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=PDmGTHFD; spf=pass (domain: pbarker.dev, ip: 103.168.172.146, mailfrom: paul@pbarker.dev) Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 26B1EEC01E2; Sat, 28 Mar 2026 05:49:16 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Sat, 28 Mar 2026 05:49:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pbarker.dev; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1774691356; x=1774777756; bh=hGPKx1G+2IZNAskzfnp0Tw3k4FmDuWWjcf70kYok6aQ=; b= SNHZg+rHQ+Y0w3IgxBjvUJR97ch9F/7N45mTdNWGn7PjNE9hX/6pzp86OrhIpLgz z5kkDI4PxvnCU+rWHJkkMYo6J5gn4rvH1G+nb5CqFsKPXhRY3StOaFganOcqNLcW SEkMzpuXwcESqa+cC9MjJEebbvJi/vbtDlfMG4P7Wv5QxE0ySWaVRU2z/Wtx/acS a9Lz7FXaAB8o9Nd9VOflRRx9tOkLjAWjJq8vFT7hpqAfZzKuk61uaMaZolSnYdIW zMmUwdMCHfg7FASa10xVVLyThC5rpcCX3lF69R54gG8OtWqvp8/ks1HoCkyD1C5q lG/lFpNahzPUln1daCKvBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1774691356; x= 1774777756; bh=hGPKx1G+2IZNAskzfnp0Tw3k4FmDuWWjcf70kYok6aQ=; b=P DmGTHFDNsXODak1grN6pv/y9DiA0NAfN5QIUfgJxY7DwYjJksr1YRXxLXAaMNoDP QtFAUOzJwwbq7I28dJtiZJAbvys3I49yA463yNWk2fD7SeBdDJfD7t5vN/wTv/xQ BspUAHIrfSpAMqzMJjrpK3eoSIJ+ir2sl6QtNfU+rw1VL+pGJykbRsnlMVXh79Ov VnTXqHOutQ0oExHFWJ1wH8To/kVwxiHcsSlsb1iMOEEIx9lzSAbl2XKZitmF4eda V9JAJe9nMp+vZ9mG2h/4qPIWylLH22gtl7Z4F9r8raxO9KjmbJW1TgNnBeXcWci0 1BSKn7hwmHAHLkNvFhXgA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeffedvkeehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhfffugggtgffkfhgjvfevofesthejre dtredtjeenucfhrhhomheprfgruhhluceurghrkhgvrhcuoehprghulhesphgsrghrkhgv rhdruggvvheqnecuggftrfgrthhtvghrnheptdffvdffjeevhfelieegudfgieefleefue efffelvdehfeeviedtieeukefhleeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepphgruhhlsehpsggrrhhkvghrrdguvghvpdhnsggprhgtph htthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehprghulhesphgsrghr khgvrhdruggvvhdprhgtphhtthhopehophgvnhgvmhgsvgguuggvugdqtghorhgvsehlih hsthhsrdhophgvnhgvmhgsvgguuggvugdrohhrgh X-ME-Proxy: Feedback-ID: i51494658:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 28 Mar 2026 05:49:15 -0400 (EDT) From: Paul Barker Date: Sat, 28 Mar 2026 09:49:02 +0000 Subject: [PATCH 4/4] lib: oe: Drop backfill support MIME-Version: 1.0 Message-Id: <20260328-default-features-v1-4-90790864d734@pbarker.dev> References: <20260328-default-features-v1-0-90790864d734@pbarker.dev> In-Reply-To: <20260328-default-features-v1-0-90790864d734@pbarker.dev> To: openembedded-core@lists.openembedded.org Cc: Paul Barker X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1809; i=paul@pbarker.dev; h=from:subject:message-id; bh=6Vl9G+T6pzGvonZPc8TCRORNyVbDSf1dMyPcnVBdhfA=; b=owGbwMvMwCW2OjnkzdxdX/IYT6slMWQeXyLB1NbeHD7xtsmvyxw7C64+CBKIko2YeYJ9yS2T7 TYC9psFOkpZGMS4GGTFFFk293y9/7TXkTcj5JYCzBxWJpAhDFycAjCR982MDCd+y/w/FKh23aGL R36LyIqm7heecjpsAr3VU8ImWT1wecbIMM/6+hS+hDS+IwwcBp8j/wXf1XwafH7q+hIG9vgW10s SnAA= X-Developer-Key: i=paul@pbarker.dev; a=openpgp; fpr=98B2AAC100AC3F82BB5D546774975C81B7E66BAC 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 ; Sat, 28 Mar 2026 09:49:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/234126 We have removed DISTRO_FEATURES_BACKFILL and MACHINE_FEATURES_BACKFILL, so we no longer need the features_backfill() function. Signed-off-by: Paul Barker --- meta/lib/oe/utils.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 928b38c64cf9..d5766fdbac2a 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -137,27 +137,6 @@ def inherits(d, *classes): """Return True if the metadata inherits any of the specified classes""" return any(bb.data.inherits_class(cls, d) for cls in classes) -def features_backfill(var,d): - # This construct allows the addition of new features to variable specified - # as var - # Example for var = "DISTRO_FEATURES" - # This construct allows the addition of new features to DISTRO_FEATURES - # that if not present would disable existing functionality, without - # disturbing distributions that have already set DISTRO_FEATURES. - # Distributions wanting to elide a value in DISTRO_FEATURES_BACKFILL should - # add the feature to DISTRO_FEATURES_BACKFILL_CONSIDERED - features = (d.getVar(var) or "").split() - backfill = (d.getVar(var+"_BACKFILL") or "").split() - considered = (d.getVar(var+"_BACKFILL_CONSIDERED") or "").split() - - addfeatures = [] - for feature in backfill: - if feature not in features and feature not in considered: - addfeatures.append(feature) - - if addfeatures: - d.appendVar(var, " " + " ".join(addfeatures)) - def filter_default_features(varname, d): # Process default features to exclude features which the user has opted out # of. This should be called from an anonymous Python function and uses