Patchwork busybox: enable shared memory logging for systemd

login
register
mail settings
Submitter Paul Eggleton
Date Aug. 23, 2013, 11:20 a.m.
Message ID <1377256830-10748-1-git-send-email-paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/56321/
State Accepted
Commit b18b210c1e68bd312785b4d956e628220b5a8c9a
Headers show

Comments

Paul Eggleton - Aug. 23, 2013, 11:20 a.m.
The default command-line options for launching busybox's syslogd are
"-C" if using sysvinit; but because we use /etc/default/busybox-syslog
when using systemd which the sysvinit initscript doesn't use, and no
/etc/default/busybox-syslog is installed by default in OE-Core, the
default arguments with systemd were no arguments at all with OE-Core
alone. Effectively merge in the bbappend from meta-oe that adds a
default file in order to set the default options to "-C" for systemd as
well.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/recipes-core/busybox/busybox.inc                  | 7 ++++++-
 meta/recipes-core/busybox/busybox_1.21.1.bb            | 1 +
 meta/recipes-core/busybox/files/busybox-syslog.default | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/busybox/files/busybox-syslog.default
Phil Blundell - Aug. 23, 2013, 11:28 a.m.
On Fri, 2013-08-23 at 12:20 +0100, Paul Eggleton wrote:
> +        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
> +

Does this mean that sysvinit users will now get a decoy version of
busybox-syslog.default which isn't actually used by anything?

p.
Paul Eggleton - Aug. 23, 2013, 11:38 a.m.
Hi Phil,

On Friday 23 August 2013 12:28:16 Phil Blundell wrote:
> On Fri, 2013-08-23 at 12:20 +0100, Paul Eggleton wrote:
> > +        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
> > +
> 
> Does this mean that sysvinit users will now get a decoy version of
> busybox-syslog.default which isn't actually used by anything?

These lines are being added into a block which is conditional upon systemd 
being in DISTRO_FEATURES, so no; however FYI the meta-oe bbappend was 
installing the file unconditionally.

Cheers,
Paul

Patch

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 454d7e3..b4cf20a 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -21,7 +21,7 @@  export EXTRA_LDFLAGS = "${LDFLAGS}"
 PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
 
 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
-FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${systemd_unitdir}/system/syslog.service"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog"
 FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf"
 FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
 FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
@@ -272,6 +272,11 @@  do_install () {
         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
+        fi
+
         ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.service
     fi
 
diff --git a/meta/recipes-core/busybox/busybox_1.21.1.bb b/meta/recipes-core/busybox/busybox_1.21.1.bb
index fdb1974..784c924 100644
--- a/meta/recipes-core/busybox/busybox_1.21.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.21.1.bb
@@ -17,6 +17,7 @@  SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://mount.busybox \
            file://syslog \
            file://syslog-startup.conf \
+           file://busybox-syslog.default \
            file://mdev \
            file://mdev.conf \
            file://umount.busybox \
diff --git a/meta/recipes-core/busybox/files/busybox-syslog.default b/meta/recipes-core/busybox/files/busybox-syslog.default
new file mode 100644
index 0000000..a3d51ca
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-syslog.default
@@ -0,0 +1 @@ 
+OPTIONS="-C"