summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2019-01-15 01:49:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-16 15:35:07 +0000
commitf509a85ceab90ef6e248e687665b5d9a99d2b6b0 (patch)
treef7aaa6b3f69def3e58a136ab1fb112c8b6ff6f48 /meta
parent8f3b5a7f43fddc20e9e9c7a3800d38261a9f137b (diff)
downloadpoky-f509a85ceab90ef6e248e687665b5d9a99d2b6b0.tar.gz
systemd: Correct and clean up user/group definitions
This makes sure that packages are only added to USERADD_PACKAGES if they will create users/groups. This avoids the following error: ERROR: systemd_239.bb: meta/recipes-core/systemd/systemd_239.bb inherits useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or GROUPMEMS_PARAM for package systemd-journal-gateway Normally this problem is not triggered even if the conditional code that expands in, e.g., USERADD_PARAM_${PN}-journal-gateway is empty because it is assigned with += and thus ends up as " ", which fools the check in useradd.bbclass. However, if USERADDEXTENSION += "useradd-staticids" and INHERIT += "extrausers" are used, they cause the problem to occur. The reason for this is because when useradd-staticids is used, it rewrites USERADD_PARAM_${PN}-journal-gateway, which strips unnecessary whitespace and thus USERADD_PARAM_${PN}-journal-gateway becomes empty. And extrausers is needed, because otherwise the test in useradd.bbclass is triggered before useradd-staticids has rewritten the variables... (From OE-Core rev: 63ae444b1dba65ccb1693648914becabd65ac30d) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/systemd/systemd_239.bb22
1 files changed, 13 insertions, 9 deletions
diff --git a/meta/recipes-core/systemd/systemd_239.bb b/meta/recipes-core/systemd/systemd_239.bb
index 586ef65299..87b0642c26 100644
--- a/meta/recipes-core/systemd/systemd_239.bb
+++ b/meta/recipes-core/systemd/systemd_239.bb
@@ -342,17 +342,21 @@ SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfm
342" 342"
343SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" 343SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
344 344
345USERADD_PACKAGES = "${PN} ${PN}-extra-utils ${PN}-journal-gateway ${PN}-journal-upload ${PN}-journal-remote" 345USERADD_PACKAGES = "${PN} ${PN}-extra-utils \
346USERADD_PARAM_${PN}-journal-gateway += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-gateway;', '', d)}" 346 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gateway', '', d)} \
347USERADD_PARAM_${PN}-journal-remote += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-remote;', '', d)}" 347 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
348USERADD_PARAM_${PN}-journal-upload += "${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '--system -d / -M --shell /bin/nologin systemd-journal-upload;', '', d)}" 348 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
349USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}" 349"
350USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}" 350GROUPADD_PARAM_${PN} = "-r systemd-journal"
351USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}" 351USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
352USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}" 352USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
353USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}" 353USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
354GROUPADD_PARAM_${PN} = "-r systemd-journal" 354USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
355USERADD_PARAM_${PN}-extra-utils += "--system -d / -M --shell /bin/nologin systemd-bus-proxy;" 355USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
356USERADD_PARAM_${PN}-extra-utils = "--system -d / -M --shell /bin/nologin systemd-bus-proxy"
357USERADD_PARAM_${PN}-journal-gateway = "--system -d / -M --shell /bin/nologin systemd-journal-gateway"
358USERADD_PARAM_${PN}-journal-remote = "--system -d / -M --shell /bin/nologin systemd-journal-remote"
359USERADD_PARAM_${PN}-journal-upload = "--system -d / -M --shell /bin/nologin systemd-journal-upload"
356 360
357FILES_${PN}-analyze = "${bindir}/systemd-analyze" 361FILES_${PN}-analyze = "${bindir}/systemd-analyze"
358 362