Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] systemd 216: add postinsts for hostname and machine nss modules
@ 2014-09-27  7:22 Koen Kooi
  2014-09-27  7:22 ` [PATCH 2/2] systemd 216: add system user factory files to CONFFILES Koen Kooi
  0 siblings, 1 reply; 7+ messages in thread
From: Koen Kooi @ 2014-09-27  7:22 UTC (permalink / raw)
  To: openembedded-core; +Cc: Koen Kooi

The external recipe has postinsts so to make this a true replacement add
them here as well.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/recipes-core/systemd/systemd_216.bb | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
index 331da99..3e572e8 100644
--- a/meta/recipes-core/systemd/systemd_216.bb
+++ b/meta/recipes-core/systemd/systemd_216.bb
@@ -369,6 +369,28 @@ pkg_prerm_udev-hwdb () {
 	rm -f ${sysconfdir}/udev/hwdb.bin
 }
 
+# Do not activate libnss-resolve by default, that needs more thought
+
+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
+
+	sed -e '/^hosts:/s/\s*\<mymachine\>//' \
+		-e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mymachine \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
+
+	sed -e '/^hosts:/s/\s*\<mymachine\>//' \
+		-e '/^hosts:/s/\s*mymachine//' \
+		-i $D${sysconfdir}/nsswitch.conf
+}
+
 # As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
 # that we don't build both udev and systemd in world builds.
 python () {
-- 
1.9.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-30 13:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-27  7:22 [PATCH 1/2] systemd 216: add postinsts for hostname and machine nss modules Koen Kooi
2014-09-27  7:22 ` [PATCH 2/2] systemd 216: add system user factory files to CONFFILES Koen Kooi
2014-09-29 20:59   ` Colin Walters
2014-09-30  7:39     ` Koen Kooi
2014-09-30  8:51       ` Richard Purdie
2014-09-30  9:36       ` Burton, Ross
2014-09-30 13:26         ` Colin Walters

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox