Return-Path: X-Greylist: delayed 992 seconds by postgrey-1.34 at layers.openembedded.org; Mon, 08 Aug 2016 13:54:06 UTC Received: from metis.ext.4.pengutronix.de (metis.ext.4.pengutronix.de [92.198.50.35]) by mail.openembedded.org (Postfix) with ESMTP id 25FDC70031 for ; Mon, 8 Aug 2016 13:54:06 +0000 (UTC) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1bWkkH-0002sT-7g; Mon, 08 Aug 2016 15:37:33 +0200 Received: from ejo by dude.hi.pengutronix.de with local (Exim 4.87) (envelope-from ) id 1bWkkG-0008SB-Uc; Mon, 08 Aug 2016 15:37:32 +0200 From: Enrico Jorns To: openembedded-core@lists.openembedded.org Date: Mon, 8 Aug 2016 15:37:28 +0200 Message-Id: <1470663448-5191-1-git-send-email-ejo@pengutronix.de> X-Mailer: git-send-email 2.8.1 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ejo@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: openembedded-core@lists.openembedded.org Subject: [PATCH] systemd: fix useradd parameter generation X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2016 13:54:08 -0000 Constructing the USERADD_PARAM_${PN} value with += (as done before) resulted in having a whitespace added for each entry not having its PACKAGECONFIG parameter activated. This is not only a cosmetical issue. The useradd class concatenates all useradd commands from all subpackages of a package by doing a ";".join(). When having a useradd command that ends with ";" and some extra spaces, concatenation will result in an empty useradd argument ("commandA; ;commandB"). The useradd command will be called with this and make the Yocto build break by returning an error code. Fortunately, there is no problem when having a "commandA;;commandB" in the useradd string, this will be ignored. Thus using "_append" instead of "+=" is sufficient here. Signed-off-by: Enrico Jorns --- meta/recipes-core/systemd/systemd_230.bb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meta/recipes-core/systemd/systemd_230.bb b/meta/recipes-core/systemd/systemd_230.bb index 374a197..dd21095 100644 --- a/meta/recipes-core/systemd/systemd_230.bb +++ b/meta/recipes-core/systemd/systemd_230.bb @@ -298,13 +298,13 @@ SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfm SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" 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)}" +USERADD_PARAM_${PN}_append = "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-gateway;', '', d)}" +USERADD_PARAM_${PN}_append = "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-remote;', '', d)}" +USERADD_PARAM_${PN}_append = "${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '--system -d / -M --shell /bin/nologin systemd-journal-upload;', '', d)}" +USERADD_PARAM_${PN}_append = "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}" +USERADD_PARAM_${PN}_append = "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}" +USERADD_PARAM_${PN}_append = "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}" +USERADD_PARAM_${PN}_append = "${@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;" -- 2.8.1