mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: Christian Melki <christian.melki@t2data.com>
Cc: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] sysklogd: Add new package.
Date: Fri, 15 Oct 2021 15:33:24 +0200	[thread overview]
Message-ID: <20211015133324.GF2239952@pengutronix.de> (raw)
In-Reply-To: <20211011144954.825006-1-christian.melki@t2data.com>

On Mon, Oct 11, 2021 at 04:49:54PM +0200, Christian Melki wrote:
> Add a forked version of the old sysklogd.
> This version has seen some major cleanup, with RFC3164 and RFC5424 support.
> Notable is the addition of remote syslog messages and syslogp() support.
> 
> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> ---
>  rules/sysklogd-bbinit.in |  8 ++++
>  rules/sysklogd.in        | 44 ++++++++++++++++++++
>  rules/sysklogd.make      | 89 ++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 141 insertions(+)
>  create mode 100644 rules/sysklogd-bbinit.in
>  create mode 100644 rules/sysklogd.in
>  create mode 100644 rules/sysklogd.make
> 
> diff --git a/rules/sysklogd-bbinit.in b/rules/sysklogd-bbinit.in
> new file mode 100644
> index 000000000..ea8f80832
> --- /dev/null
> +++ b/rules/sysklogd-bbinit.in
> @@ -0,0 +1,8 @@
> +## SECTION=initmethod_bbinit
> +
> +config SYSKLOGD_BBINIT_LINK
> +	string
> +	depends on SYSKLOGD_STARTSCRIPT
> +	prompt "syslogd"
> +	default "S10syslogd"
> +
> diff --git a/rules/sysklogd.in b/rules/sysklogd.in
> new file mode 100644
> index 000000000..1189ace95
> --- /dev/null
> +++ b/rules/sysklogd.in
> @@ -0,0 +1,44 @@
> +## SECTION=networking
> +
> +menuconfig SYSKLOGD
> +	tristate
> +	prompt "sysklogd                      "

	depends on !BUSYBOX_SYSLOGD || ALLYES
	depends on !BUSYBOX_LOGGER || ALLYES

> +	select SYSTEMD		if SYSKLOGD_SYSTEMD
> +	help
> +	  The venerable BSD syslogd and klogd rolled into one syslogd.
> +	  This is a maintained and updated variant of the same.
> +

comment "BusyBox' syslogd is selected!"
»·······depends on BUSYBOX_SYSLOGD

comment "BusyBox' logger is selected!"
»·······depends on BUSYBOX_LOGGER

Otherwise the two packages will try to install the same files and creating
the rootfs will fail.

> +if SYSKLOGD
> +
> +comment "runtime options   ---"
> +
> +config SYSKLOGD_CONFIG
> +	bool
> +	default y
> +	prompt "Install configuration file"
> +	help
> +	  Installs (if present) the "./projectroot/etc/syslogd.conf"
> +	  file from your workspace, otherwise a generic one from the
> +	  ptxdist installation
> +	  ("<PTXDIST>/projectroot/etc/syslogd.conf").

I don't like optional config files like this. Maybe just install the
example config as fallback?

> +
> +config SYSKLOGD_SYSTEMD
> +	bool
> +	default y
> +	prompt "Enable systemd support"
> +	depends on INITMETHOD_SYSTEMD
> +	help
> +	  Installs the systemd service file and enables support for the
> +	  systemd-journal
> +
> +config SYSKLOGD_STARTSCRIPT
> +	bool
> +	default y
> +	depends on INITMETHOD_BBINIT
> +	help
> +	  Installs (if present) the
> +	  "./projectroot/etc/init.d/syslogd" startscript from your
> +	  workspace, otherwise a generic one from the ptxdist
> +	  installation ("<PTXDIST>/projectroot/etc/init.d/syslogd").
> +
> +endif
> diff --git a/rules/sysklogd.make b/rules/sysklogd.make
> new file mode 100644
> index 000000000..217b1642a
> --- /dev/null
> +++ b/rules/sysklogd.make
> @@ -0,0 +1,89 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_SYSKLOGD) += sysklogd
> +
> +#
> +# Paths and names
> +#
> +SYSKLOGD_VERSION	:= 2.2.3
> +SYSKLOGD_MD5		:= 2c6749c49f52b8c5dad18e9a9315e7dd
> +SYSKLOGD		:= sysklogd-$(SYSKLOGD_VERSION)
> +SYSKLOGD_SUFFIX		:= tar.gz
> +SYSKLOGD_URL		:= https://github.com/troglobit/sysklogd/releases/download/v$(SYSKLOGD_VERSION)/$(SYSKLOGD).$(SYSKLOGD_SUFFIX)
> +SYSKLOGD_SOURCE		:= $(SRCDIR)/$(SYSKLOGD).$(SYSKLOGD_SUFFIX)
> +SYSKLOGD_DIR		:= $(BUILDDIR)/$(SYSKLOGD)
> +SYSKLOGD_LICENSE	:= BSD-3-Clause
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +#
> +# autoconf
> +#
> +SYSKLOGD_AUTOCONF = \
> +	$(CROSS_AUTOCONF_USR)

Use the modern syntax:

SYSKLOGD_CONF_TOOL	:= autoconf
SYSKLOGD_CONF_OPT	:= \
	...

> +
> +# ----------------------------------------------------------------------------
> +# Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/sysklogd.install:
> +	@$(call targetinfo)
> +	@$(call world/install, SYSKLOGD)

	@install -vD -m 644 $(SYSKLOGD_DIR)/syslog.conf \
		$(SYSKLOGD_PKGDIR)/etc/syslog.conf

This will be used as fallback by install_alternative.

> +	@$(call touch)
> +
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/sysklogd.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, sysklogd)
> +	@$(call install_fixup, sysklogd,PRIORITY,optional)
> +	@$(call install_fixup, sysklogd,SECTION,base)
> +	@$(call install_fixup, sysklogd,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
> +	@$(call install_fixup, sysklogd,DESCRIPTION,missing)

empty line

> +	@$(call install_copy, sysklogd, 0, 0, 0755, -, /usr/bin/logger)
> +	@$(call install_copy, sysklogd, 0, 0, 0755, -, /usr/sbin/syslogd)
> +	@$(call install_lib, sysklogd, 0, 0, 0644, libsyslog)

empty line

> +ifdef PTXCONF_SYSKLOGD_CONFIG
> +	@$(call install_alternative, sysklogd, 0, 0, 0644, /etc/syslog.conf, n)
> +endif
> +
> +ifdef PTXCONF_SYSKLOGD_STARTSCRIPT
> +	@$(call install_alternative, sysklogd, 0, 0, 0755, /etc/init.d/syslogd, n)
> +
> +ifneq ($(call remove_quotes,$(PTXCONF_SYSKLOGD_BBINIT_LINK)),)
> +	@$(call install_link, sysklogd, \
> +		../init.d/syslogd, \
> +		/etc/rc.d/$(PTXCONF_SYSKLOGD_BBINIT_LINK))
> +endif
> +endif
> +
> +ifdef PTXCONF_INITMETHOD_SYSTEMD

Not necessary.PTXCONF_SYSKLOGD_SYSTEMD cannot be enabled when
PTXCONF_INITMETHOD_SYSTEMD is disabled.

Micahel

> +ifdef PTXCONF_SYSKLOGD_SYSTEMD
> +	@$(call install_alternative, sysklogd, 0, 0, 0644, \
> +		/usr/lib/systemd/system/sysklogd.service)
> +	@$(call install_link, sysklogd, ../syslogd.service, \
> +		/usr/lib/systemd/system/multi-user.target.wants/syslogd.service)
> +	@$(call install_link, sysklogd, syslogd.service, \
> +		/usr/lib/systemd/system/syslog.service)
> +endif
> +endif
> +	@$(call install_finish, sysklogd)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


      reply	other threads:[~2021-10-15 13:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 14:49 Christian Melki
2021-10-15 13:33 ` Michael Olbrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211015133324.GF2239952@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=christian.melki@t2data.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox