]> code.ossystems Code Review - openembedded-core.git/commitdiff
initscripts: mask initscripts from systemd
authorRoss Burton <ross.burton@intel.com>
Tue, 11 Feb 2014 22:43:04 +0000 (22:43 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 11 Feb 2014 22:59:10 +0000 (22:59 +0000)
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@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initscripts/initscripts_1.0.bb

index d1644a3204fbcdd4fac9e116798d2bdf28fd1cac..20c025752b1286b60d747f9d545691f7c8ce968c 100644 (file)
@@ -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
+}