[OE-core] [PATCH 1/2] busybox: fix syslog related meta data
Chen Qi
Qi.Chen at windriver.com
Tue Sep 5 09:55:26 UTC 2017
Set RCONFLICTS to disallow multiple syslog daemon providers to be installed
on the target at the same time, and remove codes which dealt with such
situation.
Supporting multiple syslog daemons on the same image doesn't have much sense.
rsyslog and syslog-ng in meta-oe have set RCONFLICTS to disallow this. And
we do the same for busybox.
Also, remove the line of creating a meaningless symlink of
/lib/systemd/syslog.service to /dev/null.
Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
---
meta/recipes-core/busybox/busybox.inc | 27 +++++++--------------------
1 file changed, 7 insertions(+), 20 deletions(-)
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 735b1f6..48910ca 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -41,7 +41,9 @@ INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
SYSTEMD_PACKAGES = "${PN}-syslog"
SYSTEMD_SERVICE_${PN}-syslog = "${@bb.utils.contains('SRC_URI', 'file://syslog.cfg', 'busybox-syslog.service', '', d)}"
-CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf.${BPN}"
+CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf"
+RCONFLICTS_${PN}-syslog = "rsyslog sysklogd syslog-ng"
+
CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
@@ -248,9 +250,9 @@ do_install () {
fi
if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
- install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${BPN}
- install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf.${BPN}
- install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf.${BPN}
+ install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog
+ install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf
+ install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
fi
if grep "CONFIG_CROND=y" ${B}/.config; then
install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
@@ -311,7 +313,6 @@ do_install () {
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
@@ -322,7 +323,7 @@ do_install () {
# Remove the sysvinit specific configuration file for systemd systems to avoid confusion
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then
- rm -f ${D}${sysconfdir}/syslog-startup.conf.${BPN}
+ rm -f ${D}${sysconfdir}/syslog-startup.conf
fi
}
@@ -336,20 +337,6 @@ inherit update-alternatives
ALTERNATIVE_PRIORITY = "50"
-ALTERNATIVE_${PN}-syslog += "${@bb.utils.contains('SRC_URI', 'file://syslog.cfg', 'syslog-conf', '', d)}"
-ALTERNATIVE_LINK_NAME[syslog-conf] = "${@bb.utils.contains('SRC_URI', 'file://syslog.cfg', "${sysconfdir}/syslog.conf", '', d)}"
-
-python () {
- if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
- pn = d.getVar('PN')
- d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-init')
- d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir')))
- d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir'), d.getVar('BPN')))
- d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-startup-conf')
- d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-startup-conf', '%s/syslog-startup.conf' % (d.getVar('sysconfdir')))
- d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-startup-conf', '%s/syslog-startup.conf.%s' % (d.getVar('sysconfdir'), d.getVar('BPN')))
-}
-
python do_package_prepend () {
# We need to load the full set of busybox provides from the /etc/busybox.links
# Use this to see the update-alternatives with the right information
--
1.9.1
More information about the Openembedded-core
mailing list