busybox: Split syslog initscript into busybox-syslog
authorMichael Smith <msmith@cbnco.com>
Sun, 7 Jun 2009 20:43:25 +0000 (16:43 -0400)
committerPhil Blundell <philb@gnu.org>
Mon, 8 Jun 2009 09:39:28 +0000 (10:39 +0100)
The same is already done for httpd and udhcpd.

This fixes Busybox deb upgrades: the prerm script was failing because
the last command "/etc/init.d/syslog stop", added by the update-rc.d
class, runs after the /bin/sh symlink has been removed.

Many images expect busybox to contain the syslog initscript, so busybox
RRECOMMENDS busybox-syslog.

busybox-{syslog,httpd,udhcpd} now RDEPEND on busybox, for consistency
with other packages in the recipe (e.g. busybox-mdev).

Signed-off-by: Michael Smith <msmith@cbnco.com>
recipes/busybox/busybox.inc

index e056ad1..7b9b929 100644 (file)
@@ -33,26 +33,37 @@ SRC_URI_append_nylon = " file://xargs-double-size.patch;patch=1"
 
 export EXTRA_CFLAGS = "${CFLAGS}"
 EXTRA_OEMAKE_append = " CROSS=${HOST_PREFIX}"
-PACKAGES =+ "${PN}-mountall ${PN}-httpd ${PN}-udhcpd"
+PACKAGES =+ "${PN}-mountall ${PN}-httpd ${PN}-syslog ${PN}-udhcpd"
+
 # We need this RRECOMMENDS because libc dlopens libgcc
 # and shlib mechanism can not detect it because its not
 # listed in the NEEDED field.
 RRECOMMENDS += "libgcc"
+
 FILES_${PN}-mountall = "${sysconfdir}/default/mountall"
 RDEPENDS_${PN} += "${PN}-mountall"
+
+# Make busybox recommend busybox-syslog for those images that expect it
+RRECOMMENDS_${PN} += "libgcc ${PN}-syslog"
+
 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog ${sysconfdir}/syslog.conf"
 FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
 
 FILES_${PN} += "${datadir}/udhcpc"
 
-INITSCRIPT_PACKAGES = "${PN} ${PN}-httpd ${PN}-udhcpd"
+INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd"
 INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
+INITSCRIPT_NAME_${PN}-syslog = "syslog"
 INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" 
-INITSCRIPT_NAME_${PN} = "syslog"
-CONFFILES_${PN} = "${sysconfdir}/syslog.conf"
+CONFFILES_${PN}-syslog = "${sysconfdir}/syslog.conf"
 
 # This disables the syslog startup links in slugos (see slugos-init)
-INITSCRIPT_PARAMS_${PN}_slugos = "start 20 ."
+INITSCRIPT_PARAMS_${PN}-syslog_slugos = "start 20 ."
+
+RDEPENDS_${PN}-httpd += "${PN}"
+RDEPENDS_${PN}-syslog += "${PN}"
+RDEPENDS_${PN}-udhcpd += "${PN}"
 
 # Use gcc for linking so LDFLAGS actually makes sense
 LD = "${CC} -nostdlib"
@@ -89,8 +100,10 @@ do_install () {
        install -m 0755 ${S}/busybox ${D}${base_bindir}
        ln -sf busybox ${D}${base_bindir}/sh
 
-       install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/
-       install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/
+       if grep -q "CONFIG_SYSLOGD=y" ${WORKDIR}/defconfig; then
+               install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/
+               install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/
+       fi
        if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then
                install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
        fi