All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH 0/3] Add OpenSSL 1.1 support
@ 2018-06-07 13:21 Andrej Valek
  2018-06-07 13:21 ` [meta-oe][PATCH 1/3] thrift: add support for openssl 1.1x Andrej Valek
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andrej Valek @ 2018-06-07 13:21 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Marko Peter

Add OpenSSL 1.1 support:
 - thrift, net-snmp: apply supporting patch
 - syslog-ng: update component to version 3.15.1

 .../net-snmp/fix-openssl-build-errors.patch        | 171 +++++++++++++++++++++
 .../recipes-protocols/net-snmp/net-snmp_5.7.3.bb   |   1 +
 ...07-enable-build-with-OpenSSL-1.1.0-series.patch |  28 ++++
 ...-Compile-error-in-TSSLSocket.cpp-with-new.patch |  26 ++++
 ...-C++-library-build-fails-if-OpenSSL-does-.patch |  45 ++++++
 .../recipes-connectivity/thrift/thrift_0.9.3.bb    |   3 +
 ...ry-leak-problem-when-HAVE_ENVIRON-defined.patch |  29 ----
 ...c-add-option-enable-thread-tls-to-manage-.patch |  16 +-
 .../recipes-support/syslog-ng/files/syslog-ng.conf |   2 +-
 .../syslog-ng.service-the-syslog-ng-service.patch  |  38 +++--
 .../recipes-support/syslog-ng/syslog-ng_3.15.1.bb  |  10 ++
 .../recipes-support/syslog-ng/syslog-ng_3.8.1.bb   |  11 --
 12 files changed, 319 insertions(+), 61 deletions(-)
 create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/fix-openssl-build-errors.patch
 create mode 100644 meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0004-THRIFT-3207-enable-build-with-OpenSSL-1.1.0-series.patch
 create mode 100644 meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0005-THRIFT-3878-Compile-error-in-TSSLSocket.cpp-with-new.patch
 create mode 100644 meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0006-THRIFT-3736-C++-library-build-fails-if-OpenSSL-does-.patch
 delete mode 100644 meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
 create mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
 delete mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Marko Peter <peter.marko@siemens.com>

-- 
2.11.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [meta-oe][PATCH 1/3] thrift: add support for openssl 1.1x
  2018-06-07 13:21 [meta-oe][PATCH 0/3] Add OpenSSL 1.1 support Andrej Valek
@ 2018-06-07 13:21 ` Andrej Valek
  2018-06-07 13:21 ` [meta-oe][PATCH 2/3] syslog-ng: update to 3.15.1 Andrej Valek
  2018-06-07 13:21 ` [meta-oe][PATCH 3/3] net-snmp: add support for openssl 1.1x Andrej Valek
  2 siblings, 0 replies; 9+ messages in thread
From: Andrej Valek @ 2018-06-07 13:21 UTC (permalink / raw)
  To: openembedded-devel

The newest Thrift version has currently no fix for building with gcc>=6.
Rather posting supporting patches.

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
---
 ...07-enable-build-with-OpenSSL-1.1.0-series.patch | 28 ++++++++++++++
 ...-Compile-error-in-TSSLSocket.cpp-with-new.patch | 26 +++++++++++++
 ...-C++-library-build-fails-if-OpenSSL-does-.patch | 45 ++++++++++++++++++++++
 .../recipes-connectivity/thrift/thrift_0.9.3.bb    |  3 ++
 4 files changed, 102 insertions(+)
 create mode 100644 meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0004-THRIFT-3207-enable-build-with-OpenSSL-1.1.0-series.patch
 create mode 100644 meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0005-THRIFT-3878-Compile-error-in-TSSLSocket.cpp-with-new.patch
 create mode 100644 meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0006-THRIFT-3736-C++-library-build-fails-if-OpenSSL-does-.patch

diff --git a/meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0004-THRIFT-3207-enable-build-with-OpenSSL-1.1.0-series.patch b/meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0004-THRIFT-3207-enable-build-with-OpenSSL-1.1.0-series.patch
new file mode 100644
index 000000000..44764359c
--- /dev/null
+++ b/meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0004-THRIFT-3207-enable-build-with-OpenSSL-1.1.0-series.patch
@@ -0,0 +1,28 @@
+diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+index 68e475d..19132ff 100644
+--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
++++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+@@ -39,6 +39,7 @@
+ #include <thrift/transport/PlatformSocket.h>
+ 
+ #define OPENSSL_VERSION_NO_THREAD_ID 0x10000000L
++#define OPENSSL_VERSION_WITH_TLSv1_1_AND_TLSv1_2 0x10100000L
+ 
+ using namespace std;
+ using namespace apache::thrift::concurrency;
+@@ -148,10 +149,15 @@ SSLContext::SSLContext(const SSLProtocol& protocol) {
+     ctx_ = SSL_CTX_new(SSLv3_method());
+   } else if (protocol == TLSv1_0) {
+     ctx_ = SSL_CTX_new(TLSv1_method());
++#if (OPENSSL_VERSION_NUMBER >= OPENSSL_VERSION_WITH_TLSv1_1_AND_TLSv1_2)
+   } else if (protocol == TLSv1_1) {
+     ctx_ = SSL_CTX_new(TLSv1_1_method());
+   } else if (protocol == TLSv1_2) {
+     ctx_ = SSL_CTX_new(TLSv1_2_method());
++#else
++  //Support for this versions will end on 2016-12-31
++  //https://www.openssl.org/about/releasestrat.html
++#endif
+   } else {
+     /// UNKNOWN PROTOCOL!
+     throw TSSLException("SSL_CTX_new: Unknown protocol");
diff --git a/meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0005-THRIFT-3878-Compile-error-in-TSSLSocket.cpp-with-new.patch b/meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0005-THRIFT-3878-Compile-error-in-TSSLSocket.cpp-with-new.patch
new file mode 100644
index 000000000..8d7105667
--- /dev/null
+++ b/meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0005-THRIFT-3878-Compile-error-in-TSSLSocket.cpp-with-new.patch
@@ -0,0 +1,26 @@
+From cc4f32db13ddc62fbd1e316127c5a60f4080a2d3 Mon Sep 17 00:00:00 2001
+From: "James E. King, III" <jim.king@simplivity.com>
+Date: Thu, 29 Sep 2016 15:04:09 -0400
+Subject: [PATCH] THRIFT-3878: fix interop with newer OpenSSL libraries
+
+---
+ lib/cpp/src/thrift/transport/TSSLSocket.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+index 517151f714..1efb9f7a47 100644
+--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
++++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+@@ -108,7 +108,12 @@ void initializeOpenSSL() {
+   SSL_library_init();
+   SSL_load_error_strings();
+   // static locking
++  // newer versions of OpenSSL changed CRYPTO_num_locks - see THRIFT-3878
++#ifdef CRYPTO_num_locks
++  mutexes = boost::shared_array<Mutex>(new Mutex[CRYPTO_num_locks()]);
++#else
+   mutexes = boost::shared_array<Mutex>(new Mutex[ ::CRYPTO_num_locks()]);
++#endif
+   if (mutexes == NULL) {
+     throw TTransportException(TTransportException::INTERNAL_ERROR,
+                               "initializeOpenSSL() failed, "
diff --git a/meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0006-THRIFT-3736-C++-library-build-fails-if-OpenSSL-does-.patch b/meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0006-THRIFT-3736-C++-library-build-fails-if-OpenSSL-does-.patch
new file mode 100644
index 000000000..9c18171f1
--- /dev/null
+++ b/meta-oe/recipes-connectivity/thrift/thrift-0.9.3/0006-THRIFT-3736-C++-library-build-fails-if-OpenSSL-does-.patch
@@ -0,0 +1,45 @@
+From 53dc6e255bec2e4cd8bae85d14bec1cf28310d3f Mon Sep 17 00:00:00 2001
+From: Nobuaki Sukegawa <nsuke@apache.org>
+Date: Sun, 13 Mar 2016 08:55:38 +0900
+Subject: [PATCH] THRIFT-3736 C++ library build fails if OpenSSL does not
+ surrpot SSLv3
+
+---
+ lib/cpp/src/thrift/transport/TSSLSocket.cpp | 2 ++
+ lib/cpp/test/SecurityTest.cpp               | 8 ++++++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+index bd13160260..517151f714 100644
+--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
++++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+@@ -151,8 +151,10 @@ static char uppercase(char c);
+ SSLContext::SSLContext(const SSLProtocol& protocol) {
+   if (protocol == SSLTLS) {
+     ctx_ = SSL_CTX_new(SSLv23_method());
++#ifndef OPENSSL_NO_SSL3
+   } else if (protocol == SSLv3) {
+     ctx_ = SSL_CTX_new(SSLv3_method());
++#endif
+   } else if (protocol == TLSv1_0) {
+     ctx_ = SSL_CTX_new(TLSv1_method());
+   } else if (protocol == TLSv1_1) {
+diff --git a/lib/cpp/test/SecurityTest.cpp b/lib/cpp/test/SecurityTest.cpp
+index 9968e2c478..23650d6280 100644
+--- a/lib/cpp/test/SecurityTest.cpp
++++ b/lib/cpp/test/SecurityTest.cpp
+@@ -240,6 +240,14 @@ BOOST_AUTO_TEST_CASE(ssl_security_matrix)
+                     continue;
+                 }
+ 
++#ifdef OPENSSL_NO_SSL3
++                if (si == 2 || ci == 2)
++                {
++                    // Skip all SSLv3 cases - protocol not supported
++                    continue;
++                }
++#endif
++
+                 boost::mutex::scoped_lock lock(mMutex);
+ 
+                 BOOST_TEST_MESSAGE(boost::format("TEST: Server = %1%, Client = %2%")
diff --git a/meta-oe/recipes-connectivity/thrift/thrift_0.9.3.bb b/meta-oe/recipes-connectivity/thrift/thrift_0.9.3.bb
index aa9328371..7ab74026b 100644
--- a/meta-oe/recipes-connectivity/thrift/thrift_0.9.3.bb
+++ b/meta-oe/recipes-connectivity/thrift/thrift_0.9.3.bb
@@ -12,6 +12,9 @@ SRC_URI = "http://mirror.switch.ch/mirror/apache/dist/thrift/${PV}/${BPN}-${PV}.
            file://0001-Forcibly-disable-check-for-Qt5.patch \
            file://0001-THRIFT-3828-In-cmake-avoid-use-of-both-quoted-paths-.patch \
            file://0002-THRIFT-3831-in-test-cpp-explicitly-use-signed-char.patch \
+           file://0004-THRIFT-3207-enable-build-with-OpenSSL-1.1.0-series.patch \
+           file://0005-THRIFT-3878-Compile-error-in-TSSLSocket.cpp-with-new.patch \
+           file://0006-THRIFT-3736-C++-library-build-fails-if-OpenSSL-does-.patch \
 "
 
 SRC_URI[md5sum] = "88d667a8ae870d5adeca8cb7d6795442"
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [meta-oe][PATCH 2/3] syslog-ng: update to 3.15.1
  2018-06-07 13:21 [meta-oe][PATCH 0/3] Add OpenSSL 1.1 support Andrej Valek
  2018-06-07 13:21 ` [meta-oe][PATCH 1/3] thrift: add support for openssl 1.1x Andrej Valek
@ 2018-06-07 13:21 ` Andrej Valek
  2018-06-12 10:37   ` [meta-oe][PATCH v2] " Andrej Valek
  2018-06-14  7:37   ` [meta-oe][PATCH v3] " Andrej Valek
  2018-06-07 13:21 ` [meta-oe][PATCH 3/3] net-snmp: add support for openssl 1.1x Andrej Valek
  2 siblings, 2 replies; 9+ messages in thread
From: Andrej Valek @ 2018-06-07 13:21 UTC (permalink / raw)
  To: openembedded-devel

 - Refresh and remove obsolete patches
 - Version 3.15.1 supports OpenSSL 1.1

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
---
 ...ry-leak-problem-when-HAVE_ENVIRON-defined.patch | 29 -----------------
 ...c-add-option-enable-thread-tls-to-manage-.patch | 16 ++++-----
 .../recipes-support/syslog-ng/files/syslog-ng.conf |  2 +-
 .../syslog-ng.service-the-syslog-ng-service.patch  | 38 +++++++++++++++-------
 .../recipes-support/syslog-ng/syslog-ng_3.15.1.bb  | 10 ++++++
 .../recipes-support/syslog-ng/syslog-ng_3.8.1.bb   | 11 -------
 6 files changed, 45 insertions(+), 61 deletions(-)
 delete mode 100644 meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
 create mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
 delete mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb

diff --git a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch b/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
deleted file mode 100644
index 5d481f232..000000000
--- a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Fix the memory leak problem when HAVE_ENVIRON is defined
-
-Upstream-Status: Pending
-
-Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
----
-Index: syslog-ng-3.8.1/lib/gprocess.c
-===================================================================
---- syslog-ng-3.8.1.orig/lib/gprocess.c
-+++ syslog-ng-3.8.1/lib/gprocess.c
-@@ -1432,6 +1432,18 @@ g_process_startup_ok(void)
- void
- g_process_finish(void)
- {
-+#ifdef HAVE_ENVIRON
-+  int i = 0;
-+
-+  while (environ[i]) {
-+    g_free(environ[i]);
-+    ++i;
-+  }
-+  if (environ)
-+    g_free(environ);
-+  if (process_opts.argv_orig)
-+    free(process_opts.argv_orig);
-+#endif
-   g_process_remove_pidfile();
- }
- 
diff --git a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
index c172e4e74..4f8a3d077 100644
--- a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
+++ b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
@@ -10,21 +10,21 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
  configure.ac | 17 +++++++++++------
  1 file changed, 11 insertions(+), 6 deletions(-)
 
-Index: syslog-ng-3.8.1/configure.ac
+Index: syslog-ng-3.15.1/configure.ac
 ===================================================================
---- syslog-ng-3.8.1.orig/configure.ac
-+++ syslog-ng-3.8.1/configure.ac
-@@ -147,6 +147,9 @@ AC_ARG_ENABLE(gprof,
+--- syslog-ng-3.15.1.orig/configure.ac
++++ syslog-ng-3.15.1/configure.ac
+@@ -190,6 +190,9 @@ AC_ARG_ENABLE(gprof,
  AC_ARG_ENABLE(memtrace,
                [  --enable-memtrace   Enable alternative leak debugging code.])
  
 +AC_ARG_ENABLE(thread-tls,
-+              [  --enable-thread-tls        Enable Thread Transport Layer Security support.],,enable_thread_tls="no")
++              [  --enable-thread-tls        Enable Thread Local Storage support.],,enable_thread_tls="no")
 +
  AC_ARG_ENABLE(dynamic-linking,
                [  --enable-dynamic-linking        Link everything dynamically.],,enable_dynamic_linking="auto")
  
-@@ -486,12 +489,14 @@ dnl ************************************
+@@ -591,12 +594,14 @@ dnl ***************************************************************************
  dnl Is the __thread keyword available?
  dnl ***************************************************************************
  
@@ -33,14 +33,14 @@ Index: syslog-ng-3.8.1/configure.ac
 -__thread int a;
 -]],
 -[a=0;])],
--[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
+-[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
 +if test "x$enable_thread_tls" != "xno"; then
 +    AC_LINK_IFELSE([AC_LANG_PROGRAM(
 +    [[#include <pthread.h>
 +    __thread int a;
 +    ]],
 +    [a=0;])],
-+    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
++    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
 +fi
  
  dnl ***************************************************************************
diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
index 0c6f54355..fb183ee17 100644
--- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
+++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
@@ -1,4 +1,4 @@
-@version: 3.8
+@version: 3.15
 #
 # Syslog-ng configuration file, compatible with default Debian syslogd
 # installation. Originally written by anonymous (I can't find his name)
diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
index 6b30c20c1..dc2ba167a 100644
--- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
+++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
@@ -7,25 +7,39 @@ Subject: [PATCH] syslog-ng.service: the syslog-ng service can not start
 Upstream-Status: pending
 
 Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+Updated-by: Andrej Valek <andrej.valek@siemens.com>
 ---
  contrib/systemd/syslog-ng.service | 5 ++---
  1 file changed, 2 insertion(+), 3 deletions(-)
 
-diff --git a/contrib/systemd/syslog-ng.service b/contrib/systemd/syslog-ng.service
-index fc16f8d..8e09deb 100644
---- a/contrib/systemd/syslog-ng.service
-+++ b/contrib/systemd/syslog-ng.service
-@@ -4,8 +4,8 @@ Description=System Logger Daemon
- 
- [Service]
+diff --git a/contrib/systemd/syslog-ng@.service b/contrib/systemd/syslog-ng@.service
+index a28640e..93aec94 100644
+--- a/contrib/systemd/syslog-ng@.service
++++ b/contrib/systemd/syslog-ng@.service
+@@ -7,8 +7,8 @@ Conflicts=emergency.service emergency.target
  Type=notify
--ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS
+ EnvironmentFile=-/etc/default/syslog-ng@%i
+ EnvironmentFile=-/etc/sysconfig/syslog-ng@%i
+-ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
 -ExecReload=/bin/kill -HUP $MAINPID
-+ExecStart=@SBINDIR@/syslog-ng -F $SYSLOGNG_OPTS -p @LOCALSTATEDIR@/run/syslogd.pid
++ExecStart=@SBINDIR@/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
 +ExecReload=@BASEBINDIR@/kill -HUP $MAINPID
- EnvironmentFile=-/etc/default/syslog-ng
- EnvironmentFile=-/etc/sysconfig/syslog-ng
  StandardOutput=journal
+ StandardError=journal
+ Restart=on-failure
+diff --git a/contrib/systemd/syslog-ng@default b/contrib/systemd/syslog-ng@default
+index 02da288..3a8215d 100644
+--- a/contrib/systemd/syslog-ng@default
++++ b/contrib/systemd/syslog-ng@default
+@@ -1,5 +1,5 @@
+ CONFIG_FILE=/etc/syslog-ng.conf
+-PERSIST_FILE=/var/lib/syslog-ng/syslog-ng.persist
+-CONTROL_FILE=/var/lib/syslog-ng/syslog-ng.ctl
+-PID_FILE=/var/run/syslog-ng.pid
++PERSIST_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.persist
++CONTROL_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.ctl
++PID_FILE=@LOCALSTATEDIR@/run/syslog-ng.pid
+ OTHER_OPTIONS="--enable-core"
+
 -- 
 1.8.4.2
-
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
new file mode 100644
index 000000000..e6a214ced
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
@@ -0,0 +1,10 @@
+require syslog-ng.inc
+
+SRC_URI += " \
+    file://fix-config-libnet.patch \
+    file://fix-invalid-ownership.patch \
+    file://syslog-ng.service-the-syslog-ng-service.patch \
+"
+
+SRC_URI[md5sum] = "da59a65cd5e293ec0fa3d3ecf4984af9"
+SRC_URI[sha256sum] = "a2dabd28674e2b558e4fb92484ad111d77bf7150070aa28556827130b479f9ef"
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
deleted file mode 100644
index 91a0e4699..000000000
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-require syslog-ng.inc
-
-SRC_URI += " \
-    file://fix-config-libnet.patch \
-    file://fix-invalid-ownership.patch \
-    file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
-    file://syslog-ng.service-the-syslog-ng-service.patch \
-"
-
-SRC_URI[md5sum] = "acf14563cf5ce435db8db35486ce66af"
-SRC_URI[sha256sum] = "84b081f6e5f98cbc52052e342bcfdc5de5fe0ebe9f5ec32fe9eaec5759224cc5"
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [meta-oe][PATCH 3/3] net-snmp: add support for openssl 1.1x
  2018-06-07 13:21 [meta-oe][PATCH 0/3] Add OpenSSL 1.1 support Andrej Valek
  2018-06-07 13:21 ` [meta-oe][PATCH 1/3] thrift: add support for openssl 1.1x Andrej Valek
  2018-06-07 13:21 ` [meta-oe][PATCH 2/3] syslog-ng: update to 3.15.1 Andrej Valek
@ 2018-06-07 13:21 ` Andrej Valek
  2 siblings, 0 replies; 9+ messages in thread
From: Andrej Valek @ 2018-06-07 13:21 UTC (permalink / raw)
  To: openembedded-devel

Patch was copied from [https://sourceforge.net/p/net-snmp/patches/1336].

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
---
 .../net-snmp/fix-openssl-build-errors.patch        | 171 +++++++++++++++++++++
 .../recipes-protocols/net-snmp/net-snmp_5.7.3.bb   |   1 +
 2 files changed, 172 insertions(+)
 create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/fix-openssl-build-errors.patch

diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-openssl-build-errors.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-openssl-build-errors.patch
new file mode 100644
index 000000000..53bc37226
--- /dev/null
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-openssl-build-errors.patch
@@ -0,0 +1,171 @@
+net-snmp build fails on Debian 9 with OpenSSL 1.1.0
+
+With these changes, net-snmp builds with both
+OpenSSL 1.0.x and 1.1.x.
+
+Author: Sharmila Podury <sharmila.podury@brocade.com>
+
+--- a/apps/snmpusm.c
++++ b/apps/snmpusm.c
+@@ -125,6 +125,32 @@ char           *usmUserPublic_val = NULL
+ int             docreateandwait = 0;
+ 
+ 
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++
++#include <string.h>
++#include <openssl/engine.h>
++
++void DH_get0_pqg(const DH *dh,
++                const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
++{
++   if (p != NULL)
++       *p = dh->p;
++   if (q != NULL)
++       *q = dh->q;
++   if (g != NULL)
++       *g = dh->g;
++}
++
++void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)
++{
++   if (pub_key != NULL)
++       *pub_key = dh->pub_key;
++   if (priv_key != NULL)
++       *priv_key = dh->priv_key;
++}
++
++#endif
++
+ void
+ usage(void)
+ {
+@@ -190,7 +216,7 @@ get_USM_DH_key(netsnmp_variable_list *va
+                oid *keyoid, size_t keyoid_len) {
+     u_char *dhkeychange;
+     DH *dh;
+-    BIGNUM *other_pub;
++    BIGNUM *p, *g, *pub_key, *other_pub;
+     u_char *key;
+     size_t key_len;
+             
+@@ -205,25 +231,29 @@ get_USM_DH_key(netsnmp_variable_list *va
+         dh = d2i_DHparams(NULL, &cp, dhvar->val_len);
+     }
+ 
+-    if (!dh || !dh->g || !dh->p) {
++    if (dh)
++        DH_get0_pqg(dh, &p, NULL, &g);
++
++    if (!dh || !g || !p) {
+         SNMP_FREE(dhkeychange);
+         return SNMPERR_GENERR;
+     }
+ 
+-    DH_generate_key(dh);
+-    if (!dh->pub_key) {
++    if (!DH_generate_key(dh)) {
+         SNMP_FREE(dhkeychange);
+         return SNMPERR_GENERR;
+     }
+             
+-    if (vars->val_len != (unsigned int)BN_num_bytes(dh->pub_key)) {
++    DH_get0_key(dh, &pub_key, NULL);
++
++    if (vars->val_len != (unsigned int)BN_num_bytes(pub_key)) {
+         SNMP_FREE(dhkeychange);
+         fprintf(stderr,"incorrect diffie-helman lengths (%lu != %d)\n",
+-                (unsigned long)vars->val_len, BN_num_bytes(dh->pub_key));
++                (unsigned long)vars->val_len, BN_num_bytes(pub_key));
+         return SNMPERR_GENERR;
+     }
+ 
+-    BN_bn2bin(dh->pub_key, dhkeychange + vars->val_len);
++    BN_bn2bin(pub_key, dhkeychange + vars->val_len);
+ 
+     key_len = DH_size(dh);
+     if (!key_len) {
+--- a/configure.d/config_os_libs2
++++ b/configure.d/config_os_libs2
+@@ -327,10 +327,16 @@ if test "x$tryopenssl" != "xno" -a "x$tr
+              [[#include <openssl/evp.h>]])
+ 
+             AC_CHECK_LIB(${CRYPTO}, EVP_MD_CTX_create,
+-                AC_DEFINE([HAVE_EVP_MD_CTX_CREATE], [],
++                AC_DEFINE([HAVE_EVP_MD_CTX_CREATE], [1],
+                     [Define to 1 if you have the `EVP_MD_CTX_create' function.])
+-                AC_DEFINE([HAVE_EVP_MD_CTX_DESTROY], [],
++                AC_DEFINE([HAVE_EVP_MD_CTX_DESTROY], [1],
+                     [Define to 1 if you have the `EVP_MD_CTX_destroy' function.]))
++
++            AC_CHECK_LIB(${CRYPTO}, EVP_MD_CTX_new,
++                AC_DEFINE([HAVE_EVP_MD_CTX_NEW], [1],
++                    [Define to 1 if you have the `EVP_MD_CTX_new' function.])
++                AC_DEFINE([HAVE_EVP_MD_CTX_FREE], [1],
++                    [Define to 1 if you have the `EVP_MD_CTX_free' function.]))
+         fi
+         if echo " $transport_result_list " | $GREP "DTLS" > /dev/null; then
+ 	    AC_CHECK_LIB(ssl, DTLSv1_method,
+--- a/include/net-snmp/net-snmp-config.h.in
++++ b/include/net-snmp/net-snmp-config.h.in
+@@ -164,6 +164,12 @@
+ /* Define to 1 if you have the `EVP_MD_CTX_destroy' function. */
+ #undef HAVE_EVP_MD_CTX_DESTROY
+ 
++/* Define to 1 if you have the `EVP_MD_CTX_free' function. */
++#undef HAVE_EVP_MD_CTX_FREE
++
++/* Define to 1 if you have the `EVP_MD_CTX_new' function. */
++#undef HAVE_EVP_MD_CTX_NEW
++
+ /* Define if you have EVP_sha224/256 in openssl */
+ #undef HAVE_EVP_SHA224
+ 
+--- a/snmplib/keytools.c
++++ b/snmplib/keytools.c
+@@ -176,7 +176,9 @@ generate_Ku(const oid * hashtype, u_int
+         QUITFUN(SNMPERR_GENERR, generate_Ku_quit);
+     }
+ 
+-#ifdef HAVE_EVP_MD_CTX_CREATE
++#ifdef HAVE_EVP_MD_CTX_NEW
++    ctx = EVP_MD_CTX_new();
++#elif HAVE_EVP_MD_CTX_CREATE
+     ctx = EVP_MD_CTX_create();
+ #else
+     ctx = malloc(sizeof(*ctx));
+@@ -278,7 +280,9 @@ generate_Ku(const oid * hashtype, u_int
+     memset(buf, 0, sizeof(buf));
+ #ifdef NETSNMP_USE_OPENSSL
+     if (ctx) {
+-#ifdef HAVE_EVP_MD_CTX_DESTROY
++#ifdef HAVE_EVP_MD_CTX_FREE
++        EVP_MD_CTX_free(ctx);
++#elif HAVE_EVP_MD_CTX_DESTROY
+         EVP_MD_CTX_destroy(ctx);
+ #else
+         EVP_MD_CTX_cleanup(ctx);
+--- a/snmplib/scapi.c
++++ b/snmplib/scapi.c
+@@ -627,7 +627,9 @@ sc_hash(const oid * hashtype, size_t has
+         return SNMPERR_GENERR;
+ 
+ /** initialize the pointer */
+-#ifdef HAVE_EVP_MD_CTX_CREATE
++#ifdef HAVE_EVP_MD_CTX_NEW
++    cptr = EVP_MD_CTX_new();
++#elif HAVE_EVP_MD_CTX_CREATE
+     cptr = EVP_MD_CTX_create();
+ #else
+     cptr = malloc(sizeof(*cptr));
+@@ -648,7 +650,9 @@ sc_hash(const oid * hashtype, size_t has
+ /** do the final pass */
+     EVP_DigestFinal(cptr, MAC, &tmp_len);
+     *MAC_len = tmp_len;
+-#ifdef HAVE_EVP_MD_CTX_DESTROY
++#ifdef HAVE_EVP_MD_CTX_FREE
++    EVP_MD_CTX_free(cptr);
++#elif HAVE_EVP_MD_CTX_DESTROY
+     EVP_MD_CTX_destroy(cptr);
+ #else
+ #if !defined(OLD_DES)
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
index faf73a563..ef71c6181 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
@@ -33,6 +33,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \
            file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \
            file://net-snmp-fix-for-disable-des.patch \
            file://0001-Remove-U64-typedef.patch \
+           file://fix-openssl-build-errors.patch \
            "
 SRC_URI[md5sum] = "9f682bd70c717efdd9f15b686d07baee"
 SRC_URI[sha256sum] = "e8dfc79b6539b71a6ff335746ce63d2da2239062ad41872fff4354cafed07a3e"
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [meta-oe][PATCH v2] syslog-ng: update to 3.15.1
  2018-06-07 13:21 ` [meta-oe][PATCH 2/3] syslog-ng: update to 3.15.1 Andrej Valek
@ 2018-06-12 10:37   ` Andrej Valek
  2018-06-12 20:59     ` Khem Raj
  2018-06-14  7:37   ` [meta-oe][PATCH v3] " Andrej Valek
  1 sibling, 1 reply; 9+ messages in thread
From: Andrej Valek @ 2018-06-12 10:37 UTC (permalink / raw)
  To: openembedded-devel

 - Refresh and remove obsolete patches
 - Implement SystemD service files handling
  - splitted service into default
 - Remove dependency to eventlog
  - external libevtlog library linking was removed
 - Version 3.15.1 supports OpenSSL 1.1

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
---
 ...ry-leak-problem-when-HAVE_ENVIRON-defined.patch | 29 -----------------
 ...c-add-option-enable-thread-tls-to-manage-.patch | 16 ++++-----
 .../recipes-support/syslog-ng/files/syslog-ng.conf |  2 +-
 .../syslog-ng.service-the-syslog-ng-service.patch  | 38 +++++++++++++++-------
 meta-oe/recipes-support/syslog-ng/syslog-ng.inc    | 21 +++++++-----
 .../recipes-support/syslog-ng/syslog-ng_3.15.1.bb  | 10 ++++++
 .../recipes-support/syslog-ng/syslog-ng_3.8.1.bb   | 11 -------
 7 files changed, 58 insertions(+), 69 deletions(-)
 delete mode 100644 meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
 create mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
 delete mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb

diff --git a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch b/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
deleted file mode 100644
index 5d481f232..000000000
--- a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Fix the memory leak problem when HAVE_ENVIRON is defined
-
-Upstream-Status: Pending
-
-Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
----
-Index: syslog-ng-3.8.1/lib/gprocess.c
-===================================================================
---- syslog-ng-3.8.1.orig/lib/gprocess.c
-+++ syslog-ng-3.8.1/lib/gprocess.c
-@@ -1432,6 +1432,18 @@ g_process_startup_ok(void)
- void
- g_process_finish(void)
- {
-+#ifdef HAVE_ENVIRON
-+  int i = 0;
-+
-+  while (environ[i]) {
-+    g_free(environ[i]);
-+    ++i;
-+  }
-+  if (environ)
-+    g_free(environ);
-+  if (process_opts.argv_orig)
-+    free(process_opts.argv_orig);
-+#endif
-   g_process_remove_pidfile();
- }
- 
diff --git a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
index c172e4e74..4f8a3d077 100644
--- a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
+++ b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
@@ -10,21 +10,21 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
  configure.ac | 17 +++++++++++------
  1 file changed, 11 insertions(+), 6 deletions(-)
 
-Index: syslog-ng-3.8.1/configure.ac
+Index: syslog-ng-3.15.1/configure.ac
 ===================================================================
---- syslog-ng-3.8.1.orig/configure.ac
-+++ syslog-ng-3.8.1/configure.ac
-@@ -147,6 +147,9 @@ AC_ARG_ENABLE(gprof,
+--- syslog-ng-3.15.1.orig/configure.ac
++++ syslog-ng-3.15.1/configure.ac
+@@ -190,6 +190,9 @@ AC_ARG_ENABLE(gprof,
  AC_ARG_ENABLE(memtrace,
                [  --enable-memtrace   Enable alternative leak debugging code.])
  
 +AC_ARG_ENABLE(thread-tls,
-+              [  --enable-thread-tls        Enable Thread Transport Layer Security support.],,enable_thread_tls="no")
++              [  --enable-thread-tls        Enable Thread Local Storage support.],,enable_thread_tls="no")
 +
  AC_ARG_ENABLE(dynamic-linking,
                [  --enable-dynamic-linking        Link everything dynamically.],,enable_dynamic_linking="auto")
  
-@@ -486,12 +489,14 @@ dnl ************************************
+@@ -591,12 +594,14 @@ dnl ***************************************************************************
  dnl Is the __thread keyword available?
  dnl ***************************************************************************
  
@@ -33,14 +33,14 @@ Index: syslog-ng-3.8.1/configure.ac
 -__thread int a;
 -]],
 -[a=0;])],
--[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
+-[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
 +if test "x$enable_thread_tls" != "xno"; then
 +    AC_LINK_IFELSE([AC_LANG_PROGRAM(
 +    [[#include <pthread.h>
 +    __thread int a;
 +    ]],
 +    [a=0;])],
-+    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
++    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
 +fi
  
  dnl ***************************************************************************
diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
index 0c6f54355..fb183ee17 100644
--- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
+++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
@@ -1,4 +1,4 @@
-@version: 3.8
+@version: 3.15
 #
 # Syslog-ng configuration file, compatible with default Debian syslogd
 # installation. Originally written by anonymous (I can't find his name)
diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
index 6b30c20c1..dc2ba167a 100644
--- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
+++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
@@ -7,25 +7,39 @@ Subject: [PATCH] syslog-ng.service: the syslog-ng service can not start
 Upstream-Status: pending
 
 Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+Updated-by: Andrej Valek <andrej.valek@siemens.com>
 ---
  contrib/systemd/syslog-ng.service | 5 ++---
  1 file changed, 2 insertion(+), 3 deletions(-)
 
-diff --git a/contrib/systemd/syslog-ng.service b/contrib/systemd/syslog-ng.service
-index fc16f8d..8e09deb 100644
---- a/contrib/systemd/syslog-ng.service
-+++ b/contrib/systemd/syslog-ng.service
-@@ -4,8 +4,8 @@ Description=System Logger Daemon
- 
- [Service]
+diff --git a/contrib/systemd/syslog-ng@.service b/contrib/systemd/syslog-ng@.service
+index a28640e..93aec94 100644
+--- a/contrib/systemd/syslog-ng@.service
++++ b/contrib/systemd/syslog-ng@.service
+@@ -7,8 +7,8 @@ Conflicts=emergency.service emergency.target
  Type=notify
--ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS
+ EnvironmentFile=-/etc/default/syslog-ng@%i
+ EnvironmentFile=-/etc/sysconfig/syslog-ng@%i
+-ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
 -ExecReload=/bin/kill -HUP $MAINPID
-+ExecStart=@SBINDIR@/syslog-ng -F $SYSLOGNG_OPTS -p @LOCALSTATEDIR@/run/syslogd.pid
++ExecStart=@SBINDIR@/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
 +ExecReload=@BASEBINDIR@/kill -HUP $MAINPID
- EnvironmentFile=-/etc/default/syslog-ng
- EnvironmentFile=-/etc/sysconfig/syslog-ng
  StandardOutput=journal
+ StandardError=journal
+ Restart=on-failure
+diff --git a/contrib/systemd/syslog-ng@default b/contrib/systemd/syslog-ng@default
+index 02da288..3a8215d 100644
+--- a/contrib/systemd/syslog-ng@default
++++ b/contrib/systemd/syslog-ng@default
+@@ -1,5 +1,5 @@
+ CONFIG_FILE=/etc/syslog-ng.conf
+-PERSIST_FILE=/var/lib/syslog-ng/syslog-ng.persist
+-CONTROL_FILE=/var/lib/syslog-ng/syslog-ng.ctl
+-PID_FILE=/var/run/syslog-ng.pid
++PERSIST_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.persist
++CONTROL_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.ctl
++PID_FILE=@LOCALSTATEDIR@/run/syslog-ng.pid
+ OTHER_OPTIONS="--enable-core"
+
 -- 
 1.8.4.2
-
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
index 771cdb196..d8fd96282 100644
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
@@ -13,7 +13,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=24c0c5cb2c83d9f2ab725481e4df5240"
 
 # util-linux added to get libuuid
-DEPENDS = "libpcre flex eventlog glib-2.0 openssl util-linux"
+DEPENDS = "libpcre flex glib-2.0 openssl util-linux"
 
 SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \
            file://syslog-ng.conf \
@@ -67,12 +67,6 @@ do_configure_prepend() {
 	cd $olddir
 }
 
-do_install_prepend() {
-    sed -i -e 's,@SBINDIR@,${sbindir},g' ${S}/contrib/systemd/*.service
-    sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${S}/contrib/systemd/*.service
-    sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${S}/contrib/systemd/*.service
-}
-
 do_install_append() {
     install -d ${D}/${sysconfdir}/${BPN}
     install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf
@@ -83,6 +77,17 @@ do_install_append() {
     install -d ${D}/${localstatedir}/lib/${BPN}
     # Remove /var/run as it is created on startup
     rm -rf ${D}${localstatedir}/run
+
+    # support for systemd
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        install -d ${D}${systemd_unitdir}/system/
+        install -m 0644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
+        install -m 0644 ${S}/contrib/systemd/${BPN}@default ${D}${systemd_unitdir}/system/${BPN}@default
+
+        sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
+        sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
+        sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
+    fi
 }
 
 FILES_${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools"
@@ -108,7 +113,7 @@ RCONFLICTS_${PN} = "busybox-syslog sysklogd rsyslog"
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
 RCONFLICTS_${PN} += "${PN}-systemd"
-SYSTEMD_SERVICE_${PN} = "${BPN}.service"
+SYSTEMD_SERVICE_${PN} = "${BPN}@default ${BPN}@.service"
 
 INITSCRIPT_NAME = "syslog"
 INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
new file mode 100644
index 000000000..e6a214ced
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
@@ -0,0 +1,10 @@
+require syslog-ng.inc
+
+SRC_URI += " \
+    file://fix-config-libnet.patch \
+    file://fix-invalid-ownership.patch \
+    file://syslog-ng.service-the-syslog-ng-service.patch \
+"
+
+SRC_URI[md5sum] = "da59a65cd5e293ec0fa3d3ecf4984af9"
+SRC_URI[sha256sum] = "a2dabd28674e2b558e4fb92484ad111d77bf7150070aa28556827130b479f9ef"
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
deleted file mode 100644
index 91a0e4699..000000000
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-require syslog-ng.inc
-
-SRC_URI += " \
-    file://fix-config-libnet.patch \
-    file://fix-invalid-ownership.patch \
-    file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
-    file://syslog-ng.service-the-syslog-ng-service.patch \
-"
-
-SRC_URI[md5sum] = "acf14563cf5ce435db8db35486ce66af"
-SRC_URI[sha256sum] = "84b081f6e5f98cbc52052e342bcfdc5de5fe0ebe9f5ec32fe9eaec5759224cc5"
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [meta-oe][PATCH v2] syslog-ng: update to 3.15.1
  2018-06-12 10:37   ` [meta-oe][PATCH v2] " Andrej Valek
@ 2018-06-12 20:59     ` Khem Raj
  2018-06-13  8:56       ` Andrej Valek
  0 siblings, 1 reply; 9+ messages in thread
From: Khem Raj @ 2018-06-12 20:59 UTC (permalink / raw)
  To: Andrej Valek; +Cc: openembeded-devel

Fails to build with qemux86_64/musl

In file included from
/mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/limits.h:8,
                 from
/mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/lib/glib-2.0/include/glibconfig.h:11,
                 from
/mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/glib-2.0/glib/gtypes.h:32,
                 from
/mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/glib-2.0/glib/galloca.h:32,
                 from
/mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/glib-2.0/glib.h:30,
                 from ../syslog-ng-3.15.1/lib/compat/glib.h:31,
                 from
../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.h:27,
                 from
../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.c:31:
../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.c: In
function 'nondumpable_buffer_alloc':
../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.c:107:9:
error: expected identifier or '(' before numeric constant
   gsize PAGESIZE = sysconf(_SC_PAGE_SIZE);
         ^~~~~~~~
On Tue, Jun 12, 2018 at 3:38 AM Andrej Valek <andrej.valek@siemens.com> wrote:
>
>  - Refresh and remove obsolete patches
>  - Implement SystemD service files handling
>   - splitted service into default
>  - Remove dependency to eventlog
>   - external libevtlog library linking was removed
>  - Version 3.15.1 supports OpenSSL 1.1
>
> Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
> ---
>  ...ry-leak-problem-when-HAVE_ENVIRON-defined.patch | 29 -----------------
>  ...c-add-option-enable-thread-tls-to-manage-.patch | 16 ++++-----
>  .../recipes-support/syslog-ng/files/syslog-ng.conf |  2 +-
>  .../syslog-ng.service-the-syslog-ng-service.patch  | 38 +++++++++++++++-------
>  meta-oe/recipes-support/syslog-ng/syslog-ng.inc    | 21 +++++++-----
>  .../recipes-support/syslog-ng/syslog-ng_3.15.1.bb  | 10 ++++++
>  .../recipes-support/syslog-ng/syslog-ng_3.8.1.bb   | 11 -------
>  7 files changed, 58 insertions(+), 69 deletions(-)
>  delete mode 100644 meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
>  create mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
>  delete mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
>
> diff --git a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch b/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
> deleted file mode 100644
> index 5d481f232..000000000
> --- a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -Fix the memory leak problem when HAVE_ENVIRON is defined
> -
> -Upstream-Status: Pending
> -
> -Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
> ----
> -Index: syslog-ng-3.8.1/lib/gprocess.c
> -===================================================================
> ---- syslog-ng-3.8.1.orig/lib/gprocess.c
> -+++ syslog-ng-3.8.1/lib/gprocess.c
> -@@ -1432,6 +1432,18 @@ g_process_startup_ok(void)
> - void
> - g_process_finish(void)
> - {
> -+#ifdef HAVE_ENVIRON
> -+  int i = 0;
> -+
> -+  while (environ[i]) {
> -+    g_free(environ[i]);
> -+    ++i;
> -+  }
> -+  if (environ)
> -+    g_free(environ);
> -+  if (process_opts.argv_orig)
> -+    free(process_opts.argv_orig);
> -+#endif
> -   g_process_remove_pidfile();
> - }
> -
> diff --git a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
> index c172e4e74..4f8a3d077 100644
> --- a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
> +++ b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
> @@ -10,21 +10,21 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>   configure.ac | 17 +++++++++++------
>   1 file changed, 11 insertions(+), 6 deletions(-)
>
> -Index: syslog-ng-3.8.1/configure.ac
> +Index: syslog-ng-3.15.1/configure.ac
>  ===================================================================
> ---- syslog-ng-3.8.1.orig/configure.ac
> -+++ syslog-ng-3.8.1/configure.ac
> -@@ -147,6 +147,9 @@ AC_ARG_ENABLE(gprof,
> +--- syslog-ng-3.15.1.orig/configure.ac
> ++++ syslog-ng-3.15.1/configure.ac
> +@@ -190,6 +190,9 @@ AC_ARG_ENABLE(gprof,
>   AC_ARG_ENABLE(memtrace,
>                 [  --enable-memtrace   Enable alternative leak debugging code.])
>
>  +AC_ARG_ENABLE(thread-tls,
> -+              [  --enable-thread-tls        Enable Thread Transport Layer Security support.],,enable_thread_tls="no")
> ++              [  --enable-thread-tls        Enable Thread Local Storage support.],,enable_thread_tls="no")
>  +
>   AC_ARG_ENABLE(dynamic-linking,
>                 [  --enable-dynamic-linking        Link everything dynamically.],,enable_dynamic_linking="auto")
>
> -@@ -486,12 +489,14 @@ dnl ************************************
> +@@ -591,12 +594,14 @@ dnl ***************************************************************************
>   dnl Is the __thread keyword available?
>   dnl ***************************************************************************
>
> @@ -33,14 +33,14 @@ Index: syslog-ng-3.8.1/configure.ac
>  -__thread int a;
>  -]],
>  -[a=0;])],
> --[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
> +-[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
>  +if test "x$enable_thread_tls" != "xno"; then
>  +    AC_LINK_IFELSE([AC_LANG_PROGRAM(
>  +    [[#include <pthread.h>
>  +    __thread int a;
>  +    ]],
>  +    [a=0;])],
> -+    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
> ++    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
>  +fi
>
>   dnl ***************************************************************************
> diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
> index 0c6f54355..fb183ee17 100644
> --- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
> +++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
> @@ -1,4 +1,4 @@
> -@version: 3.8
> +@version: 3.15
>  #
>  # Syslog-ng configuration file, compatible with default Debian syslogd
>  # installation. Originally written by anonymous (I can't find his name)
> diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
> index 6b30c20c1..dc2ba167a 100644
> --- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
> +++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
> @@ -7,25 +7,39 @@ Subject: [PATCH] syslog-ng.service: the syslog-ng service can not start
>  Upstream-Status: pending
>
>  Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
> +Updated-by: Andrej Valek <andrej.valek@siemens.com>
>  ---
>   contrib/systemd/syslog-ng.service | 5 ++---
>   1 file changed, 2 insertion(+), 3 deletions(-)
>
> -diff --git a/contrib/systemd/syslog-ng.service b/contrib/systemd/syslog-ng.service
> -index fc16f8d..8e09deb 100644
> ---- a/contrib/systemd/syslog-ng.service
> -+++ b/contrib/systemd/syslog-ng.service
> -@@ -4,8 +4,8 @@ Description=System Logger Daemon
> -
> - [Service]
> +diff --git a/contrib/systemd/syslog-ng@.service b/contrib/systemd/syslog-ng@.service
> +index a28640e..93aec94 100644
> +--- a/contrib/systemd/syslog-ng@.service
> ++++ b/contrib/systemd/syslog-ng@.service
> +@@ -7,8 +7,8 @@ Conflicts=emergency.service emergency.target
>   Type=notify
> --ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS
> + EnvironmentFile=-/etc/default/syslog-ng@%i
> + EnvironmentFile=-/etc/sysconfig/syslog-ng@%i
> +-ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
>  -ExecReload=/bin/kill -HUP $MAINPID
> -+ExecStart=@SBINDIR@/syslog-ng -F $SYSLOGNG_OPTS -p @LOCALSTATEDIR@/run/syslogd.pid
> ++ExecStart=@SBINDIR@/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
>  +ExecReload=@BASEBINDIR@/kill -HUP $MAINPID
> - EnvironmentFile=-/etc/default/syslog-ng
> - EnvironmentFile=-/etc/sysconfig/syslog-ng
>   StandardOutput=journal
> + StandardError=journal
> + Restart=on-failure
> +diff --git a/contrib/systemd/syslog-ng@default b/contrib/systemd/syslog-ng@default
> +index 02da288..3a8215d 100644
> +--- a/contrib/systemd/syslog-ng@default
> ++++ b/contrib/systemd/syslog-ng@default
> +@@ -1,5 +1,5 @@
> + CONFIG_FILE=/etc/syslog-ng.conf
> +-PERSIST_FILE=/var/lib/syslog-ng/syslog-ng.persist
> +-CONTROL_FILE=/var/lib/syslog-ng/syslog-ng.ctl
> +-PID_FILE=/var/run/syslog-ng.pid
> ++PERSIST_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.persist
> ++CONTROL_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.ctl
> ++PID_FILE=@LOCALSTATEDIR@/run/syslog-ng.pid
> + OTHER_OPTIONS="--enable-core"
> +
>  --
>  1.8.4.2
> -
> diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
> index 771cdb196..d8fd96282 100644
> --- a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
> +++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
> @@ -13,7 +13,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=24c0c5cb2c83d9f2ab725481e4df5240"
>
>  # util-linux added to get libuuid
> -DEPENDS = "libpcre flex eventlog glib-2.0 openssl util-linux"
> +DEPENDS = "libpcre flex glib-2.0 openssl util-linux"
>
>  SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \
>             file://syslog-ng.conf \
> @@ -67,12 +67,6 @@ do_configure_prepend() {
>         cd $olddir
>  }
>
> -do_install_prepend() {
> -    sed -i -e 's,@SBINDIR@,${sbindir},g' ${S}/contrib/systemd/*.service
> -    sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${S}/contrib/systemd/*.service
> -    sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${S}/contrib/systemd/*.service
> -}
> -
>  do_install_append() {
>      install -d ${D}/${sysconfdir}/${BPN}
>      install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf
> @@ -83,6 +77,17 @@ do_install_append() {
>      install -d ${D}/${localstatedir}/lib/${BPN}
>      # Remove /var/run as it is created on startup
>      rm -rf ${D}${localstatedir}/run
> +
> +    # support for systemd
> +    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
> +        install -d ${D}${systemd_unitdir}/system/
> +        install -m 0644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
> +        install -m 0644 ${S}/contrib/systemd/${BPN}@default ${D}${systemd_unitdir}/system/${BPN}@default
> +
> +        sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
> +        sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
> +        sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
> +    fi
>  }
>
>  FILES_${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools"
> @@ -108,7 +113,7 @@ RCONFLICTS_${PN} = "busybox-syslog sysklogd rsyslog"
>  RPROVIDES_${PN} += "${PN}-systemd"
>  RREPLACES_${PN} += "${PN}-systemd"
>  RCONFLICTS_${PN} += "${PN}-systemd"
> -SYSTEMD_SERVICE_${PN} = "${BPN}.service"
> +SYSTEMD_SERVICE_${PN} = "${BPN}@default ${BPN}@.service"
>
>  INITSCRIPT_NAME = "syslog"
>  INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."
> diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
> new file mode 100644
> index 000000000..e6a214ced
> --- /dev/null
> +++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
> @@ -0,0 +1,10 @@
> +require syslog-ng.inc
> +
> +SRC_URI += " \
> +    file://fix-config-libnet.patch \
> +    file://fix-invalid-ownership.patch \
> +    file://syslog-ng.service-the-syslog-ng-service.patch \
> +"
> +
> +SRC_URI[md5sum] = "da59a65cd5e293ec0fa3d3ecf4984af9"
> +SRC_URI[sha256sum] = "a2dabd28674e2b558e4fb92484ad111d77bf7150070aa28556827130b479f9ef"
> diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
> deleted file mode 100644
> index 91a0e4699..000000000
> --- a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -require syslog-ng.inc
> -
> -SRC_URI += " \
> -    file://fix-config-libnet.patch \
> -    file://fix-invalid-ownership.patch \
> -    file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
> -    file://syslog-ng.service-the-syslog-ng-service.patch \
> -"
> -
> -SRC_URI[md5sum] = "acf14563cf5ce435db8db35486ce66af"
> -SRC_URI[sha256sum] = "84b081f6e5f98cbc52052e342bcfdc5de5fe0ebe9f5ec32fe9eaec5759224cc5"
> --
> 2.11.0
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [meta-oe][PATCH v2] syslog-ng: update to 3.15.1
  2018-06-12 20:59     ` Khem Raj
@ 2018-06-13  8:56       ` Andrej Valek
  2018-06-13 13:47         ` Khem Raj
  0 siblings, 1 reply; 9+ messages in thread
From: Andrej Valek @ 2018-06-13  8:56 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

Hi Khem,

I have tested it on glibc@qemuarm/x86 before posting. After posted this
error message, I have setup new build like this:

$ export MACHINE=qemux86-64 TCLIBC=musl
$ . oe-init-build-env
$ bitbake syslog-ng

It was compiled without any problems. libsecret-storage library was built.

How did you setup our build?

So, this error looks like that PAGESIZE is represented as constant. What
about change type to long? Maybe there is a problem with capitalization.

Regards,
Andrej

On 06/12/18 22:59, Khem Raj wrote:
> Fails to build with qemux86_64/musl
> 
> In file included from
> /mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/limits.h:8,
>                  from
> /mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/lib/glib-2.0/include/glibconfig.h:11,
>                  from
> /mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/glib-2.0/glib/gtypes.h:32,
>                  from
> /mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/glib-2.0/glib/galloca.h:32,
>                  from
> /mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/glib-2.0/glib.h:30,
>                  from ../syslog-ng-3.15.1/lib/compat/glib.h:31,
>                  from
> ../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.h:27,
>                  from
> ../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.c:31:
> ../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.c: In
> function 'nondumpable_buffer_alloc':
> ../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.c:107:9:
> error: expected identifier or '(' before numeric constant
>    gsize PAGESIZE = sysconf(_SC_PAGE_SIZE);
>          ^~~~~~~~
> On Tue, Jun 12, 2018 at 3:38 AM Andrej Valek <andrej.valek@siemens.com> wrote:
>>
>>  - Refresh and remove obsolete patches
>>  - Implement SystemD service files handling
>>   - splitted service into default
>>  - Remove dependency to eventlog
>>   - external libevtlog library linking was removed
>>  - Version 3.15.1 supports OpenSSL 1.1
>>
>> Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
>> ---
>>  ...ry-leak-problem-when-HAVE_ENVIRON-defined.patch | 29 -----------------
>>  ...c-add-option-enable-thread-tls-to-manage-.patch | 16 ++++-----
>>  .../recipes-support/syslog-ng/files/syslog-ng.conf |  2 +-
>>  .../syslog-ng.service-the-syslog-ng-service.patch  | 38 +++++++++++++++-------
>>  meta-oe/recipes-support/syslog-ng/syslog-ng.inc    | 21 +++++++-----
>>  .../recipes-support/syslog-ng/syslog-ng_3.15.1.bb  | 10 ++++++
>>  .../recipes-support/syslog-ng/syslog-ng_3.8.1.bb   | 11 -------
>>  7 files changed, 58 insertions(+), 69 deletions(-)
>>  delete mode 100644 meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
>>  create mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
>>  delete mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
>>
>> diff --git a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch b/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
>> deleted file mode 100644
>> index 5d481f232..000000000
>> --- a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
>> +++ /dev/null
>> @@ -1,29 +0,0 @@
>> -Fix the memory leak problem when HAVE_ENVIRON is defined
>> -
>> -Upstream-Status: Pending
>> -
>> -Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
>> ----
>> -Index: syslog-ng-3.8.1/lib/gprocess.c
>> -===================================================================
>> ---- syslog-ng-3.8.1.orig/lib/gprocess.c
>> -+++ syslog-ng-3.8.1/lib/gprocess.c
>> -@@ -1432,6 +1432,18 @@ g_process_startup_ok(void)
>> - void
>> - g_process_finish(void)
>> - {
>> -+#ifdef HAVE_ENVIRON
>> -+  int i = 0;
>> -+
>> -+  while (environ[i]) {
>> -+    g_free(environ[i]);
>> -+    ++i;
>> -+  }
>> -+  if (environ)
>> -+    g_free(environ);
>> -+  if (process_opts.argv_orig)
>> -+    free(process_opts.argv_orig);
>> -+#endif
>> -   g_process_remove_pidfile();
>> - }
>> -
>> diff --git a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
>> index c172e4e74..4f8a3d077 100644
>> --- a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
>> +++ b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
>> @@ -10,21 +10,21 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>>   configure.ac | 17 +++++++++++------
>>   1 file changed, 11 insertions(+), 6 deletions(-)
>>
>> -Index: syslog-ng-3.8.1/configure.ac
>> +Index: syslog-ng-3.15.1/configure.ac
>>  ===================================================================
>> ---- syslog-ng-3.8.1.orig/configure.ac
>> -+++ syslog-ng-3.8.1/configure.ac
>> -@@ -147,6 +147,9 @@ AC_ARG_ENABLE(gprof,
>> +--- syslog-ng-3.15.1.orig/configure.ac
>> ++++ syslog-ng-3.15.1/configure.ac
>> +@@ -190,6 +190,9 @@ AC_ARG_ENABLE(gprof,
>>   AC_ARG_ENABLE(memtrace,
>>                 [  --enable-memtrace   Enable alternative leak debugging code.])
>>
>>  +AC_ARG_ENABLE(thread-tls,
>> -+              [  --enable-thread-tls        Enable Thread Transport Layer Security support.],,enable_thread_tls="no")
>> ++              [  --enable-thread-tls        Enable Thread Local Storage support.],,enable_thread_tls="no")
>>  +
>>   AC_ARG_ENABLE(dynamic-linking,
>>                 [  --enable-dynamic-linking        Link everything dynamically.],,enable_dynamic_linking="auto")
>>
>> -@@ -486,12 +489,14 @@ dnl ************************************
>> +@@ -591,12 +594,14 @@ dnl ***************************************************************************
>>   dnl Is the __thread keyword available?
>>   dnl ***************************************************************************
>>
>> @@ -33,14 +33,14 @@ Index: syslog-ng-3.8.1/configure.ac
>>  -__thread int a;
>>  -]],
>>  -[a=0;])],
>> --[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
>> +-[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
>>  +if test "x$enable_thread_tls" != "xno"; then
>>  +    AC_LINK_IFELSE([AC_LANG_PROGRAM(
>>  +    [[#include <pthread.h>
>>  +    __thread int a;
>>  +    ]],
>>  +    [a=0;])],
>> -+    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
>> ++    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
>>  +fi
>>
>>   dnl ***************************************************************************
>> diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
>> index 0c6f54355..fb183ee17 100644
>> --- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
>> +++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
>> @@ -1,4 +1,4 @@
>> -@version: 3.8
>> +@version: 3.15
>>  #
>>  # Syslog-ng configuration file, compatible with default Debian syslogd
>>  # installation. Originally written by anonymous (I can't find his name)
>> diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
>> index 6b30c20c1..dc2ba167a 100644
>> --- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
>> +++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
>> @@ -7,25 +7,39 @@ Subject: [PATCH] syslog-ng.service: the syslog-ng service can not start
>>  Upstream-Status: pending
>>
>>  Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
>> +Updated-by: Andrej Valek <andrej.valek@siemens.com>
>>  ---
>>   contrib/systemd/syslog-ng.service | 5 ++---
>>   1 file changed, 2 insertion(+), 3 deletions(-)
>>
>> -diff --git a/contrib/systemd/syslog-ng.service b/contrib/systemd/syslog-ng.service
>> -index fc16f8d..8e09deb 100644
>> ---- a/contrib/systemd/syslog-ng.service
>> -+++ b/contrib/systemd/syslog-ng.service
>> -@@ -4,8 +4,8 @@ Description=System Logger Daemon
>> -
>> - [Service]
>> +diff --git a/contrib/systemd/syslog-ng@.service b/contrib/systemd/syslog-ng@.service
>> +index a28640e..93aec94 100644
>> +--- a/contrib/systemd/syslog-ng@.service
>> ++++ b/contrib/systemd/syslog-ng@.service
>> +@@ -7,8 +7,8 @@ Conflicts=emergency.service emergency.target
>>   Type=notify
>> --ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS
>> + EnvironmentFile=-/etc/default/syslog-ng@%i
>> + EnvironmentFile=-/etc/sysconfig/syslog-ng@%i
>> +-ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
>>  -ExecReload=/bin/kill -HUP $MAINPID
>> -+ExecStart=@SBINDIR@/syslog-ng -F $SYSLOGNG_OPTS -p @LOCALSTATEDIR@/run/syslogd.pid
>> ++ExecStart=@SBINDIR@/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
>>  +ExecReload=@BASEBINDIR@/kill -HUP $MAINPID
>> - EnvironmentFile=-/etc/default/syslog-ng
>> - EnvironmentFile=-/etc/sysconfig/syslog-ng
>>   StandardOutput=journal
>> + StandardError=journal
>> + Restart=on-failure
>> +diff --git a/contrib/systemd/syslog-ng@default b/contrib/systemd/syslog-ng@default
>> +index 02da288..3a8215d 100644
>> +--- a/contrib/systemd/syslog-ng@default
>> ++++ b/contrib/systemd/syslog-ng@default
>> +@@ -1,5 +1,5 @@
>> + CONFIG_FILE=/etc/syslog-ng.conf
>> +-PERSIST_FILE=/var/lib/syslog-ng/syslog-ng.persist
>> +-CONTROL_FILE=/var/lib/syslog-ng/syslog-ng.ctl
>> +-PID_FILE=/var/run/syslog-ng.pid
>> ++PERSIST_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.persist
>> ++CONTROL_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.ctl
>> ++PID_FILE=@LOCALSTATEDIR@/run/syslog-ng.pid
>> + OTHER_OPTIONS="--enable-core"
>> +
>>  --
>>  1.8.4.2
>> -
>> diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
>> index 771cdb196..d8fd96282 100644
>> --- a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
>> +++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
>> @@ -13,7 +13,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
>>  LIC_FILES_CHKSUM = "file://COPYING;md5=24c0c5cb2c83d9f2ab725481e4df5240"
>>
>>  # util-linux added to get libuuid
>> -DEPENDS = "libpcre flex eventlog glib-2.0 openssl util-linux"
>> +DEPENDS = "libpcre flex glib-2.0 openssl util-linux"
>>
>>  SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \
>>             file://syslog-ng.conf \
>> @@ -67,12 +67,6 @@ do_configure_prepend() {
>>         cd $olddir
>>  }
>>
>> -do_install_prepend() {
>> -    sed -i -e 's,@SBINDIR@,${sbindir},g' ${S}/contrib/systemd/*.service
>> -    sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${S}/contrib/systemd/*.service
>> -    sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${S}/contrib/systemd/*.service
>> -}
>> -
>>  do_install_append() {
>>      install -d ${D}/${sysconfdir}/${BPN}
>>      install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf
>> @@ -83,6 +77,17 @@ do_install_append() {
>>      install -d ${D}/${localstatedir}/lib/${BPN}
>>      # Remove /var/run as it is created on startup
>>      rm -rf ${D}${localstatedir}/run
>> +
>> +    # support for systemd
>> +    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
>> +        install -d ${D}${systemd_unitdir}/system/
>> +        install -m 0644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
>> +        install -m 0644 ${S}/contrib/systemd/${BPN}@default ${D}${systemd_unitdir}/system/${BPN}@default
>> +
>> +        sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
>> +        sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
>> +        sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
>> +    fi
>>  }
>>
>>  FILES_${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools"
>> @@ -108,7 +113,7 @@ RCONFLICTS_${PN} = "busybox-syslog sysklogd rsyslog"
>>  RPROVIDES_${PN} += "${PN}-systemd"
>>  RREPLACES_${PN} += "${PN}-systemd"
>>  RCONFLICTS_${PN} += "${PN}-systemd"
>> -SYSTEMD_SERVICE_${PN} = "${BPN}.service"
>> +SYSTEMD_SERVICE_${PN} = "${BPN}@default ${BPN}@.service"
>>
>>  INITSCRIPT_NAME = "syslog"
>>  INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."
>> diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
>> new file mode 100644
>> index 000000000..e6a214ced
>> --- /dev/null
>> +++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
>> @@ -0,0 +1,10 @@
>> +require syslog-ng.inc
>> +
>> +SRC_URI += " \
>> +    file://fix-config-libnet.patch \
>> +    file://fix-invalid-ownership.patch \
>> +    file://syslog-ng.service-the-syslog-ng-service.patch \
>> +"
>> +
>> +SRC_URI[md5sum] = "da59a65cd5e293ec0fa3d3ecf4984af9"
>> +SRC_URI[sha256sum] = "a2dabd28674e2b558e4fb92484ad111d77bf7150070aa28556827130b479f9ef"
>> diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
>> deleted file mode 100644
>> index 91a0e4699..000000000
>> --- a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
>> +++ /dev/null
>> @@ -1,11 +0,0 @@
>> -require syslog-ng.inc
>> -
>> -SRC_URI += " \
>> -    file://fix-config-libnet.patch \
>> -    file://fix-invalid-ownership.patch \
>> -    file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
>> -    file://syslog-ng.service-the-syslog-ng-service.patch \
>> -"
>> -
>> -SRC_URI[md5sum] = "acf14563cf5ce435db8db35486ce66af"
>> -SRC_URI[sha256sum] = "84b081f6e5f98cbc52052e342bcfdc5de5fe0ebe9f5ec32fe9eaec5759224cc5"
>> --
>> 2.11.0
>>
>> --
>> _______________________________________________
>> Openembedded-devel mailing list
>> Openembedded-devel@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [meta-oe][PATCH v2] syslog-ng: update to 3.15.1
  2018-06-13  8:56       ` Andrej Valek
@ 2018-06-13 13:47         ` Khem Raj
  0 siblings, 0 replies; 9+ messages in thread
From: Khem Raj @ 2018-06-13 13:47 UTC (permalink / raw)
  To: Andrej Valek; +Cc: openembeded-devel

Hi Andrej

On 6/13/18 1:56 AM, Andrej Valek wrote:
> Hi Khem,
> 
> I have tested it on glibc@qemuarm/x86 before posting. After posted this
> error message, I have setup new build like this:
> 
> $ export MACHINE=qemux86-64 TCLIBC=musl
> $ . oe-init-build-env
> $ bitbake syslog-ng
> 
> It was compiled without any problems. libsecret-storage library was built.
> 
> How did you setup our build?

Try to enable ptests as well. this is what I have in local.conf
DISTRO_FEATURES_append = " largefile opengl ptest multiarch wayland pam "

then try

$ TCLIBC=musl bitbake syslog-ng

> 
> So, this error looks like that PAGESIZE is represented as constant. What
> about change type to long? Maybe there is a problem with capitalization.
> 
> Regards,
> Andrej
> 
> On 06/12/18 22:59, Khem Raj wrote:
>> Fails to build with qemux86_64/musl
>>
>> In file included from
>> /mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/limits.h:8,
>>                   from
>> /mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/lib/glib-2.0/include/glibconfig.h:11,
>>                   from
>> /mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/glib-2.0/glib/gtypes.h:32,
>>                   from
>> /mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/glib-2.0/glib/galloca.h:32,
>>                   from
>> /mnt/a/oe/build/tmp/work/core2-64-bec-linux-musl/syslog-ng/3.15.1-r0/recipe-sysroot/usr/include/glib-2.0/glib.h:30,
>>                   from ../syslog-ng-3.15.1/lib/compat/glib.h:31,
>>                   from
>> ../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.h:27,
>>                   from
>> ../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.c:31:
>> ../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.c: In
>> function 'nondumpable_buffer_alloc':
>> ../syslog-ng-3.15.1/lib/secret-storage/nondumpable-allocator.c:107:9:
>> error: expected identifier or '(' before numeric constant
>>     gsize PAGESIZE = sysconf(_SC_PAGE_SIZE);
>>           ^~~~~~~~
>> On Tue, Jun 12, 2018 at 3:38 AM Andrej Valek <andrej.valek@siemens.com> wrote:
>>>
>>>   - Refresh and remove obsolete patches
>>>   - Implement SystemD service files handling
>>>    - splitted service into default
>>>   - Remove dependency to eventlog
>>>    - external libevtlog library linking was removed
>>>   - Version 3.15.1 supports OpenSSL 1.1
>>>
>>> Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
>>> ---
>>>   ...ry-leak-problem-when-HAVE_ENVIRON-defined.patch | 29 -----------------
>>>   ...c-add-option-enable-thread-tls-to-manage-.patch | 16 ++++-----
>>>   .../recipes-support/syslog-ng/files/syslog-ng.conf |  2 +-
>>>   .../syslog-ng.service-the-syslog-ng-service.patch  | 38 +++++++++++++++-------
>>>   meta-oe/recipes-support/syslog-ng/syslog-ng.inc    | 21 +++++++-----
>>>   .../recipes-support/syslog-ng/syslog-ng_3.15.1.bb  | 10 ++++++
>>>   .../recipes-support/syslog-ng/syslog-ng_3.8.1.bb   | 11 -------
>>>   7 files changed, 58 insertions(+), 69 deletions(-)
>>>   delete mode 100644 meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
>>>   create mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
>>>   delete mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
>>>
>>> diff --git a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch b/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
>>> deleted file mode 100644
>>> index 5d481f232..000000000
>>> --- a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
>>> +++ /dev/null
>>> @@ -1,29 +0,0 @@
>>> -Fix the memory leak problem when HAVE_ENVIRON is defined
>>> -
>>> -Upstream-Status: Pending
>>> -
>>> -Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
>>> ----
>>> -Index: syslog-ng-3.8.1/lib/gprocess.c
>>> -===================================================================
>>> ---- syslog-ng-3.8.1.orig/lib/gprocess.c
>>> -+++ syslog-ng-3.8.1/lib/gprocess.c
>>> -@@ -1432,6 +1432,18 @@ g_process_startup_ok(void)
>>> - void
>>> - g_process_finish(void)
>>> - {
>>> -+#ifdef HAVE_ENVIRON
>>> -+  int i = 0;
>>> -+
>>> -+  while (environ[i]) {
>>> -+    g_free(environ[i]);
>>> -+    ++i;
>>> -+  }
>>> -+  if (environ)
>>> -+    g_free(environ);
>>> -+  if (process_opts.argv_orig)
>>> -+    free(process_opts.argv_orig);
>>> -+#endif
>>> -   g_process_remove_pidfile();
>>> - }
>>> -
>>> diff --git a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
>>> index c172e4e74..4f8a3d077 100644
>>> --- a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
>>> +++ b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
>>> @@ -10,21 +10,21 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>>>    configure.ac | 17 +++++++++++------
>>>    1 file changed, 11 insertions(+), 6 deletions(-)
>>>
>>> -Index: syslog-ng-3.8.1/configure.ac
>>> +Index: syslog-ng-3.15.1/configure.ac
>>>   ===================================================================
>>> ---- syslog-ng-3.8.1.orig/configure.ac
>>> -+++ syslog-ng-3.8.1/configure.ac
>>> -@@ -147,6 +147,9 @@ AC_ARG_ENABLE(gprof,
>>> +--- syslog-ng-3.15.1.orig/configure.ac
>>> ++++ syslog-ng-3.15.1/configure.ac
>>> +@@ -190,6 +190,9 @@ AC_ARG_ENABLE(gprof,
>>>    AC_ARG_ENABLE(memtrace,
>>>                  [  --enable-memtrace   Enable alternative leak debugging code.])
>>>
>>>   +AC_ARG_ENABLE(thread-tls,
>>> -+              [  --enable-thread-tls        Enable Thread Transport Layer Security support.],,enable_thread_tls="no")
>>> ++              [  --enable-thread-tls        Enable Thread Local Storage support.],,enable_thread_tls="no")
>>>   +
>>>    AC_ARG_ENABLE(dynamic-linking,
>>>                  [  --enable-dynamic-linking        Link everything dynamically.],,enable_dynamic_linking="auto")
>>>
>>> -@@ -486,12 +489,14 @@ dnl ************************************
>>> +@@ -591,12 +594,14 @@ dnl ***************************************************************************
>>>    dnl Is the __thread keyword available?
>>>    dnl ***************************************************************************
>>>
>>> @@ -33,14 +33,14 @@ Index: syslog-ng-3.8.1/configure.ac
>>>   -__thread int a;
>>>   -]],
>>>   -[a=0;])],
>>> --[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
>>> +-[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
>>>   +if test "x$enable_thread_tls" != "xno"; then
>>>   +    AC_LINK_IFELSE([AC_LANG_PROGRAM(
>>>   +    [[#include <pthread.h>
>>>   +    __thread int a;
>>>   +    ]],
>>>   +    [a=0;])],
>>> -+    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
>>> ++    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
>>>   +fi
>>>
>>>    dnl ***************************************************************************
>>> diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
>>> index 0c6f54355..fb183ee17 100644
>>> --- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
>>> +++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
>>> @@ -1,4 +1,4 @@
>>> -@version: 3.8
>>> +@version: 3.15
>>>   #
>>>   # Syslog-ng configuration file, compatible with default Debian syslogd
>>>   # installation. Originally written by anonymous (I can't find his name)
>>> diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
>>> index 6b30c20c1..dc2ba167a 100644
>>> --- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
>>> +++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
>>> @@ -7,25 +7,39 @@ Subject: [PATCH] syslog-ng.service: the syslog-ng service can not start
>>>   Upstream-Status: pending
>>>
>>>   Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
>>> +Updated-by: Andrej Valek <andrej.valek@siemens.com>
>>>   ---
>>>    contrib/systemd/syslog-ng.service | 5 ++---
>>>    1 file changed, 2 insertion(+), 3 deletions(-)
>>>
>>> -diff --git a/contrib/systemd/syslog-ng.service b/contrib/systemd/syslog-ng.service
>>> -index fc16f8d..8e09deb 100644
>>> ---- a/contrib/systemd/syslog-ng.service
>>> -+++ b/contrib/systemd/syslog-ng.service
>>> -@@ -4,8 +4,8 @@ Description=System Logger Daemon
>>> -
>>> - [Service]
>>> +diff --git a/contrib/systemd/syslog-ng@.service b/contrib/systemd/syslog-ng@.service
>>> +index a28640e..93aec94 100644
>>> +--- a/contrib/systemd/syslog-ng@.service
>>> ++++ b/contrib/systemd/syslog-ng@.service
>>> +@@ -7,8 +7,8 @@ Conflicts=emergency.service emergency.target
>>>    Type=notify
>>> --ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS
>>> + EnvironmentFile=-/etc/default/syslog-ng@%i
>>> + EnvironmentFile=-/etc/sysconfig/syslog-ng@%i
>>> +-ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
>>>   -ExecReload=/bin/kill -HUP $MAINPID
>>> -+ExecStart=@SBINDIR@/syslog-ng -F $SYSLOGNG_OPTS -p @LOCALSTATEDIR@/run/syslogd.pid
>>> ++ExecStart=@SBINDIR@/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
>>>   +ExecReload=@BASEBINDIR@/kill -HUP $MAINPID
>>> - EnvironmentFile=-/etc/default/syslog-ng
>>> - EnvironmentFile=-/etc/sysconfig/syslog-ng
>>>    StandardOutput=journal
>>> + StandardError=journal
>>> + Restart=on-failure
>>> +diff --git a/contrib/systemd/syslog-ng@default b/contrib/systemd/syslog-ng@default
>>> +index 02da288..3a8215d 100644
>>> +--- a/contrib/systemd/syslog-ng@default
>>> ++++ b/contrib/systemd/syslog-ng@default
>>> +@@ -1,5 +1,5 @@
>>> + CONFIG_FILE=/etc/syslog-ng.conf
>>> +-PERSIST_FILE=/var/lib/syslog-ng/syslog-ng.persist
>>> +-CONTROL_FILE=/var/lib/syslog-ng/syslog-ng.ctl
>>> +-PID_FILE=/var/run/syslog-ng.pid
>>> ++PERSIST_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.persist
>>> ++CONTROL_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.ctl
>>> ++PID_FILE=@LOCALSTATEDIR@/run/syslog-ng.pid
>>> + OTHER_OPTIONS="--enable-core"
>>> +
>>>   --
>>>   1.8.4.2
>>> -
>>> diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
>>> index 771cdb196..d8fd96282 100644
>>> --- a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
>>> +++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
>>> @@ -13,7 +13,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
>>>   LIC_FILES_CHKSUM = "file://COPYING;md5=24c0c5cb2c83d9f2ab725481e4df5240"
>>>
>>>   # util-linux added to get libuuid
>>> -DEPENDS = "libpcre flex eventlog glib-2.0 openssl util-linux"
>>> +DEPENDS = "libpcre flex glib-2.0 openssl util-linux"
>>>
>>>   SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \
>>>              file://syslog-ng.conf \
>>> @@ -67,12 +67,6 @@ do_configure_prepend() {
>>>          cd $olddir
>>>   }
>>>
>>> -do_install_prepend() {
>>> -    sed -i -e 's,@SBINDIR@,${sbindir},g' ${S}/contrib/systemd/*.service
>>> -    sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${S}/contrib/systemd/*.service
>>> -    sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${S}/contrib/systemd/*.service
>>> -}
>>> -
>>>   do_install_append() {
>>>       install -d ${D}/${sysconfdir}/${BPN}
>>>       install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf
>>> @@ -83,6 +77,17 @@ do_install_append() {
>>>       install -d ${D}/${localstatedir}/lib/${BPN}
>>>       # Remove /var/run as it is created on startup
>>>       rm -rf ${D}${localstatedir}/run
>>> +
>>> +    # support for systemd
>>> +    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
>>> +        install -d ${D}${systemd_unitdir}/system/
>>> +        install -m 0644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
>>> +        install -m 0644 ${S}/contrib/systemd/${BPN}@default ${D}${systemd_unitdir}/system/${BPN}@default
>>> +
>>> +        sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
>>> +        sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
>>> +        sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
>>> +    fi
>>>   }
>>>
>>>   FILES_${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools"
>>> @@ -108,7 +113,7 @@ RCONFLICTS_${PN} = "busybox-syslog sysklogd rsyslog"
>>>   RPROVIDES_${PN} += "${PN}-systemd"
>>>   RREPLACES_${PN} += "${PN}-systemd"
>>>   RCONFLICTS_${PN} += "${PN}-systemd"
>>> -SYSTEMD_SERVICE_${PN} = "${BPN}.service"
>>> +SYSTEMD_SERVICE_${PN} = "${BPN}@default ${BPN}@.service"
>>>
>>>   INITSCRIPT_NAME = "syslog"
>>>   INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."
>>> diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
>>> new file mode 100644
>>> index 000000000..e6a214ced
>>> --- /dev/null
>>> +++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
>>> @@ -0,0 +1,10 @@
>>> +require syslog-ng.inc
>>> +
>>> +SRC_URI += " \
>>> +    file://fix-config-libnet.patch \
>>> +    file://fix-invalid-ownership.patch \
>>> +    file://syslog-ng.service-the-syslog-ng-service.patch \
>>> +"
>>> +
>>> +SRC_URI[md5sum] = "da59a65cd5e293ec0fa3d3ecf4984af9"
>>> +SRC_URI[sha256sum] = "a2dabd28674e2b558e4fb92484ad111d77bf7150070aa28556827130b479f9ef"
>>> diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
>>> deleted file mode 100644
>>> index 91a0e4699..000000000
>>> --- a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
>>> +++ /dev/null
>>> @@ -1,11 +0,0 @@
>>> -require syslog-ng.inc
>>> -
>>> -SRC_URI += " \
>>> -    file://fix-config-libnet.patch \
>>> -    file://fix-invalid-ownership.patch \
>>> -    file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
>>> -    file://syslog-ng.service-the-syslog-ng-service.patch \
>>> -"
>>> -
>>> -SRC_URI[md5sum] = "acf14563cf5ce435db8db35486ce66af"
>>> -SRC_URI[sha256sum] = "84b081f6e5f98cbc52052e342bcfdc5de5fe0ebe9f5ec32fe9eaec5759224cc5"
>>> --
>>> 2.11.0
>>>
>>> --
>>> _______________________________________________
>>> Openembedded-devel mailing list
>>> Openembedded-devel@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [meta-oe][PATCH v3] syslog-ng: update to 3.15.1
  2018-06-07 13:21 ` [meta-oe][PATCH 2/3] syslog-ng: update to 3.15.1 Andrej Valek
  2018-06-12 10:37   ` [meta-oe][PATCH v2] " Andrej Valek
@ 2018-06-14  7:37   ` Andrej Valek
  1 sibling, 0 replies; 9+ messages in thread
From: Andrej Valek @ 2018-06-14  7:37 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Marko Pater

 - Refresh and remove obsolete patches
 - Fix PAGESIZE variable conflicting
  - PAGESIZE is a define in some libc libraries
 - Implement SystemD service files handling
  - splitted service into default
 - Remove dependency to eventlog
  - external libevtlog library linking was removed
 - Version 3.15.1 supports OpenSSL 1.1

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Marko Pater <peter.marko@siemens.com>
---
 ...ry-leak-problem-when-HAVE_ENVIRON-defined.patch | 29 ---------
 ...c-add-option-enable-thread-tls-to-manage-.patch | 16 ++---
 .../rename-PAGESIZE-variables-to-pagesize.patch    | 72 ++++++++++++++++++++++
 .../recipes-support/syslog-ng/files/syslog-ng.conf |  2 +-
 .../syslog-ng.service-the-syslog-ng-service.patch  | 38 ++++++++----
 meta-oe/recipes-support/syslog-ng/syslog-ng.inc    | 21 ++++---
 .../recipes-support/syslog-ng/syslog-ng_3.15.1.bb  | 11 ++++
 .../recipes-support/syslog-ng/syslog-ng_3.8.1.bb   | 11 ----
 8 files changed, 131 insertions(+), 69 deletions(-)
 delete mode 100644 meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
 create mode 100644 meta-oe/recipes-support/syslog-ng/files/rename-PAGESIZE-variables-to-pagesize.patch
 create mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
 delete mode 100644 meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb

diff --git a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch b/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
deleted file mode 100644
index 5d481f232..000000000
--- a/meta-oe/recipes-support/syslog-ng/files/Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Fix the memory leak problem when HAVE_ENVIRON is defined
-
-Upstream-Status: Pending
-
-Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
----
-Index: syslog-ng-3.8.1/lib/gprocess.c
-===================================================================
---- syslog-ng-3.8.1.orig/lib/gprocess.c
-+++ syslog-ng-3.8.1/lib/gprocess.c
-@@ -1432,6 +1432,18 @@ g_process_startup_ok(void)
- void
- g_process_finish(void)
- {
-+#ifdef HAVE_ENVIRON
-+  int i = 0;
-+
-+  while (environ[i]) {
-+    g_free(environ[i]);
-+    ++i;
-+  }
-+  if (environ)
-+    g_free(environ);
-+  if (process_opts.argv_orig)
-+    free(process_opts.argv_orig);
-+#endif
-   g_process_remove_pidfile();
- }
- 
diff --git a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
index c172e4e74..4f8a3d077 100644
--- a/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
+++ b/meta-oe/recipes-support/syslog-ng/files/configure.ac-add-option-enable-thread-tls-to-manage-.patch
@@ -10,21 +10,21 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
  configure.ac | 17 +++++++++++------
  1 file changed, 11 insertions(+), 6 deletions(-)
 
-Index: syslog-ng-3.8.1/configure.ac
+Index: syslog-ng-3.15.1/configure.ac
 ===================================================================
---- syslog-ng-3.8.1.orig/configure.ac
-+++ syslog-ng-3.8.1/configure.ac
-@@ -147,6 +147,9 @@ AC_ARG_ENABLE(gprof,
+--- syslog-ng-3.15.1.orig/configure.ac
++++ syslog-ng-3.15.1/configure.ac
+@@ -190,6 +190,9 @@ AC_ARG_ENABLE(gprof,
  AC_ARG_ENABLE(memtrace,
                [  --enable-memtrace   Enable alternative leak debugging code.])
  
 +AC_ARG_ENABLE(thread-tls,
-+              [  --enable-thread-tls        Enable Thread Transport Layer Security support.],,enable_thread_tls="no")
++              [  --enable-thread-tls        Enable Thread Local Storage support.],,enable_thread_tls="no")
 +
  AC_ARG_ENABLE(dynamic-linking,
                [  --enable-dynamic-linking        Link everything dynamically.],,enable_dynamic_linking="auto")
  
-@@ -486,12 +489,14 @@ dnl ************************************
+@@ -591,12 +594,14 @@ dnl ***************************************************************************
  dnl Is the __thread keyword available?
  dnl ***************************************************************************
  
@@ -33,14 +33,14 @@ Index: syslog-ng-3.8.1/configure.ac
 -__thread int a;
 -]],
 -[a=0;])],
--[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
+-[ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
 +if test "x$enable_thread_tls" != "xno"; then
 +    AC_LINK_IFELSE([AC_LANG_PROGRAM(
 +    [[#include <pthread.h>
 +    __thread int a;
 +    ]],
 +    [a=0;])],
-+    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Transport Layer Security is supported by the system")])
++    [ac_cv_have_tls=yes; AC_DEFINE_UNQUOTED(HAVE_THREAD_KEYWORD, 1, "Whether Thread Local Storage is supported by the system")])
 +fi
  
  dnl ***************************************************************************
diff --git a/meta-oe/recipes-support/syslog-ng/files/rename-PAGESIZE-variables-to-pagesize.patch b/meta-oe/recipes-support/syslog-ng/files/rename-PAGESIZE-variables-to-pagesize.patch
new file mode 100644
index 000000000..56ffb4a06
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/files/rename-PAGESIZE-variables-to-pagesize.patch
@@ -0,0 +1,72 @@
+From 29f0de401b9df056c7eeb47a025c341654ca579d Mon Sep 17 00:00:00 2001
+From: Andrej Valek <andrej.valek@siemens.com>
+Date: Thu, 14 Jun 2018 08:54:14 +0200
+Subject: [PATCH] secret-storage: rename PAGESIZE variables to pagesize
+
+PAGESIZE is a define in some libc libraries, which conflicts with these
+local variables.
+
+Upstream-Status: Submitted [https://github.com/balabit/syslog-ng/pull/2111]
+
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+Signed-off-by: Marko Peter <peter.marko@siemens.com>
+---
+ lib/secret-storage/nondumpable-allocator.c            | 4 ++--
+ lib/secret-storage/tests/test_nondumpable_allocator.c | 6 +++---
+ lib/secret-storage/tests/test_secret_storage.c        | 4 ++--
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/lib/secret-storage/nondumpable-allocator.c b/lib/secret-storage/nondumpable-allocator.c
+index 07d94fbb0..314ce571f 100644
+--- a/lib/secret-storage/nondumpable-allocator.c
++++ b/lib/secret-storage/nondumpable-allocator.c
+@@ -104,8 +104,8 @@ gpointer
+ nondumpable_buffer_alloc(gsize len)
+ {
+   gsize minimum_size = len + ALLOCATION_HEADER_SIZE;
+-  gsize PAGESIZE = sysconf(_SC_PAGE_SIZE);
+-  gsize alloc_size = round_to_nearest(minimum_size, PAGESIZE);
++  gsize pagesize = sysconf(_SC_PAGE_SIZE);
++  gsize alloc_size = round_to_nearest(minimum_size, pagesize);
+ 
+   Allocation *buffer = _mmap(alloc_size);
+   if (!buffer)
+diff --git a/lib/secret-storage/tests/test_nondumpable_allocator.c b/lib/secret-storage/tests/test_nondumpable_allocator.c
+index 6ef5b3035..a20b287ff 100644
+--- a/lib/secret-storage/tests/test_nondumpable_allocator.c
++++ b/lib/secret-storage/tests/test_nondumpable_allocator.c
+@@ -34,10 +34,10 @@ Test(nondumpableallocator, malloc_realloc_free)
+   strcpy(buffer, test_string);
+   cr_assert_str_eq(buffer, test_string);
+ 
+-  const gsize PAGESIZE = sysconf(_SC_PAGE_SIZE);
+-  gpointer buffer_realloc = nondumpable_buffer_realloc(buffer, 2*PAGESIZE);
++  const gsize pagesize = sysconf(_SC_PAGE_SIZE);
++  gpointer buffer_realloc = nondumpable_buffer_realloc(buffer, 2*pagesize);
+   cr_assert_str_eq(buffer_realloc, test_string);
+-  ((gchar *)buffer_realloc)[2*PAGESIZE] = 'a';
++  ((gchar *)buffer_realloc)[2*pagesize] = 'a';
+ 
+   nondumpable_buffer_free(buffer_realloc);
+ }
+diff --git a/lib/secret-storage/tests/test_secret_storage.c b/lib/secret-storage/tests/test_secret_storage.c
+index 5297d4f60..89122cada 100644
+--- a/lib/secret-storage/tests/test_secret_storage.c
++++ b/lib/secret-storage/tests/test_secret_storage.c
+@@ -263,11 +263,11 @@ Test(secretstorage, test_rlimit)
+   cr_assert(!getrlimit(RLIMIT_MEMLOCK, &locked_limit));
+   locked_limit.rlim_cur = MIN(locked_limit.rlim_max, 64 * 1024);
+   cr_assert(!setrlimit(RLIMIT_MEMLOCK, &locked_limit));
+-  const gsize PAGESIZE = sysconf(_SC_PAGE_SIZE);
++  const gsize pagesize = sysconf(_SC_PAGE_SIZE);
+ 
+   gchar *key_fmt = g_strdup("keyXXX");
+   int i = 0;
+-  int for_limit = locked_limit.rlim_cur/PAGESIZE;
++  int for_limit = locked_limit.rlim_cur/pagesize;
+   for (; i < for_limit; i++)
+     {
+       sprintf(key_fmt, "key%03d", i);
+-- 
+2.11.0
+
diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
index 0c6f54355..fb183ee17 100644
--- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
+++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.conf
@@ -1,4 +1,4 @@
-@version: 3.8
+@version: 3.15
 #
 # Syslog-ng configuration file, compatible with default Debian syslogd
 # installation. Originally written by anonymous (I can't find his name)
diff --git a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
index 6b30c20c1..dc2ba167a 100644
--- a/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
+++ b/meta-oe/recipes-support/syslog-ng/files/syslog-ng.service-the-syslog-ng-service.patch
@@ -7,25 +7,39 @@ Subject: [PATCH] syslog-ng.service: the syslog-ng service can not start
 Upstream-Status: pending
 
 Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+Updated-by: Andrej Valek <andrej.valek@siemens.com>
 ---
  contrib/systemd/syslog-ng.service | 5 ++---
  1 file changed, 2 insertion(+), 3 deletions(-)
 
-diff --git a/contrib/systemd/syslog-ng.service b/contrib/systemd/syslog-ng.service
-index fc16f8d..8e09deb 100644
---- a/contrib/systemd/syslog-ng.service
-+++ b/contrib/systemd/syslog-ng.service
-@@ -4,8 +4,8 @@ Description=System Logger Daemon
- 
- [Service]
+diff --git a/contrib/systemd/syslog-ng@.service b/contrib/systemd/syslog-ng@.service
+index a28640e..93aec94 100644
+--- a/contrib/systemd/syslog-ng@.service
++++ b/contrib/systemd/syslog-ng@.service
+@@ -7,8 +7,8 @@ Conflicts=emergency.service emergency.target
  Type=notify
--ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS
+ EnvironmentFile=-/etc/default/syslog-ng@%i
+ EnvironmentFile=-/etc/sysconfig/syslog-ng@%i
+-ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
 -ExecReload=/bin/kill -HUP $MAINPID
-+ExecStart=@SBINDIR@/syslog-ng -F $SYSLOGNG_OPTS -p @LOCALSTATEDIR@/run/syslogd.pid
++ExecStart=@SBINDIR@/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
 +ExecReload=@BASEBINDIR@/kill -HUP $MAINPID
- EnvironmentFile=-/etc/default/syslog-ng
- EnvironmentFile=-/etc/sysconfig/syslog-ng
  StandardOutput=journal
+ StandardError=journal
+ Restart=on-failure
+diff --git a/contrib/systemd/syslog-ng@default b/contrib/systemd/syslog-ng@default
+index 02da288..3a8215d 100644
+--- a/contrib/systemd/syslog-ng@default
++++ b/contrib/systemd/syslog-ng@default
+@@ -1,5 +1,5 @@
+ CONFIG_FILE=/etc/syslog-ng.conf
+-PERSIST_FILE=/var/lib/syslog-ng/syslog-ng.persist
+-CONTROL_FILE=/var/lib/syslog-ng/syslog-ng.ctl
+-PID_FILE=/var/run/syslog-ng.pid
++PERSIST_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.persist
++CONTROL_FILE=@LOCALSTATEDIR@/lib/syslog-ng/syslog-ng.ctl
++PID_FILE=@LOCALSTATEDIR@/run/syslog-ng.pid
+ OTHER_OPTIONS="--enable-core"
+
 -- 
 1.8.4.2
-
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
index 771cdb196..d8fd96282 100644
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
@@ -13,7 +13,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=24c0c5cb2c83d9f2ab725481e4df5240"
 
 # util-linux added to get libuuid
-DEPENDS = "libpcre flex eventlog glib-2.0 openssl util-linux"
+DEPENDS = "libpcre flex glib-2.0 openssl util-linux"
 
 SRC_URI = "https://github.com/balabit/syslog-ng/releases/download/${BP}/${BP}.tar.gz \
            file://syslog-ng.conf \
@@ -67,12 +67,6 @@ do_configure_prepend() {
 	cd $olddir
 }
 
-do_install_prepend() {
-    sed -i -e 's,@SBINDIR@,${sbindir},g' ${S}/contrib/systemd/*.service
-    sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${S}/contrib/systemd/*.service
-    sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${S}/contrib/systemd/*.service
-}
-
 do_install_append() {
     install -d ${D}/${sysconfdir}/${BPN}
     install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${BPN}/${BPN}.conf
@@ -83,6 +77,17 @@ do_install_append() {
     install -d ${D}/${localstatedir}/lib/${BPN}
     # Remove /var/run as it is created on startup
     rm -rf ${D}${localstatedir}/run
+
+    # support for systemd
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        install -d ${D}${systemd_unitdir}/system/
+        install -m 0644 ${S}/contrib/systemd/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@.service
+        install -m 0644 ${S}/contrib/systemd/${BPN}@default ${D}${systemd_unitdir}/system/${BPN}@default
+
+        sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
+        sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
+        sed -i -e 's,@BASEBINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/${BPN}@.service ${D}${systemd_unitdir}/system/${BPN}@default
+    fi
 }
 
 FILES_${PN} += "${datadir}/include/scl/ ${datadir}/xsd ${datadir}/tools"
@@ -108,7 +113,7 @@ RCONFLICTS_${PN} = "busybox-syslog sysklogd rsyslog"
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
 RCONFLICTS_${PN} += "${PN}-systemd"
-SYSTEMD_SERVICE_${PN} = "${BPN}.service"
+SYSTEMD_SERVICE_${PN} = "${BPN}@default ${BPN}@.service"
 
 INITSCRIPT_NAME = "syslog"
 INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
new file mode 100644
index 000000000..6d48cc331
--- /dev/null
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.15.1.bb
@@ -0,0 +1,11 @@
+require syslog-ng.inc
+
+SRC_URI += " \
+    file://fix-config-libnet.patch \
+    file://fix-invalid-ownership.patch \
+    file://syslog-ng.service-the-syslog-ng-service.patch \
+    file://rename-PAGESIZE-variables-to-pagesize.patch \
+"
+
+SRC_URI[md5sum] = "da59a65cd5e293ec0fa3d3ecf4984af9"
+SRC_URI[sha256sum] = "a2dabd28674e2b558e4fb92484ad111d77bf7150070aa28556827130b479f9ef"
diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb b/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
deleted file mode 100644
index 91a0e4699..000000000
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng_3.8.1.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-require syslog-ng.inc
-
-SRC_URI += " \
-    file://fix-config-libnet.patch \
-    file://fix-invalid-ownership.patch \
-    file://Fix-the-memory-leak-problem-when-HAVE_ENVIRON-defined.patch \
-    file://syslog-ng.service-the-syslog-ng-service.patch \
-"
-
-SRC_URI[md5sum] = "acf14563cf5ce435db8db35486ce66af"
-SRC_URI[sha256sum] = "84b081f6e5f98cbc52052e342bcfdc5de5fe0ebe9f5ec32fe9eaec5759224cc5"
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-06-14  7:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-07 13:21 [meta-oe][PATCH 0/3] Add OpenSSL 1.1 support Andrej Valek
2018-06-07 13:21 ` [meta-oe][PATCH 1/3] thrift: add support for openssl 1.1x Andrej Valek
2018-06-07 13:21 ` [meta-oe][PATCH 2/3] syslog-ng: update to 3.15.1 Andrej Valek
2018-06-12 10:37   ` [meta-oe][PATCH v2] " Andrej Valek
2018-06-12 20:59     ` Khem Raj
2018-06-13  8:56       ` Andrej Valek
2018-06-13 13:47         ` Khem Raj
2018-06-14  7:37   ` [meta-oe][PATCH v3] " Andrej Valek
2018-06-07 13:21 ` [meta-oe][PATCH 3/3] net-snmp: add support for openssl 1.1x Andrej Valek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.