]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
busybox: handle syslog related files properly ChenQi/busybox-syslog
authorChen Qi <Qi.Chen@windriver.com>
Thu, 12 Jun 2014 08:10:58 +0000 (04:10 -0400)
committerChen Qi <Qi.Chen@windriver.com>
Fri, 13 Jun 2014 05:40:55 +0000 (13:40 +0800)
If CONFIG_SYSLOGD is not enabled, then the related service file should
not be installed as it will always fail at system start-up. The error
message is as following.

[FAILED] Failed to start System Logging Service.

The same logic applies to CONFIG_KLOGD.

So we should first check the configuration before we install these
service files.

[YOCTO #5302]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
meta/recipes-core/busybox/busybox.inc

index f6cb039543b516d6e752398e485e50ad6d50ac0b..bd66e4f14892ea98d5a22ca8bc94dada36d901d1 100644 (file)
@@ -272,18 +272,21 @@ do_install () {
        fi
 
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
-        install -d ${D}${systemd_unitdir}/system
-        sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \
-            > ${D}${systemd_unitdir}/system/busybox-syslog.service
-        sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \
-            > ${D}${systemd_unitdir}/system/busybox-klogd.service
-
-        if [ -f ${WORKDIR}/busybox-syslog.default ] ; then
-            install -d ${D}${sysconfdir}/default
-            install -m 0644 ${WORKDIR}/busybox-syslog.default ${D}${sysconfdir}/default/busybox-syslog
+        if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
+            install -d ${D}${systemd_unitdir}/system
+            sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \
+               > ${D}${systemd_unitdir}/system/busybox-syslog.service
+            if [ -f ${WORKDIR}/busybox-syslog.default ] ; then
+               install -d ${D}${sysconfdir}/default
+               install -m 0644 ${WORKDIR}/busybox-syslog.default ${D}${sysconfdir}/default/busybox-syslog
+            fi
+            ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.service
+        fi
+        if grep -q "CONFIG_KLOGD=y" ${B}/.config; then
+            install -d ${D}${systemd_unitdir}/system
+            sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \
+               > ${D}${systemd_unitdir}/system/busybox-klogd.service
         fi
-
-        ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.service
     fi
 
     # Remove the sysvinit specific configuration file for systemd systems to avoid confusion