All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ross Burton <ross.burton@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 07/10] update-rc.d: disable update-rc.d.bbclass when systemd enabled
Date: Sat, 19 Jan 2013 22:47:10 +0000	[thread overview]
Message-ID: <20752e738080291f5353baa951193a23ac464b18.1358635193.git.ross.burton@intel.com> (raw)
In-Reply-To: <cover.1358635193.git.ross.burton@intel.com>
In-Reply-To: <cover.1358635193.git.ross.burton@intel.com>

From: Radu Moisan <radu.moisan@intel.com>

update-rc.d is not necessary when systemd is enabled,
systemctl is the replacement

Signed-off-by: Radu Moisan <radu.moisan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/classes/update-rc.d.bbclass      |   90 +--------------------------------
 meta/classes/update-rc.d_real.bbclass |   89 ++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+), 89 deletions(-)
 create mode 100644 meta/classes/update-rc.d_real.bbclass

diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 83816d6..34f9838 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -1,89 +1 @@
-UPDATERCPN ?= "${PN}"
-
-DEPENDS_append = " update-rc.d-native"
-UPDATERCD = "update-rc.d"
-UPDATERCD_virtclass-cross = ""
-UPDATERCD_class-native = ""
-UPDATERCD_class-nativesdk = ""
-
-RDEPENDS_${UPDATERCPN}_append = " ${UPDATERCD}"
-
-INITSCRIPT_PARAMS ?= "defaults"
-
-INIT_D_DIR = "${sysconfdir}/init.d"
-
-updatercd_postinst() {
-if test "x$D" != "x"; then
-	OPT="-r $D"
-else
-	OPT="-s"
-fi
-update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
-}
-
-updatercd_prerm() {
-if test "x$D" = "x"; then
-	${INIT_D_DIR}/${INITSCRIPT_NAME} stop
-fi
-}
-
-updatercd_postrm() {
-if [ "$D" != "" ]; then
-	update-rc.d -f -r $D ${INITSCRIPT_NAME} remove
-else
-	update-rc.d ${INITSCRIPT_NAME} remove
-fi
-}
-
-
-def update_rc_after_parse(d):
-    if d.getVar('INITSCRIPT_PACKAGES') == None:
-        if d.getVar('INITSCRIPT_NAME') == None:
-            raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE')
-        if d.getVar('INITSCRIPT_PARAMS') == None:
-            raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE')
-
-python __anonymous() {
-    update_rc_after_parse(d)
-}
-
-python populate_packages_prepend () {
-    def update_rcd_package(pkg):
-        bb.debug(1, 'adding update-rc.d calls to postinst/postrm for %s' % pkg)
-        localdata = bb.data.createCopy(d)
-        overrides = localdata.getVar("OVERRIDES", True)
-        localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides))
-        bb.data.update_data(localdata)
-
-        """
-        update_rc.d postinst is appended here because pkg_postinst may require to
-        execute on the target. Not doing so may cause update_rc.d postinst invoked
-        twice to cause unwanted warnings.
-        """ 
-        postinst = localdata.getVar('pkg_postinst', True)
-        if not postinst:
-            postinst = '#!/bin/sh\n'
-        postinst += localdata.getVar('updatercd_postinst', True)
-        d.setVar('pkg_postinst_%s' % pkg, postinst)
-
-        prerm = localdata.getVar('pkg_prerm', True)
-        if not prerm:
-            prerm = '#!/bin/sh\n'
-        prerm += localdata.getVar('updatercd_prerm', True)
-        d.setVar('pkg_prerm_%s' % pkg, prerm)
-
-        postrm = localdata.getVar('pkg_postrm', True)
-        if not postrm:
-                postrm = '#!/bin/sh\n'
-        postrm += localdata.getVar('updatercd_postrm', True)
-        d.setVar('pkg_postrm_%s' % pkg, postrm)
-
-    pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
-    if pkgs == None:
-        pkgs = d.getVar('UPDATERCPN', True)
-        packages = (d.getVar('PACKAGES', True) or "").split()
-        if not pkgs in packages and packages != []:
-            pkgs = packages[0]
-    for pkg in pkgs.split():
-        update_rcd_package(pkg)
-}
+inherit ${@base_contains('DISTRO_FEATURES','sysvinit','update-rc.d_real','',d)}
diff --git a/meta/classes/update-rc.d_real.bbclass b/meta/classes/update-rc.d_real.bbclass
new file mode 100644
index 0000000..83816d6
--- /dev/null
+++ b/meta/classes/update-rc.d_real.bbclass
@@ -0,0 +1,89 @@
+UPDATERCPN ?= "${PN}"
+
+DEPENDS_append = " update-rc.d-native"
+UPDATERCD = "update-rc.d"
+UPDATERCD_virtclass-cross = ""
+UPDATERCD_class-native = ""
+UPDATERCD_class-nativesdk = ""
+
+RDEPENDS_${UPDATERCPN}_append = " ${UPDATERCD}"
+
+INITSCRIPT_PARAMS ?= "defaults"
+
+INIT_D_DIR = "${sysconfdir}/init.d"
+
+updatercd_postinst() {
+if test "x$D" != "x"; then
+	OPT="-r $D"
+else
+	OPT="-s"
+fi
+update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
+}
+
+updatercd_prerm() {
+if test "x$D" = "x"; then
+	${INIT_D_DIR}/${INITSCRIPT_NAME} stop
+fi
+}
+
+updatercd_postrm() {
+if [ "$D" != "" ]; then
+	update-rc.d -f -r $D ${INITSCRIPT_NAME} remove
+else
+	update-rc.d ${INITSCRIPT_NAME} remove
+fi
+}
+
+
+def update_rc_after_parse(d):
+    if d.getVar('INITSCRIPT_PACKAGES') == None:
+        if d.getVar('INITSCRIPT_NAME') == None:
+            raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE')
+        if d.getVar('INITSCRIPT_PARAMS') == None:
+            raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE')
+
+python __anonymous() {
+    update_rc_after_parse(d)
+}
+
+python populate_packages_prepend () {
+    def update_rcd_package(pkg):
+        bb.debug(1, 'adding update-rc.d calls to postinst/postrm for %s' % pkg)
+        localdata = bb.data.createCopy(d)
+        overrides = localdata.getVar("OVERRIDES", True)
+        localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides))
+        bb.data.update_data(localdata)
+
+        """
+        update_rc.d postinst is appended here because pkg_postinst may require to
+        execute on the target. Not doing so may cause update_rc.d postinst invoked
+        twice to cause unwanted warnings.
+        """ 
+        postinst = localdata.getVar('pkg_postinst', True)
+        if not postinst:
+            postinst = '#!/bin/sh\n'
+        postinst += localdata.getVar('updatercd_postinst', True)
+        d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+        prerm = localdata.getVar('pkg_prerm', True)
+        if not prerm:
+            prerm = '#!/bin/sh\n'
+        prerm += localdata.getVar('updatercd_prerm', True)
+        d.setVar('pkg_prerm_%s' % pkg, prerm)
+
+        postrm = localdata.getVar('pkg_postrm', True)
+        if not postrm:
+                postrm = '#!/bin/sh\n'
+        postrm += localdata.getVar('updatercd_postrm', True)
+        d.setVar('pkg_postrm_%s' % pkg, postrm)
+
+    pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
+    if pkgs == None:
+        pkgs = d.getVar('UPDATERCPN', True)
+        packages = (d.getVar('PACKAGES', True) or "").split()
+        if not pkgs in packages and packages != []:
+            pkgs = packages[0]
+    for pkg in pkgs.split():
+        update_rcd_package(pkg)
+}
-- 
1.7.10.4




  parent reply	other threads:[~2013-01-19 23:04 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-19 22:47 [PATCH 00/10] Initial systemd integration Ross Burton
2013-01-19 22:47 ` [PATCH 01/10] default-distrovars: Add DISTRO_FEATURES_INITMAN to DISTRO_FEATURES Ross Burton
2013-01-23 11:38   ` [PATCH] bitbake.conf: unbreak all builds with custom DISTRO_FEATURES Marcin Juszkiewicz
2013-01-23 11:43     ` Burton, Ross
2013-01-23 11:47       ` Marcin Juszkiewicz
2013-01-19 22:47 ` [PATCH 02/10] default-providers: Automatically set PREFERRED_PROVIDER_udev Ross Burton
2013-01-20 23:12   ` Martin Jansa
2013-01-20 23:15     ` Martin Jansa
2013-01-19 22:47 ` [PATCH 03/10] dbus: respect systemd distro feature Ross Burton
2013-01-19 22:47 ` [PATCH 04/10] systemd: add systemd recipes Ross Burton
2013-01-20 23:11   ` Martin Jansa
2013-01-21 12:07     ` Burton, Ross
2013-01-19 22:47 ` [PATCH 05/10] default-providers: Add systemd option to PREFERRED_PROVIDER_udev Ross Burton
2013-01-19 22:47 ` [PATCH 06/10] packagegroup-core-boot: install systemd-compat-units on systemd images Ross Burton
2013-01-19 22:47 ` Ross Burton [this message]
2013-01-19 22:47 ` [PATCH 08/10] base-files: add fstab for systemd based systems Ross Burton
2013-01-19 22:47 ` [PATCH 09/10] packagegroup-core-boot: only install initscripts if we're using sysvinit Ross Burton
2013-01-19 22:47 ` [PATCH 10/10] libpam: register PAM session with logind Ross Burton
2013-01-20 18:34 ` [PATCH 00/10] Initial systemd integration Saul Wold
2013-01-20 20:21   ` Burton, Ross
2013-01-21  8:59     ` Martin Jansa
2013-01-21  9:21       ` Burton, Ross
2013-01-21  3:57   ` Saul Wold
2013-01-21  8:08     ` Burton, Ross
2013-01-21  8:19       ` Eric Bénard
2013-01-21  8:47         ` Radu Moisan
2013-01-21 10:14         ` Richard Purdie
2013-01-21 12:09           ` Burton, Ross
2013-01-21 12:10     ` Burton, Ross
2013-01-21  3:30 ` Ciprian Ciubotariu
2013-01-21 12:12   ` Burton, Ross
2013-01-21 16:57     ` Saul Wold
2013-01-21 17:00       ` Burton, Ross
2013-01-22 22:04     ` Ciprian Ciubotariu
2013-01-22 22:29       ` Richard Purdie
2013-01-22  9:30 ` ChenQi
2013-01-22 10:48   ` Radu Moisan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20752e738080291f5353baa951193a23ac464b18.1358635193.git.ross.burton@intel.com \
    --to=ross.burton@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.