aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd_228.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd_228.bb')
-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"
ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
ALTERNATIVE_PRIORITY[runlevel] ?= "300"
+pkg_postinst_${PN} () {
+ sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+ -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
+ -i $D${sysconfdir}/nsswitch.conf
+}
+
+pkg_prerm_${PN} () {
+ sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+ -e '/^hosts:/s/\s*myhostname//' \
+ -i $D${sysconfdir}/nsswitch.conf
+}
+
pkg_postinst_udev-hwdb () {
if test -n "$D"; then
${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \