Bug 10334

Summary: useradd_sysroot fails due to the way USERADD_PARAM is set in systemd_229 recipe
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Venka Gade <venkag>
Component: coreAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Undecided CC: akuster, infras.bug.watcher, Infras.watcher, meta.mr.watcher, meta.watcher, richard.purdie, ross.burton
Version: 2.1.2   
Target Milestone: ---   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Venka Gade 2016-09-27 13:49:15 UTC
A recent update to system recipe (systemd_229.bb) resulted in do_install to fail. The following are the changes:

USERADD_PACKAGES = "${PN} ${PN}-extra-utils"
USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-gateway;', '', d)}"
USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-remote;', '', d)}"
USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '--system -d / -M --shell /bin/nologin systemd-journal-upload;', '', d)}"
USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
USERADD_PARAM_${PN}-extra-utils += "--system -d / -M --shell /bin/nologin systemd-bus-proxy;"


To simplify things, lets shorten the above settings to:

USERADD_PACKAGES = "${PN}" "${PN}-a"
USERADD_PARAM_${PN} += x; 
USERADD_PARAM_${PN} += y;
USERADD_PARAM_${PN}-a = z;

As a result of parsing these settings by get_all_cmd_parse() in meta/classes/useradd.bbclass, this turns out to be:

x; y; ; z;

"; ".join(params) introduces an additional semicolon in the list. As a result, perform_useradd runs with empty argument listand causes do_install() to fail.
Comment 1 Richard Purdie 2016-09-29 14:43:08 UTC
Was this a bug with krogoth fixed by http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=krogoth&id=2ea93e2b1db4a825543e37e68121d63a71c7d6b3 ?
Comment 2 Ross Burton 2016-09-29 14:46:01 UTC
Certainly looks like that was the fix, marking as resolved fixed.  Venka, if you can replicate with current oe-core/krogoth then please reopen.
Comment 3 Ross Burton 2016-09-29 14:46:23 UTC
(Actually closing this time)