summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2015-11-04 13:57:45 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-11 23:26:29 +0000
commit5548a76a3c218381a34f021c9d80aa0ace6aa3f5 (patch)
tree32c88f4c79ca7c9cdb35f3783a2a97b23537bf43 /meta
parentd6bc84192cb144a0d84aecfb0cab868b454cb48a (diff)
downloadpoky-5548a76a3c218381a34f021c9d80aa0ace6aa3f5.tar.gz
systemd: add myhostname to nsswitch.conf
We don't need nss-myhostname on systemd systems, because systemd already provides myhostname, but we weren't configuring nsswitch to use it. Being able to resolve the hostname is useful for a number of different applications, so enable it using the same postinst/prerm bits which are in nss-myhostname. (From OE-Core rev: 1fb3e1a4bbf36a5b46d126a478d42d0b94f43182) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/systemd/systemd_228.bb12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_228.bb b/meta/recipes-core/systemd/systemd_228.bb
index 19b7b4218d..df8813ac42 100644
--- a/meta/recipes-core/systemd/systemd_228.bb
+++ b/meta/recipes-core/systemd/systemd_228.bb
@@ -404,6 +404,18 @@ ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
404ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" 404ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
405ALTERNATIVE_PRIORITY[runlevel] ?= "300" 405ALTERNATIVE_PRIORITY[runlevel] ?= "300"
406 406
407pkg_postinst_${PN} () {
408 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
409 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
410 -i $D${sysconfdir}/nsswitch.conf
411}
412
413pkg_prerm_${PN} () {
414 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
415 -e '/^hosts:/s/\s*myhostname//' \
416 -i $D${sysconfdir}/nsswitch.conf
417}
418
407pkg_postinst_udev-hwdb () { 419pkg_postinst_udev-hwdb () {
408 if test -n "$D"; then 420 if test -n "$D"; then
409 ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ 421 ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \