Bug 15863 - useradd: using only USERADD_DEPENDS gives errors about not setting one of the useradd class variables
Summary: useradd: using only USERADD_DEPENDS gives errors about not setting one of the...
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: oe-core other (show other bugs)
Version: 5.0.9
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 6.1 M1
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2025-05-14 09:50 UTC by Ludovic Jozeau
Modified: 2026-08-20 13:03 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic Jozeau 2025-05-14 09:50:01 UTC
I have a recipe that depends on the user/group created in another one (while not creating users nor groups itself), so I naturally tried to use the new USERADD_DEPENDS variable from the useradd class

unfortunately it gives the following errors:

"inherits useradd but doesn't set USERADD_PACKAGES"

then when I set USERADD_PACKAGES to "${PN}"

I now have this error:

"... inherits useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or GROUPMEMS_PARAM for package ..."

I think the USERADD_DEPENDS variable should also be checked if it is set

also extending the tests in selftest-users, something like:

# usegroup1.bb:

SUMMARY = "usegroupb1"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

LICENSE = "MIT"

USERADD_DEPENDS = "dcreategroup"

S = "${WORKDIR}"

EXCLUDE_FROM_WORLD="1"

inherit useradd allarch

USERADD_PACKAGES = "${PN}"

TESTDIR = "${D}${sysconfdir}/creategroup"

do_install() {
	install -d   ${TESTDIR}
	install -d   ${TESTDIR}/dir
	touch        ${TESTDIR}/file
	ln -s ./file ${TESTDIR}/symlink
	install -d   ${TESTDIR}/fifotest
	mkfifo       ${TESTDIR}/fifotest/fifo

	chown    d_user:d_group ${TESTDIR}/file
	chown -R d_user:b_group ${TESTDIR}/dir
	chown -h d_user:d_group ${TESTDIR}/symlink
	chown -R d_user:b_group ${TESTDIR}/fifotest
}
Comment 1 Randy MacLeod 2025-05-15 14:43:30 UTC
Yoann or Ludovic to send a patch, hopefully.
Comment 2 Yoann Congal 2025-11-06 10:57:03 UTC
Bulk move to 6.0 M1
Comment 3 Yoann Congal 2026-04-03 09:25:41 UTC
(Unassigning myself since a do not realistically have the time to work on this)