xuser-account: convert to standard-user-account
PATCH v2 1/1 xuser-account: convert to standard-user-account
From: Randolph Sapp <[email protected]>
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
---
v2:
- Add seat to the default STANDARD_USER_SYSTEM_GROUPS var
---
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 | 46 +++++++++++++++++++
.../user-creation/xuser-account_0.1.bb | 30 ------------
scripts/sstate-sysroot-cruft.sh | 6 +--
12 files changed, 105 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.bbmeta-selftest/files/static-group +1 -2
@@ -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:
meta-selftest/files/static-passwd +1 -2
@@ -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
meta/classes-recipe/standard-user.bbclass new file +26 -0
@@ -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) + ) +}
meta/conf/distro/include/default-distrovars.inc +12 -0
@@ -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 seat"
meta/conf/distro/include/maintainers.inc +1 -1
@@ -815,6 +815,7 @@ RECIPE_MAINTAINER:pn-spirv-tools = "Jose Quaresma <[email protected]>" RECIPE_MAINTAINER:pn-sqlite3 = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-squashfs-tools = "Robert Yang <[email protected]>" RECIPE_MAINTAINER:pn-ssh-pregen-hostkeys = "Richard Purdie <[email protected]>" +RECIPE_MAINTAINER:pn-standard-user-account = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-startup-notification = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-strace = "Robert Yang <[email protected]>" RECIPE_MAINTAINER:pn-stress-ng = "Unassigned <[email protected]>"
@@ -941,7 +942,6 @@ RECIPE_MAINTAINER:pn-xserver-xf86-config = "Unassigned <unassigned@yoctoproject. RECIPE_MAINTAINER:pn-xserver-xorg = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-xset = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-xtrans = "Unassigned <[email protected]>" -RECIPE_MAINTAINER:pn-xuser-account = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-xvinfo = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-xwayland = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-xwininfo = "Unassigned <[email protected]>"
meta/conf/documentation.conf +4 -0
@@ -346,6 +346,7 @@ RDEPENDS[doc] = "Lists a package's runtime dependencies (i.e. other packages) th REQUIRED_COMBINED_FEATURES[doc] = "When a recipe inherits the features_check class, all items in this variable must be included in COMBINED_FEATURES." REQUIRED_DISTRO_FEATURES[doc] = "When a recipe inherits the features_check class, all items in this variable must be included in DISTRO_FEATURES." REQUIRED_MACHINE_FEATURES[doc] = "When a recipe inherits the features_check class, all items in this variable must be included in MACHINE_FEATURES." +REQUIRED_STANDARD_USER_GROUPS[doc] = "When a recipe inherits the standard-user class, all items in this variable must be included in STANDARD_USER_GROUPS or STANDARD_USER_SYSTEM_GROUPS." RM_WORK_EXCLUDE[doc] = "With rm_work enabled, this variable specifies a list of packages whose work directories should not be removed." ROOTFS[doc] = "Indicates a filesystem image to include as the root filesystem." ROOTFS_POSTPROCESS_COMMAND[doc] = "Added by classes to run post processing commands once the OpenEmbedded build system has created the root filesystem."
@@ -388,6 +389,9 @@ SSTATE_MIRRORS[doc] = "Configures the OpenEmbedded build system to search other STAGING_KERNEL_DIR[doc] = "The directory with kernel headers that are required to build out-of-tree modules." STAMP[doc] = "Specifies the base path used to create recipe stamp files. The path to an actual stamp file is constructed by evaluating this string and then appending additional information." STAMPS_DIR[doc] = "Specifies the base directory in which the OpenEmbedded build system places stamps." +STANDARD_USER_GROUPS[doc] = "Specifies the default underprivileged user's groups." +STANDARD_USER_NAME[doc] = "Specifies the default underprivileged user's account name." +STANDARD_USER_SYSTEM_GROUPS[doc] = "Specifies the default underprivileged user's system groups." SUMMARY[doc] = "The short (80 characters or less) summary of the binary package for packaging systems such as opkg, rpm or dpkg. By default, SUMMARY is used to define the DESCRIPTION variable if DESCRIPTION is not set in the recipe." SYSLINUX_DEFAULT_CONSOLE[doc] = "Specifies the kernel boot default console." SYSLINUX_OPTS[doc] = "Lists additional options to add to the syslinux file."
meta/recipes-graphics/wayland/weston-init.bb +5 -7
@@ -26,8 +26,8 @@ PACKAGECONFIG[use-pixman] = ",," DEFAULTBACKEND ??= "" DEFAULTBACKEND:qemuall ?= "drm" -WESTON_USER ??= "weston" -WESTON_USER_HOME ??= "/home/${WESTON_USER}" +WESTON_USER = "${STANDARD_USER_NAME}" +WESTON_USER_HOME = "/home/${WESTON_USER}" do_install() { # Install weston-start script
@@ -83,14 +83,14 @@ do_install() { INHIBIT_UPDATERCD_BBCLASS = "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', d)}" -inherit update-rc.d systemd useradd - -USERADD_PACKAGES = "${PN}" +inherit update-rc.d systemd standard-user # rdepends on weston which depends on virtual/egl # require ${THISDIR}/required-distro-features.inc +REQUIRED_STANDARD_USER_GROUPS = "video input render seat wayland" + RDEPENDS:${PN} = "weston kbd ${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'weston-xwayland', '', d)}" INITSCRIPT_NAME = "weston"
@@ -109,5 +109,3 @@ FILES:${PN} += "\ CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston" SYSTEMD_SERVICE:${PN} = "weston.service weston.socket" -USERADD_PARAM:${PN} = "--home ${WESTON_USER_HOME} --shell /bin/sh --user-group -G video,input,render,seat,wayland ${WESTON_USER}" -GROUPADD_PARAM:${PN} = "-r wayland; -r render; -r seat"
meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb +5 -3
@@ -18,7 +18,9 @@ S = "${UNPACKDIR}" PACKAGE_ARCH = "${MACHINE_ARCH}" inherit update-rc.d systemd features_check +inherit_defer ${@oe.utils.conditional('ROOTLESS_X', '1', 'standard-user', '', d)} +REQUIRED_STANDARD_USER_GROUPS = "video tty audio input shutdown disk" REQUIRED_DISTRO_FEATURES = "x11 ${@oe.utils.conditional('ROOTLESS_X', '1', 'pam', '', d)}" PACKAGECONFIG ??= "blank"
@@ -38,8 +40,8 @@ do_install() { BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}" NO_CURSOR_ARG="${@bb.utils.contains('PACKAGECONFIG', 'nocursor', '-nocursor', '', d)}" if [ "${ROOTLESS_X}" = "1" ] ; then - XUSER_HOME="/home/xuser" - XUSER="xuser" + XUSER_HOME="/home/${STANDARD_USER_NAME}" + XUSER="${STANDARD_USER_NAME}" install -D capability.conf ${D}${sysconfdir}/security/capability.conf sed -i "s:@USER@:${XUSER}:" ${D}${sysconfdir}/security/capability.conf else
@@ -62,7 +64,7 @@ do_install() { fi } -RDEPENDS:${PN} = "xinit ${@oe.utils.conditional('ROOTLESS_X', '1', 'xuser-account libcap libcap-bin', '', d)}" +RDEPENDS:${PN} = "xinit ${@oe.utils.conditional('ROOTLESS_X', '1', 'libcap libcap-bin', '', d)}" INITSCRIPT_NAME = "xserver-nodm" INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
meta/recipes-support/user-creation/files/system-user.conf renamed from meta/recipes-support/user-creation/files/system-xuser.conf +1 -1
@@ -1,7 +1,7 @@ <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> <busconfig> - <policy user="xuser"> + <policy user="@STANDARD_USER_NAME@"> <allow send_destination="net.connman"/> <allow send_destination="net.connman.vpn"/> <allow send_destination="org.ofono"/>
meta/recipes-support/user-creation/standard-user-account_0.1.bb new file +46 -0
46 lines not on this page · raw message
meta/recipes-support/user-creation/xuser-account_0.1.bb deleted +0 -30
@@ -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"
scripts/sstate-sysroot-cruft.sh +3 -3
@@ -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 \
Signature · 1 line
2.54.0
Quoted 11 lines · rs
From: Randolph Sapp <[email protected]>
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.
Quoted 8 lines
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/230665Signed-off-by Randolph Sapp <[email protected]>---
Hi Randolph,
Thanks, it looks better now.
Yet we have some test failures:
AssertionError: ssh exited with status '255' for command '['ssh', '-l', 'root', '-o', 'ServerAliveCountMax=2', '-o', 'ServerAliveInterval=30', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-o', 'LogLevel=ERROR', '192.168.7.2', 'export PATH=/usr/sbin:/sbin:/usr/bin:/bin; export XDG_RUNTIME_DIR=/run/user/id -u weston; export WAYLAND_DISPLAY=wayland-1; wayland-info']': this is likely an SSH failure
id: unknown user weston
failed to create display: No such file or directory
...
RESULTS - weston.WestonTest.test_wayland_info: FAILED (0.47s)
RESULTS - weston.WestonTest.test_weston_can_initialize_new_wayland_compositor: FAILED (0.27s)
RESULTS - weston.WestonTest.test_weston_running: FAILED (0.73s)
https://autobuilder.yoctoproject.org/valkyrie/#/builders/25/builds/3950
Also we have a failing selftest:
2026-06-17 11:32:17,460 - oe-selftest - INFO - incompatible_lic.NoGPL3InImagesTests.test_core_image_full_cmdline_weston (subunit.RemotedTestCase) 2026-06-17 11:32:17,465 - oe-selftest - INFO - ... FAIL
...
ERROR: weston-init-1.0-r0 do_package_write_rpm: File /srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-953747/tmp/work/qemux86_64-poky-linux/weston-init/1.0/recipe-sysroot/etc/passwd doesn't exist in sysroot!
...
File: '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/classes-global/package_rpm.bbclass', lineno: 202, function: get_attr
0198: def get_attr(path):
0199: stat_f = os.stat(rootpath + "/" + path, follow_symlinks=False)
0200: mode = stat.S_IMODE(stat_f.st_mode)
0201: try:
*** 0202: owner = pwd.getpwuid(stat_f.st_uid).pw_name
0203: except Exception as e:
0204: filename = d.getVar('RECIPE_SYSROOT') + '/etc/passwd'
0205: if os.path.exists(filename):
0206: bb.error("Content of /etc/passwd in sysroot:\n{}".format(
Exception: KeyError: 'getpwuid(): uid not found: 1000'
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4139
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/4061
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/3911
Can you have a look at the issue?
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Quoted 56 lines · Mathieu Dubois-Briand
Quoted 11 lines · rs
From: Randolph Sapp <[email protected]>
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.
Quoted 8 lines
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/230665Signed-off-by Randolph Sapp <[email protected]>---
Hi Randolph,
Thanks, it looks better now.
Yet we have some test failures:
AssertionError: ssh exited with status '255' for command '['ssh', '-l', 'root', '-o', 'ServerAliveCountMax=2', '-o', 'ServerAliveInterval=30', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-o', 'LogLevel=ERROR', '192.168.7.2', 'export PATH=/usr/sbin:/sbin:/usr/bin:/bin; export XDG_RUNTIME_DIR=/run/user/
id -u weston; export WAYLAND_DISPLAY=wayland-1; wayland-info']': this is likely an SSH failure
id: unknown user weston
failed to create display: No such file or directory
...
RESULTS - weston.WestonTest.test_wayland_info: FAILED (0.47s)
RESULTS - weston.WestonTest.test_weston_can_initialize_new_wayland_compositor: FAILED (0.27s)
RESULTS - weston.WestonTest.test_weston_running: FAILED (0.73s)https://autobuilder.yoctoproject.org/valkyrie/#/builders/25/builds/3950
Also we have a failing selftest:
2026-06-17 11:32:17,460 - oe-selftest - INFO - incompatible_lic.NoGPL3InImagesTests.test_core_image_full_cmdline_weston (subunit.RemotedTestCase) 2026-06-17 11:32:17,465 - oe-selftest - INFO - ... FAIL...
ERROR: weston-init-1.0-r0do_package_write_rpm: File/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-953747/tmp/work/qemux86_64-poky-linux/weston-init/1.0/recipe-sysroot/etc/passwddoesn't exist in sysroot!
...
File: '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/classes-global/package_rpm.bbclass', lineno: 202, function:get_attr
0198: defget_attr(path):
0199:stat_f=os.stat(rootpath + "/" + path, follow_symlinks=False)
0200: mode =stat.S_IMODE(stat_f.st_mode)
0201: try:
*** 0202: owner = pwd.getpwuid(stat_f.st_uid).pw_name
0203: except Exception as e:
0204: filename =d.getVar('RECIPE_SYSROOT')+ '/etc/passwd'
0205: ifos.path.exists(filename):
0206: bb.error("Content of/etc/passwdin sysroot:\n{}".format(
Exception: KeyError: 'getpwuid(): uid not found: 1000'
Quoted 8 lines
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4139
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/4061
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/3911Can you have a look at the issue?
Thanks,
Mathieu
Sorry, we also have a dependency issue in the reproducibility test:
2026-06-17 12:32:19,348 - oe-selftest - INFO - ERROR: Nothing PROVIDES 'standard-user-account' (but /srv/pokybuild/yocto-worker/reproducible/build/layers/openembedded-core/meta/recipes-graphics/wayland/weston-init.bb DEPENDS on or otherwise requires it) 2026-06-17 12:32:19,348 - oe-selftest - INFO - standard-user-account was skipped: Recipe standard-user-account, package standard-user-account: system groupname "disk" does not have a static ID defined. Add disk to one of these files: /srv/pokybuild/yocto-worker/reproducible/build/build-st/meta-selftest/files/static-group 2026-06-17 12:32:19,348 - oe-selftest - INFO - ERROR: Nothing RPROVIDES 'weston-init' (but /srv/pokybuild/yocto-worker/reproducible/build/layers/openembedded-core/meta/recipes-graphics/packagegroups/packagegroup-core-weston.bb, /srv/pokybuild/yocto-worker/reproducible/build/layers/openembedded-core/meta/recipes-graphics/wayland/weston-init.bb, /srv/pokybuild/yocto-worker/reproducible/build/layers/openembedded-core/meta/recipes-graphics/wayland/weston_15.0.1.bb RDEPENDS on or otherwise requires it) 2026-06-17 12:32:19,348 - oe-selftest - INFO - No eligible RPROVIDERs exist for 'weston-init' 2026-06-17 12:32:19,348 - oe-selftest - INFO - NOTE: Runtime target 'weston-init' is unbuildable, removing... 2026-06-17 12:32:19,348 - oe-selftest - INFO - Missing or unbuildable dependency chain was: ['weston-init'] 2026-06-17 12:32:19,349 - oe-selftest - INFO - NOTE: Runtime target 'packagegroup-core-weston' is unbuildable, removing... 2026-06-17 12:32:19,349 - oe-selftest - INFO - Missing or unbuildable dependency chain was: ['packagegroup-core-weston', 'weston-init'] 2026-06-17 12:32:19,349 - oe-selftest - INFO - NOTE: Runtime target 'core-image-weston' is unbuildable, removing... 2026-06-17 12:32:19,349 - oe-selftest - INFO - Missing or unbuildable dependency chain was: ['core-image-weston', 'packagegroup-core-weston', 'weston-init'] 2026-06-17 12:32:19,349 - oe-selftest - INFO - NOTE: Runtime target 'weston-xwayland' is unbuildable, removing... 2026-06-17 12:32:19,349 - oe-selftest - INFO - Missing or unbuildable dependency chain was: ['weston-xwayland', 'weston-init']
https://autobuilder.yoctoproject.org/valkyrie/#/builders/37/builds/4185
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Quoted 36 lines · Mathieu Dubois-Briand
Quoted 35 lines · Mathieu Dubois-Briand
Quoted 11 lines · rs
From: Randolph Sapp <[email protected]>
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.
Quoted 8 lines
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/230665Signed-off-by Randolph Sapp <[email protected]>---
Hi Randolph,
Thanks, it looks better now.
Yet we have some test failures:
AssertionError: ssh exited with status '255' for command '['ssh', '-l', 'root', '-o', 'ServerAliveCountMax=2', '-o', 'ServerAliveInterval=30', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-o', 'LogLevel=ERROR', '192.168.7.2', 'export PATH=/usr/sbin:/sbin:/usr/bin:/bin; export XDG_RUNTIME_DIR=/run/user/
id -u weston; export WAYLAND_DISPLAY=wayland-1; wayland-info']': this is likely an SSH failure
id: unknown user weston
failed to create display: No such file or directory
...
RESULTS - weston.WestonTest.test_wayland_info: FAILED (0.47s)
RESULTS - weston.WestonTest.test_weston_can_initialize_new_wayland_compositor: FAILED (0.27s)
RESULTS - weston.WestonTest.test_weston_running: FAILED (0.73s)
Quoted 1 line
Yeah, that tracks. Have been testing against sato on x86 since that's been the most problematic combination in the past. Completely missed that.
Quoted 19 lines
Quoted 19 lines
Also we have a failing selftest:
2026-06-17 11:32:17,460 - oe-selftest - INFO - incompatible_lic.NoGPL3InImagesTests.test_core_image_full_cmdline_weston (subunit.RemotedTestCase) 2026-06-17 11:32:17,465 - oe-selftest - INFO - ... FAIL...
ERROR: weston-init-1.0-r0do_package_write_rpm: File/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-953747/tmp/work/qemux86_64-poky-linux/weston-init/1.0/recipe-sysroot/etc/passwddoesn't exist in sysroot!
...
File: '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/classes-global/package_rpm.bbclass', lineno: 202, function:get_attr
0198: defget_attr(path):
0199:stat_f=os.stat(rootpath + "/" + path, follow_symlinks=False)
0200: mode =stat.S_IMODE(stat_f.st_mode)
0201: try:
*** 0202: owner = pwd.getpwuid(stat_f.st_uid).pw_name
0203: except Exception as e:
0204: filename =d.getVar('RECIPE_SYSROOT')+ '/etc/passwd'
0205: ifos.path.exists(filename):
0206: bb.error("Content of/etc/passwdin sysroot:\n{}".format(
Exception: KeyError: 'getpwuid(): uid not found: 1000'
Quoted 8 lines
Quoted 8 lines
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4139
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/4061
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/3911Can you have a look at the issue?
Thanks,
Mathieu
That's fun. I'll take a look.
Quoted 15 lines
Sorry, we also have a dependency issue in the reproducibility test:
2026-06-17 12:32:19,348 - oe-selftest - INFO - ERROR: Nothing PROVIDES 'standard-user-account' (but /srv/pokybuild/yocto-worker/reproducible/build/layers/openembedded-core/meta/recipes-graphics/wayland/weston-init.bb DEPENDS on or otherwise requires it) 2026-06-17 12:32:19,348 - oe-selftest - INFO - standard-user-account was skipped: Recipe standard-user-account, package standard-user-account: system groupname "disk" does not have a static ID defined. Add disk to one of these files: /srv/pokybuild/yocto-worker/reproducible/build/build-st/meta-selftest/files/static-group 2026-06-17 12:32:19,348 - oe-selftest - INFO - ERROR: Nothing RPROVIDES 'weston-init' (but /srv/pokybuild/yocto-worker/reproducible/build/layers/openembedded-core/meta/recipes-graphics/packagegroups/packagegroup-core-weston.bb, /srv/pokybuild/yocto-worker/reproducible/build/layers/openembedded-core/meta/recipes-graphics/wayland/weston-init.bb, /srv/pokybuild/yocto-worker/reproducible/build/layers/openembedded-core/meta/recipes-graphics/wayland/weston_15.0.1.bb RDEPENDS on or otherwise requires it) 2026-06-17 12:32:19,348 - oe-selftest - INFO - No eligible RPROVIDERs exist for 'weston-init' 2026-06-17 12:32:19,348 - oe-selftest - INFO - NOTE: Runtime target 'weston-init' is unbuildable, removing... 2026-06-17 12:32:19,348 - oe-selftest - INFO - Missing or unbuildable dependency chain was: ['weston-init'] 2026-06-17 12:32:19,349 - oe-selftest - INFO - NOTE: Runtime target 'packagegroup-core-weston' is unbuildable, removing... 2026-06-17 12:32:19,349 - oe-selftest - INFO - Missing or unbuildable dependency chain was: ['packagegroup-core-weston', 'weston-init'] 2026-06-17 12:32:19,349 - oe-selftest - INFO - NOTE: Runtime target 'core-image-weston' is unbuildable, removing... 2026-06-17 12:32:19,349 - oe-selftest - INFO - Missing or unbuildable dependency chain was: ['core-image-weston', 'packagegroup-core-weston', 'weston-init'] 2026-06-17 12:32:19,349 - oe-selftest - INFO - NOTE: Runtime target 'weston-xwayland' is unbuildable, removing... 2026-06-17 12:32:19,349 - oe-selftest - INFO - Missing or unbuildable dependency chain was: ['weston-xwayland', 'weston-init']
Quoted 4 lines
https://autobuilder.yoctoproject.org/valkyrie/#/builders/37/builds/4185
Thanks,
Mathieu
Ah, man. The implications of this error really bug me. There's not really a clean enough solution to fix the "some groups are just implicitly expected" issue though. *Suppose I'll make a separate var for groups that we know need to be created and let everything else be implied.*
Lot of weird cases like:
What if the group is no longer provided by base-passwd? Will there be any compile time warnings? Should there be any? Should this really be an installation check?
Scripts using group names vs group IDs will have completely different behavior. The filesystem is more than happy to keep trucking with an ID that no longer exists, and that ID can be claimed by anything later. Good system administrators normally try to prevent that, but this is all oneshot right?
Should recipes have to indicate where they expect a group to come from? That seems messy, and will have to deal with recipes spanning layers. No telling how often those values will be wrong due to a namechange more than an actual deprecation of a group.
Don't like this.