summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd
diff options
context:
space:
mode:
authorJermain Horsman <jermain.horsman@nedap.com>2024-02-08 10:11:28 +0100
committerSteve Sakoman <steve@sakoman.com>2024-02-09 06:38:05 -1000
commit17e20ce90b5b3abb5a597d4a5b470c8eaa3fd296 (patch)
tree41afd3a6e9962a8bc8ce9705cdb6a35bc2699b87 /meta/recipes-core/systemd
parent04c9b6b081914005209bac8eeb9f417e7b989cca (diff)
downloadopenembedded-core-contrib-17e20ce90b5b3abb5a597d4a5b470c8eaa3fd296.tar.gz
systemd: Only add myhostname to nsswitch.conf if in PACKAGECONFIG
Currently myhostname is always added to nsswitch.conf even if it is not included in PACKAGECONFIG. This is based on changes made in OE-core rev: ba3a78c08cb0ce08afde049610d3172b9e3b0695 Cc: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-core/systemd')
-rw-r--r--meta/recipes-core/systemd/systemd_250.5.bb16
1 files changed, 10 insertions, 6 deletions
diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb
index 889473ee1f..80a797cf2c 100644
--- a/meta/recipes-core/systemd/systemd_250.5.bb
+++ b/meta/recipes-core/systemd/systemd_250.5.bb
@@ -776,15 +776,19 @@ ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
ALTERNATIVE_PRIORITY[runlevel] ?= "300"
pkg_postinst:${PN}:libc-glibc () {
- sed -e '/^hosts:/s/\s*\<myhostname\>//' \
- -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
- -i $D${sysconfdir}/nsswitch.conf
+ if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then
+ sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+ -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
+ -i $D${sysconfdir}/nsswitch.conf
+ fi
}
pkg_prerm:${PN}:libc-glibc () {
- sed -e '/^hosts:/s/\s*\<myhostname\>//' \
- -e '/^hosts:/s/\s*myhostname//' \
- -i $D${sysconfdir}/nsswitch.conf
+ if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then
+ sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+ -e '/^hosts:/s/\s*myhostname//' \
+ -i $D${sysconfdir}/nsswitch.conf
+ fi
}
PACKAGE_WRITE_DEPS += "qemu-native"