summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Bräuner Sørensen <yocto@bsorensen.net>2024-05-02 11:42:04 +0200
committerSteve Sakoman <steve@sakoman.com>2024-05-06 13:32:02 -0700
commit0d895fa4c124bd4ee54c2662d76c7a8c5df79e93 (patch)
tree26f9991b4263bc63b6cad444d8684b3dec8aeea1
parent94dc3e62a5b7f75dc3b45764afc21c4d7f323228 (diff)
downloadpoky-0d895fa4c124bd4ee54c2662d76c7a8c5df79e93.tar.gz
systemd: sed ROOT_HOME only if sysusers PACKAGECONFIG is set
Fixes a bug introducted in ebafe46379 systemd: upgrade to 255.1. Besides updating systemd, that commit also made other changes. One of them being when to perform the replacement in order to fix ROOT_HOME. Previously, that happened on a configure prefunc and on ${S}/sysusers.d/basic.conf.in. Now it happens in install and on image/usr/lib/sysusers.d/basic.conf. However, that file is not present if sysusers is not in PACKAGECONFIG, since that file in that case is not installed hence resulting in: sed: can't read <redactedpath>/image/usr/lib/sysusers.d/basic.conf: No such file or directory Previously, in the case of sysusers not being in PACKAGECONFIG, that was a "silent error" since the replacement was done but the file was not really used since the file was not installed. (From OE-Core rev: 6954cd4bb60762f86981621e8b37dbe5e8236640) Signed-off-by: Christian Bräuner Sørensen <yocto@bsorensen.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Martin Hundebøll <martin@geanix.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-core/systemd/systemd_255.4.bb18
1 files changed, 10 insertions, 8 deletions
diff --git a/meta/recipes-core/systemd/systemd_255.4.bb b/meta/recipes-core/systemd/systemd_255.4.bb
index e7498c802d..f58a1bc2b6 100644
--- a/meta/recipes-core/systemd/systemd_255.4.bb
+++ b/meta/recipes-core/systemd/systemd_255.4.bb
@@ -271,14 +271,16 @@ WATCHDOG_TIMEOUT ??= "60"
271 271
272do_install() { 272do_install() {
273 meson_do_install 273 meson_do_install
274 # Change the root user's home directory in /lib/sysusers.d/basic.conf. 274 if ${@bb.utils.contains('PACKAGECONFIG', 'sysusers', 'true', 'false', d)}; then
275 # This is done merely for backward compatibility with previous systemd recipes. 275 # Change the root user's home directory in /lib/sysusers.d/basic.conf.
276 # systemd hardcodes root user's HOME to be "/root". Changing to use other values 276 # This is done merely for backward compatibility with previous systemd recipes.
277 # may have unexpected runtime behaviors. 277 # systemd hardcodes root user's HOME to be "/root". Changing to use other values
278 if [ "${ROOT_HOME}" != "/root" ]; then 278 # may have unexpected runtime behaviors.
279 bbwarn "Using ${ROOT_HOME} as root user's home directory is not fully supported by systemd" 279 if [ "${ROOT_HOME}" != "/root" ]; then
280 sed -i -e 's#/root#${ROOT_HOME}#g' ${D}${exec_prefix}/lib/sysusers.d/basic.conf 280 bbwarn "Using ${ROOT_HOME} as root user's home directory is not fully supported by systemd"
281 fi 281 sed -i -e 's#/root#${ROOT_HOME}#g' ${D}${exec_prefix}/lib/sysusers.d/basic.conf
282 fi
283 fi
282 install -d ${D}/${base_sbindir} 284 install -d ${D}/${base_sbindir}
283 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then 285 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
284 # Provided by a separate recipe 286 # Provided by a separate recipe