[oe] [PATCH] busybox/syslogs: use update-alternatives for syslog selection

Martin Jansa martin.jansa at gmail.com
Fri May 7 14:58:50 UTC 2010


On Fri, May 07, 2010 at 04:20:36PM +0200, Steffen Sledz wrote:
> * u-a for init scripts of busybox-syslog, sysklogd, and rsyslog
> * syslog-ng needs to be integrated too!
> 
> Signed-off-by: Steffen Sledz <sledz at dresearch.de>
> ---
>  recipes/busybox/busybox.inc        |   18 ++++++++++++++++--
>  recipes/rsyslog/rsyslog.inc        |   22 +++++++++++++---------
>  recipes/sysklogd/sysklogd.inc      |   19 +++++++++++++++----
>  recipes/sysklogd/sysklogd_1.4.1.bb |    2 +-
>  recipes/sysklogd/sysklogd_1.5.bb   |    2 +-
>  5 files changed, 46 insertions(+), 17 deletions(-)
> 
> diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
> index 17d8d14..31651d6 100644
> --- a/recipes/busybox/busybox.inc
> +++ b/recipes/busybox/busybox.inc
> @@ -11,7 +11,7 @@ LICENSE = "GPLv2"
>  SECTION = "base"
>  PRIORITY = "required"
>  
> -INC_PR = "r27"
> +INC_PR = "r28"
>  
>  SRC_URI = "\
>    file://busybox-cron \
> @@ -46,7 +46,7 @@ RDEPENDS_${PN} += "${PN}-mountall"
>  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}-syslog = "${sysconfdir}/init.d/syslog.${PN} ${sysconfdir}/syslog.conf"
>  FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
>  
>  FILES_${PN} += "${datadir}/udhcpc"
> @@ -154,6 +154,20 @@ pkg_prerm_${PN}-mountall () {
>  	update-alternatives --remove default_mountall mountall.${PN}
>  }
>  
> +pkg_preinst_${PN}-syslog () {
> +    # this is needed to avoid sysmlink errors,
> +    # because update-rc.d runs before pkg_postinst :(
> +    touch {sysconfdir}/init.d/syslog
> +}
> +
> +pkg_postinst_${PN}-syslog () {
> +    update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 50
> +}
> +
> +pkg_prerm_${PN}-syslog () {
> +    update-alternatives --remove syslog-init syslog.${PN}
> +}
> +
>  pkg_prerm_${PN} () {
>  	# This is so you can make busybox commit suicide - removing busybox with no other packages
>  	# providing its files, this will make update-alternatives work, but the update-rc.d part

One more issue with this part, partialy explaining what went wrong in
that log. You're not creating syslog.busybox, so real /etc/init.d/syslog
is not packaged and after u-a /etc/init.d/syslog points to non-existing
/etc/init.d/syslog.busybox and that's why update-rc.d says it doesn't
exist.

Regards,




More information about the Openembedded-devel mailing list