summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/recipes-extended/sysklogd
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-extended/sysklogd')
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch132
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch20
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd151
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf71
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc66
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb4
7 files changed, 461 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
new file mode 100644
index 000000000..9567946c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
@@ -0,0 +1,132 @@
+From f0af5bcfd753691652eac35efbcb208c933253f1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 05:11:53 +0000
+Subject: [PATCH] Fix build with musl
+
+Explicitly include fcntl.h since with glibc is comes in as indirect
+include but not with musl
+
+linux/time.h inclusion is not required on musl so using !__GLIBC__ is
+not right for musl here
+
+wait type is glibc specific
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ klogd.c | 10 +---------
+ ksym_mod.c | 5 +----
+ pidfile.c | 1 +
+ syslog.c | 3 ++-
+ syslogd.c | 4 +---
+ 5 files changed, 6 insertions(+), 17 deletions(-)
+
+diff --git a/klogd.c b/klogd.c
+index 6cc80ed..9219671 100644
+--- a/klogd.c
++++ b/klogd.c
+@@ -260,11 +260,8 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdlib.h>
+@@ -277,13 +274,8 @@
+
+ #define __LIBRARY__
+ #include <linux/unistd.h>
+-#if !defined(__GLIBC__)
+-# define __NR_ksyslog __NR_syslog
+-_syscall3(int,ksyslog,int, type, char *, buf, int, len);
+-#else
+ #include <sys/klog.h>
+ #define ksyslog klogctl
+-#endif
+
+ #define LOG_BUFFER_SIZE 4096
+ #define LOG_LINE_LENGTH 1000
+diff --git a/ksym_mod.c b/ksym_mod.c
+index 68cd6b6..6e26da1 100644
+--- a/ksym_mod.c
++++ b/ksym_mod.c
+@@ -113,12 +113,9 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+ #include "module.h"
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <linux/version.h>
+diff --git a/pidfile.c b/pidfile.c
+index e0959a0..6daa2e0 100644
+--- a/pidfile.c
++++ b/pidfile.c
+@@ -31,6 +31,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <signal.h>
++#include <fcntl.h>
+
+ /* read_pid
+ *
+diff --git a/syslog.c b/syslog.c
+index bdb3ff2..ef7b34e 100644
+--- a/syslog.c
++++ b/syslog.c
+@@ -55,7 +55,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90";
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/file.h>
+-#include <sys/signal.h>
++//#include <sys/signal.h>
+ #include <sys/syslog.h>
+ #if 0
+ #include "syslog.h"
+@@ -72,6 +72,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90";
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdio.h>
++#include <fcntl.h>
+
+ #define _PATH_LOGNAME "/dev/log"
+
+diff --git a/syslogd.c b/syslogd.c
+index ea73ea5..1ca0595 100644
+--- a/syslogd.c
++++ b/syslogd.c
+@@ -818,9 +818,7 @@ void doexit(int sig);
+ void init();
+ void cfline(char *line, register struct filed *f);
+ int decode(char *name, struct code *codetab);
+-#if defined(__GLIBC__)
+ #define dprintf mydprintf
+-#endif /* __GLIBC__ */
+ static void dprintf(char *, ...);
+ static void allocate_log(void);
+ void sighup_handler();
+@@ -2094,7 +2092,7 @@ void reapchild()
+ (void) signal(SIGCHLD, reapchild); /* reset signal handler -ASP */
+ wait ((int *)0);
+ #else
+- union wait status;
++ int status;
+
+ while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0)
+ ;
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch
new file mode 100644
index 000000000..00fba7101
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: sysklogd-1.5/Makefile
+===================================================================
+--- sysklogd-1.5.orig/Makefile 2009-06-09 13:02:41.000000000 +0200
++++ sysklogd-1.5/Makefile 2009-06-09 13:03:06.000000000 +0200
+@@ -127,8 +127,8 @@
+ rm -f syslogd klogd ksym syslog_tst oops_test TAGS tsyslogd tklogd
+
+ install_exec: syslogd klogd
+- ${INSTALL} -m 500 -s syslogd ${BINDIR}/syslogd
+- ${INSTALL} -m 500 -s klogd ${BINDIR}/klogd
++ ${INSTALL} -m 500 syslogd ${BINDIR}/syslogd
++ ${INSTALL} -m 500 klogd ${BINDIR}/klogd
+
+ install_man:
+ ${INSTALL} -m ${MAN_PERMS} sysklogd.8 ${MANDIR}/man8/sysklogd.8
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch
new file mode 100644
index 000000000..c1cc042c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate
+
+The compiler should not be generating vectorized instructions on this target.
+This is a work around until I can determine why this is occuring on this
+particular recipe
+
+Index: sysklogd-1.5/Makefile
+===================================================================
+--- sysklogd-1.5.orig/Makefile
++++ sysklogd-1.5/Makefile
+@@ -20,7 +20,8 @@
+ CC= gcc
+ #SKFLAGS= -g -DSYSV -Wall
+ #LDFLAGS= -g
+-SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
++SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce \
++ -fno-tree-vectorize
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+ # $(shell getconf LFS_SKFLAGS)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd
new file mode 100755
index 000000000..258f88280
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd
@@ -0,0 +1,151 @@
+#! /bin/sh
+# /etc/init.d/sysklogd: start the system log daemon.
+
+### BEGIN INIT INFO
+# Provides: sysklogd
+# Required-Start: $remote_fs $time
+# Required-Stop: $remote_fs $time
+# Should-Start: $network
+# Should-Stop: $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: System logger
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+pidfile_syslogd=/var/run/syslogd.pid
+pidfile_klogd=/var/run/klogd.pid
+binpath_syslogd=/sbin/syslogd
+binpath_klogd=/sbin/klogd
+
+test -x $binpath || exit 0
+
+test ! -r /etc/default/syslogd || . /etc/default/syslogd
+
+create_xconsole()
+{
+ # Only proceed if /dev/xconsole is used at all
+ if ! grep -q '^[^#].*/dev/xconsole' /etc/syslog.conf
+ then
+ return
+ fi
+
+ if [ ! -e /dev/xconsole ]; then
+ mknod -m 640 /dev/xconsole p
+ else
+ chmod 0640 /dev/xconsole
+ fi
+ chown root:adm /dev/xconsole
+ test ! -x /sbin/restorecon || /sbin/restorecon /dev/xconsole
+}
+
+log_begin_msg () {
+ echo -n $1
+}
+
+log_end_msg () {
+ echo $1
+}
+
+log_success_msg () {
+ echo $1
+}
+
+running()
+{
+ # No pidfile, probably no daemon present
+ #
+ if [ ! -f $pidfile ]
+ then
+ return 1
+ fi
+
+ pid=`cat $pidfile_syslogd`
+
+ # No pid, probably no daemon present
+ #
+ if [ -z "$pid" ]
+ then
+ return 1
+ fi
+
+ if [ ! -d /proc/$pid ]
+ then
+ return 1
+ fi
+
+ cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1`
+
+ # No syslogd?
+ #
+ if [ "$cmd" != "$binpath" ]
+ then
+ return 1
+ fi
+
+ return 0
+}
+
+case "$1" in
+ start)
+ log_begin_msg "Starting system log daemon..."
+ create_xconsole
+ start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD
+ log_end_msg $?
+ log_begin_msg "Starting kernel log daemon..."
+ start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+ log_end_msg $?
+ ;;
+ stop)
+ log_begin_msg "Stopping system log daemon..."
+ start-stop-daemon --stop --quiet --pidfile $pidfile_syslogd --name syslogd
+ log_end_msg $?
+ log_begin_msg "Stopping kernel log daemon..."
+ start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+ log_end_msg $?
+ ;;
+ reload|force-reload)
+ log_begin_msg "Reloading system log daemon..."
+ start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile_syslogd --name syslogd
+ log_end_msg $?
+ log_begin_msg "Reloading kernel log daemon..."
+ start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+ start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+ log_end_msg $?
+ ;;
+ restart)
+ log_begin_msg "Restarting system log daemon..."
+ start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile_syslogd --name syslogd
+ start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD
+ log_end_msg $?
+ log_begin_msg "Reloading kernel log daemon..."
+ start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+ start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+ log_end_msg $?
+ ;;
+ reload-or-restart)
+ if running
+ then
+ $0 reload
+ else
+ $0 start
+ fi
+ ;;
+ status)
+ status syslogd
+ RETVAL=$?
+ status klogd
+ rval=$?
+ [ $RETVAL -eq 0 ] && exit $rval
+ exit $RETVAL
+ ;;
+ *)
+ log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart|status}"
+ exit 1
+esac
+
+exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf
new file mode 100644
index 000000000..0849de126
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf
@@ -0,0 +1,71 @@
+# /etc/syslog.conf Configuration file for syslogd.
+#
+# Ported from debian by Yu Ke <ke.yu@intel.com>
+#
+
+#
+# First some standard logfiles. Log by facility.
+#
+
+auth,authpriv.* /var/log/auth.log
+*.*;auth,authpriv.none -/var/log/syslog
+#cron.* /var/log/cron.log
+daemon.* -/var/log/daemon.log
+kern.* -/var/log/kern.log
+lpr.* -/var/log/lpr.log
+mail.* -/var/log/mail.log
+user.* -/var/log/user.log
+
+#
+# Logging for the mail system. Split it up so that
+# it is easy to write scripts to parse these files.
+#
+mail.info -/var/log/mail.info
+mail.warn -/var/log/mail.warn
+mail.err /var/log/mail.err
+
+# Logging for INN news system
+#
+news.crit /var/log/news.crit
+news.err /var/log/news.err
+news.notice -/var/log/news.notice
+
+#
+# Some `catch-all' logfiles.
+#
+*.=debug;\
+auth,authpriv.none;\
+news.none;mail.none -/var/log/debug
+
+*.=info;*.=notice;*.=warn;\
+auth,authpriv.none;\
+cron,daemon.none;\
+mail,news.none -/var/log/messages
+
+#
+# Emergencies are sent to everybody logged in.
+#
+*.emerg *
+
+#
+# I like to have messages displayed on the console, but only on a virtual
+# console I usually leave idle.
+#
+#daemon,mail.*;\
+#news.=crit;news.=err;news.=notice;\
+#*.=debug;*.=info;\
+#*.=notice;*.=warn /dev/tty8
+
+# The named pipe /dev/xconsole is for the `xconsole' utility. To use it,
+# you must invoke `xconsole' with the `-file' option:
+#
+# $ xconsole -file /dev/xconsole [...]
+#
+# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
+# busy site..
+#
+daemon.*;mail.*;\
+news.err;\
+*.=debug;*.=info;\
+*.=notice;*.=warn |/dev/xconsole
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc
new file mode 100644
index 000000000..1e363db6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -0,0 +1,66 @@
+SUMMARY = "System Log Daemons"
+DESCRIPTION = "The sysklogd package implements two system log daemons: syslogd, klogd"
+HOMEPAGE = "http://www.infodrom.org/projects/sysklogd/"
+SECTION = "base"
+
+LICENSE = "GPLv2+ & BSD"
+LICENSE_syslogd = "BSD"
+LICENSE_klogd = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+ file://syslogd.c;beginline=2;endline=15;md5=77ffb2fec48c46d7ca0abb2d5813e7fd \
+ file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \
+ "
+
+inherit update-rc.d update-alternatives
+
+SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \
+ file://no-strip-install.patch \
+ file://0001-Fix-build-with-musl.patch \
+ file://sysklogd \
+ file://syslog.conf \
+ "
+
+SRC_URI_append_e500v2 = " file://no-vectorization.patch"
+
+INITSCRIPT_NAME = "syslog"
+CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+CFLAGS_append = " -DSYSV"
+
+do_install () {
+ install -d ${D}${mandir}/man8 \
+ ${D}${mandir}/man5 \
+ ${D}${base_sbindir}
+ oe_runmake 'BINDIR=${D}${base_sbindir}' \
+ 'MANDIR=${D}${mandir}' install
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
+ install -d ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
+}
+
+# sysklogd package has no internal systemd support, so we weigh busybox's
+# sysklogd utility over it in case of systemd
+ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}"
+
+ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
+
+ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
+ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd"
+ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog"
+ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
+
+pkg_prerm_${PN} () {
+ if test "x$D" = "x"; then
+ if test "$1" = "upgrade" -o "$1" = "remove"; then
+ /etc/init.d/syslog stop
+ fi
+ fi
+}
+
+python () {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb
new file mode 100644
index 000000000..975ecc2b6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb
@@ -0,0 +1,4 @@
+require sysklogd.inc
+
+SRC_URI[md5sum] = "c70599ab0d037fde724f7210c2c8d7f8"
+SRC_URI[sha256sum] = "5166c185ae23c92e8b9feee66a6e3d0bc944bf673112f53e3ecf62e08ce7c201"
OpenPOWER on IntegriCloud