From patchwork Fri Jun 5 17:55:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randolph Sapp X-Patchwork-Id: 89381 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 975CBCD6E7B for ; Fri, 5 Jun 2026 17:56:08 +0000 (UTC) Received: from BYAPR05CU005.outbound.protection.outlook.com (BYAPR05CU005.outbound.protection.outlook.com [52.101.85.14]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1047.1780682166993301120 for ; Fri, 05 Jun 2026 10:56:07 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ti.com header.s=selector1 header.b=pYkZEncN; spf=pass (domain: ti.com, ip: 52.101.85.14, mailfrom: rs@ti.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BCGgMlikOmFtw4LD808Tzy0OR8FTkirMXgl9uNCaB1BIFHVgcHPNBb3ZvsooQy7TBtuXkxZZE9a2MY9Jmm2TuUfczu7TFX4oIXaipkk9O9ktE58pPPF0zmGz2TpYCdDOA/Dq7TWO7plUIl7eGKt6TttOq8XBUDGHKAhzsHd/JenjRxWTV+FSTmQgR7o3pnic5ecLV8uhNsjRkv5aYV23yb2NHTIj1BQlXmSOruDyf9fOE1ViBaY9MAlegLsUUu7WDAiz4ee4LqYgJgQyQeizx/1xt81vbdvNiW/jdeRdgXO7T5qPO7EE78oYOoHpCXmieXlFjLLeRGPqPzVR1aV/wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CxDSwT8sGxsa9Ra+bbfSnESjUI7BcGhSmFaD7Svw4k0=; b=cDvJjH0CLBoAPyY0A72XV+Ygb5OhjLfkc9faPnQ0Md5jipbWr9l7Uhq1IYKUVD1MLHNN3e/9ogNeAfoDI/20MmioGb7VOsFo0EKzDT7vPo99M1OA+teK0n0Sng8U8Z8yOS9AP40bP0x3+g0DH+8k0okpgsXhvBtPBU7ZPwPZtkiZ5YMNX+XgwUJis0F9FJWQyiAdIabPET9Ju6YQ6Jduo3N4oCkk5RGaYtccRjWT7XVWGfK8MN9vbFiOV0zMHFfGoU/cWGKuxG0lSyq4wnPZsbXAi4kvmdAyyfsiiKyJJC29TO7qQuSI5jNT16nCbsrFMLU6EtCaPXoV8OcqtxLR3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.23.195) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CxDSwT8sGxsa9Ra+bbfSnESjUI7BcGhSmFaD7Svw4k0=; b=pYkZEncNhHEQ140BI4Ha+5h+UOBVpq8FnftkbdY4/7tf2JVwwaBcuD2GA3OnsUH/hzZK/whHB70BOXlV2WkTNC3dkABVqqyC2sJDvhmV/YgRtPmRpgo3EgxcuvAbn0Iv8zwQGxYVBa2Fr7v8Cm23IRMjfSS0nXfk/uvSckn8gJg= Received: from SJ0PR13CA0066.namprd13.prod.outlook.com (2603:10b6:a03:2c4::11) by CH3PR10MB7780.namprd10.prod.outlook.com (2603:10b6:610:1b1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.92.8; Fri, 5 Jun 2026 17:56:03 +0000 Received: from SJ5PEPF000001EF.namprd05.prod.outlook.com (2603:10b6:a03:2c4:cafe::c2) by SJ0PR13CA0066.outlook.office365.com (2603:10b6:a03:2c4::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.92.10 via Frontend Transport; Fri, 5 Jun 2026 17:56:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.23.195) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.23.195 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.23.195; helo=lewvzet201.ext.ti.com; pr=C Received: from lewvzet201.ext.ti.com (198.47.23.195) by SJ5PEPF000001EF.mail.protection.outlook.com (10.167.242.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.92.5 via Frontend Transport; Fri, 5 Jun 2026 17:56:02 +0000 Received: from DLEE215.ent.ti.com (157.170.170.118) by lewvzet201.ext.ti.com (10.4.14.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Fri, 5 Jun 2026 12:56:02 -0500 Received: from DLEE212.ent.ti.com (157.170.170.114) by DLEE215.ent.ti.com (157.170.170.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Fri, 5 Jun 2026 12:56:02 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE212.ent.ti.com (157.170.170.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37 via Frontend Transport; Fri, 5 Jun 2026 12:56:02 -0500 Received: from rs-desk.dhcp.ti.com (rs-desk.dhcp.ti.com [128.247.81.39]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 655Hu2Wh1856899; Fri, 5 Jun 2026 12:56:02 -0500 From: To: , , , , , CC: , , , , Subject: [oe-core][RFCv2] xuser-account: convert to standard-user-account Date: Fri, 5 Jun 2026 12:55:52 -0500 Message-ID: <20260605175552.1531866-1-rs@ti.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001EF:EE_|CH3PR10MB7780:EE_ X-MS-Office365-Filtering-Correlation-Id: 199628b1-474a-42a4-468a-08dec32bb57c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700016|20052099010|6133799003|3023799007|18002099003|56012099006; X-Microsoft-Antispam-Message-Info: slZ048FVY4JuWS8REovC7yj4rrxWDABupl9HrG2zc6Ok+wZmwTT97pKUoRyL2nHpjfQyvbqa22ONYLOIvrJS68iGZqYvgXAWRsiC0mn27XK5N6Lck5oiuHH9C9184OvTYA6/HpYmp2TAaEqe5ZeR3x0GjMFkNyZl7vZksFZr6ue0Jcp5d5veV4IuDphGRnsltz/614H7x2A2mt1etMilxUZB8QqvA0nfdkphD9qNooTD56ceM89K/H2b37oh3A4vr3tz0r0qBemHrJigkIRMOkYGGBUyJTK25j0iHWl5s+dAiCNgb08aZVdrzj+jdaVftdDdPVKBmY/zTBTtKhWDdcZv6eDaAldfqmDOmrxIxKp6voPFkQfHl2VUEUJxj1heovpg53g8c1HZ2lSdV6pN6B6KVlJCn2nryMmnsJG198uIA8Tfrpc2vTMX2pjbdIXBhkpPFr5xCDvE78XCRse7b018JTlvdXxch+1+rWXxxVF4H1qp88QERkFHeYNKpquKjYw8fEp2vogwNB6Zzj6SACuJ9EHVKcxc5+DrMb/IujGD3pYmJsw4oRclh8ZA3rsiuq8498PfXtfVyvh/Z3WXr/pooM7V1lbTxiO82c11t/xnS1mJqldhyWYmr+XQzUCAnNIdOlh1VGpO+gXbB6Aho+Rnrs9xqt62bpxWNwvTmlWkKuYBt21k7gAAM3Zm9bWg X-Forefront-Antispam-Report: CIP:198.47.23.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:lewvzet201.ext.ti.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700016)(20052099010)(6133799003)(3023799007)(18002099003)(56012099006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 29W+5vr6N60327iWUyU0hYzzlL1m4xXRnpORhPl2X6sCwPrqfYuIcPWYrnEMmvETZFtQnX2HbM7U0A8M93a6T2IgL2jWwX8Z1OdYOLeDKU8FNxlcnkUUTz6eiO3kFrU1jqidE94O6r6dAyINMRX0HWFS8M/rgWNrFnKY+T9/L4FQy2UUsuyaCCmTzRSuweISHqnk2odhPmNtcBr+0VBI47TyYzViWEtVZGCI7vXXXdFDnZfaKw6Ln0rHZvUYqroGGdJpJmFow6a56pXTI6QLEuvWcNd6d+mnZilrGPBZKz0ufjQ7k8ytwx8h1kDNyjEIupHQa9l6LPKkTBSzUXIK9NhWZn40aCalTQtRuYl7iXIwt2XCesrbgJegMhPFM2ERW4Z8Pzn2wkNGNrQsw4GFDEERllfL6F1lqu/9Dm+U4jJEo/jqI9j3iLVNhgIHpF/9 X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2026 17:56:02.8310 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 199628b1-474a-42a4-468a-08dec32bb57c X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.23.195];Helo=[lewvzet201.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001EF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7780 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 ; Fri, 05 Jun 2026 17:56:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/238180 From: Randolph Sapp Change this single xuser account template into a generic standard-user-account that uses distro level variables for configuration. This allows for seamless configuration of multiple out-of-box scripts and tests across layers without having to implicitly hope that the username or groups haven't been changed by a bbappend or recipe override. This also adds a class and a variable to allow recipes to assert that the user is in requested groups. This was proposed specifically to remove some issues highlighted in: https://lists.openembedded.org/g/openembedded-core/message/230665 Signed-off-by: Randolph Sapp --- meta-selftest/files/static-group | 3 +- meta-selftest/files/static-passwd | 3 +- meta/classes-recipe/standard-user.bbclass | 26 ++++++++++++ .../distro/include/default-distrovars.inc | 12 ++++++ meta/conf/distro/include/maintainers.inc | 2 +- meta/conf/documentation.conf | 4 ++ meta/recipes-graphics/wayland/weston-init.bb | 12 +++--- .../x11-common/xserver-nodm-init_3.0.bb | 8 ++-- .../{system-xuser.conf => system-user.conf} | 2 +- .../standard-user-account_0.1.bb | 42 +++++++++++++++++++ .../user-creation/xuser-account_0.1.bb | 30 ------------- scripts/sstate-sysroot-cruft.sh | 6 +-- 12 files changed, 101 insertions(+), 49 deletions(-) create mode 100644 meta/classes-recipe/standard-user.bbclass rename meta/recipes-support/user-creation/files/{system-xuser.conf => system-user.conf} (90%) create mode 100644 meta/recipes-support/user-creation/standard-user-account_0.1.bb delete mode 100644 meta/recipes-support/user-creation/xuser-account_0.1.bb diff --git a/meta-selftest/files/static-group b/meta-selftest/files/static-group index 6a9ece20a8..9ef91bbdca 100644 --- a/meta-selftest/files/static-group +++ b/meta-selftest/files/static-group @@ -20,12 +20,11 @@ pulse:x:520: bind:x:521: builder:x:522: weston-launch:x:524: -weston:x:525: wayland:x:526: render:x:527: sgx:x:528: ptest:x:529: -xuser:x:530: +user:x:530: seat:x:531: audio:x:532: empower:x:533: diff --git a/meta-selftest/files/static-passwd b/meta-selftest/files/static-passwd index 98017c8153..cddf095ff2 100644 --- a/meta-selftest/files/static-passwd +++ b/meta-selftest/files/static-passwd @@ -16,8 +16,7 @@ pulse:x:520:520::/:/bin/nologin bind:x:521:521::/:/bin/nologin builder:x:522:522::/:/bin/nologin _apt:x:523:523::/:/bin/nologin -weston:x:525:525::/:/bin/nologin ptest:x:529:529::/:/bin/nologin -xuser:x:530:530::/:/bin/nologin +user:x:530:530::/:/bin/nologin cmake-example:x:534:534::/var/lib/cmake-example:/bin/false meson-example:x:535:535::/var/lib/meson-example:/bin/false diff --git a/meta/classes-recipe/standard-user.bbclass b/meta/classes-recipe/standard-user.bbclass new file mode 100644 index 0000000000..ff931b8092 --- /dev/null +++ b/meta/classes-recipe/standard-user.bbclass @@ -0,0 +1,26 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + +STANDARD_USER_PACKAGES ?= "${PN}" +REQUIRED_STANDARD_USER_GROUPS ?= "" + +python __anonymous() { + d.appendVar("DEPENDS", " standard-user-account") + + for pkg in d.getVar('STANDARD_USER_PACKAGES').split(): + d.appendVar("RDEPENDS:" + pkg, " standard-user-account") + + active_groups = set(d.getVar('STANDARD_USER_GROUPS').split()) + active_groups.update(d.getVar('STANDARD_USER_SYSTEM_GROUPS').split()) + required_groups = set(d.getVar('REQUIRED_STANDARD_USER_GROUPS').split()) + + if not required_groups.issubset(active_groups): + raise bb.parse.SkipRecipe( + "one of '%s' needs to be in STANDARD_USER_GROUPS or " + "STANDARD_USER_SYSTEM_GROUPS" + % ' '.join(required_groups) + ) +} diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc index 69c6db589b..88c3bc38be 100644 --- a/meta/conf/distro/include/default-distrovars.inc +++ b/meta/conf/distro/include/default-distrovars.inc @@ -66,3 +66,15 @@ KERNEL_IMAGETYPES ??= "${KERNEL_IMAGETYPE}" # the variable to be empty. # Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=master;branch=master CONNECTIVITY_CHECK_URIS ?= "https://www.yoctoproject.org/connectivity.html" + +# The STANDARD_USER_NAME is the default underprivileged user account name. +# The STANDARD_USER_GROUPS is a space delimited list of user groups that account +# should belong to, and STANDARD_USER_SYSTEM_GROUPS is the same but for system +# groups. +# +# Please take note that not all tooling currently supports changing these +# variables. Scripts like sstate-sysroot-cruft.sh and reproducible builds expect +# these values to be the defaults listed below. +STANDARD_USER_NAME ??= "user" +STANDARD_USER_GROUPS ??= "" +STANDARD_USER_SYSTEM_GROUPS ??= "video render tty audio input shutdown disk wayland" diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 66902616f5..8d2a92f041 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -814,6 +814,7 @@ RECIPE_MAINTAINER:pn-spirv-tools = "Jose Quaresma " RECIPE_MAINTAINER:pn-sqlite3 = "Unassigned " RECIPE_MAINTAINER:pn-squashfs-tools = "Robert Yang " RECIPE_MAINTAINER:pn-ssh-pregen-hostkeys = "Richard Purdie " +RECIPE_MAINTAINER:pn-standard-user-account = "Unassigned " RECIPE_MAINTAINER:pn-startup-notification = "Unassigned " RECIPE_MAINTAINER:pn-strace = "Robert Yang " RECIPE_MAINTAINER:pn-stress-ng = "Unassigned " @@ -940,7 +941,6 @@ RECIPE_MAINTAINER:pn-xserver-xf86-config = "Unassigned - + diff --git a/meta/recipes-support/user-creation/standard-user-account_0.1.bb b/meta/recipes-support/user-creation/standard-user-account_0.1.bb new file mode 100644 index 0000000000..7aa42e0338 --- /dev/null +++ b/meta/recipes-support/user-creation/standard-user-account_0.1.bb @@ -0,0 +1,42 @@ +SUMMARY = "Creates a standard user account" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +SRC_URI = "file://system-user.conf" + +inherit allarch useradd + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +COMMON_ARGS = "--create-home --user-group" + +python __anonymous() { + common_args = d.getVar("COMMON_ARGS") or "" + user = d.getVar("STANDARD_USER_NAME") or "" + pn = d.getVar("PN") or "" + + unique_groups = sorted(set((d.getVar("STANDARD_USER_GROUPS") or "").split())) + unique_system_groups = sorted(set((d.getVar("STANDARD_USER_SYSTEM_GROUPS") or "").split())) + + if unique_groups or unique_system_groups: + joined_groups = ','.join(unique_groups + unique_system_groups) + d.setVar(f"USERADD_PARAM:{pn}", f"{common_args} --groups {joined_groups} {user}") + + # make sure all the groups exist + groupadd_str = "" + for group in unique_groups: + groupadd_str += f" {group} ;" + for group in unique_system_groups: + groupadd_str += f" --system {group} ;" + d.setVar(f"GROUPADD_PARAM:{pn}", f"{groupadd_str}") +} + +# default case, and a requirement to satisfy the parser check +USERADD_PARAM:${PN} = "${COMMON_ARGS} ${STANDARD_USER_NAME}" +USERADD_PACKAGES = "${PN}" + +do_install () { + install -D -m 0644 ${UNPACKDIR}/system-user.conf ${D}${datadir}/dbus-1/system.d/system-user.conf + sed -i -e 's|@STANDARD_USER_NAME@|${STANDARD_USER_NAME}|g' ${D}${datadir}/dbus-1/system.d/system-user.conf +} diff --git a/meta/recipes-support/user-creation/xuser-account_0.1.bb b/meta/recipes-support/user-creation/xuser-account_0.1.bb deleted file mode 100644 index 04f506e7a3..0000000000 --- a/meta/recipes-support/user-creation/xuser-account_0.1.bb +++ /dev/null @@ -1,30 +0,0 @@ -SUMMARY = "Creates an 'xuser' account used for running X11" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -SRC_URI = "file://system-xuser.conf" - -inherit allarch useradd - -S = "${UNPACKDIR}" - -do_configure() { - : -} - -do_compile() { - : -} - -do_install() { - install -D -m 0644 ${UNPACKDIR}/system-xuser.conf ${D}${sysconfdir}/dbus-1/system.d/system-xuser.conf -} - -FILES:${PN} = "${sysconfdir}/dbus-1/system.d/system-xuser.conf" - -USERADD_PACKAGES = "${PN}" -USERADD_PARAM:${PN} = "--create-home \ - --groups video,tty,audio,input,shutdown,disk \ - --user-group xuser" - -ALLOW_EMPTY:${PN} = "1" diff --git a/scripts/sstate-sysroot-cruft.sh b/scripts/sstate-sysroot-cruft.sh index b2002badfb..5e1ae9c535 100755 --- a/scripts/sstate-sysroot-cruft.sh +++ b/scripts/sstate-sysroot-cruft.sh @@ -127,9 +127,9 @@ WHITELIST="${WHITELIST} \ # generated by useradd.bbclass WHITELIST="${WHITELIST} \ [^/]*/home \ - [^/]*/home/xuser \ - [^/]*/home/xuser/.bashrc \ - [^/]*/home/xuser/.profile \ + [^/]*/home/user \ + [^/]*/home/user/.bashrc \ + [^/]*/home/user/.profile \ [^/]*/home/builder \ [^/]*/home/builder/.bashrc \ [^/]*/home/builder/.profile \