Skip to contentSkip to conversation

dlt-daemon: fix wrong CONFIGURATION_FILES_DIR

PATCH New Changqing Li 1 participant 2 messages Apr 10

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dlt-daemon: fix wrong CONFIGURATION_FILES_DIR

The not aligned value of CONFIGURATION_FILES_DIR makes the configuration file install path is different with the default configuration file path from where the application to read, then make the service dlt/dlt-system not works well.

---
 ...make-CONFIGURATION_FILES_DIR-aligned.patch | 42 +++++++++++++++++++
 .../dlt-daemon/dlt-daemon_3.0.0.bb            |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0001-CMakeLists.txt-make-CONFIGURATION_FILES_DIR-aligned.patch
meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0001-CMakeLists.txt-make-CONFIGURATION_FILES_DIR-aligned.patch new file +42 -0
new file mode 100644
index 0000000000..2d51253e69
@@ -0,0 +1,42 @@
+From bad5d689a69dca3d1dc3e7653946f1205661afbf Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Fri, 10 Apr 2026 13:25:39 +0800
+Subject: [PATCH 1/2] CMakeLists.txt: make CONFIGURATION_FILES_DIR aligned
+
+Commit [723e90e dlt: Adaptation for QNX build system with SDP 7.x
+(#609)], refer [1], make CONFIGURATION_FILES_DIR not aligned.  the CMake
+variable CONFIGURATION_FILES_DIR set to CMAKE_INSTALL_SYSCONFDIR, but
+the tell the compiler to define macro CONFIGURATION_FILES_DIR as
+${CMAKE_INSTALL_PREFIX}/${CONFIGURATION_FILES_DIR}.
+
+At least for linux, this will cause failure of the systemd service. Eg:
+if CMAKE_INSTALL_PREFIX is /usr, then the configuration file is
+installed under ${CONFIGURATION_FILES_DIR}, usually is /etc. But the
+application like dlt-daemon/dlt-system will find the default
+configuration file under /usr/etc. This makes service start failed.
+
+[1] https://github.com/COVESA/dlt-daemon/commit/723e90e77db91130375238a592b9a292302a32bb
+
+Upstream-Status: Submitted [https://github.com/COVESA/dlt-daemon/issues/848]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bb9250f..821730a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -289,7 +289,7 @@ endif()
+ 
+ set(CONFIGURATION_FILES_DIR ${CMAKE_INSTALL_SYSCONFDIR})
+ 
+-add_definitions(-DCONFIGURATION_FILES_DIR="${CMAKE_INSTALL_PREFIX}/${CONFIGURATION_FILES_DIR}")
++add_definitions(-DCONFIGURATION_FILES_DIR="${CONFIGURATION_FILES_DIR}")
+ 
+ add_subdirectory(cmake)
+ 
+-- 
+2.34.1
+
meta-oe/recipes-extended/dlt-daemon/dlt-daemon_3.0.0.bb +1 -0
index 431e9f3067..609566a1b3 100644
@@ -22,6 +22,7 @@ SRC_URI = "git://github.com/COVESA/${BPN}.git;protocol=https;branch=master \
            file://0001-Fix-build-failures.patch \
            file://0001-fix-build-failure-when-systemd-is-enabled.patch \
            file://0001-Fix-build-failure-with-glibc-2.43.patch \
+           file://0001-CMakeLists.txt-make-CONFIGURATION_FILES_DIR-aligned.patch \
            "
 SRCREV = "f595ea29d1007ca1c3b2d1fd3a88adf7d3db6320"
 
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 dlt-daemon: disable DLT_USE_IPv6

There is a bug when DLT_USE_IPv6 enabled, refer [1]. This make dlt-adaptor-udp.service startup failed with error "Bind: Invalid argument". Disable DLT_USE_IPv6 to workaround the issue

[1] https://github.com/COVESA/dlt-daemon/issues/849

---
 ...ix-build-failure-when-systemd-is-enabled.patch | 15 ++++++++++-----
 .../dlt-daemon/dlt-daemon_3.0.0.bb                |  2 +-
 2 files changed, 11 insertions(+), 6 deletions(-)
meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0001-fix-build-failure-when-systemd-is-enabled.patch +10 -5
index d19a23cd9c..b1ba08a7d3 100644
@@ -1,4 +1,4 @@
-From 28322f951bb8510ddb4cf767426a67c81ce826ab Mon Sep 17 00:00:00 2001
+From 6a95cc20d3c5adfc5c16f269f6dca9f7e2305b4e Mon Sep 17 00:00:00 2001
 From: Changqing Li <[email protected]>
 Date: Tue, 17 Mar 2026 13:04:11 +0800
 Subject: [PATCH] fix build failure when systemd is enabled
@@ -42,10 +42,10 @@ Signed-off-by: Changqing Li <[email protected]>
  src/system/dlt-system-logfile.c          |  4 +--
  src/system/dlt-system-process-handling.c |  2 +-
  src/system/dlt-system-processes.c        |  2 +-
- src/system/dlt-system-syslog.c           |  6 ++--
+ src/system/dlt-system-syslog.c           |  8 ++---
  src/system/dlt-system-watchdog.c         |  8 ++---
  systemd/3rdparty/sd-daemon.c             |  5 +--
- 10 files changed, 40 insertions(+), 42 deletions(-)
+ 10 files changed, 41 insertions(+), 43 deletions(-)
 
 diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c
 index ef42f89..8c318a4 100644
@@ -329,10 +329,10 @@ index c35596c..b17b8ee 100644
  
      /* go through all process files in directory */
 diff --git a/src/system/dlt-system-syslog.c b/src/system/dlt-system-syslog.c
-index 59e9d3f..d6b1b8a 100644
+index 59e9d3f..f0bf3dc 100644
 --- a/src/system/dlt-system-syslog.c
 +++ b/src/system/dlt-system-syslog.c
-@@ -88,7 +88,7 @@ int init_socket(SyslogOptions opts)
+@@ -88,11 +88,11 @@ int init_socket(SyslogOptions opts)
  #ifdef DLT_USE_IPv6
      syslog_addr.sin6_family = AF_INET6;
      syslog_addr.sin6_addr = in6addr_any;
@@ -341,6 +341,11 @@ index 59e9d3f..d6b1b8a 100644
  #else
      syslog_addr.sin_family = AF_INET;
      syslog_addr.sin_addr.s_addr = INADDR_ANY;
+-    syslog_addr.sin_port = htons(opts.Port);
++    syslog_addr.sin_port = htons((uint16_t)opts.Port);
+     memset(&(syslog_addr.sin_zero), 0, 8);
+ #endif
+ 
 @@ -117,7 +117,7 @@ int read_socket(int sock)
      struct sockaddr_in client_addr;
      socklen_t addr_len = sizeof(struct sockaddr_in);
meta-oe/recipes-extended/dlt-daemon/dlt-daemon_3.0.0.bb +1 -1
index 609566a1b3..1c15ef0483 100644
@@ -54,7 +54,7 @@ inherit autotools gettext cmake pkgconfig systemd
 
 # -DWITH_DLT_COREDUMPHANDLER=ON this feature is too experimental, disable for now
 #FILES:${PN} += "${libdir}/sysctl.d"
-EXTRA_OECMAKE += "-DWITH_DLT_LOGSTORAGE_GZIP=ON -DWITH_EXTENDED_FILTERING=ON -DSYSTEMD_UNITDIR=${systemd_system_unitdir}"
+EXTRA_OECMAKE += "-DWITH_DLT_LOGSTORAGE_GZIP=ON -DWITH_EXTENDED_FILTERING=ON -DSYSTEMD_UNITDIR=${systemd_system_unitdir} -DWITH_DLT_USE_IPv6=OFF"
 
 PACKAGES += "${PN}-systemd"
 SYSTEMD_PACKAGES = "${PN} ${PN}-systemd"
Signature · 1 line
2.34.1