On 07/23/2013 06:03 PM, Shakeel, Muhammad wrote:
From: Muhammad Shakeel <[email protected]>

If systemd is supported DISTRO_FEATURE and sysvinit is not and also if
systemd_unitdir contains a service file(s) then no need to keep init.d scripts
for sysvinit compatibility.

Signed-off-by: Muhammad Shakeel <[email protected]>
---
  meta/classes/systemd.bbclass |   19 +++++++++++++++++++
  1 file changed, 19 insertions(+)

diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index 9763faa..55f378e 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -170,3 +170,22 @@ python rm_systemd_unitdir (){
              shutil.rmtree(systemd_unitdir)
  }
  do_install[postfuncs] += "rm_systemd_unitdir "
+
+python rm_sysvinit_initddir (){
+    import shutil
+    if ("systemd" in d.getVar("DISTRO_FEATURES", True).split() and
+        "sysvinit" not in d.getVar("DISTRO_FEATURES", True).split()):
+        service_file_exists = False
+        systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', 
True), "system")
+        if os.path.exists(systemd_unitdir):
+            for filename in os.listdir(systemd_unitdir):
+                if filename.endswith(".service"):
+                    service_file_exists = True
+                    break
+
+        if service_file_exists:
+            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 "
Hi,

I just tried this patch out.
It resulted in the following warning.

WARNING: busybox: NOT adding alternative provide /etc/init.d/syslog: /etc/init.d/syslog.busybox does not exist

I know this warning is harmless. But it's still somewhat misleading. So are we going to do something about it?

//Chen Qi

//Chen Qi
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to