Patchwork [2/2] busybox: Add syslog-init alternative only if SysV in enabled

login
register
mail settings
Submitter Shakeel, Muhammad
Date July 29, 2013, 8:09 a.m.
Message ID <1375085392-12339-2-git-send-email-muhammad_shakeel@mentor.com>
Download mbox | patch
Permalink /patch/54673/
State Accepted
Commit 29c3ecee32d9bfb03099a4f10456fd0270e107fb
Headers show

Comments

Shakeel, Muhammad - July 29, 2013, 8:09 a.m.
From: Muhammad Shakeel <muhammad_shakeel@mentor.com>

If systemd is enabled then syslog is handled through a service file
and related files in /etc/init.d are removed. This removes following
warning:

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

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
---
 meta/recipes-core/busybox/busybox.inc |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Patch

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index acd2bfb..2f26953 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -280,10 +280,15 @@  inherit update-alternatives
 
 ALTERNATIVE_PRIORITY = "50"
 
-ALTERNATIVE_${PN}-syslog = "syslog-init syslog-startup-conf"
+ALTERNATIVE_${PN}-syslog = "syslog-startup-conf"
 
-ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog"
-ALTERNATIVE_TARGET[syslog-init] = "${sysconfdir}/init.d/syslog.${BPN}"
+python () {
+    if 'sysvinit' in d.getVar("DISTRO_FEATURES", True).split():
+        pn = d.getVar('PN', True)
+        d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-init')
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir', True)))
+        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
+}
 
 ALTERNATIVE_LINK_NAME[syslog-startup-conf] = "${sysconfdir}/syslog-startup.conf"
 ALTERNATIVE_TARGET[syslog-startup-conf] = "${sysconfdir}/syslog-startup.conf.${BPN}"