[oe-commits] Ross Burton : initscripts: mask initscripts from systemd

git at git.openembedded.org git at git.openembedded.org
Tue Feb 11 18:12:23 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: 8f4d9d37505c91eb9fe2688a4aee1ff5987b8b34
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=8f4d9d37505c91eb9fe2688a4aee1ff5987b8b34

Author: Ross Burton <ross.burton at intel.com>
Date:   Tue Feb 11 16:31:58 2014 +0000

initscripts: mask initscripts from systemd

Many of the init scripts in here will do nasty things if systemd decides to run
them.  Mask the obviously bad ones so that systemd won't attempt to invoke them
if initscripts is installed with systemd.

Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-core/initscripts/initscripts_1.0.bb | 25 ++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index d1644a3..20c0257 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -41,6 +41,7 @@ KERNEL_VERSION = ""
 
 inherit update-alternatives
 DEPENDS_append = " update-rc.d-native"
+DEPENDS_append = " ${@base_contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
 
 PACKAGES =+ "${PN}-functions"
 RDEPENDS_${PN} = "${PN}-functions"
@@ -134,3 +135,27 @@ do_install () {
 	# populate-volatile.sh
 	update-rc.d -r ${D} dmesg.sh start 38 S .
 }
+
+MASKED_SCRIPTS = " \
+  banner \
+  bootmisc \
+  checkroot \
+  devpts \
+  hostname \
+  mountall \
+  mountnfs \
+  rmnologin \
+  sysfs \
+  urandom"
+
+pkg_postinst_${PN} () {
+	if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		for SERVICE in ${MASKED_SCRIPTS}; do
+			systemctl $OPTS mask $SERVICE.service
+		done
+	fi
+fi
+}



More information about the Openembedded-commits mailing list