Patchwork [2/2] update-rc.d: Remove init.d dir if sysvinit is not in distro features

login
register
mail settings
Submitter Shakeel, Muhammad
Date July 19, 2013, 11:53 a.m.
Message ID <1374234806-31680-2-git-send-email-muhammad_shakeel@mentor.com>
Download mbox | patch
Permalink /patch/54065/
State New
Headers show

Comments

Shakeel, Muhammad - July 19, 2013, 11:53 a.m.
From: Muhammad Shakeel <muhammad_shakeel@mentor.com>

If sysvinit is not supported DISTRO_FEATURE than there is no need to
package related initialization scripts.

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
---
 meta/classes/update-rc.d.bbclass |    9 +++++++++
 1 file changed, 9 insertions(+)
Chris Larson - July 19, 2013, 3:02 p.m.
On Fri, Jul 19, 2013 at 4:53 AM, Shakeel, Muhammad <
muhammad_shakeel@mentor.com> wrote:

> From: Muhammad Shakeel <muhammad_shakeel@mentor.com>
>
> If sysvinit is not supported DISTRO_FEATURE than there is no need to
> package related initialization scripts.
>
> Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
>

If we stop shipping init.d for non-sysvinit distros, which makes sense, we
should also consider automatically enabling/disabling sysv compat support
in the systems build based on that distro feature also. So, I support this
commit, but am proposing adding another for consistency :)
Paul Eggleton - July 19, 2013, 3:13 p.m.
On Friday 19 July 2013 08:02:32 Chris Larson wrote:
> On Fri, Jul 19, 2013 at 4:53 AM, Shakeel, Muhammad 
> <muhammad_shakeel@mentor.com> wrote:
> > From: Muhammad Shakeel <muhammad_shakeel@mentor.com>
> > 
> > If sysvinit is not supported DISTRO_FEATURE than there is no need to
> > package related initialization scripts.
> > 
> > Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
> 
> If we stop shipping init.d for non-sysvinit distros, which makes sense, we
> should also consider automatically enabling/disabling sysv compat support
> in the systems build based on that distro feature also. So, I support this
> commit, but am proposing adding another for consistency :)

Yes, actually at the moment I think we cannot delete the sysvinit initscripts 
unless the recipe also inherits systemd, otherwise there will be no fallback 
to sysvinit compatibility and the daemon will no longer be started.

Cheers,
Paul

Patch

diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 5588569..946c077 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -99,3 +99,12 @@  python populate_packages_updatercd () {
         for pkg in pkgs.split():
             update_rcd_package(pkg)
 }
+
+python rm_sysvinit_initddir (){
+    import shutil
+    if "sysvinit" not in d.getVar("DISTRO_FEATURES", True).split():
+        sysv_initddir = oe.path.join(d.getVar("D", True), d.getVar('INIT_D_DIR', True))
+        if os.path.exists(sysv_initddir):
+            shutil.rmtree(sysv_initddir)
+}
+do_install[postfuncs] += "rm_sysvinit_initddir "