diff options
author | Gianfranco Costamagna <gianfranco.costamagna@abinsula.com> | 2020-01-25 19:52:16 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-01-25 12:44:25 -0800 |
commit | c063eb6472b3fde419032ea5a00e02df40acfed6 (patch) | |
tree | 4a80d600ed0feb168085f0163cec6ce517d45ba9 /meta-oe | |
parent | bd85cf0642b9e5467da0ba91a3308d53410e7ece (diff) | |
download | meta-openembedded-c063eb6472b3fde419032ea5a00e02df40acfed6.tar.gz |
dlt-daemon: Add initial recipe from meta-ivi
as of commit 6a5b0d6460028f695c62bd1f0b064207671b2236 with
added upstream proposed pull request: https://github.com/GENIVI/meta-ivi/pull/118
dlt-daemon is useful on embedded systems as a logging system
Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Signed-off-by: Gianfranco Costamagna <gianfranco.costamagna@abinsula.com>
Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
4 files changed, 326 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0002-Don-t-execute-processes-as-a-specific-user.patch b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0002-Don-t-execute-processes-as-a-specific-user.patch new file mode 100644 index 000000000..181be25c7 --- /dev/null +++ b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0002-Don-t-execute-processes-as-a-specific-user.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | From bcca4c99394ba422d03a5e76f2a0023ef248824a Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrei Gherzan <andrei.gherzan@windriver.com> | ||
3 | Date: Tue, 18 Nov 2014 15:47:22 +0100 | ||
4 | Subject: [PATCH 2/4] Don't execute processes as a specific user. | ||
5 | |||
6 | Upstream-Status: Inappropriate [Configuration Specific] | ||
7 | Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com> | ||
8 | --- | ||
9 | systemd/dlt-adaptor-udp.service.cmake | 1 - | ||
10 | systemd/dlt-dbus.service.cmake | 1 - | ||
11 | systemd/dlt-example-user.service.cmake | 1 - | ||
12 | systemd/dlt-receive.service.cmake | 1 - | ||
13 | systemd/dlt-system.service.cmake | 1 - | ||
14 | systemd/dlt.service.cmake | 1 - | ||
15 | 6 files changed, 6 deletions(-) | ||
16 | |||
17 | diff --git a/systemd/dlt-adaptor-udp.service.cmake b/systemd/dlt-adaptor-udp.service.cmake | ||
18 | index 8dac1f2..ecf9f9e 100644 | ||
19 | --- a/systemd/dlt-adaptor-udp.service.cmake | ||
20 | +++ b/systemd/dlt-adaptor-udp.service.cmake | ||
21 | @@ -21,9 +21,8 @@ Wants=dlt.service | ||
22 | |||
23 | [Service] | ||
24 | Type=simple | ||
25 | -User=@DLT_USER@ | ||
26 | ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-adaptor-udp -a @DLT_ADAPTOR_UDP_APPID@ -c @DLT_ADAPTOR_UDP_CTID@ -p @DLT_ADAPTOR_UDP_PORT@ | ||
27 | LimitCORE=infinity | ||
28 | |||
29 | [Install] | ||
30 | -WantedBy=multi-user.target | ||
31 | \ No newline at end of file | ||
32 | +WantedBy=multi-user.target | ||
33 | diff --git a/systemd/dlt-dbus.service.cmake b/systemd/dlt-dbus.service.cmake | ||
34 | index 9baf3e9..74a7eac 100644 | ||
35 | --- a/systemd/dlt-dbus.service.cmake | ||
36 | +++ b/systemd/dlt-dbus.service.cmake | ||
37 | @@ -20,7 +20,6 @@ Wants=dlt.service | ||
38 | |||
39 | [Service] | ||
40 | Type=simple | ||
41 | -User=@DLT_USER@ | ||
42 | ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-dbus | ||
43 | WatchdogSec=@DLT_WatchdogSec@ | ||
44 | NotifyAccess=main | ||
45 | diff --git a/systemd/dlt-example-user.service.cmake b/systemd/dlt-example-user.service.cmake | ||
46 | index b665742..35009b0 100644 | ||
47 | --- a/systemd/dlt-example-user.service.cmake | ||
48 | +++ b/systemd/dlt-example-user.service.cmake | ||
49 | @@ -21,6 +21,5 @@ Wants=dlt.service | ||
50 | |||
51 | [Service] | ||
52 | Type=simple | ||
53 | -User=@DLT_USER@ | ||
54 | ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-example-user "Hallo from GENIVI DLT example user application" | ||
55 | -LimitCORE=infinity | ||
56 | \ No newline at end of file | ||
57 | +LimitCORE=infinity | ||
58 | diff --git a/systemd/dlt-receive.service.cmake b/systemd/dlt-receive.service.cmake | ||
59 | index c07d447..8f88f00 100644 | ||
60 | --- a/systemd/dlt-receive.service.cmake | ||
61 | +++ b/systemd/dlt-receive.service.cmake | ||
62 | @@ -22,6 +22,5 @@ Wants=dlt.service | ||
63 | |||
64 | [Service] | ||
65 | Type=simple | ||
66 | -User=@DLT_USER@ | ||
67 | ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-receive -o /tmp/dlt_receive_log.dlt localhost | ||
68 | -LimitCORE=infinity | ||
69 | \ No newline at end of file | ||
70 | +LimitCORE=infinity | ||
71 | diff --git a/systemd/dlt-system.service.cmake b/systemd/dlt-system.service.cmake | ||
72 | index 0e91f42..1a5b913 100755 | ||
73 | --- a/systemd/dlt-system.service.cmake | ||
74 | +++ b/systemd/dlt-system.service.cmake | ||
75 | @@ -22,7 +22,6 @@ Wants=dlt.service | ||
76 | |||
77 | [Service] | ||
78 | Type=simple | ||
79 | -User=@DLT_USER@ | ||
80 | ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-system | ||
81 | WatchdogSec=@DLT_WatchdogSec@ | ||
82 | NotifyAccess=main | ||
83 | diff --git a/systemd/dlt.service.cmake b/systemd/dlt.service.cmake | ||
84 | index 0b3ee2c..e4753a2 100755 | ||
85 | --- a/systemd/dlt.service.cmake | ||
86 | +++ b/systemd/dlt.service.cmake | ||
87 | @@ -21,7 +21,6 @@ Documentation=man:dlt-daemon(1) man:dlt.conf(5) | ||
88 | |||
89 | [Service] | ||
90 | Type=simple | ||
91 | -User=@DLT_USER@ | ||
92 | ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-daemon | ||
93 | WatchdogSec=@DLT_WatchdogSec@ | ||
94 | NotifyAccess=main | ||
diff --git a/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0004-Modify-systemd-config-directory.patch b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0004-Modify-systemd-config-directory.patch new file mode 100644 index 000000000..ce028c0c5 --- /dev/null +++ b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0004-Modify-systemd-config-directory.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | From 9a5e655cf57301008cd61d53c8a410a7f397e650 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrei Gherzan <andrei.gherzan@windriver.com> | ||
3 | Date: Tue, 18 Nov 2014 15:51:30 +0100 | ||
4 | Subject: [PATCH 4/4] Modify systemd config directory | ||
5 | |||
6 | Upstream-Status: Inappropriate [Configuration Specific] | ||
7 | Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com> | ||
8 | --- | ||
9 | systemd/CMakeLists.txt | 2 +- | ||
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
13 | index e6b44a2..0e885bf 100644 | ||
14 | --- a/CMakeLists.txt | ||
15 | +++ b/CMakeLists.txt | ||
16 | @@ -201,7 +201,7 @@ if(WITH_SYSTEMD OR WITH_SYSTEMD_WATCHDOG OR WITH_SYSTEMD_JOURNAL) | ||
17 | |||
18 | set(systemd_SRCS ${PROJECT_SOURCE_DIR}/systemd/3rdparty/sd-daemon.c) | ||
19 | |||
20 | - set(SYSTEMD_UNITDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system" CACHE PATH | ||
21 | + set(SYSTEMD_UNITDIR "/lib/systemd/system" CACHE PATH | ||
22 | "Set directory to install systemd unit files") | ||
23 | |||
24 | add_subdirectory(systemd) | ||
diff --git a/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/204.patch b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/204.patch new file mode 100644 index 000000000..f0fc0bcb2 --- /dev/null +++ b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/204.patch | |||
@@ -0,0 +1,148 @@ | |||
1 | Upstream-Status: Submitted [https://github.com/GENIVI/dlt-daemon/pull/204] | ||
2 | From 92830aff6e91041f574753d78da758c62981d9a4 Mon Sep 17 00:00:00 2001 | ||
3 | From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
4 | Date: Sat, 25 Jan 2020 09:08:07 +0100 | ||
5 | Subject: [PATCH 1/3] dlt_user.h: fix build when musl is the libc | ||
6 | implementation, by adding a missing include for pthread_t reference: | ||
7 | |||
8 | see https://errors.yoctoproject.org/Errors/Details/308000/ for details | ||
9 | |||
10 | Thanks Khem Raj <raj.khem@gmail.com> for the report | ||
11 | |||
12 | Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
13 | Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org> | ||
14 | --- | ||
15 | include/dlt/dlt_user.h | 1 + | ||
16 | 1 file changed, 1 insertion(+) | ||
17 | |||
18 | diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h | ||
19 | index 69cb854..766d349 100644 | ||
20 | --- a/include/dlt/dlt_user.h | ||
21 | +++ b/include/dlt/dlt_user.h | ||
22 | @@ -74,6 +74,7 @@ | ||
23 | \{ | ||
24 | */ | ||
25 | # include <mqueue.h> | ||
26 | +# include <pthread.h> | ||
27 | |||
28 | # if !defined (__WIN32__) | ||
29 | # include <semaphore.h> | ||
30 | |||
31 | From 5f67aba02c12b7446e63ccc86285c13bc5c7a432 Mon Sep 17 00:00:00 2001 | ||
32 | From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
33 | Date: Sat, 25 Jan 2020 09:16:14 +0100 | ||
34 | Subject: [PATCH 2/3] dlt-test-init-free: fix build failure with strict | ||
35 | compiler flags, due to uint being undefined. This is actually an "int" type, | ||
36 | looking at the test implementation | ||
37 | |||
38 | Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
39 | Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org> | ||
40 | --- | ||
41 | src/tests/dlt-test-init-free.c | 4 ++-- | ||
42 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
43 | |||
44 | diff --git a/src/tests/dlt-test-init-free.c b/src/tests/dlt-test-init-free.c | ||
45 | index 96b5245..35b8803 100644 | ||
46 | --- a/src/tests/dlt-test-init-free.c | ||
47 | +++ b/src/tests/dlt-test-init-free.c | ||
48 | @@ -32,7 +32,7 @@ | ||
49 | |||
50 | void exec(const char *cmd, char *buffer, size_t length); | ||
51 | void printMemoryUsage(); | ||
52 | -char *occupyMemory(uint size); | ||
53 | +char *occupyMemory(int size); | ||
54 | void do_example_test(); | ||
55 | void do_dlt_test(); | ||
56 | |||
57 | @@ -131,7 +131,7 @@ void printMemoryUsage() | ||
58 | printf("%s", result); | ||
59 | } | ||
60 | |||
61 | -char *occupyMemory(uint size) | ||
62 | +char *occupyMemory(int size) | ||
63 | { | ||
64 | char *buf = (char *)malloc(size * sizeof(char)); | ||
65 | |||
66 | |||
67 | From c790d61fad382e5d3e648ee99904087eb9bc4a77 Mon Sep 17 00:00:00 2001 | ||
68 | From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
69 | Date: Sat, 25 Jan 2020 09:20:48 +0100 | ||
70 | Subject: [PATCH 3/3] sys/poll.h: deprecate old sys/poll.h include header, now | ||
71 | glibc/musl wants poll.h being included directly. This fixes a build failure | ||
72 | on musl systems with strict c hardening flags | ||
73 | |||
74 | Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> | ||
75 | Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org> | ||
76 | --- | ||
77 | src/console/logstorage/dlt-logstorage-ctrl.c | 2 +- | ||
78 | src/daemon/dlt_daemon_event_handler.c | 2 +- | ||
79 | src/daemon/dlt_daemon_event_handler.h | 2 +- | ||
80 | src/daemon/dlt_daemon_event_handler_types.h | 2 +- | ||
81 | src/lib/dlt_user.c | 2 +- | ||
82 | 5 files changed, 5 insertions(+), 5 deletions(-) | ||
83 | |||
84 | diff --git a/src/console/logstorage/dlt-logstorage-ctrl.c b/src/console/logstorage/dlt-logstorage-ctrl.c | ||
85 | index 525c137..6614f44 100644 | ||
86 | --- a/src/console/logstorage/dlt-logstorage-ctrl.c | ||
87 | +++ b/src/console/logstorage/dlt-logstorage-ctrl.c | ||
88 | @@ -61,7 +61,7 @@ | ||
89 | #include <string.h> | ||
90 | #include <getopt.h> | ||
91 | |||
92 | -#include <sys/poll.h> | ||
93 | +#include <poll.h> | ||
94 | |||
95 | #if defined(__linux__) | ||
96 | # include "sd-daemon.h" | ||
97 | diff --git a/src/daemon/dlt_daemon_event_handler.c b/src/daemon/dlt_daemon_event_handler.c | ||
98 | index 1611f7b..0d463da 100644 | ||
99 | --- a/src/daemon/dlt_daemon_event_handler.c | ||
100 | +++ b/src/daemon/dlt_daemon_event_handler.c | ||
101 | @@ -30,7 +30,7 @@ | ||
102 | #include <string.h> | ||
103 | #include <errno.h> | ||
104 | |||
105 | -#include <sys/poll.h> | ||
106 | +#include <poll.h> | ||
107 | #include <syslog.h> | ||
108 | |||
109 | #include "dlt_common.h" | ||
110 | diff --git a/src/daemon/dlt_daemon_event_handler.h b/src/daemon/dlt_daemon_event_handler.h | ||
111 | index eb96101..bd550d3 100644 | ||
112 | --- a/src/daemon/dlt_daemon_event_handler.h | ||
113 | +++ b/src/daemon/dlt_daemon_event_handler.h | ||
114 | @@ -25,7 +25,7 @@ | ||
115 | * \file dlt_daemon_event_handler.h | ||
116 | */ | ||
117 | |||
118 | -#include <sys/poll.h> | ||
119 | +#include <poll.h> | ||
120 | |||
121 | #include "dlt_daemon_connection_types.h" | ||
122 | #include "dlt_daemon_event_handler_types.h" | ||
123 | diff --git a/src/daemon/dlt_daemon_event_handler_types.h b/src/daemon/dlt_daemon_event_handler_types.h | ||
124 | index 370e503..0b16d08 100644 | ||
125 | --- a/src/daemon/dlt_daemon_event_handler_types.h | ||
126 | +++ b/src/daemon/dlt_daemon_event_handler_types.h | ||
127 | @@ -25,7 +25,7 @@ | ||
128 | * \file dlt_daemon_event_handler_types.h | ||
129 | */ | ||
130 | |||
131 | -#include <sys/poll.h> | ||
132 | +#include <poll.h> | ||
133 | |||
134 | #include "dlt_daemon_connection_types.h" | ||
135 | |||
136 | #diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c | ||
137 | #index ffa9b09..511f991 100644 | ||
138 | #--- a/src/lib/dlt_user.c | ||
139 | #+++ b/src/lib/dlt_user.c | ||
140 | #@@ -43,7 +43,7 @@ | ||
141 | # #include <errno.h> | ||
142 | # | ||
143 | # #include <sys/uio.h> /* writev() */ | ||
144 | #-#include <sys/poll.h> | ||
145 | #+#include <poll.h> | ||
146 | # | ||
147 | # #include <limits.h> | ||
148 | # #ifdef linux | ||
diff --git a/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.4.bb b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.4.bb new file mode 100644 index 000000000..ef4fb6a76 --- /dev/null +++ b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.4.bb | |||
@@ -0,0 +1,60 @@ | |||
1 | SUMMARY = "Diagnostic Log and Trace" | ||
2 | DESCRIPTION = "This component provides a standardised log and trace interface, \ | ||
3 | based on the standardised protocol specified in the AUTOSAR standard 4.0 DLT. \ | ||
4 | This component can be used by GENIVI components and other applications as \ | ||
5 | logging facility providing: \ | ||
6 | - the DLT shared library \ | ||
7 | - the DLT daemon, including startup scripts \ | ||
8 | - the DLT daemon adaptors- the DLT client console utilities \ | ||
9 | - the DLT test applications" | ||
10 | HOMEPAGE = "https://www.genivi.org/" | ||
11 | SECTION = "console/utils" | ||
12 | LICENSE = "MPLv2" | ||
13 | LIC_FILES_CHKSUM = "file://LICENSE;md5=8184208060df880fe3137b93eb88aeea" | ||
14 | |||
15 | DEPENDS = "zlib gzip-native" | ||
16 | |||
17 | SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=https \ | ||
18 | file://0002-Don-t-execute-processes-as-a-specific-user.patch \ | ||
19 | file://0004-Modify-systemd-config-directory.patch \ | ||
20 | file://204.patch \ | ||
21 | " | ||
22 | SRCREV = "14ea971be7e808b9c5099c7f404ed3cf341873c4" | ||
23 | |||
24 | S = "${WORKDIR}/git" | ||
25 | |||
26 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES','systemd', d)}" | ||
27 | # General options | ||
28 | PACKAGECONFIG[dlt-examples] = "-DWITH_DLT_EXAMPLES=ON,-DWITH_DLT_EXAMPLES=OFF,,dlt-daemon-systemd" | ||
29 | |||
30 | # Linux options | ||
31 | PACKAGECONFIG[systemd] = "-DWITH_SYSTEMD=ON,-DWITH_SYSTEMD=OFF,systemd" | ||
32 | PACKAGECONFIG[systemd-watchdog] = "-DWITH_SYSTEMD_WATCHDOG=ON,-DWITH_SYSTEMD_WATCHDOG=OFF,systemd,libsystemd" | ||
33 | PACKAGECONFIG[systemd-journal] = "-DWITH_SYSTEMD_JOURNAL=ON,-DWITH_SYSTEMD_JOURNAL=OFF,systemd,libsystemd" | ||
34 | PACKAGECONFIG[dlt-dbus] = "-DWITH_DLT_DBUS=ON,-DWITH_DLT_DBUS=OFF,dbus,dbus-lib" | ||
35 | PACKAGECONFIG[udp-connection] = "-DWITH_UDP_CONNECTION=ON,-DWITH_UDP_CONNECTION=OFF" | ||
36 | |||
37 | # Command line options | ||
38 | PACKAGECONFIG[dlt-system] = "-DWITH_DLT_SYSTEM=ON,-DWITH_DLT_SYSTEM=OFF" | ||
39 | PACKAGECONFIG[dlt-adaptor] = "-DWITH_DLT_ADAPTOR=ON,-DWITH_DLT_ADAPTOR=OFF,,dlt-daemon-systemd" | ||
40 | PACKAGECONFIG[dlt-console] = "-DWITH_DLT_CONSOLE=ON,-DWITH_DLT_CONSOLE=OFF,,dlt-daemon-systemd" | ||
41 | |||
42 | inherit autotools gettext cmake systemd | ||
43 | |||
44 | PACKAGES += "${PN}-systemd" | ||
45 | SYSTEMD_PACKAGES = "${PN} ${PN}-systemd" | ||
46 | SYSTEMD_SERVICE_${PN} = " ${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'dlt.service', '', d)} \ | ||
47 | ${@bb.utils.contains('PACKAGECONFIG', 'dlt-system', 'dlt-system.service', '', d)}" | ||
48 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" | ||
49 | SYSTEMD_SERVICE_${PN}-systemd = " \ | ||
50 | ${@bb.utils.contains('PACKAGECONFIG', 'dlt-adaptor', 'dlt-adaptor-udp.service', '', d)} \ | ||
51 | ${@bb.utils.contains('PACKAGECONFIG', 'dlt-examples', 'dlt-example-user.service', '', d)} \ | ||
52 | ${@bb.utils.contains('PACKAGECONFIG', 'dlt-examples dlt-console', 'dlt-receive.service', '', d)} \ | ||
53 | " | ||
54 | SYSTEMD_AUTO_ENABLE_${PN}-systemd = "disable" | ||
55 | |||
56 | FILES_${PN}-doc += "${datadir}/dlt-filetransfer" | ||
57 | |||
58 | do_install_append() { | ||
59 | rm -f ${D}${bindir}/dlt-test-* | ||
60 | } | ||