aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/rsyslog
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-extended/rsyslog')
-rw-r--r--meta-oe/recipes-extended/rsyslog/libfastjson/0001-fix-jump-misses-init-gcc-8-warning.patch46
-rw-r--r--meta-oe/recipes-extended/rsyslog/libfastjson_1.2304.0.bb (renamed from meta-oe/recipes-extended/rsyslog/libfastjson_0.99.8.bb)5
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch34
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch37
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch88
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch164
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Fix-callback-prototype.patch49
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Include-missing-sys-time.h.patch41
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp/run-ptest10
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb87
-rw-r--r--meta-oe/recipes-extended/rsyslog/librelp_1.2.18.bb17
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch46
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-tcpflood.c-Pass-correct-parameter-type-to-send.patch35
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/disable-omfile-outchannel.patch23
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-fix-ptest-not-finish.patch118
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.service21
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog/run-ptest11
-rw-r--r--meta-oe/recipes-extended/rsyslog/rsyslog_8.2404.0.bb (renamed from meta-oe/recipes-extended/rsyslog/rsyslog_8.37.0.bb)109
18 files changed, 558 insertions, 383 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/libfastjson/0001-fix-jump-misses-init-gcc-8-warning.patch b/meta-oe/recipes-extended/rsyslog/libfastjson/0001-fix-jump-misses-init-gcc-8-warning.patch
deleted file mode 100644
index 25e5efa4b6..0000000000
--- a/meta-oe/recipes-extended/rsyslog/libfastjson/0001-fix-jump-misses-init-gcc-8-warning.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From d697182f18a421b7f80ea9de4914251b55d82532 Mon Sep 17 00:00:00 2001
-From: Rainer Gerhards <rgerhards@adiscon.com>
-Date: Sun, 15 Jul 2018 17:24:59 +0200
-Subject: [PATCH] "fix" "jump-misses-init" gcc-8 warning
-
-Actually, that warning is overly conservative, and so we
-have changed the code in a somewhat suboptimal way to "fix"
-it. In this spots, it's not that bad and we wanted to avoid
-totally disabling this warning.
-
-If it were more costly in terms of cleanness, we would probaly
-have done that. Just mention it to tell anyone else the
-cure is not really a good one, just selected due to the
-circumstances in this special case.
-
-Upstream-Status: Backport
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
----
- json_object.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/json_object.c b/json_object.c
-index 35338e1..6e67891 100644
---- a/json_object.c
-+++ b/json_object.c
-@@ -396,6 +396,7 @@ fjson_child_get_empty_etry(struct fjson_object *const __restrict__ jso)
- {
- struct _fjson_child *chld = NULL;
- struct _fjson_child_pg *pg;
-+ int pg_idx;
-
- if (jso->o.c_obj.ndeleted > 0) {
- /* we first fill deleted spots */
-@@ -415,7 +416,7 @@ fjson_child_get_empty_etry(struct fjson_object *const __restrict__ jso)
- goto done;
- }
-
-- const int pg_idx = jso->o.c_obj.nelem % FJSON_OBJECT_CHLD_PG_SIZE;
-+ pg_idx = jso->o.c_obj.nelem % FJSON_OBJECT_CHLD_PG_SIZE;
- if (jso->o.c_obj.nelem > 0 && pg_idx == 0) {
- if((pg = calloc(1, sizeof(struct _fjson_child_pg))) == NULL) {
- errno = ENOMEM;
---
-2.11.0
-
diff --git a/meta-oe/recipes-extended/rsyslog/libfastjson_0.99.8.bb b/meta-oe/recipes-extended/rsyslog/libfastjson_1.2304.0.bb
index b84dde3d37..f16126d936 100644
--- a/meta-oe/recipes-extended/rsyslog/libfastjson_0.99.8.bb
+++ b/meta-oe/recipes-extended/rsyslog/libfastjson_1.2304.0.bb
@@ -6,10 +6,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a958bb07122368f3e1d9b2efe07d231f"
DEPENDS = ""
-SRC_URI = "git://github.com/rsyslog/libfastjson.git;protocol=https \
- file://0001-fix-jump-misses-init-gcc-8-warning.patch"
+SRC_URI = "git://github.com/rsyslog/libfastjson.git;protocol=https;branch=master"
-SRCREV = "4758b1caf69ada911ef79e1d80793fe489b98dff"
+SRCREV = "3a8402c1de7c7747c95229db26d8d32fb85a7a52"
S = "${WORKDIR}/git"
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch
new file mode 100644
index 0000000000..10e2b564cc
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch
@@ -0,0 +1,34 @@
+From 6d575d98565ce3119a14359eecb11ccdff92a303 Mon Sep 17 00:00:00 2001
+From: Yash Shinde <53660251+Yashinde145@users.noreply.github.com>
+Date: Thu, 29 Jun 2023 18:10:15 +0530
+Subject: [PATCH] Fix function inline errors in debug optimization (-Og)
+
+Compiler does not inline any functions when using debug optimization (-Og).
+Hence, remove -Winline flag when compiling with debug optimization.
+
+Signed-off-by: Nicolas Marguet <nicolas.marguet@windriver.com>
+---
+Upstream-Status: Backport [https://github.com/rsyslog/librelp/commit/6d575d9]
+
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 21c1fde..1204c4e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -230,6 +230,12 @@ if test "$enable_debug" = "no"; then
+ AC_DEFINE(NDEBUG, 1, [Defined if debug mode is disabled.])
+ fi
+
++#Compiler does not inline any functions when not optimizing(-Og).
++#Hence, remove -Winline flag when DEBUG is enabled.
++#ifdef DEBUG
++WARN_CFLAGS="$(echo "$WARN_CFLAGS" | sed s/-Winline//g)"
++#endif
++
+ # valgrind
+ AC_ARG_ENABLE(valgrind,
+ [AS_HELP_STRING([--enable-valgrind],[Enable valgrind tests@<:@default=yes@:>@])],
+--
+2.39.0
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch
new file mode 100644
index 0000000000..cf4f4080a6
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch
@@ -0,0 +1,37 @@
+From baf992f82aa987c608731866876adb856847ea45 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 May 2024 18:03:40 -0700
+Subject: [PATCH] relp: fix build against upcoming `gcc-14`
+ (`-Werror=calloc-transposed-args`)
+
+`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
+ detected minor infelicity in `calloc()` API usage
+
+Fixes
+../../git/src/relp.c: In function 'addToEpollSet':
+../../git/src/relp.c:101:39: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
+ 101 | CHKmalloc(epd = calloc(sizeof(epolld_t), 1));
+ | ^~~~~~~~
+
+Upstream-Status: Submitted [https://github.com/rsyslog/librelp/pull/264]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/relp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/relp.c b/src/relp.c
+index eadda36..6268f1d 100644
+--- a/src/relp.c
++++ b/src/relp.c
+@@ -98,7 +98,7 @@ addToEpollSet(relpEngine_t *const pThis, epolld_type_t typ, void *ptr, int sock,
+ epolld_t *epd = NULL;
+ ENTER_RELPFUNC;
+
+- CHKmalloc(epd = calloc(sizeof(epolld_t), 1));
++ CHKmalloc(epd = calloc(1, sizeof(epolld_t)));
+ epd->typ = typ;
+ epd->ptr = ptr;
+ epd->sock = sock;
+--
+2.45.0
+
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch
new file mode 100644
index 0000000000..3ce5926333
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch
@@ -0,0 +1,88 @@
+From 6e9b27f04132287463c89d3be0ce4f506944920d Mon Sep 17 00:00:00 2001
+From: Patrick Williams <patrick@stwcx.xyz>
+Date: Fri, 3 Feb 2023 16:11:29 -0600
+Subject: [PATCH] tcp: fix some compiler warnings with enable-tls-openssl
+
+When --enable-tls=no and --enable-tls-openssl=yes, the following
+compiler errors are reported:
+
+```
+| ../../git/src/tcp.c:3765:1: error: no previous declaration for 'relpTcpGetRtryDirection_gtls' [-Werror=missing-declarations]
+| 3765 | relpTcpGetRtryDirection_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis)
+| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
+| ../../git/src/tcp.c:3583:1: error: 'relpTcpChkPeerName' defined but not used [-Werror=unused-function]
+| 3583 | relpTcpChkPeerName(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED void* cert)
+| | ^~~~~~~~~~~~~~~~~~
+```
+
+Fix these by:
+ 1. Add static on the openssl path for relpTcpGetRtryDirection_gtls.
+ 2. Move the relpTcpChkPeerName forward declaration to another ifdef
+ leg.
+ 3. Wrap relpTcpChkPeerName in gnutls-based ifdef.
+ 4. Remove relpTcpChkPeerName_gtls from openssl path.
+
+Upstream-Status: Backport [https://github.com/rsyslog/librelp/pull/255]
+Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
+---
+ src/tcp.c | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/src/tcp.c b/src/tcp.c
+index 7a75cc4..18cffda 100644
+--- a/src/tcp.c
++++ b/src/tcp.c
+@@ -132,12 +132,12 @@ callOnErr(const relpTcp_t *__restrict__ const pThis,
+ static int LIBRELP_ATTR_NONNULL() relpTcpGetCN(char *const namebuf, const size_t lenNamebuf, const char *const szDN);
+ #ifdef HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION
+ static int relpTcpVerifyCertificateCallback(gnutls_session_t session);
++static int relpTcpChkPeerName(relpTcp_t *const pThis, void* cert);
+ #endif /* #ifdef HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION */
+ #if defined(HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION) || defined(ENABLE_TLS_OPENSSL)
+ static void relpTcpChkOnePeerName(relpTcp_t *const pThis, char *peername, int *pbFoundPositiveMatch);
+ static int relpTcpAddToCertNamesBuffer(relpTcp_t *const pThis, char *const buf,
+ const size_t buflen, int *p_currIdx, const char *const certName);
+-static int relpTcpChkPeerName(relpTcp_t *const pThis, void* cert);
+ #endif /* defined(HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION) || defined(ENABLE_TLS_OPENSSL) */
+
+
+@@ -2820,11 +2820,6 @@ relpTcpLstnInitTLS_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis)
+ {
+ return RELP_RET_ERR_INTERNAL;
+ }
+-static int
+-relpTcpChkPeerName_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis, LIBRELP_ATTR_UNUSED void *vcert)
+-{
+- return RELP_RET_ERR_INTERNAL;
+-}
+ #endif /* defined(ENABLE_TLS)*/
+
+
+@@ -3579,6 +3574,7 @@ finalize_it:
+
+ }
+
++#ifdef HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION
+ static int
+ relpTcpChkPeerName(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED void* cert)
+ {
+@@ -3592,6 +3588,7 @@ relpTcpChkPeerName(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED void* cert)
+ #endif /* #ifdef WITH_TLS*/
+ LEAVE_RELPFUNC;
+ }
++#endif
+
+ static relpRetVal LIBRELP_ATTR_NONNULL()
+ relpTcpAcceptConnReqInitTLS(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED relpSrv_t *const pSrv)
+@@ -3761,7 +3758,7 @@ relpTcpGetRtryDirection_gtls(relpTcp_t *const pThis)
+ return gnutls_record_get_direction(pThis->session);
+ }
+ #else /* #ifdef ENABLE_TLS */
+-relpRetVal LIBRELP_ATTR_NONNULL()
++static relpRetVal LIBRELP_ATTR_NONNULL()
+ relpTcpGetRtryDirection_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis)
+ {
+ return RELP_RET_ERR_INTERNAL;
+--
+2.41.0
+
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch
deleted file mode 100644
index 6b60bd7486..0000000000
--- a/meta-oe/recipes-extended/rsyslog/librelp/0001-testbench-improvements.patch
+++ /dev/null
@@ -1,164 +0,0 @@
-From 1e6be18ed243dc562ff2976b46850bfd2e576664 Mon Sep 17 00:00:00 2001
-From: Rainer Gerhards <rgerhards@adiscon.com>
-Date: Thu, 15 Nov 2018 12:23:41 +0100
-Subject: [PATCH] testbench improvements
-
-Most importantly, the test receiver process is now terminated
-gracefully. Without that, gcov can never pick up correct
-coverage data.
-
-Upstream-Status: Backport[https://github.com/rsyslog/librelp/commit/1e6be18ed243dc562ff2976b46850bfd2e576664]
-
-Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
----
- src/tcp.c | 4 ++--
- tests/Makefile.am | 3 ++-
- tests/receive.c | 29 +++++++++++++++++++++++++++--
- tests/selftest_receive_usage.sh | 5 +++++
- tests/test-framework.sh | 4 ++--
- 5 files changed, 38 insertions(+), 7 deletions(-)
- create mode 100755 tests/selftest_receive_usage.sh
-
-diff --git a/src/tcp.c b/src/tcp.c
-index f10a720..0ea92ea 100644
---- a/src/tcp.c
-+++ b/src/tcp.c
-@@ -3027,7 +3027,7 @@ relpTcpConnect(relpTcp_t *const pThis,
- struct addrinfo hints;
- struct addrinfo *reslocal = NULL;
- struct pollfd pfd;
-- char errmsg[1024];
-+ char errmsg[1424];
- int so_error;
- socklen_t len = sizeof so_error;
- int r;
-@@ -3067,7 +3067,7 @@ relpTcpConnect(relpTcp_t *const pThis,
- }
- if(connect(pThis->sock, res->ai_addr, res->ai_addrlen) == -1) {
- if(errno != EINPROGRESS) {
-- char errStr[1024];
-+ char errStr[1200];
- _relpEngine_strerror_r(errno, errStr, sizeof(errStr));
- snprintf(errmsg, sizeof(errmsg), "error connecting: '%s'", errStr);
- callOnErr(pThis, errmsg, RELP_RET_IO_ERR);
-diff --git a/tests/Makefile.am b/tests/Makefile.am
-index 64deb19..51fd78f 100644
---- a/tests/Makefile.am
-+++ b/tests/Makefile.am
-@@ -25,7 +25,8 @@ TESTS= basic.sh \
- long-msg.sh \
- oversize-msg-abort-errmsg.sh \
- oversize-msg-accept-errmsg.sh \
-- truncate-oversize-msg.sh
-+ truncate-oversize-msg.sh \
-+ selftest_receive_usage.sh
- # OpenSSL tests only!
- if ENABLE_TLS_OPENSSL
- TESTS += tls-wrong-permittedPeer.sh \
-diff --git a/tests/receive.c b/tests/receive.c
-index e56e59c..4b69c99 100644
---- a/tests/receive.c
-+++ b/tests/receive.c
-@@ -1,6 +1,7 @@
- /* A minimal RELP receiver using librelp
- *
- * Copyright 2014 Mathias Nyman
-+ * Copyright 2018 Adiscon GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
-@@ -24,6 +25,7 @@
- #include <string.h>
- #include <limits.h>
- #include <errno.h>
-+#include <signal.h>
- #include "librelp.h"
-
- #define TRY(f) if(f != RELP_RET_OK) { fprintf(stderr, "receive.c: FAILURE in '%s'\n", #f); ret = 1; goto done; }
-@@ -31,6 +33,24 @@
- static FILE *errFile = NULL;
- static relpEngine_t *pRelpEngine;
-
-+static void
-+hdlr_enable(int sig, void (*hdlr)())
-+{
-+ struct sigaction sigAct;
-+ memset(&sigAct, 0, sizeof (sigAct));
-+ sigemptyset(&sigAct.sa_mask);
-+ sigAct.sa_handler = hdlr;
-+ sigaction(sig, &sigAct, NULL);
-+}
-+
-+void
-+terminate(int sig)
-+{
-+ fprintf(stderr, "terminating on signal %d\n", sig);
-+ relpEngineSetStop(pRelpEngine);
-+}
-+
-+
- static void __attribute__((format(printf, 1, 2)))
- dbgprintf(char *fmt, ...)
- {
-@@ -237,6 +257,8 @@ int main(int argc, char *argv[]) {
- }
- }
-
-+ hdlr_enable(SIGTERM, terminate);
-+
- TRY(relpEngineConstruct(&pRelpEngine));
- TRY(relpEngineSetDbgprint(pRelpEngine, verbose ? dbgprintf : NULL));
- TRY(relpEngineSetEnableCmd(pRelpEngine, (unsigned char*) "syslog", eRelpCmdState_Required));
-@@ -294,11 +316,14 @@ int main(int argc, char *argv[]) {
- fclose(fp);
- }
-
-- TRY(relpEngineRun(pRelpEngine)); /* Abort with ctrl-c */
-+ TRY(relpEngineRun(pRelpEngine)); /* Abort via SIGHUP */
-
-- TRY(relpEngineSetStop(pRelpEngine));
- TRY(relpEngineDestruct(&pRelpEngine));
-
-+ if(pidFileName != NULL) {
-+ unlink(pidFileName);
-+ }
-+
- done:
- return ret;
- }
-diff --git a/tests/selftest_receive_usage.sh b/tests/selftest_receive_usage.sh
-new file mode 100755
-index 0000000..c4ac8bb
---- /dev/null
-+++ b/tests/selftest_receive_usage.sh
-@@ -0,0 +1,5 @@
-+#!/bin/bash
-+. ${srcdir:=$(pwd)}/test-framework.sh
-+./receive &>librelp.out.log
-+check_output "Port is missing"
-+terminate
-diff --git a/tests/test-framework.sh b/tests/test-framework.sh
-index 6abdcf2..d4ab3ec 100644
---- a/tests/test-framework.sh
-+++ b/tests/test-framework.sh
-@@ -32,7 +32,7 @@ function wait_process_startup_via_pidfile() {
- # start receiver WITH valgrind, add receiver command line parameters after function name
- function startup_receiver_valgrind() {
- printf 'Starting Receiver...\n'
-- $valgrind ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>>librelp.out.log &
-+ $valgrind ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>librelp.out.log &
- export RECEIVE_PID=$!
- printf "got receive pid $RECEIVE_PID\n"
- wait_process_startup_via_pidfile receive.pid
-@@ -43,7 +43,7 @@ function startup_receiver_valgrind() {
- # start receiver, add receiver command line parameters after function name
- function startup_receiver() {
- printf 'Starting Receiver...\n'
-- ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>>librelp.out.log &
-+ ./receive -p $TESTPORT -F receive.pid $OPT_VERBOSE $* 1>librelp.out.log &
- export RECEIVE_PID=$!
- printf "got receive pid $RECEIVE_PID\n"
- wait_process_startup_via_pidfile receive.pid
---
-2.17.1
-
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Fix-callback-prototype.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Fix-callback-prototype.patch
new file mode 100644
index 0000000000..ba081926e1
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Fix-callback-prototype.patch
@@ -0,0 +1,49 @@
+From 2a7e26510cf9276b7e640ca8282cc1c5e46075d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Aug 2023 11:59:40 -0700
+Subject: [PATCH] tests: Fix callback prototype
+
+clang errors about it
+
+| ../../git/tests/receive.c:71:34: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
+| 71 | hdlr_enable(int sig, void (*hdlr)())
+| | ^
+| | void
+| 1 error generated.
+
+Upstream-Status: Submitted [https://github.com/rsyslog/librelp/pull/260]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/receive.c | 2 +-
+ tests/send.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/receive.c b/tests/receive.c
+index f376cb4..c12e911 100644
+--- a/tests/receive.c
++++ b/tests/receive.c
+@@ -68,7 +68,7 @@ doSleep(int iSeconds, const int iuSeconds)
+ }
+
+ static void
+-hdlr_enable(int sig, void (*hdlr)())
++hdlr_enable(int sig, void (*hdlr)(const int))
+ {
+ struct sigaction sigAct;
+ memset(&sigAct, 0, sizeof (sigAct));
+diff --git a/tests/send.c b/tests/send.c
+index d7e90f0..1b1df4f 100644
+--- a/tests/send.c
++++ b/tests/send.c
+@@ -57,7 +57,7 @@ struct usrdata { /* used for testing user pointer pass-back */
+ struct usrdata *userdata = NULL;
+
+ static void
+-hdlr_enable(int sig, void (*hdlr)())
++hdlr_enable(int sig, void (*hdlr)(const int))
+ {
+ struct sigaction sigAct;
+ memset(&sigAct, 0, sizeof (sigAct));
+--
+2.41.0
+
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Include-missing-sys-time.h.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Include-missing-sys-time.h.patch
new file mode 100644
index 0000000000..6fed23c1d1
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-tests-Include-missing-sys-time.h.patch
@@ -0,0 +1,41 @@
+From 5c32487a9c127f37141488d416cdb5d5bec6aca1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 19 Aug 2023 10:24:40 -0700
+Subject: [PATCH] tests: Include missing sys/time.h
+
+This is found when building for musl C library systems where sys/time.h
+is not included indirectly and select() and timeval structs are used
+
+Fixes
+
+../../git/tests/receive.c:64:17: error: variable has incomplete type 'struct timeval'
+ 64 | struct timeval tvSelectTimeout;
+ | ^
+../../git/tests/receive.c:64:9: note: forward declaration of 'struct timeval'
+ 64 | struct timeval tvSelectTimeout;
+ | ^
+../../git/tests/receive.c:67:2: error: call to undeclared function 'select'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+ 67 | select(0, NULL, NULL, NULL, &tvSelectTimeout);
+ | ^
+
+Upstream-Status: Submitted [https://github.com/rsyslog/librelp/pull/261]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/receive.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/receive.c b/tests/receive.c
+index f376cb4..e20861e 100644
+--- a/tests/receive.c
++++ b/tests/receive.c
+@@ -33,6 +33,7 @@
+ #include <limits.h>
+ #include <errno.h>
+ #include <signal.h>
++#include <sys/time.h>
+ #include "librelp.h"
+
+ #define TRY(f) { const int TRY_r = f; if(TRY_r != RELP_RET_OK) { \
+--
+2.41.0
+
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/run-ptest b/meta-oe/recipes-extended/rsyslog/librelp/run-ptest
new file mode 100644
index 0000000000..a649a5716f
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+set -e
+set -o pipefail
+
+SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
+cd ${SCRIPTPATH}
+useradd tester || echo "user already exists"
+su tester -c "make -C tests -k check-TESTS"
+userdel tester
diff --git a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
new file mode 100644
index 0000000000..49847047ac
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
@@ -0,0 +1,87 @@
+SUMMARY = "A reliable logging library"
+HOMEPAGE = "https://github.com/rsyslog/librelp"
+
+LICENSE = "GPL-3.0-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9"
+
+DEPENDS = "gmp libidn zlib"
+
+SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \
+ file://0001-Fix-function-inline-errors-in-debug-optimization-Og.patch \
+ file://0001-tests-Fix-callback-prototype.patch \
+ file://0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch \
+ file://0001-tests-Include-missing-sys-time.h.patch \
+ file://0001-relp-fix-build-against-upcoming-gcc-14-Werror-calloc.patch \
+ file://run-ptest \
+"
+
+SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig ptest
+
+PACKAGECONFIG ?= "tls-openssl valgrind"
+# Valgrind is not available for RISCV yet
+PACKAGECONFIG:remove:riscv64 = "valgrind"
+PACKAGECONFIG:remove:riscv32 = "valgrind"
+
+PACKAGECONFIG[tls] = "--enable-tls,--disable-tls,gnutls nettle"
+PACKAGECONFIG[tls-openssl] = "--enable-tls-openssl,--disable-tls-openssl,openssl"
+PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,"
+
+# For ptests, copy source tests/*.sh scripts, Makefile and
+# executables and run them with make on target.
+TESTDIR = "tests"
+do_compile_ptest() {
+ echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
+ oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/${TESTDIR}
+
+ # copy source tests/*.sh and python scripts
+ cp -f ${S}/${TESTDIR}/*.sh ${S}/${TESTDIR}/*.py ${D}${PTEST_PATH}/${TESTDIR}
+ # install data files needed by the test scripts on the target
+ cp -f ${S}/${TESTDIR}/*.supp ${D}${PTEST_PATH}/${TESTDIR}
+ cp -rf ${S}/${TESTDIR}/tls-certs ${D}${PTEST_PATH}/${TESTDIR}
+
+ # copy executables
+ find ${B}/${TESTDIR} -type f -executable -exec cp {} ${D}${PTEST_PATH}/${TESTDIR} \;
+ cp -rf ${B}/${TESTDIR}/.libs ${D}${PTEST_PATH}/${TESTDIR}
+ # copy Makefile
+ # run-ptest will run make which runs the executables
+ cp -f ${B}/${TESTDIR}/Makefile ${D}${PTEST_PATH}/${TESTDIR}
+ cp -f ${B}/${TESTDIR}/set-envvars ${D}${PTEST_PATH}/${TESTDIR}
+
+ # give permissions to all users
+ # some tests need to write to this directory
+ chmod 777 -R ${D}${PTEST_PATH}/${TESTDIR}
+
+ # do NOT need to rebuild Makefile or $(check_PROGRAMS)
+ sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+ sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+
+ # fix the srcdir, top_srcdir, abs_top_builddir
+ sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+ sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+ sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+
+ # install test-driver
+ install -m 644 ${S}/test-driver ${D}${PTEST_PATH}
+
+ # fix the python3 path for tests/set-envar
+ sed -i -e s:${HOSTTOOLS_DIR}:${bindir}:g ${D}${PTEST_PATH}/${TESTDIR}/set-envvars
+
+ # these 2 scripts need help finding their /usr/lib/librelp/ptest/tests/.libs libraries
+ sed -i 's:${B}/src:${PTEST_PATH}/${TESTDIR}:' ${D}${PTEST_PATH}/${TESTDIR}/send
+ sed -i 's:${B}/src:${PTEST_PATH}/${TESTDIR}:' ${D}${PTEST_PATH}/${TESTDIR}/receive
+}
+
+RDEPENDS:${PN}-ptest += "\
+ make bash coreutils libgcc util-linux gawk grep \
+ python3-core python3-io \
+"
+RRECOMMENDS:${PN}-ptest += "${@bb.utils.filter('PACKAGECONFIG', 'valgrind', d)}"
+
diff --git a/meta-oe/recipes-extended/rsyslog/librelp_1.2.18.bb b/meta-oe/recipes-extended/rsyslog/librelp_1.2.18.bb
deleted file mode 100644
index e4838fa5b9..0000000000
--- a/meta-oe/recipes-extended/rsyslog/librelp_1.2.18.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-SUMMARY = "A reliable logging library"
-HOMEPAGE = "https://github.com/rsyslog/librelp"
-
-LICENSE = "GPLv3"
-LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9"
-
-DEPENDS = "gmp nettle libidn zlib gnutls"
-
-SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https \
- file://0001-testbench-improvements.patch \
-"
-
-SRCREV = "4b6a81061bccf68cba6fddd27f99fb5dc0d0c3a3"
-
-S = "${WORKDIR}/git"
-
-inherit autotools pkgconfig
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch
new file mode 100644
index 0000000000..c1480406fe
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch
@@ -0,0 +1,46 @@
+From 194e199ce08acc2192f6a63420ff24d9064666e5 Mon Sep 17 00:00:00 2001
+From: Yi Fan Yu <yifan.yu@windriver.com>
+Date: Sat, 27 Mar 2021 19:18:25 -0400
+Subject: [PATCH] tests: disable the check for inotify
+
+We don't need to check inotify.h.
+Assume it is present since it is part of the linux kernel
+since 2.6.13 [1].
+
+[1](https://kernelnewbies.org/Linux_2_6_13)
+
+(it would require installing the libc headers otherwise,
+ for the test to detect /usr/include/sys/inotify.h.)
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
+---
+ tests/diag.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/diag.sh b/tests/diag.sh
+index 6cd60ea88..7424f48c5 100755
+--- a/tests/diag.sh
++++ b/tests/diag.sh
+@@ -2672,7 +2672,7 @@ case $1 in
+ fi
+ ;;
+ 'check-inotify') # Check for inotify/fen support
+- if [ -n "$(find /usr/include -name 'inotify.h' -print -quit)" ]; then
++ if true; then
+ echo [inotify mode]
+ elif [ -n "$(find /usr/include/sys/ -name 'port.h' -print -quit)" ]; then
+ grep -qF "PORT_SOURCE_FILE" < /usr/include/sys/port.h
+@@ -2687,7 +2687,7 @@ case $1 in
+ fi
+ ;;
+ 'check-inotify-only') # Check for ONLY inotify support
+- if [ -n "$(find /usr/include -name 'inotify.h' -print -quit)" ]; then
++ if true; then
+ echo [inotify mode]
+ else
+ echo [inotify not supported, skipping...]
+--
+2.29.2
+
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-tcpflood.c-Pass-correct-parameter-type-to-send.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-tcpflood.c-Pass-correct-parameter-type-to-send.patch
new file mode 100644
index 0000000000..5df29e7d90
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-tcpflood.c-Pass-correct-parameter-type-to-send.patch
@@ -0,0 +1,35 @@
+From 1e0a77d8a5ae7cd0223afadf46cdbb540119774d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 11 May 2024 23:31:46 -0700
+Subject: [PATCH] tests/tcpflood.c: Pass correct parameter type to sendto()
+
+Fixes build with GCC-14 and musl
+
+../../rsyslog-8.2404.0/tests/tcpflood.c:811:70: error: passing argument 5 of 'sendto' from incompatible pointer type [-Wincompatible-pointer-types]
+ 811 | lenSend = sendto(udpsockout, buf, lenBuf, 0, &udpRcvr, sizeof(udpRcvr));
+ | ^~~~~~~~
+ | |
+ | struct sockaddr_in *
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/tcpflood.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/tcpflood.c b/tests/tcpflood.c
+index bd8edaf..0feda23 100644
+--- a/tests/tcpflood.c
++++ b/tests/tcpflood.c
+@@ -808,7 +808,7 @@ int sendMessages(struct instdata *inst)
+ }
+ lenSend = sendPlainTCP(socknum, buf, lenBuf, &error_number);
+ } else if(transport == TP_UDP) {
+- lenSend = sendto(udpsockout, buf, lenBuf, 0, &udpRcvr, sizeof(udpRcvr));
++ lenSend = sendto(udpsockout, buf, lenBuf, 0, (const struct sockaddr *)&udpRcvr, sizeof(udpRcvr));
+ error_number = errno;
+ } else if(transport == TP_TLS) {
+ if(sockArray[socknum] == -1) {
+--
+2.45.0
+
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/disable-omfile-outchannel.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/disable-omfile-outchannel.patch
new file mode 100644
index 0000000000..a8bbe2b51e
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/disable-omfile-outchannel.patch
@@ -0,0 +1,23 @@
+tests: Skip omfile-outchannel test as it fails on musl
+
+scanf error in index i=5559
+sequence error detected in rstb_168227_f19f3b245QVE.out.log
+number of lines in file: 5559 rstb_168227_f19f3b245QVE.out.log
+
+Patch is also applied in void linux
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/tests/omfile-outchannel.sh 2021-03-09 05:51:07.000000000 -0600
++++ b/tests/omfile-outchannel.sh 2022-05-26 15:55:23.358520256 -0500
+@@ -1,5 +1,9 @@
+ #!/bin/bash
+ # addd 2018-08-02 by RGerhards, released under ASL 2.0
++
++# This test fails for x86_64-musl, under GitHub's CI/CD. Disable for now.
++exit 77
++
+ . ${srcdir:=.}/diag.sh init
+ export NUMMESSAGES=10000
+ echo "ls -l $RSYSLOG_DYNNAME*
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-fix-ptest-not-finish.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-fix-ptest-not-finish.patch
deleted file mode 100644
index a248f75e5b..0000000000
--- a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-fix-ptest-not-finish.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From 07ad2a1905089b9124623324a9969e4522317110 Mon Sep 17 00:00:00 2001
-From: Jackie Huang <jackie.huang@windriver.com>
-Date: Fri, 12 Sep 2014 03:41:11 -0400
-Subject: [PATCH] rsyslog: update configure to fix ptest
-
-$MaxMessageSize doesn't work if before $IncludeConfig diag-common.conf, then
-test cases fall into infinite loop with error message:
-
-8062.511110729:4902c480: error: message received is larger than max msg size, we split it
-8062.511152265:4902c480: discarding zero-sized message
-
-Update configure to fix it.
-
-Upstream-Status: Pending
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
-
----
- tests/testsuites/complex1.conf | 2 +-
- tests/testsuites/gzipwr_large.conf | 2 +-
- tests/testsuites/gzipwr_large_dynfile.conf | 2 +-
- tests/testsuites/imptcp_conndrop.conf | 2 +-
- tests/testsuites/imptcp_large.conf | 2 +-
- tests/testsuites/imtcp_conndrop.conf | 2 +-
- tests/testsuites/wr_large.conf | 2 +-
- 7 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/tests/testsuites/complex1.conf b/tests/testsuites/complex1.conf
-index 9b6a9f3..e00caa4 100644
---- a/tests/testsuites/complex1.conf
-+++ b/tests/testsuites/complex1.conf
-@@ -1,7 +1,7 @@
- # complex test case with multiple actions in gzip mode
- # rgerhards, 2009-05-22
--$MaxMessageSize 10k
- $IncludeConfig diag-common.conf
-+$MaxMessageSize 10k
-
- $MainMsgQueueTimeoutEnqueue 5000
-
-diff --git a/tests/testsuites/gzipwr_large.conf b/tests/testsuites/gzipwr_large.conf
-index 54ad3bb..e8247a9 100644
---- a/tests/testsuites/gzipwr_large.conf
-+++ b/tests/testsuites/gzipwr_large.conf
-@@ -1,7 +1,7 @@
- # simple async writing test
- # rgerhards, 2010-03-09
--$MaxMessageSize 10k
- $IncludeConfig diag-common.conf
-+$MaxMessageSize 10k
-
- $ModLoad ../plugins/imtcp/.libs/imtcp
- $MainMsgQueueTimeoutShutdown 10000
-diff --git a/tests/testsuites/gzipwr_large_dynfile.conf b/tests/testsuites/gzipwr_large_dynfile.conf
-index 3a1b255..297cb70 100644
---- a/tests/testsuites/gzipwr_large_dynfile.conf
-+++ b/tests/testsuites/gzipwr_large_dynfile.conf
-@@ -1,7 +1,7 @@
- # simple async writing test
- # rgerhards, 2010-03-09
--$MaxMessageSize 10k
- $IncludeConfig diag-common.conf
-+$MaxMessageSize 10k
-
- $ModLoad ../plugins/imtcp/.libs/imtcp
- $MainMsgQueueTimeoutShutdown 10000
-diff --git a/tests/testsuites/imptcp_conndrop.conf b/tests/testsuites/imptcp_conndrop.conf
-index 77a5d79..d9a14a8 100644
---- a/tests/testsuites/imptcp_conndrop.conf
-+++ b/tests/testsuites/imptcp_conndrop.conf
-@@ -1,7 +1,7 @@
- # simple async writing test
- # rgerhards, 2010-03-09
--$MaxMessageSize 10k
- $IncludeConfig diag-common.conf
-+$MaxMessageSize 10k
-
- $ModLoad ../plugins/imptcp/.libs/imptcp
- $MainMsgQueueTimeoutShutdown 10000
-diff --git a/tests/testsuites/imptcp_large.conf b/tests/testsuites/imptcp_large.conf
-index 77a5d79..d9a14a8 100644
---- a/tests/testsuites/imptcp_large.conf
-+++ b/tests/testsuites/imptcp_large.conf
-@@ -1,7 +1,7 @@
- # simple async writing test
- # rgerhards, 2010-03-09
--$MaxMessageSize 10k
- $IncludeConfig diag-common.conf
-+$MaxMessageSize 10k
-
- $ModLoad ../plugins/imptcp/.libs/imptcp
- $MainMsgQueueTimeoutShutdown 10000
-diff --git a/tests/testsuites/imtcp_conndrop.conf b/tests/testsuites/imtcp_conndrop.conf
-index de41bc4..7844dc7 100644
---- a/tests/testsuites/imtcp_conndrop.conf
-+++ b/tests/testsuites/imtcp_conndrop.conf
-@@ -1,7 +1,7 @@
- # simple async writing test
- # rgerhards, 2010-03-09
--$MaxMessageSize 10k
- $IncludeConfig diag-common.conf
-+$MaxMessageSize 10k
-
- $ModLoad ../plugins/imtcp/.libs/imtcp
- $MainMsgQueueTimeoutShutdown 10000
-diff --git a/tests/testsuites/wr_large.conf b/tests/testsuites/wr_large.conf
-index b64f132..b0ae264 100644
---- a/tests/testsuites/wr_large.conf
-+++ b/tests/testsuites/wr_large.conf
-@@ -1,7 +1,7 @@
- # simple async writing test
- # rgerhards, 2010-03-09
--$MaxMessageSize 10k
- $IncludeConfig diag-common.conf
-+$MaxMessageSize 10k
-
- $ModLoad ../plugins/imtcp/.libs/imtcp
- $MainMsgQueueTimeoutShutdown 10000
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.service b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.service
new file mode 100644
index 0000000000..0aacff32d5
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=System Logging Service
+Requires=syslog.socket
+Wants=network.target network-online.target
+After=network.target network-online.target
+Documentation=man:rsyslogd(8)
+Documentation=http://www.rsyslog.com/doc/
+
+[Service]
+Type=notify
+ExecStart=@sbindir@/rsyslogd -n -iNONE
+StandardOutput=null
+Restart=on-failure
+
+# Increase the default a bit in order to allow many simultaneous
+# files to be monitored, we might need a lot of fds.
+LimitNOFILE=16384
+
+[Install]
+WantedBy=multi-user.target
+Alias=syslog.service
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/run-ptest b/meta-oe/recipes-extended/rsyslog/rsyslog/run-ptest
index 3770a75065..efa9ba3ed0 100644
--- a/meta-oe/recipes-extended/rsyslog/rsyslog/run-ptest
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog/run-ptest
@@ -1,3 +1,12 @@
#!/bin/sh
#
-make -C tests -k check-TESTS
+set -e
+set -o pipefail
+
+SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
+cd ${SCRIPTPATH}
+useradd tester || echo "user already exists"
+ln -sf /usr/sbin/logrotate /usr/bin/logrotate
+su tester -c "make -C tests -k check-TESTS"
+userdel tester
+rm -f /usr/bin/logrotate
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog_8.37.0.bb b/meta-oe/recipes-extended/rsyslog/rsyslog_8.2404.0.bb
index 1fb4390150..5152984249 100644
--- a/meta-oe/recipes-extended/rsyslog/rsyslog_8.37.0.bb
+++ b/meta-oe/recipes-extended/rsyslog/rsyslog_8.2404.0.bb
@@ -11,27 +11,28 @@ Rsyslog is an enhanced syslogd supporting, among others, MySQL,\
DEPENDS = "zlib libestr libfastjson bison-native flex-native liblogging"
HOMEPAGE = "http://www.rsyslog.com/"
-LICENSE = "GPLv3 & LGPLv3 & Apache-2.0"
+LICENSE = "GPL-3.0-only & LGPL-3.0-only & Apache-2.0"
LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973 \
file://COPYING.LESSER;md5=cb7903f1e5c39ae838209e130dca270a \
file://COPYING.ASL20;md5=052f8a09206615ab07326ff8ce2d9d32\
"
-SRC_URI = "http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.tar.gz \
+SRC_URI = "https://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \
file://initscript \
file://rsyslog.conf \
file://rsyslog.logrotate \
+ file://rsyslog.service \
file://use-pkgconfig-to-check-libgcrypt.patch \
file://run-ptest \
- file://rsyslog-fix-ptest-not-finish.patch \
+ file://0001-tests-disable-the-check-for-inotify.patch \
+ file://0001-tests-tcpflood.c-Pass-correct-parameter-type-to-send.patch \
"
-SRC_URI_append_libc-musl = " \
+SRC_URI:append:libc-musl = " \
file://0001-Include-sys-time-h.patch \
+ file://disable-omfile-outchannel.patch \
"
-
-SRC_URI[md5sum] = "e0942b4b88a13602a6b6352bf9f05091"
-SRC_URI[sha256sum] = "295c289b4c8abd8f8f3fe35a83249b739cedabe82721702b910255f9faf147e7"
+SRC_URI[sha256sum] = "30528d140ec1b1f079224081fa37df6e06587ff42b02e3e61f2daa0526c54d33"
UPSTREAM_CHECK_URI = "https://github.com/rsyslog/rsyslog/releases"
UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
@@ -39,11 +40,15 @@ UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
inherit autotools pkgconfig systemd update-rc.d ptest
EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes"
+EXTRA_OECONF += "--enable-imfile-tests"
+EXTRA_OECONF:remove:mipsarch = "ap_cv_atomic_builtins=yes"
+EXTRA_OECONF:remove:powerpc = "ap_cv_atomic_builtins=yes"
+EXTRA_OECONF:remove:riscv32 = "ap_cv_atomic_builtins=yes"
# first line is default yes in configure
PACKAGECONFIG ??= " \
- rsyslogd rsyslogrt klog inet regexp uuid libgcrypt \
- fmhttp imdiag gnutls imfile \
+ rsyslogd rsyslogrt klog inet regexp uuid libcap-ng libgcrypt \
+ fmhttp imdiag openssl imfile \
${@bb.utils.filter('DISTRO_FEATURES', 'snmp systemd', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'testbench relp ${VALGRIND}', '', d)} \
"
@@ -55,6 +60,7 @@ PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,,"
PACKAGECONFIG[fmhttp] = "--enable-fmhttp,--disable-fmhttp,curl,"
PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,,"
PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,,"
+PACKAGECONFIG[libcap-ng] = "--enable-libcap-ng,--disable-libcap-ng,libcap-ng,"
PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,,"
PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux,"
PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt,"
@@ -66,13 +72,17 @@ PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,,"
PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,,"
PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp,"
PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
-PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd,"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,"
+PACKAGECONFIG[systemd] = "--enable-libsystemd,--disable-libsystemd,systemd,"
PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal,"
+PACKAGECONFIG[mmjsonparse] = "--enable-mmjsonparse,--disable-mmjsonparse,"
PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,"
PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql,"
PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi,"
PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,,"
-PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind,"
+PACKAGECONFIG[valgrind] = ",--without-valgrind-testbench,valgrind,"
+PACKAGECONFIG[imhttp] = "--enable-imhttp,--disable-imhttp,civetweb,"
+
TESTDIR = "tests"
do_compile_ptest() {
@@ -85,6 +95,10 @@ do_install_ptest() {
cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
+ # give permissions to all users
+ # some tests need to write to this directory as user 'daemon'
+ chmod 777 -R ${D}${PTEST_PATH}/tests
+
# do NOT need to rebuild Makefile itself
sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
# do NOT need to rebuild $(check_PROGRAMS)
@@ -96,12 +110,6 @@ do_install_ptest() {
# fix the abs_top_builddir
sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
- # valgrind is not compatible with arm and mips,
- # so remove related test cases if there is no valgrind.
- if [ x${VALGRIND} = x ]; then
- sed -i '/udp-msgreduc-/d' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
- fi
-
# install test-driver
install -m 644 ${S}/test-driver ${D}${PTEST_PATH}
@@ -122,9 +130,11 @@ do_install_ptest() {
# fix the module load path with runtime/.libs
find ${D}${PTEST_PATH}/${TESTDIR} -name "*.conf" -o -name "*.sh" -o -name "*.c" | xargs \
sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:g'
+ # fix the python3 path for tests/set-envar
+ sed -i -e s:${HOSTTOOLS_DIR}:${bindir}:g ${D}${PTEST_PATH}/tests/set-envvars
}
-do_install_append() {
+do_install:append() {
install -d "${D}${sysconfdir}/init.d"
install -d "${D}${sysconfdir}/logrotate.d"
install -m 755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog
@@ -136,31 +146,62 @@ do_install_append() {
install -d 0755 ${D}${sysconfdir}/rsyslog.d
echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.d/imjournal.conf
fi
+ if ${@bb.utils.contains('PACKAGECONFIG', 'mmjsonparse', 'true', 'false', d)}; then
+ install -d 0755 ${D}${sysconfdir}/rsyslog.d
+ echo '$ModLoad mmjsonparse' >> ${D}${sysconfdir}/rsyslog.d/mmjsonparse.conf
+ fi
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_system_unitdir}
+ install -m 644 ${WORKDIR}/rsyslog.service ${D}${systemd_system_unitdir}
+ sed -i -e "s,@sbindir@,${sbindir},g" ${D}${systemd_system_unitdir}/rsyslog.service
+ fi
}
-FILES_${PN} += "${bindir}"
+FILES:${PN} += "${bindir}"
INITSCRIPT_NAME = "syslog"
INITSCRIPT_PARAMS = "defaults"
-CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf"
+CONFFILES:${PN} = "${sysconfdir}/rsyslog.conf"
-RCONFLICTS_${PN} = "busybox-syslog sysklogd syslog-ng"
+RCONFLICTS:${PN} = "busybox-syslog sysklogd syslog-ng"
-RPROVIDES_${PN} += "${PN}-systemd"
-RREPLACES_${PN} += "${PN}-systemd"
-RCONFLICTS_${PN} += "${PN}-systemd"
-SYSTEMD_SERVICE_${PN} = "${BPN}.service"
+RPROVIDES:${PN} += "${PN}-systemd"
+RREPLACES:${PN} += "${PN}-systemd"
+RCONFLICTS:${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
-RDEPENDS_${PN} += "logrotate"
+RDEPENDS:${PN} += "logrotate"
# for rsyslog-ptest
VALGRIND = "valgrind"
-VALGRIND_mips = ""
-VALGRIND_mips64 = ""
-VALGRIND_mips64n32 = ""
-VALGRIND_arm = ""
-VALGRIND_aarch64 = ""
-VALGRIND_riscv64 = ""
-RDEPENDS_${PN}-ptest += "make diffutils gzip bash gawk coreutils procps"
-RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}"
+
+# valgrind supports armv7 and above
+VALGRIND:armv4 = ''
+VALGRIND:armv5 = ''
+VALGRIND:armv6 = ''
+
+# X32 isn't supported by valgrind at this time
+VALGRIND:linux-gnux32 = ''
+VALGRIND:linux-muslx32 = ''
+
+# Disable for some MIPS variants
+VALGRIND:mipsarchr6 = ''
+VALGRIND:linux-gnun32 = ''
+
+# Disable for powerpc64 with musl
+VALGRIND:libc-musl:powerpc64 = ''
+VALGRIND:libc-musl:powerpc64le = ''
+
+# RISC-V support for valgrind is not there yet
+VALGRIND:riscv64 = ""
+VALGRIND:riscv32 = ""
+
+# util-linux: logger needs the -d option
+RDEPENDS:${PN}-ptest += "\
+ make diffutils gzip bash gawk coreutils procps \
+ libgcc python3-core python3-io python3-json \
+ curl util-linux shadow \
+ "
+
+RRECOMMENDS:${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}"