summaryrefslogtreecommitdiffstats
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-15 03:51:57 -1000
commitb8a07a0ed25734738c5c6e557b8829b229191cee (patch)
treef2b34155c77ceb4354b79ad65cef0371fbdbd8dd
parente17cf6a549c53c48629d9454ec744fd2c824a83f (diff)
downloadpoky-b8a07a0ed25734738c5c6e557b8829b229191cee.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> (From OE-Core rev: 17e20ce90b5b3abb5a597d4a5b470c8eaa3fd296) Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-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"
776ALTERNATIVE_PRIORITY[runlevel] ?= "300" 776ALTERNATIVE_PRIORITY[runlevel] ?= "300"
777 777
778pkg_postinst:${PN}:libc-glibc () { 778pkg_postinst:${PN}:libc-glibc () {
779 sed -e '/^hosts:/s/\s*\<myhostname\>//' \ 779 if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then
780 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \ 780 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
781 -i $D${sysconfdir}/nsswitch.conf 781 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
782 -i $D${sysconfdir}/nsswitch.conf
783 fi
782} 784}
783 785
784pkg_prerm:${PN}:libc-glibc () { 786pkg_prerm:${PN}:libc-glibc () {
785 sed -e '/^hosts:/s/\s*\<myhostname\>//' \ 787 if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then
786 -e '/^hosts:/s/\s*myhostname//' \ 788 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
787 -i $D${sysconfdir}/nsswitch.conf 789 -e '/^hosts:/s/\s*myhostname//' \
790 -i $D${sysconfdir}/nsswitch.conf
791 fi
788} 792}
789 793
790PACKAGE_WRITE_DEPS += "qemu-native" 794PACKAGE_WRITE_DEPS += "qemu-native"