summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorKhem Raj <khem.raj@oss.qualcomm.com>2026-04-17 00:25:55 -0700
committerKhem Raj <khem.raj@oss.qualcomm.com>2026-04-17 14:16:04 -0700
commitee394862b93a0136f6d9479250c93565f9c6413b (patch)
treeaaace8cf0a0c560c330ea43acf4f019052557b81 /meta-oe
parent2a1772dbc84c64c7adee01e7c720fb48e774676e (diff)
downloadmeta-openembedded-ee394862b93a0136f6d9479250c93565f9c6413b.tar.gz
sdbus-c++-libsystemd: Upgrade to 259.5
It matches OE-core and has musl support upstream Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0001-missing_type.h-add-comparison_fn_t.patch61
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0002-add-fallback-parse_printf_format-implementation.patch434
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch79
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0003-src-basic-missing.h-check-for-missing-strndupa.patch699
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0004-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch156
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0005-add-missing-FTW_-macros-for-musl.patch44
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0006-Use-uintmax_t-for-handling-rlim_t.patch106
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0007-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch99
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch34
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0008-implment-systemd-sysv-install-for-OE.patch43
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch41
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch76
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0011-avoid-redefinition-of-prctl_mm_map-structure.patch32
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0012-do-not-disable-buffer-in-writing-files.patch515
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0013-Handle-__cpu_mask-usage.patch60
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0014-Handle-missing-gshadow.patch173
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch49
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0016-pass-correct-parameters-to-getdents64.patch37
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0017-Adjust-for-musl-headers.patch572
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch52
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch42
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch39
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0021-shared-Do-not-use-malloc_info-on-musl.patch57
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0022-avoid-missing-LOCK_EX-declaration.patch36
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd_255.6.bb76
-rw-r--r--meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd_259.5.bb45
26 files changed, 45 insertions, 3612 deletions
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0001-missing_type.h-add-comparison_fn_t.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0001-missing_type.h-add-comparison_fn_t.patch
deleted file mode 100644
index 2aa5dee6b5..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0001-missing_type.h-add-comparison_fn_t.patch
+++ /dev/null
@@ -1,61 +0,0 @@
1From 01195eb9f7d59139fb45df506ac6b3968c14a57f Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 13:55:12 +0800
4Subject: [PATCH 01/22] missing_type.h: add comparison_fn_t
5
6Make it work with musl where comparison_fn_t and is not provided.
7
8Upstream-Status: Inappropriate [musl specific]
9
10Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
11[Rebased for v244]
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13[Rebased for v242]
14Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
15[Rebased for v250, Drop __compare_fn_t]
16Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
17---
18 src/basic/missing_type.h | 4 ++++
19 src/basic/sort-util.h | 1 +
20 src/libsystemd/sd-journal/catalog.c | 1 +
21 3 files changed, 6 insertions(+)
22
23diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
24index f6233090a9..6c0456349d 100644
25--- a/src/basic/missing_type.h
26+++ b/src/basic/missing_type.h
27@@ -10,3 +10,7 @@
28 #if !HAVE_CHAR16_T
29 #define char16_t uint16_t
30 #endif
31+
32+#ifndef __GLIBC__
33+typedef int (*comparison_fn_t)(const void *, const void *);
34+#endif
35diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h
36index 9c818bd747..ef10c8be2c 100644
37--- a/src/basic/sort-util.h
38+++ b/src/basic/sort-util.h
39@@ -4,6 +4,7 @@
40 #include <stdlib.h>
41
42 #include "macro.h"
43+#include "missing_type.h"
44
45 /* This is the same as glibc's internal __compar_d_fn_t type. glibc exports a public comparison_fn_t, for the
46 * external type __compar_fn_t, but doesn't do anything similar for __compar_d_fn_t. Let's hence do that
47diff --git a/src/libsystemd/sd-journal/catalog.c b/src/libsystemd/sd-journal/catalog.c
48index ae91534198..7f67eea38b 100644
49--- a/src/libsystemd/sd-journal/catalog.c
50+++ b/src/libsystemd/sd-journal/catalog.c
51@@ -28,6 +28,7 @@
52 #include "string-util.h"
53 #include "strv.h"
54 #include "tmpfile-util.h"
55+#include "missing_type.h"
56
57 const char * const catalog_file_dirs[] = {
58 "/usr/local/lib/systemd/catalog/",
59--
602.34.1
61
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0002-add-fallback-parse_printf_format-implementation.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0002-add-fallback-parse_printf_format-implementation.patch
deleted file mode 100644
index 900a931632..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0002-add-fallback-parse_printf_format-implementation.patch
+++ /dev/null
@@ -1,434 +0,0 @@
1From 872b72739e62123867ce6c4f82aa37de24cc3f75 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Sat, 22 May 2021 20:26:24 +0200
4Subject: [PATCH 02/22] add fallback parse_printf_format implementation
5
6Upstream-Status: Inappropriate [musl specific]
7
8Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
11[rebased for systemd 243]
12Signed-off-by: Scott Murray <scott.murray@konsulko.com>
13---
14 meson.build | 1 +
15 src/basic/meson.build | 5 +
16 src/basic/parse-printf-format.c | 273 +++++++++++++++++++++++
17 src/basic/parse-printf-format.h | 57 +++++
18 src/basic/stdio-util.h | 2 +-
19 src/libsystemd/sd-journal/journal-send.c | 2 +-
20 6 files changed, 338 insertions(+), 2 deletions(-)
21 create mode 100644 src/basic/parse-printf-format.c
22 create mode 100644 src/basic/parse-printf-format.h
23
24diff --git a/meson.build b/meson.build
25index 7419e2b0b0..01fd3ffc19 100644
26--- a/meson.build
27+++ b/meson.build
28@@ -725,6 +725,7 @@ endif
29 foreach header : ['crypt.h',
30 'linux/memfd.h',
31 'linux/vm_sockets.h',
32+ 'printf.h',
33 'sys/auxv.h',
34 'threads.h',
35 'valgrind/memcheck.h',
36diff --git a/src/basic/meson.build b/src/basic/meson.build
37index d7450d8b44..c3e3daf4bd 100644
38--- a/src/basic/meson.build
39+++ b/src/basic/meson.build
40@@ -183,6 +183,11 @@ endforeach
41
42 basic_sources += generated_gperf_headers
43
44+if conf.get('HAVE_PRINTF_H') != 1
45+ basic_sources += [files('parse-printf-format.c')]
46+endif
47+
48+
49 ############################################################
50
51 arch_list = [
52diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c
53new file mode 100644
54index 0000000000..49437e5445
55--- /dev/null
56+++ b/src/basic/parse-printf-format.c
57@@ -0,0 +1,273 @@
58+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
59+
60+/***
61+ This file is part of systemd.
62+
63+ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
64+
65+ With parts from the musl C library
66+ Copyright 2005-2014 Rich Felker, et al.
67+
68+ systemd is free software; you can redistribute it and/or modify it
69+ under the terms of the GNU Lesser General Public License as published by
70+ the Free Software Foundation; either version 2.1 of the License, or
71+ (at your option) any later version.
72+
73+ systemd is distributed in the hope that it will be useful, but
74+ WITHOUT ANY WARRANTY; without even the implied warranty of
75+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
76+ Lesser General Public License for more details.
77+
78+ You should have received a copy of the GNU Lesser General Public License
79+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
80+***/
81+
82+#include <stddef.h>
83+#include <string.h>
84+
85+#include "parse-printf-format.h"
86+
87+static const char *consume_nonarg(const char *fmt)
88+{
89+ do {
90+ if (*fmt == '\0')
91+ return fmt;
92+ } while (*fmt++ != '%');
93+ return fmt;
94+}
95+
96+static const char *consume_num(const char *fmt)
97+{
98+ for (;*fmt >= '0' && *fmt <= '9'; fmt++)
99+ /* do nothing */;
100+ return fmt;
101+}
102+
103+static const char *consume_argn(const char *fmt, size_t *arg)
104+{
105+ const char *p = fmt;
106+ size_t val = 0;
107+
108+ if (*p < '1' || *p > '9')
109+ return fmt;
110+ do {
111+ val = 10*val + (*p++ - '0');
112+ } while (*p >= '0' && *p <= '9');
113+
114+ if (*p != '$')
115+ return fmt;
116+ *arg = val;
117+ return p+1;
118+}
119+
120+static const char *consume_flags(const char *fmt)
121+{
122+ while (1) {
123+ switch (*fmt) {
124+ case '#':
125+ case '0':
126+ case '-':
127+ case ' ':
128+ case '+':
129+ case '\'':
130+ case 'I':
131+ fmt++;
132+ continue;
133+ }
134+ return fmt;
135+ }
136+}
137+
138+enum state {
139+ BARE,
140+ LPRE,
141+ LLPRE,
142+ HPRE,
143+ HHPRE,
144+ BIGLPRE,
145+ ZTPRE,
146+ JPRE,
147+ STOP
148+};
149+
150+enum type {
151+ NONE,
152+ PTR,
153+ INT,
154+ UINT,
155+ ULLONG,
156+ LONG,
157+ ULONG,
158+ SHORT,
159+ USHORT,
160+ CHAR,
161+ UCHAR,
162+ LLONG,
163+ SIZET,
164+ IMAX,
165+ UMAX,
166+ PDIFF,
167+ UIPTR,
168+ DBL,
169+ LDBL,
170+ MAXTYPE
171+};
172+
173+static const short pa_types[MAXTYPE] = {
174+ [NONE] = PA_INT,
175+ [PTR] = PA_POINTER,
176+ [INT] = PA_INT,
177+ [UINT] = PA_INT,
178+ [ULLONG] = PA_INT | PA_FLAG_LONG_LONG,
179+ [LONG] = PA_INT | PA_FLAG_LONG,
180+ [ULONG] = PA_INT | PA_FLAG_LONG,
181+ [SHORT] = PA_INT | PA_FLAG_SHORT,
182+ [USHORT] = PA_INT | PA_FLAG_SHORT,
183+ [CHAR] = PA_CHAR,
184+ [UCHAR] = PA_CHAR,
185+ [LLONG] = PA_INT | PA_FLAG_LONG_LONG,
186+ [SIZET] = PA_INT | PA_FLAG_LONG,
187+ [IMAX] = PA_INT | PA_FLAG_LONG_LONG,
188+ [UMAX] = PA_INT | PA_FLAG_LONG_LONG,
189+ [PDIFF] = PA_INT | PA_FLAG_LONG_LONG,
190+ [UIPTR] = PA_INT | PA_FLAG_LONG,
191+ [DBL] = PA_DOUBLE,
192+ [LDBL] = PA_DOUBLE | PA_FLAG_LONG_DOUBLE
193+};
194+
195+#define S(x) [(x)-'A']
196+#define E(x) (STOP + (x))
197+
198+static const unsigned char states[]['z'-'A'+1] = {
199+ { /* 0: bare types */
200+ S('d') = E(INT), S('i') = E(INT),
201+ S('o') = E(UINT),S('u') = E(UINT),S('x') = E(UINT), S('X') = E(UINT),
202+ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
203+ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
204+ S('c') = E(CHAR),S('C') = E(INT),
205+ S('s') = E(PTR), S('S') = E(PTR), S('p') = E(UIPTR),S('n') = E(PTR),
206+ S('m') = E(NONE),
207+ S('l') = LPRE, S('h') = HPRE, S('L') = BIGLPRE,
208+ S('z') = ZTPRE, S('j') = JPRE, S('t') = ZTPRE
209+ }, { /* 1: l-prefixed */
210+ S('d') = E(LONG), S('i') = E(LONG),
211+ S('o') = E(ULONG),S('u') = E(ULONG),S('x') = E(ULONG),S('X') = E(ULONG),
212+ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
213+ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
214+ S('c') = E(INT), S('s') = E(PTR), S('n') = E(PTR),
215+ S('l') = LLPRE
216+ }, { /* 2: ll-prefixed */
217+ S('d') = E(LLONG), S('i') = E(LLONG),
218+ S('o') = E(ULLONG),S('u') = E(ULLONG),
219+ S('x') = E(ULLONG),S('X') = E(ULLONG),
220+ S('n') = E(PTR)
221+ }, { /* 3: h-prefixed */
222+ S('d') = E(SHORT), S('i') = E(SHORT),
223+ S('o') = E(USHORT),S('u') = E(USHORT),
224+ S('x') = E(USHORT),S('X') = E(USHORT),
225+ S('n') = E(PTR),
226+ S('h') = HHPRE
227+ }, { /* 4: hh-prefixed */
228+ S('d') = E(CHAR), S('i') = E(CHAR),
229+ S('o') = E(UCHAR),S('u') = E(UCHAR),
230+ S('x') = E(UCHAR),S('X') = E(UCHAR),
231+ S('n') = E(PTR)
232+ }, { /* 5: L-prefixed */
233+ S('e') = E(LDBL),S('f') = E(LDBL),S('g') = E(LDBL), S('a') = E(LDBL),
234+ S('E') = E(LDBL),S('F') = E(LDBL),S('G') = E(LDBL), S('A') = E(LDBL),
235+ S('n') = E(PTR)
236+ }, { /* 6: z- or t-prefixed (assumed to be same size) */
237+ S('d') = E(PDIFF),S('i') = E(PDIFF),
238+ S('o') = E(SIZET),S('u') = E(SIZET),
239+ S('x') = E(SIZET),S('X') = E(SIZET),
240+ S('n') = E(PTR)
241+ }, { /* 7: j-prefixed */
242+ S('d') = E(IMAX), S('i') = E(IMAX),
243+ S('o') = E(UMAX), S('u') = E(UMAX),
244+ S('x') = E(UMAX), S('X') = E(UMAX),
245+ S('n') = E(PTR)
246+ }
247+};
248+
249+size_t parse_printf_format(const char *fmt, size_t n, int *types)
250+{
251+ size_t i = 0;
252+ size_t last = 0;
253+
254+ memset(types, 0, n);
255+
256+ while (1) {
257+ size_t arg;
258+ unsigned int state;
259+
260+ fmt = consume_nonarg(fmt);
261+ if (*fmt == '\0')
262+ break;
263+ if (*fmt == '%') {
264+ fmt++;
265+ continue;
266+ }
267+ arg = 0;
268+ fmt = consume_argn(fmt, &arg);
269+ /* flags */
270+ fmt = consume_flags(fmt);
271+ /* width */
272+ if (*fmt == '*') {
273+ size_t warg = 0;
274+ fmt = consume_argn(fmt+1, &warg);
275+ if (warg == 0)
276+ warg = ++i;
277+ if (warg > last)
278+ last = warg;
279+ if (warg <= n && types[warg-1] == NONE)
280+ types[warg-1] = INT;
281+ } else
282+ fmt = consume_num(fmt);
283+ /* precision */
284+ if (*fmt == '.') {
285+ fmt++;
286+ if (*fmt == '*') {
287+ size_t parg = 0;
288+ fmt = consume_argn(fmt+1, &parg);
289+ if (parg == 0)
290+ parg = ++i;
291+ if (parg > last)
292+ last = parg;
293+ if (parg <= n && types[parg-1] == NONE)
294+ types[parg-1] = INT;
295+ } else {
296+ if (*fmt == '-')
297+ fmt++;
298+ fmt = consume_num(fmt);
299+ }
300+ }
301+ /* length modifier and conversion specifier */
302+ state = BARE;
303+ do {
304+ unsigned char c = *fmt++;
305+
306+ if (c < 'A' || c > 'z')
307+ continue;
308+ state = states[state]S(c);
309+ if (state == 0)
310+ continue;
311+ } while (state < STOP);
312+
313+ if (state == E(NONE))
314+ continue;
315+
316+ if (arg == 0)
317+ arg = ++i;
318+ if (arg > last)
319+ last = arg;
320+ if (arg <= n)
321+ types[arg-1] = state - STOP;
322+ }
323+
324+ if (last > n)
325+ last = n;
326+ for (i = 0; i < last; i++)
327+ types[i] = pa_types[types[i]];
328+
329+ return last;
330+}
331diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h
332new file mode 100644
333index 0000000000..47be7522d7
334--- /dev/null
335+++ b/src/basic/parse-printf-format.h
336@@ -0,0 +1,57 @@
337+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
338+
339+/***
340+ This file is part of systemd.
341+
342+ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
343+
344+ With parts from the GNU C Library
345+ Copyright 1991-2014 Free Software Foundation, Inc.
346+
347+ systemd is free software; you can redistribute it and/or modify it
348+ under the terms of the GNU Lesser General Public License as published by
349+ the Free Software Foundation; either version 2.1 of the License, or
350+ (at your option) any later version.
351+
352+ systemd is distributed in the hope that it will be useful, but
353+ WITHOUT ANY WARRANTY; without even the implied warranty of
354+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
355+ Lesser General Public License for more details.
356+
357+ You should have received a copy of the GNU Lesser General Public License
358+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
359+***/
360+
361+#pragma once
362+
363+#include "config.h"
364+
365+#if HAVE_PRINTF_H
366+#include <printf.h>
367+#else
368+
369+#include <stddef.h>
370+
371+enum { /* C type: */
372+ PA_INT, /* int */
373+ PA_CHAR, /* int, cast to char */
374+ PA_WCHAR, /* wide char */
375+ PA_STRING, /* const char *, a '\0'-terminated string */
376+ PA_WSTRING, /* const wchar_t *, wide character string */
377+ PA_POINTER, /* void * */
378+ PA_FLOAT, /* float */
379+ PA_DOUBLE, /* double */
380+ PA_LAST
381+};
382+
383+/* Flag bits that can be set in a type returned by `parse_printf_format'. */
384+#define PA_FLAG_MASK 0xff00
385+#define PA_FLAG_LONG_LONG (1 << 8)
386+#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG
387+#define PA_FLAG_LONG (1 << 9)
388+#define PA_FLAG_SHORT (1 << 10)
389+#define PA_FLAG_PTR (1 << 11)
390+
391+size_t parse_printf_format(const char *fmt, size_t n, int *types);
392+
393+#endif /* HAVE_PRINTF_H */
394diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h
395index 4e93ac90c9..f9deb6f662 100644
396--- a/src/basic/stdio-util.h
397+++ b/src/basic/stdio-util.h
398@@ -1,12 +1,12 @@
399 /* SPDX-License-Identifier: LGPL-2.1-or-later */
400 #pragma once
401
402-#include <printf.h>
403 #include <stdarg.h>
404 #include <stdio.h>
405 #include <sys/types.h>
406
407 #include "macro.h"
408+#include "parse-printf-format.h"
409
410 _printf_(3, 4)
411 static inline char *snprintf_ok(char *buf, size_t len, const char *format, ...) {
412diff --git a/src/libsystemd/sd-journal/journal-send.c b/src/libsystemd/sd-journal/journal-send.c
413index be23b2fe75..69a2eb6404 100644
414--- a/src/libsystemd/sd-journal/journal-send.c
415+++ b/src/libsystemd/sd-journal/journal-send.c
416@@ -2,7 +2,6 @@
417
418 #include <errno.h>
419 #include <fcntl.h>
420-#include <printf.h>
421 #include <stddef.h>
422 #include <sys/un.h>
423 #include <unistd.h>
424@@ -28,6 +27,7 @@
425 #include "stdio-util.h"
426 #include "string-util.h"
427 #include "tmpfile-util.h"
428+#include "parse-printf-format.h"
429
430 #define SNDBUF_SIZE (8*1024*1024)
431
432--
4332.34.1
434
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch
deleted file mode 100644
index be231cf6b2..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch
+++ /dev/null
@@ -1,79 +0,0 @@
1From 29a58009a172e369ad7166e16dab2f4945c6b0d2 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 21 Feb 2019 16:23:24 +0800
4Subject: [PATCH 1/2] binfmt: Don't install dependency links at install time
5 for the binfmt services
6
7use [Install] blocks so that they get created when the service is enabled
8like a traditional service.
9
10The [Install] blocks were rejected upstream as they don't have a way to
11"enable" it on install without static symlinks which can't be disabled,
12only masked. We however can do that in a postinst.
13
14Upstream-Status: Denied
15
16Signed-off-by: Ross Burton <ross.burton@intel.com>
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
19[rebased for systemd 243]
20Signed-off-by: Scott Murray <scott.murray@konsulko.com>
21---
22 units/meson.build | 2 --
23 units/proc-sys-fs-binfmt_misc.automount | 3 +++
24 units/systemd-binfmt.service.in | 4 ++++
25 3 files changed, 7 insertions(+), 2 deletions(-)
26
27diff --git a/units/meson.build b/units/meson.build
28index e7bfb7f838..1d5ec4b178 100644
29--- a/units/meson.build
30+++ b/units/meson.build
31@@ -154,7 +154,6 @@ units = [
32 {
33 'file' : 'proc-sys-fs-binfmt_misc.automount',
34 'conditions' : ['ENABLE_BINFMT'],
35- 'symlinks' : ['sysinit.target.wants/'],
36 },
37 {
38 'file' : 'proc-sys-fs-binfmt_misc.mount',
39@@ -251,7 +250,6 @@ units = [
40 {
41 'file' : 'systemd-binfmt.service.in',
42 'conditions' : ['ENABLE_BINFMT'],
43- 'symlinks' : ['sysinit.target.wants/'],
44 },
45 {
46 'file' : 'systemd-bless-boot.service.in',
47diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
48index 5d212015a5..6c2900ca77 100644
49--- a/units/proc-sys-fs-binfmt_misc.automount
50+++ b/units/proc-sys-fs-binfmt_misc.automount
51@@ -22,3 +22,6 @@ Before=shutdown.target
52
53 [Automount]
54 Where=/proc/sys/fs/binfmt_misc
55+
56+[Install]
57+WantedBy=sysinit.target
58diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
59index 6861c76674..531e9fbd90 100644
60--- a/units/systemd-binfmt.service.in
61+++ b/units/systemd-binfmt.service.in
62@@ -14,6 +14,7 @@ Documentation=https://docs.kernel.org/admin-guide/binfmt-misc.html
63 Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
64 DefaultDependencies=no
65 Conflicts=shutdown.target
66+Wants=proc-sys-fs-binfmt_misc.automount
67 After=proc-sys-fs-binfmt_misc.automount
68 After=proc-sys-fs-binfmt_misc.mount
69 After=local-fs.target
70@@ -31,3 +32,6 @@ RemainAfterExit=yes
71 ExecStart={{LIBEXECDIR}}/systemd-binfmt
72 ExecStop={{LIBEXECDIR}}/systemd-binfmt --unregister
73 TimeoutSec=90s
74+
75+[Install]
76+WantedBy=sysinit.target
77--
782.34.1
79
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0003-src-basic-missing.h-check-for-missing-strndupa.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0003-src-basic-missing.h-check-for-missing-strndupa.patch
deleted file mode 100644
index 5595b5bc23..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0003-src-basic-missing.h-check-for-missing-strndupa.patch
+++ /dev/null
@@ -1,699 +0,0 @@
1From 87f1d38f40c5fe9cadf2b2de442473e4e5605788 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 14:18:21 +0800
4Subject: [PATCH 03/22] src/basic/missing.h: check for missing strndupa
5
6include missing.h for definition of strndupa
7
8Upstream-Status: Inappropriate [musl specific]
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12[Rebased for v242]
13Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
14[rebased for systemd 243]
15Signed-off-by: Scott Murray <scott.murray@konsulko.com>
16Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
17[rebased for systemd 244]
18[Rebased for v247]
19Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
20[Rebased for v254]
21Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
22[Rebased for v255.1]
23---
24 meson.build | 1 +
25 src/backlight/backlight.c | 1 +
26 src/basic/cgroup-util.c | 1 +
27 src/basic/env-util.c | 1 +
28 src/basic/log.c | 1 +
29 src/basic/missing_stdlib.h | 12 ++++++++++++
30 src/basic/mkdir.c | 1 +
31 src/basic/mountpoint-util.c | 1 +
32 src/basic/parse-util.c | 1 +
33 src/basic/path-lookup.c | 1 +
34 src/basic/percent-util.c | 1 +
35 src/basic/proc-cmdline.c | 1 +
36 src/basic/procfs-util.c | 1 +
37 src/basic/time-util.c | 1 +
38 src/boot/bless-boot.c | 1 +
39 src/core/dbus-cgroup.c | 1 +
40 src/core/dbus-execute.c | 1 +
41 src/core/dbus-util.c | 1 +
42 src/core/execute.c | 1 +
43 src/core/kmod-setup.c | 1 +
44 src/core/service.c | 1 +
45 src/coredump/coredump-vacuum.c | 1 +
46 src/fstab-generator/fstab-generator.c | 1 +
47 src/journal-remote/journal-remote-main.c | 1 +
48 src/journal/journalctl.c | 1 +
49 src/libsystemd/sd-bus/bus-message.c | 1 +
50 src/libsystemd/sd-bus/bus-objects.c | 1 +
51 src/libsystemd/sd-bus/bus-socket.c | 1 +
52 src/libsystemd/sd-bus/sd-bus.c | 1 +
53 src/libsystemd/sd-bus/test-bus-benchmark.c | 1 +
54 src/libsystemd/sd-journal/sd-journal.c | 1 +
55 src/login/pam_systemd.c | 1 +
56 src/network/generator/network-generator.c | 1 +
57 src/nspawn/nspawn-settings.c | 1 +
58 src/nss-mymachines/nss-mymachines.c | 1 +
59 src/portable/portable.c | 1 +
60 src/resolve/resolvectl.c | 1 +
61 src/shared/bus-get-properties.c | 1 +
62 src/shared/bus-unit-procs.c | 1 +
63 src/shared/bus-unit-util.c | 1 +
64 src/shared/bus-util.c | 1 +
65 src/shared/dns-domain.c | 1 +
66 src/shared/journal-importer.c | 1 +
67 src/shared/logs-show.c | 1 +
68 src/shared/pager.c | 1 +
69 src/socket-proxy/socket-proxyd.c | 1 +
70 src/test/test-hexdecoct.c | 1 +
71 src/udev/udev-builtin-net_id.c | 1 +
72 src/udev/udev-builtin-path_id.c | 1 +
73 src/udev/udev-event.c | 1 +
74 src/udev/udev-rules.c | 1 +
75 51 files changed, 62 insertions(+)
76
77diff --git a/meson.build b/meson.build
78index 01fd3ffc19..61a872b753 100644
79--- a/meson.build
80+++ b/meson.build
81@@ -567,6 +567,7 @@ foreach ident : ['secure_getenv', '__secure_getenv']
82 endforeach
83
84 foreach ident : [
85+ ['strndupa' , '''#include <string.h>'''],
86 ['memfd_create', '''#include <sys/mman.h>'''],
87 ['gettid', '''#include <sys/types.h>
88 #include <unistd.h>'''],
89diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
90index 5ac9f904a9..99d5122dd7 100644
91--- a/src/backlight/backlight.c
92+++ b/src/backlight/backlight.c
93@@ -20,6 +20,7 @@
94 #include "string-util.h"
95 #include "strv.h"
96 #include "terminal-util.h"
97+#include "missing_stdlib.h"
98
99 #define PCI_CLASS_GRAPHICS_CARD 0x30000
100
101diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
102index 18b16ecc0e..d2be79622f 100644
103--- a/src/basic/cgroup-util.c
104+++ b/src/basic/cgroup-util.c
105@@ -38,6 +38,7 @@
106 #include "unit-name.h"
107 #include "user-util.h"
108 #include "xattr-util.h"
109+#include "missing_stdlib.h"
110
111 static int cg_enumerate_items(const char *controller, const char *path, FILE **ret, const char *item) {
112 _cleanup_free_ char *fs = NULL;
113diff --git a/src/basic/env-util.c b/src/basic/env-util.c
114index d3bf73385f..16b17358ca 100644
115--- a/src/basic/env-util.c
116+++ b/src/basic/env-util.c
117@@ -19,6 +19,7 @@
118 #include "string-util.h"
119 #include "strv.h"
120 #include "utf8.h"
121+#include "missing_stdlib.h"
122
123 /* We follow bash for the character set. Different shells have different rules. */
124 #define VALID_BASH_ENV_NAME_CHARS \
125diff --git a/src/basic/log.c b/src/basic/log.c
126index 1470611a75..9924ec2b9a 100644
127--- a/src/basic/log.c
128+++ b/src/basic/log.c
129@@ -40,6 +40,7 @@
130 #include "terminal-util.h"
131 #include "time-util.h"
132 #include "utf8.h"
133+#include "missing_stdlib.h"
134
135 #define SNDBUF_SIZE (8*1024*1024)
136 #define IOVEC_MAX 256U
137diff --git a/src/basic/missing_stdlib.h b/src/basic/missing_stdlib.h
138index 8c76f93eb2..9068bfb4f0 100644
139--- a/src/basic/missing_stdlib.h
140+++ b/src/basic/missing_stdlib.h
141@@ -11,3 +11,15 @@
142 # error "neither secure_getenv nor __secure_getenv are available"
143 # endif
144 #endif
145+
146+/* string.h */
147+#if ! HAVE_STRNDUPA
148+#define strndupa(s, n) \
149+ ({ \
150+ const char *__old = (s); \
151+ size_t __len = strnlen(__old, (n)); \
152+ char *__new = (char *)alloca(__len + 1); \
153+ __new[__len] = '\0'; \
154+ (char *)memcpy(__new, __old, __len); \
155+ })
156+#endif
157diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
158index c770e5ed32..1fd8816cd0 100644
159--- a/src/basic/mkdir.c
160+++ b/src/basic/mkdir.c
161@@ -16,6 +16,7 @@
162 #include "stat-util.h"
163 #include "stdio-util.h"
164 #include "user-util.h"
165+#include "missing_stdlib.h"
166
167 int mkdirat_safe_internal(
168 int dir_fd,
169diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
170index bf67f7e01a..409f8d8a73 100644
171--- a/src/basic/mountpoint-util.c
172+++ b/src/basic/mountpoint-util.c
173@@ -18,6 +18,7 @@
174 #include "missing_stat.h"
175 #include "missing_syscall.h"
176 #include "mkdir.h"
177+#include "missing_stdlib.h"
178 #include "mountpoint-util.h"
179 #include "nulstr-util.h"
180 #include "parse-util.h"
181diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
182index 0430e33e40..f3728de026 100644
183--- a/src/basic/parse-util.c
184+++ b/src/basic/parse-util.c
185@@ -18,6 +18,7 @@
186 #include "stat-util.h"
187 #include "string-util.h"
188 #include "strv.h"
189+#include "missing_stdlib.h"
190
191 int parse_boolean(const char *v) {
192 if (!v)
193diff --git a/src/basic/path-lookup.c b/src/basic/path-lookup.c
194index 4e3d59fc56..726e240df0 100644
195--- a/src/basic/path-lookup.c
196+++ b/src/basic/path-lookup.c
197@@ -16,6 +16,7 @@
198 #include "strv.h"
199 #include "tmpfile-util.h"
200 #include "user-util.h"
201+#include "missing_stdlib.h"
202
203 int xdg_user_runtime_dir(char **ret, const char *suffix) {
204 const char *e;
205diff --git a/src/basic/percent-util.c b/src/basic/percent-util.c
206index cab9d0eaea..5f6ca258e9 100644
207--- a/src/basic/percent-util.c
208+++ b/src/basic/percent-util.c
209@@ -3,6 +3,7 @@
210 #include "percent-util.h"
211 #include "string-util.h"
212 #include "parse-util.h"
213+#include "missing_stdlib.h"
214
215 static int parse_parts_value_whole(const char *p, const char *symbol) {
216 const char *pc, *n;
217diff --git a/src/basic/proc-cmdline.c b/src/basic/proc-cmdline.c
218index 522d8de1f4..7c129dc0fc 100644
219--- a/src/basic/proc-cmdline.c
220+++ b/src/basic/proc-cmdline.c
221@@ -16,6 +16,7 @@
222 #include "string-util.h"
223 #include "strv.h"
224 #include "virt.h"
225+#include "missing_stdlib.h"
226
227 int proc_cmdline_filter_pid1_args(char **argv, char ***ret) {
228 enum {
229diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c
230index d7cfcd9105..6cb0ddf575 100644
231--- a/src/basic/procfs-util.c
232+++ b/src/basic/procfs-util.c
233@@ -12,6 +12,7 @@
234 #include "procfs-util.h"
235 #include "stdio-util.h"
236 #include "string-util.h"
237+#include "missing_stdlib.h"
238
239 int procfs_get_pid_max(uint64_t *ret) {
240 _cleanup_free_ char *value = NULL;
241diff --git a/src/basic/time-util.c b/src/basic/time-util.c
242index f9014dc560..1d7840a5b5 100644
243--- a/src/basic/time-util.c
244+++ b/src/basic/time-util.c
245@@ -27,6 +27,7 @@
246 #include "string-util.h"
247 #include "strv.h"
248 #include "time-util.h"
249+#include "missing_stdlib.h"
250
251 static clockid_t map_clock_id(clockid_t c) {
252
253diff --git a/src/boot/bless-boot.c b/src/boot/bless-boot.c
254index 0c0b4f23c7..68fe5ca509 100644
255--- a/src/boot/bless-boot.c
256+++ b/src/boot/bless-boot.c
257@@ -22,6 +22,7 @@
258 #include "terminal-util.h"
259 #include "verbs.h"
260 #include "virt.h"
261+#include "missing_stdlib.h"
262
263 static char **arg_path = NULL;
264
265diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c
266index 4237e694c0..05f9d9d9a9 100644
267--- a/src/core/dbus-cgroup.c
268+++ b/src/core/dbus-cgroup.c
269@@ -25,6 +25,7 @@
270 #include "parse-util.h"
271 #include "path-util.h"
272 #include "percent-util.h"
273+#include "missing_stdlib.h"
274 #include "socket-util.h"
275
276 BUS_DEFINE_PROPERTY_GET(bus_property_get_tasks_max, "t", CGroupTasksMax, cgroup_tasks_max_resolve);
277diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
278index 4daa1cefd3..2c77901471 100644
279--- a/src/core/dbus-execute.c
280+++ b/src/core/dbus-execute.c
281@@ -42,6 +42,7 @@
282 #include "unit-printf.h"
283 #include "user-util.h"
284 #include "utf8.h"
285+#include "missing_stdlib.h"
286
287 BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_exec_output, exec_output, ExecOutput);
288 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_exec_input, exec_input, ExecInput);
289diff --git a/src/core/dbus-util.c b/src/core/dbus-util.c
290index d680a64268..e59f48103e 100644
291--- a/src/core/dbus-util.c
292+++ b/src/core/dbus-util.c
293@@ -9,6 +9,7 @@
294 #include "unit-printf.h"
295 #include "user-util.h"
296 #include "unit.h"
297+#include "missing_stdlib.h"
298
299 int bus_property_get_triggered_unit(
300 sd_bus *bus,
301diff --git a/src/core/execute.c b/src/core/execute.c
302index ef0bf88687..bd3da0c401 100644
303--- a/src/core/execute.c
304+++ b/src/core/execute.c
305@@ -72,6 +72,7 @@
306 #include "unit-serialize.h"
307 #include "user-util.h"
308 #include "utmp-wtmp.h"
309+#include "missing_stdlib.h"
310
311 static bool is_terminal_input(ExecInput i) {
312 return IN_SET(i,
313diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
314index b8e3f7aadd..8ce8ca68d8 100644
315--- a/src/core/kmod-setup.c
316+++ b/src/core/kmod-setup.c
317@@ -13,6 +13,7 @@
318 #include "string-util.h"
319 #include "strv.h"
320 #include "virt.h"
321+#include "missing_stdlib.h"
322
323 #if HAVE_KMOD
324 #include "module-util.h"
325diff --git a/src/core/service.c b/src/core/service.c
326index b9eb40c555..268fe7573b 100644
327--- a/src/core/service.c
328+++ b/src/core/service.c
329@@ -45,6 +45,7 @@
330 #include "unit-name.h"
331 #include "unit.h"
332 #include "utf8.h"
333+#include "missing_stdlib.h"
334
335 #define service_spawn(...) service_spawn_internal(__func__, __VA_ARGS__)
336
337diff --git a/src/coredump/coredump-vacuum.c b/src/coredump/coredump-vacuum.c
338index 7e0c98cb7d..978a7f5874 100644
339--- a/src/coredump/coredump-vacuum.c
340+++ b/src/coredump/coredump-vacuum.c
341@@ -17,6 +17,7 @@
342 #include "string-util.h"
343 #include "time-util.h"
344 #include "user-util.h"
345+#include "missing_stdlib.h"
346
347 #define DEFAULT_MAX_USE_LOWER (uint64_t) (1ULL*1024ULL*1024ULL) /* 1 MiB */
348 #define DEFAULT_MAX_USE_UPPER (uint64_t) (4ULL*1024ULL*1024ULL*1024ULL) /* 4 GiB */
349diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
350index 016f3baa7f..b1def81313 100644
351--- a/src/fstab-generator/fstab-generator.c
352+++ b/src/fstab-generator/fstab-generator.c
353@@ -37,6 +37,7 @@
354 #include "unit-name.h"
355 #include "virt.h"
356 #include "volatile-util.h"
357+#include "missing_stdlib.h"
358
359 typedef enum MountPointFlags {
360 MOUNT_NOAUTO = 1 << 0,
361diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c
362index da0f20d3ce..f22ce41908 100644
363--- a/src/journal-remote/journal-remote-main.c
364+++ b/src/journal-remote/journal-remote-main.c
365@@ -27,6 +27,7 @@
366 #include "stat-util.h"
367 #include "string-table.h"
368 #include "strv.h"
369+#include "missing_stdlib.h"
370
371 #define PRIV_KEY_FILE CERTIFICATE_ROOT "/private/journal-remote.pem"
372 #define CERT_FILE CERTIFICATE_ROOT "/certs/journal-remote.pem"
373diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
374index 7f3dcd56a4..41b7cbaaf1 100644
375--- a/src/journal/journalctl.c
376+++ b/src/journal/journalctl.c
377@@ -77,6 +77,7 @@
378 #include "unit-name.h"
379 #include "user-util.h"
380 #include "varlink.h"
381+#include "missing_stdlib.h"
382
383 #define DEFAULT_FSS_INTERVAL_USEC (15*USEC_PER_MINUTE)
384 #define PROCESS_INOTIFY_INTERVAL 1024 /* Every 1,024 messages processed */
385diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
386index ff0228081f..9066fcb133 100644
387--- a/src/libsystemd/sd-bus/bus-message.c
388+++ b/src/libsystemd/sd-bus/bus-message.c
389@@ -19,6 +19,7 @@
390 #include "strv.h"
391 #include "time-util.h"
392 #include "utf8.h"
393+#include "missing_stdlib.h"
394
395 static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored);
396 static int message_parse_fields(sd_bus_message *m);
397diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
398index c25c40ff37..57a5da704f 100644
399--- a/src/libsystemd/sd-bus/bus-objects.c
400+++ b/src/libsystemd/sd-bus/bus-objects.c
401@@ -11,6 +11,7 @@
402 #include "missing_capability.h"
403 #include "string-util.h"
404 #include "strv.h"
405+#include "missing_stdlib.h"
406
407 static int node_vtable_get_userdata(
408 sd_bus *bus,
409diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
410index 3c59d0d615..746922d46f 100644
411--- a/src/libsystemd/sd-bus/bus-socket.c
412+++ b/src/libsystemd/sd-bus/bus-socket.c
413@@ -29,6 +29,7 @@
414 #include "string-util.h"
415 #include "user-util.h"
416 #include "utf8.h"
417+#include "missing_stdlib.h"
418
419 #define SNDBUF_SIZE (8*1024*1024)
420
421diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
422index 4a0259f8bb..aaa90d2223 100644
423--- a/src/libsystemd/sd-bus/sd-bus.c
424+++ b/src/libsystemd/sd-bus/sd-bus.c
425@@ -46,6 +46,7 @@
426 #include "string-util.h"
427 #include "strv.h"
428 #include "user-util.h"
429+#include "missing_stdlib.h"
430
431 #define log_debug_bus_message(m) \
432 do { \
433diff --git a/src/libsystemd/sd-bus/test-bus-benchmark.c b/src/libsystemd/sd-bus/test-bus-benchmark.c
434index d988588de0..458df8df9a 100644
435--- a/src/libsystemd/sd-bus/test-bus-benchmark.c
436+++ b/src/libsystemd/sd-bus/test-bus-benchmark.c
437@@ -14,6 +14,7 @@
438 #include "string-util.h"
439 #include "tests.h"
440 #include "time-util.h"
441+#include "missing_stdlib.h"
442
443 #define MAX_SIZE (2*1024*1024)
444
445diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c
446index 6b9ff0a4ed..4a5027ad0f 100644
447--- a/src/libsystemd/sd-journal/sd-journal.c
448+++ b/src/libsystemd/sd-journal/sd-journal.c
449@@ -44,6 +44,7 @@
450 #include "strv.h"
451 #include "syslog-util.h"
452 #include "uid-alloc-range.h"
453+#include "missing_stdlib.h"
454
455 #define JOURNAL_FILES_RECHECK_USEC (2 * USEC_PER_SEC)
456
457diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c
458index b8da266e27..4bb8dd9496 100644
459--- a/src/login/pam_systemd.c
460+++ b/src/login/pam_systemd.c
461@@ -35,6 +35,7 @@
462 #include "login-util.h"
463 #include "macro.h"
464 #include "missing_syscall.h"
465+#include "missing_stdlib.h"
466 #include "pam-util.h"
467 #include "parse-util.h"
468 #include "path-util.h"
469diff --git a/src/network/generator/network-generator.c b/src/network/generator/network-generator.c
470index 48527a2c73..9777fe0561 100644
471--- a/src/network/generator/network-generator.c
472+++ b/src/network/generator/network-generator.c
473@@ -14,6 +14,7 @@
474 #include "string-table.h"
475 #include "string-util.h"
476 #include "strv.h"
477+#include "missing_stdlib.h"
478
479 /*
480 # .network
481diff --git a/src/nspawn/nspawn-settings.c b/src/nspawn/nspawn-settings.c
482index 161b1c1c70..ba1c459f78 100644
483--- a/src/nspawn/nspawn-settings.c
484+++ b/src/nspawn/nspawn-settings.c
485@@ -16,6 +16,7 @@
486 #include "string-util.h"
487 #include "strv.h"
488 #include "user-util.h"
489+#include "missing_stdlib.h"
490
491 Settings *settings_new(void) {
492 Settings *s;
493diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c
494index c64e79bdff..eda26b0b9a 100644
495--- a/src/nss-mymachines/nss-mymachines.c
496+++ b/src/nss-mymachines/nss-mymachines.c
497@@ -21,6 +21,7 @@
498 #include "nss-util.h"
499 #include "signal-util.h"
500 #include "string-util.h"
501+#include "missing_stdlib.h"
502
503 static void setup_logging_once(void) {
504 static pthread_once_t once = PTHREAD_ONCE_INIT;
505diff --git a/src/portable/portable.c b/src/portable/portable.c
506index d4b448a627..bb26623565 100644
507--- a/src/portable/portable.c
508+++ b/src/portable/portable.c
509@@ -40,6 +40,7 @@
510 #include "strv.h"
511 #include "tmpfile-util.h"
512 #include "user-util.h"
513+#include "missing_stdlib.h"
514
515 /* Markers used in the first line of our 20-portable.conf unit file drop-in to determine, that a) the unit file was
516 * dropped there by the portable service logic and b) for which image it was dropped there. */
517diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c
518index afa537f160..32ccee4ae5 100644
519--- a/src/resolve/resolvectl.c
520+++ b/src/resolve/resolvectl.c
521@@ -48,6 +48,7 @@
522 #include "varlink.h"
523 #include "verb-log-control.h"
524 #include "verbs.h"
525+#include "missing_stdlib.h"
526
527 static int arg_family = AF_UNSPEC;
528 static int arg_ifindex = 0;
529diff --git a/src/shared/bus-get-properties.c b/src/shared/bus-get-properties.c
530index 53e5d6b99f..851ecd5644 100644
531--- a/src/shared/bus-get-properties.c
532+++ b/src/shared/bus-get-properties.c
533@@ -4,6 +4,7 @@
534 #include "rlimit-util.h"
535 #include "stdio-util.h"
536 #include "string-util.h"
537+#include "missing_stdlib.h"
538
539 int bus_property_get_bool(
540 sd_bus *bus,
541diff --git a/src/shared/bus-unit-procs.c b/src/shared/bus-unit-procs.c
542index 8b462b5627..183ce1c18e 100644
543--- a/src/shared/bus-unit-procs.c
544+++ b/src/shared/bus-unit-procs.c
545@@ -11,6 +11,7 @@
546 #include "sort-util.h"
547 #include "string-util.h"
548 #include "terminal-util.h"
549+#include "missing_stdlib.h"
550
551 struct CGroupInfo {
552 char *cgroup_path;
553diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
554index 4ee9706847..30c8084847 100644
555--- a/src/shared/bus-unit-util.c
556+++ b/src/shared/bus-unit-util.c
557@@ -50,6 +50,7 @@
558 #include "unit-def.h"
559 #include "user-util.h"
560 #include "utf8.h"
561+#include "missing_stdlib.h"
562
563 int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
564 assert(message);
565diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
566index 4123152d93..74f148c8b4 100644
567--- a/src/shared/bus-util.c
568+++ b/src/shared/bus-util.c
569@@ -24,6 +24,7 @@
570 #include "path-util.h"
571 #include "socket-util.h"
572 #include "stdio-util.h"
573+#include "missing_stdlib.h"
574
575 static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
576 sd_event *e = ASSERT_PTR(userdata);
577diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
578index b41c9b06ca..e69050a507 100644
579--- a/src/shared/dns-domain.c
580+++ b/src/shared/dns-domain.c
581@@ -18,6 +18,7 @@
582 #include "string-util.h"
583 #include "strv.h"
584 #include "utf8.h"
585+#include "missing_stdlib.h"
586
587 int dns_label_unescape(const char **name, char *dest, size_t sz, DNSLabelFlags flags) {
588 const char *n;
589diff --git a/src/shared/journal-importer.c b/src/shared/journal-importer.c
590index 83e9834bbf..74eaae6f5e 100644
591--- a/src/shared/journal-importer.c
592+++ b/src/shared/journal-importer.c
593@@ -16,6 +16,7 @@
594 #include "string-util.h"
595 #include "strv.h"
596 #include "unaligned.h"
597+#include "missing_stdlib.h"
598
599 enum {
600 IMPORTER_STATE_LINE = 0, /* waiting to read, or reading line */
601diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
602index a5d04003bd..10392c132d 100644
603--- a/src/shared/logs-show.c
604+++ b/src/shared/logs-show.c
605@@ -41,6 +41,7 @@
606 #include "time-util.h"
607 #include "utf8.h"
608 #include "web-util.h"
609+#include "missing_stdlib.h"
610
611 /* up to three lines (each up to 100 characters) or 300 characters, whichever is less */
612 #define PRINT_LINE_THRESHOLD 3
613diff --git a/src/shared/pager.c b/src/shared/pager.c
614index 19deefab56..6b6d0af1a0 100644
615--- a/src/shared/pager.c
616+++ b/src/shared/pager.c
617@@ -25,6 +25,7 @@
618 #include "string-util.h"
619 #include "strv.h"
620 #include "terminal-util.h"
621+#include "missing_stdlib.h"
622
623 static pid_t pager_pid = 0;
624
625diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c
626index 287fd6c181..8f8d5493da 100644
627--- a/src/socket-proxy/socket-proxyd.c
628+++ b/src/socket-proxy/socket-proxyd.c
629@@ -27,6 +27,7 @@
630 #include "set.h"
631 #include "socket-util.h"
632 #include "string-util.h"
633+#include "missing_stdlib.h"
634
635 #define BUFFER_SIZE (256 * 1024)
636
637diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
638index f884008660..987e180697 100644
639--- a/src/test/test-hexdecoct.c
640+++ b/src/test/test-hexdecoct.c
641@@ -7,6 +7,7 @@
642 #include "macro.h"
643 #include "random-util.h"
644 #include "string-util.h"
645+#include "missing_stdlib.h"
646 #include "tests.h"
647
648 TEST(hexchar) {
649diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
650index 91b40088f4..f528a46b8e 100644
651--- a/src/udev/udev-builtin-net_id.c
652+++ b/src/udev/udev-builtin-net_id.c
653@@ -39,6 +39,7 @@
654 #include "strv.h"
655 #include "strxcpyx.h"
656 #include "udev-builtin.h"
657+#include "missing_stdlib.h"
658
659 #define ONBOARD_14BIT_INDEX_MAX ((1U << 14) - 1)
660 #define ONBOARD_16BIT_INDEX_MAX ((1U << 16) - 1)
661diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c
662index 467c9a6ad3..f74dae60af 100644
663--- a/src/udev/udev-builtin-path_id.c
664+++ b/src/udev/udev-builtin-path_id.c
665@@ -24,6 +24,7 @@
666 #include "sysexits.h"
667 #include "udev-builtin.h"
668 #include "udev-util.h"
669+#include "missing_stdlib.h"
670
671 _printf_(2,3)
672 static void path_prepend(char **path, const char *fmt, ...) {
673diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
674index ed22c8b679..19ebe20237 100644
675--- a/src/udev/udev-event.c
676+++ b/src/udev/udev-event.c
677@@ -16,6 +16,7 @@
678 #include "udev-util.h"
679 #include "udev-watch.h"
680 #include "user-util.h"
681+#include "missing_stdlib.h"
682
683 UdevEvent *udev_event_new(sd_device *dev, usec_t exec_delay_usec, sd_netlink *rtnl, int log_level) {
684 UdevEvent *event;
685diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
686index 5f12002394..febe345b4c 100644
687--- a/src/udev/udev-rules.c
688+++ b/src/udev/udev-rules.c
689@@ -41,6 +41,7 @@
690 #include "udev-util.h"
691 #include "user-util.h"
692 #include "virt.h"
693+#include "missing_stdlib.h"
694
695 #define RULES_DIRS ((const char* const*) CONF_PATHS_STRV("udev/rules.d"))
696
697--
6982.34.1
699
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0004-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0004-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
deleted file mode 100644
index 15877bea88..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0004-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
+++ /dev/null
@@ -1,156 +0,0 @@
1From 5325ab5813617f35f03806ec420829dde7104387 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 14:56:21 +0800
4Subject: [PATCH 04/22] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not
5 defined
6
7If the standard library doesn't provide brace
8expansion users just won't get it.
9
10Dont use GNU GLOB extentions on non-glibc systems
11
12Conditionalize use of GLOB_ALTDIRFUNC
13
14Upstream-Status: Inappropriate [musl specific]
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
18[rebased for systemd 243]
19Signed-off-by: Scott Murray <scott.murray@konsulko.com>
20---
21 src/basic/glob-util.c | 12 ++++++++++++
22 src/test/test-glob-util.c | 16 ++++++++++++++++
23 src/tmpfiles/tmpfiles.c | 10 ++++++++++
24 3 files changed, 38 insertions(+)
25
26diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c
27index 802ca8c655..23818a67c6 100644
28--- a/src/basic/glob-util.c
29+++ b/src/basic/glob-util.c
30@@ -12,6 +12,12 @@
31 #include "path-util.h"
32 #include "strv.h"
33
34+/* Don't fail if the standard library
35+ * doesn't provide brace expansion */
36+#ifndef GLOB_BRACE
37+#define GLOB_BRACE 0
38+#endif
39+
40 static void closedir_wrapper(void* v) {
41 (void) closedir(v);
42 }
43@@ -19,6 +25,7 @@ static void closedir_wrapper(void* v) {
44 int safe_glob(const char *path, int flags, glob_t *pglob) {
45 int k;
46
47+#ifdef GLOB_ALTDIRFUNC
48 /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */
49 assert(!(flags & GLOB_ALTDIRFUNC));
50
51@@ -32,9 +39,14 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
52 pglob->gl_lstat = lstat;
53 if (!pglob->gl_stat)
54 pglob->gl_stat = stat;
55+#endif
56
57 errno = 0;
58+#ifdef GLOB_ALTDIRFUNC
59 k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob);
60+#else
61+ k = glob(path, flags, NULL, pglob);
62+#endif
63 if (k == GLOB_NOMATCH)
64 return -ENOENT;
65 if (k == GLOB_NOSPACE)
66diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c
67index 9b3e73cce0..3790ba3be5 100644
68--- a/src/test/test-glob-util.c
69+++ b/src/test/test-glob-util.c
70@@ -34,6 +34,12 @@ TEST(glob_first) {
71 assert_se(first == NULL);
72 }
73
74+/* Don't fail if the standard library
75+ * doesn't provide brace expansion */
76+#ifndef GLOB_BRACE
77+#define GLOB_BRACE 0
78+#endif
79+
80 TEST(glob_exists) {
81 char name[] = "/tmp/test-glob_exists.XXXXXX";
82 int fd = -EBADF;
83@@ -61,11 +67,13 @@ TEST(glob_no_dot) {
84 const char *fn;
85
86 _cleanup_globfree_ glob_t g = {
87+#ifdef GLOB_ALTDIRFUNC
88 .gl_closedir = closedir_wrapper,
89 .gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot,
90 .gl_opendir = (void *(*)(const char *)) opendir,
91 .gl_lstat = lstat,
92 .gl_stat = stat,
93+#endif
94 };
95
96 int r;
97@@ -73,11 +81,19 @@ TEST(glob_no_dot) {
98 assert_se(mkdtemp(template));
99
100 fn = strjoina(template, "/*");
101+#ifdef GLOB_ALTDIRFUNC
102 r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
103+#else
104+ r = glob(fn, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
105+#endif
106 assert_se(r == GLOB_NOMATCH);
107
108 fn = strjoina(template, "/.*");
109+#ifdef GLOB_ALTDIRFUNC
110 r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
111+#else
112+ r = glob(fn, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
113+#endif
114 assert_se(r == GLOB_NOMATCH);
115
116 (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL);
117diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
118index 230ec09b97..2cc5f391d7 100644
119--- a/src/tmpfiles/tmpfiles.c
120+++ b/src/tmpfiles/tmpfiles.c
121@@ -73,6 +73,12 @@
122 #include "user-util.h"
123 #include "virt.h"
124
125+/* Don't fail if the standard library
126+ * doesn't provide brace expansion */
127+#ifndef GLOB_BRACE
128+#define GLOB_BRACE 0
129+#endif
130+
131 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
132 * them in the file system. This is intended to be used to create
133 * properly owned directories beneath /tmp, /var/tmp, /run, which are
134@@ -2434,7 +2440,9 @@ finish:
135
136 static int glob_item(Context *c, Item *i, action_t action) {
137 _cleanup_globfree_ glob_t g = {
138+#ifdef GLOB_ALTDIRFUNC
139 .gl_opendir = (void *(*)(const char *)) opendir_nomod,
140+#endif
141 };
142 int r = 0, k;
143
144@@ -2461,7 +2469,9 @@ static int glob_item_recursively(
145 fdaction_t action) {
146
147 _cleanup_globfree_ glob_t g = {
148+#ifdef GLOB_ALTDIRFUNC
149 .gl_opendir = (void *(*)(const char *)) opendir_nomod,
150+#endif
151 };
152 int r = 0, k;
153
154--
1552.34.1
156
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0005-add-missing-FTW_-macros-for-musl.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0005-add-missing-FTW_-macros-for-musl.patch
deleted file mode 100644
index a1dfca22cd..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0005-add-missing-FTW_-macros-for-musl.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From dad7f897c0de654fa5592fda3e90f874639849f9 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 15:00:06 +0800
4Subject: [PATCH 05/22] add missing FTW_ macros for musl
5
6This is to avoid build failures like below for musl.
7
8 locale-util.c:296:24: error: 'FTW_STOP' undeclared
9
10Upstream-Status: Inappropriate [musl specific]
11
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13---
14 src/basic/missing_type.h | 4 ++++
15 src/test/test-recurse-dir.c | 1 +
16 2 files changed, 5 insertions(+)
17
18diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
19index 6c0456349d..73a5b90e3c 100644
20--- a/src/basic/missing_type.h
21+++ b/src/basic/missing_type.h
22@@ -14,3 +14,7 @@
23 #ifndef __GLIBC__
24 typedef int (*comparison_fn_t)(const void *, const void *);
25 #endif
26+
27+#ifndef FTW_CONTINUE
28+#define FTW_CONTINUE 0
29+#endif
30diff --git a/src/test/test-recurse-dir.c b/src/test/test-recurse-dir.c
31index 8684d064ec..70fc2b5376 100644
32--- a/src/test/test-recurse-dir.c
33+++ b/src/test/test-recurse-dir.c
34@@ -8,6 +8,7 @@
35 #include "recurse-dir.h"
36 #include "strv.h"
37 #include "tests.h"
38+#include "missing_type.h"
39
40 static char **list_nftw = NULL;
41
42--
432.34.1
44
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0006-Use-uintmax_t-for-handling-rlim_t.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0006-Use-uintmax_t-for-handling-rlim_t.patch
deleted file mode 100644
index 4be14b72ec..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0006-Use-uintmax_t-for-handling-rlim_t.patch
+++ /dev/null
@@ -1,106 +0,0 @@
1From 96e975a2412a20e5f80bd3ab144057d275eb8597 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 15:12:41 +0800
4Subject: [PATCH 06/22] Use uintmax_t for handling rlim_t
5
6PRIu{32,64} is not right format to represent rlim_t type
7therefore use %ju and typecast the rlim_t variables to
8uintmax_t.
9
10Fixes portablility errors like
11
12execute.c:3446:36: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=]
13| fprintf(f, "%s%s: " RLIM_FMT "\n",
14| ^~~~~~~~
15| prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
16| ~~~~~~~~~~~~~~~~~~~~~~
17
18Upstream-Status: Denied [https://github.com/systemd/systemd/pull/7199]
19
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21[Rebased for v241]
22Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
23---
24 src/basic/format-util.h | 8 +-------
25 src/basic/rlimit-util.c | 12 ++++++------
26 src/core/execute.c | 4 ++--
27 3 files changed, 9 insertions(+), 15 deletions(-)
28
29diff --git a/src/basic/format-util.h b/src/basic/format-util.h
30index 8719df3e29..9becc96066 100644
31--- a/src/basic/format-util.h
32+++ b/src/basic/format-util.h
33@@ -34,13 +34,7 @@ assert_cc(sizeof(gid_t) == sizeof(uint32_t));
34 # error Unknown timex member size
35 #endif
36
37-#if SIZEOF_RLIM_T == 8
38-# define RLIM_FMT "%" PRIu64
39-#elif SIZEOF_RLIM_T == 4
40-# define RLIM_FMT "%" PRIu32
41-#else
42-# error Unknown rlim_t size
43-#endif
44+#define RLIM_FMT "%ju"
45
46 #if SIZEOF_DEV_T == 8
47 # define DEV_FMT "%" PRIu64
48diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
49index c1f0b2b974..61c5412582 100644
50--- a/src/basic/rlimit-util.c
51+++ b/src/basic/rlimit-util.c
52@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
53 fixed.rlim_max == highest.rlim_max)
54 return 0;
55
56- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max);
57+ log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max);
58
59 return RET_NERRNO(setrlimit(resource, &fixed));
60 }
61@@ -307,13 +307,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) {
62 if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY)
63 r = free_and_strdup(&s, "infinity");
64 else if (rl->rlim_cur >= RLIM_INFINITY)
65- r = asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max);
66+ r = asprintf(&s, "infinity:" RLIM_FMT, (uintmax_t)rl->rlim_max);
67 else if (rl->rlim_max >= RLIM_INFINITY)
68- r = asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur);
69+ r = asprintf(&s, RLIM_FMT ":infinity", (uintmax_t)rl->rlim_cur);
70 else if (rl->rlim_cur == rl->rlim_max)
71- r = asprintf(&s, RLIM_FMT, rl->rlim_cur);
72+ r = asprintf(&s, RLIM_FMT, (uintmax_t)rl->rlim_cur);
73 else
74- r = asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max);
75+ r = asprintf(&s, RLIM_FMT ":" RLIM_FMT, (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max);
76 if (r < 0)
77 return -ENOMEM;
78
79@@ -422,7 +422,7 @@ int rlimit_nofile_safe(void) {
80 rl.rlim_max = MIN(rl.rlim_max, (rlim_t) read_nr_open());
81 rl.rlim_cur = MIN((rlim_t) FD_SETSIZE, rl.rlim_max);
82 if (setrlimit(RLIMIT_NOFILE, &rl) < 0)
83- return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", rl.rlim_cur);
84+ return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", (uintmax_t)rl.rlim_cur);
85
86 return 1;
87 }
88diff --git a/src/core/execute.c b/src/core/execute.c
89index bd3da0c401..df1870fd2f 100644
90--- a/src/core/execute.c
91+++ b/src/core/execute.c
92@@ -1045,9 +1045,9 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) {
93 for (unsigned i = 0; i < RLIM_NLIMITS; i++)
94 if (c->rlimit[i]) {
95 fprintf(f, "%sLimit%s: " RLIM_FMT "\n",
96- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
97+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max);
98 fprintf(f, "%sLimit%sSoft: " RLIM_FMT "\n",
99- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur);
100+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur);
101 }
102
103 if (c->ioprio_set) {
104--
1052.34.1
106
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0007-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0007-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
deleted file mode 100644
index 8d6084239e..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0007-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
+++ /dev/null
@@ -1,99 +0,0 @@
1From 4842cff4f1329f0b5034b529d56f8ad1f234ac4c Mon Sep 17 00:00:00 2001
2From: Andre McCurdy <armccurdy@gmail.com>
3Date: Tue, 10 Oct 2017 14:33:30 -0700
4Subject: [PATCH 07/22] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat()
5
6Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right
7thing to do and it's not portable (not supported by musl). See:
8
9 http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003610.html
10 http://www.openwall.com/lists/musl/2015/02/05/2
11
12Note that laccess() is never passing AT_EACCESS so a lot of the
13discussion in the links above doesn't apply. Note also that
14(currently) all systemd callers of laccess() pass mode as F_OK, so
15only check for existence of a file, not access permissions.
16Therefore, in this case, the only distiction between faccessat()
17with (flag == 0) and (flag == AT_SYMLINK_NOFOLLOW) is the behaviour
18for broken symlinks; laccess() on a broken symlink will succeed with
19(flag == AT_SYMLINK_NOFOLLOW) and fail (flag == 0).
20
21The laccess() macros was added to systemd some time ago and it's not
22clear if or why it needs to return success for broken symlinks. Maybe
23just historical and not actually necessary or desired behaviour?
24
25Upstream-Status: Inappropriate [musl specific]
26
27Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
28---
29 src/basic/fs-util.h | 21 ++++++++++++++++++++-
30 src/shared/base-filesystem.c | 6 +++---
31 2 files changed, 23 insertions(+), 4 deletions(-)
32
33diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
34index 1023ab73ca..c78ff6f27f 100644
35--- a/src/basic/fs-util.h
36+++ b/src/basic/fs-util.h
37@@ -49,8 +49,27 @@ int futimens_opath(int fd, const struct timespec ts[2]);
38 int fd_warn_permissions(const char *path, int fd);
39 int stat_warn_permissions(const char *path, const struct stat *st);
40
41+/*
42+ Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right thing to
43+ do and it's not portable (not supported by musl). See:
44+
45+ http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003610.html
46+ http://www.openwall.com/lists/musl/2015/02/05/2
47+
48+ Note that laccess() is never passing AT_EACCESS so a lot of the discussion in
49+ the links above doesn't apply. Note also that (currently) all systemd callers
50+ of laccess() pass mode as F_OK, so only check for existence of a file, not
51+ access permissions. Therefore, in this case, the only distiction between
52+ faccessat() with (flag == 0) and (flag == AT_SYMLINK_NOFOLLOW) is the
53+ behaviour for broken symlinks; laccess() on a broken symlink will succeed
54+ with (flag == AT_SYMLINK_NOFOLLOW) and fail (flag == 0).
55+
56+ The laccess() macros was added to systemd some time ago and it's not clear if
57+ or why it needs to return success for broken symlinks. Maybe just historical
58+ and not actually necessary or desired behaviour?
59+*/
60 #define laccess(path, mode) \
61- RET_NERRNO(faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW))
62+ RET_NERRNO(faccessat(AT_FDCWD, (path), (mode), 0))
63
64 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
65
66diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
67index 569ef466c3..7ae921a113 100644
68--- a/src/shared/base-filesystem.c
69+++ b/src/shared/base-filesystem.c
70@@ -145,7 +145,7 @@ int base_filesystem_create_fd(int fd, const char *root, uid_t uid, gid_t gid) {
71 /* The "root" parameter is decoration only – it's only used as part of log messages */
72
73 for (size_t i = 0; i < ELEMENTSOF(table); i++) {
74- if (faccessat(fd, table[i].dir, F_OK, AT_SYMLINK_NOFOLLOW) >= 0)
75+ if (faccessat(fd, table[i].dir, F_OK, 0) >= 0)
76 continue;
77
78 if (table[i].target) { /* Create as symlink? */
79@@ -153,7 +153,7 @@ int base_filesystem_create_fd(int fd, const char *root, uid_t uid, gid_t gid) {
80
81 /* check if one of the targets exists */
82 NULSTR_FOREACH(s, table[i].target) {
83- if (faccessat(fd, s, F_OK, AT_SYMLINK_NOFOLLOW) < 0)
84+ if (faccessat(fd, s, F_OK, 0) < 0)
85 continue;
86
87 /* check if a specific file exists at the target path */
88@@ -164,7 +164,7 @@ int base_filesystem_create_fd(int fd, const char *root, uid_t uid, gid_t gid) {
89 if (!p)
90 return log_oom();
91
92- if (faccessat(fd, p, F_OK, AT_SYMLINK_NOFOLLOW) < 0)
93+ if (faccessat(fd, p, F_OK, 0) < 0)
94 continue;
95 }
96
97--
982.34.1
99
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch
deleted file mode 100644
index c1a8bb19fe..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From bab07e779ff23d5593bb118efaaa31b60a6dce87 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 27 May 2018 08:36:44 -0700
4Subject: [PATCH 08/22] Define glibc compatible basename() for non-glibc
5 systems
6
7Fixes builds with musl, even though systemd is adamant about
8using non-posix basename implementation, we have a way out
9
10Upstream-Status: Inappropriate [musl specific]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 src/basic/string-util.h | 4 ++++
15 1 file changed, 4 insertions(+)
16
17diff --git a/src/basic/string-util.h b/src/basic/string-util.h
18index b6d8be3083..0a29036c4c 100644
19--- a/src/basic/string-util.h
20+++ b/src/basic/string-util.h
21@@ -26,6 +26,10 @@
22 #define URI_UNRESERVED ALPHANUMERICAL "-._~" /* [RFC3986] */
23 #define URI_VALID URI_RESERVED URI_UNRESERVED /* [RFC3986] */
24
25+#if !defined(__GLIBC__)
26+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
27+#endif
28+
29 static inline char* strstr_ptr(const char *haystack, const char *needle) {
30 if (!haystack || !needle)
31 return NULL;
32--
332.34.1
34
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0008-implment-systemd-sysv-install-for-OE.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0008-implment-systemd-sysv-install-for-OE.patch
deleted file mode 100644
index acff18dc43..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0008-implment-systemd-sysv-install-for-OE.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 5712d56f1cd654d2e5d2e9117ff77fe4c299f76b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 5 Sep 2015 06:31:47 +0000
4Subject: [PATCH] implment systemd-sysv-install for OE
5
6Use update-rc.d for enabling/disabling and status command
7to check the status of the sysv service
8
9Upstream-Status: Inappropriate [OE-Specific]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 src/systemctl/systemd-sysv-install.SKELETON | 6 +++---
14 1 file changed, 3 insertions(+), 3 deletions(-)
15
16diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON
17index cb58d8243b..000bdf6165 100755
18--- a/src/systemctl/systemd-sysv-install.SKELETON
19+++ b/src/systemctl/systemd-sysv-install.SKELETON
20@@ -34,17 +34,17 @@ case "$1" in
21 enable)
22 # call the command to enable SysV init script $NAME here
23 # (consider optional $ROOT)
24- echo "IMPLEMENT ME: enabling SysV init.d script $NAME"
25+ update-rc.d -f $NAME defaults
26 ;;
27 disable)
28 # call the command to disable SysV init script $NAME here
29 # (consider optional $ROOT)
30- echo "IMPLEMENT ME: disabling SysV init.d script $NAME"
31+ update-rc.d -f $NAME remove
32 ;;
33 is-enabled)
34 # exit with 0 if $NAME is enabled, non-zero if it is disabled
35 # (consider optional $ROOT)
36- echo "IMPLEMENT ME: checking SysV init.d script $NAME"
37+ /etc/init.d/$NAME status
38 ;;
39 *)
40 usage ;;
41--
422.39.2
43
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
deleted file mode 100644
index 3ff0177ae3..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From 25093c5017725b8577c444dfea0f42ad85b43522 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 4 Jul 2018 15:00:44 +0800
4Subject: [PATCH 09/22] Do not disable buffering when writing to oom_score_adj
5
6On musl, disabling buffering when writing to oom_score_adj will
7cause the following error.
8
9 Failed to adjust OOM setting: Invalid argument
10
11This error appears for systemd-udevd.service and dbus.service.
12This is because kernel receives '-' instead of the whole '-900'
13if buffering is disabled.
14
15This is libc implementation specific, as glibc does not have this issue.
16
17Upstream-Status: Inappropriate [musl specific]
18
19Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
20[rebased for systemd 243]
21Signed-off-by: Scott Murray <scott.murray@konsulko.com>
22---
23 src/basic/process-util.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/src/basic/process-util.c b/src/basic/process-util.c
27index 201c5596ae..ea51595b6c 100644
28--- a/src/basic/process-util.c
29+++ b/src/basic/process-util.c
30@@ -1716,7 +1716,7 @@ int set_oom_score_adjust(int value) {
31 xsprintf(t, "%i", value);
32
33 return write_string_file("/proc/self/oom_score_adj", t,
34- WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER);
35+ WRITE_STRING_FILE_VERIFY_ON_FAILURE);
36 }
37
38 int get_oom_score_adjust(int *ret) {
39--
402.34.1
41
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
deleted file mode 100644
index cf59ac7d06..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
+++ /dev/null
@@ -1,76 +0,0 @@
1From 2adbe9773cd65c48eec9df96868d4a738927c8d9 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 10 Jul 2018 15:40:17 +0800
4Subject: [PATCH 10/22] distinguish XSI-compliant strerror_r from GNU-specifi
5 strerror_r
6
7XSI-compliant strerror_r and GNU-specifi strerror_r are different.
8
9 int strerror_r(int errnum, char *buf, size_t buflen);
10 /* XSI-compliant */
11
12 char *strerror_r(int errnum, char *buf, size_t buflen);
13 /* GNU-specific */
14
15We need to distinguish between them. Otherwise, we'll get an int value
16assigned to (char *) variable, resulting in segment fault.
17
18Upstream-Status: Inappropriate [musl specific]
19
20Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
21---
22 src/libsystemd/sd-bus/bus-error.c | 11 ++++++++++-
23 src/libsystemd/sd-journal/journal-send.c | 5 +++++
24 2 files changed, 15 insertions(+), 1 deletion(-)
25
26diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
27index 77b2e1a0fd..fdba0e0142 100644
28--- a/src/libsystemd/sd-bus/bus-error.c
29+++ b/src/libsystemd/sd-bus/bus-error.c
30@@ -408,7 +408,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
31 return;
32
33 errno = 0;
34+#ifndef __GLIBC__
35+ strerror_r(error, m, k);
36+ x = m;
37+#else
38 x = strerror_r(error, m, k);
39+#endif
40 if (errno == ERANGE || strlen(x) >= k - 1) {
41 free(m);
42 k *= 2;
43@@ -593,8 +598,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
44
45 if (e && e->message)
46 return e->message;
47-
48+#ifndef __GLIBC__
49+ strerror_r(abs(error), buf, ERRNO_BUF_LEN);
50+ return buf;
51+#else
52 return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
53+#endif
54 }
55
56 static bool map_ok(const sd_bus_error_map *map) {
57diff --git a/src/libsystemd/sd-journal/journal-send.c b/src/libsystemd/sd-journal/journal-send.c
58index 69a2eb6404..1561859650 100644
59--- a/src/libsystemd/sd-journal/journal-send.c
60+++ b/src/libsystemd/sd-journal/journal-send.c
61@@ -361,7 +361,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
62 char* j;
63
64 errno = 0;
65+#ifndef __GLIBC__
66+ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
67+ j = buffer + 8 + k;
68+#else
69 j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
70+#endif
71 if (errno == 0) {
72 char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
73
74--
752.34.1
76
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0011-avoid-redefinition-of-prctl_mm_map-structure.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0011-avoid-redefinition-of-prctl_mm_map-structure.patch
deleted file mode 100644
index e481b2e2e4..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0011-avoid-redefinition-of-prctl_mm_map-structure.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From 49c446cfb78cf74a909bed8c3798b77a5469866a Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 15:44:54 +0800
4Subject: [PATCH 11/22] avoid redefinition of prctl_mm_map structure
5
6Fix the following compile failure:
7error: redefinition of 'struct prctl_mm_map'
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 src/basic/missing_prctl.h | 2 ++
14 1 file changed, 2 insertions(+)
15
16diff --git a/src/basic/missing_prctl.h b/src/basic/missing_prctl.h
17index 7d9e395c92..88c2d7dfac 100644
18--- a/src/basic/missing_prctl.h
19+++ b/src/basic/missing_prctl.h
20@@ -1,7 +1,9 @@
21 /* SPDX-License-Identifier: LGPL-2.1-or-later */
22 #pragma once
23
24+#ifdef __GLIBC__
25 #include <linux/prctl.h>
26+#endif
27
28 /* 58319057b7847667f0c9585b9de0e8932b0fdb08 (4.3) */
29 #ifndef PR_CAP_AMBIENT
30--
312.34.1
32
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0012-do-not-disable-buffer-in-writing-files.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0012-do-not-disable-buffer-in-writing-files.patch
deleted file mode 100644
index c23d9b7551..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0012-do-not-disable-buffer-in-writing-files.patch
+++ /dev/null
@@ -1,515 +0,0 @@
1From e4885a8e60f883d9217e26e1db3754c2906aca31 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 1 Mar 2019 15:22:15 +0800
4Subject: [PATCH 12/22] do not disable buffer in writing files
5
6Do not disable buffer in writing files, otherwise we get
7failure at boot for musl like below.
8
9 [!!!!!!] Failed to allocate manager object.
10
11And there will be other failures, critical or not critical.
12This is specific to musl.
13
14Upstream-Status: Inappropriate [musl]
15
16Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
17[Rebased for v242]
18Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
19[rebased for systemd 243]
20Signed-off-by: Scott Murray <scott.murray@konsulko.com>
21[rebased for systemd 254]
22Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
23[rebased for systemd 255.1]
24---
25 src/basic/cgroup-util.c | 12 ++++++------
26 src/basic/namespace-util.c | 4 ++--
27 src/basic/procfs-util.c | 4 ++--
28 src/basic/sysctl-util.c | 2 +-
29 src/binfmt/binfmt.c | 6 +++---
30 src/core/cgroup.c | 2 +-
31 src/core/main.c | 2 +-
32 src/core/smack-setup.c | 8 ++++----
33 src/home/homework.c | 2 +-
34 src/libsystemd/sd-device/sd-device.c | 2 +-
35 src/nspawn/nspawn-cgroup.c | 2 +-
36 src/nspawn/nspawn.c | 6 +++---
37 src/shared/binfmt-util.c | 2 +-
38 src/shared/cgroup-setup.c | 4 ++--
39 src/shared/coredump-util.c | 4 ++--
40 src/shared/hibernate-util.c | 4 ++--
41 src/shared/smack-util.c | 2 +-
42 src/shared/watchdog.c | 2 +-
43 src/sleep/sleep.c | 4 ++--
44 src/storagetm/storagetm.c | 24 ++++++++++++------------
45 src/udev/udev-rules.c | 1 -
46 src/vconsole/vconsole-setup.c | 2 +-
47 22 files changed, 50 insertions(+), 51 deletions(-)
48
49--- a/src/basic/cgroup-util.c
50+++ b/src/basic/cgroup-util.c
51@@ -417,7 +417,7 @@ int cg_kill_kernel_sigkill(const char *p
52 if (r < 0)
53 return r;
54
55- r = write_string_file(killfile, "1", WRITE_STRING_FILE_DISABLE_BUFFER);
56+ r = write_string_file(killfile, "1", 0);
57 if (r < 0)
58 return r;
59
60@@ -843,7 +843,7 @@ int cg_install_release_agent(const char
61
62 sc = strstrip(contents);
63 if (isempty(sc)) {
64- r = write_string_file(fs, agent, WRITE_STRING_FILE_DISABLE_BUFFER);
65+ r = write_string_file(fs, agent, 0);
66 if (r < 0)
67 return r;
68 } else if (!path_equal(sc, agent))
69@@ -861,7 +861,7 @@ int cg_install_release_agent(const char
70
71 sc = strstrip(contents);
72 if (streq(sc, "0")) {
73- r = write_string_file(fs, "1", WRITE_STRING_FILE_DISABLE_BUFFER);
74+ r = write_string_file(fs, "1", 0);
75 if (r < 0)
76 return r;
77
78@@ -888,7 +888,7 @@ int cg_uninstall_release_agent(const cha
79 if (r < 0)
80 return r;
81
82- r = write_string_file(fs, "0", WRITE_STRING_FILE_DISABLE_BUFFER);
83+ r = write_string_file(fs, "0", 0);
84 if (r < 0)
85 return r;
86
87@@ -898,7 +898,7 @@ int cg_uninstall_release_agent(const cha
88 if (r < 0)
89 return r;
90
91- r = write_string_file(fs, "", WRITE_STRING_FILE_DISABLE_BUFFER);
92+ r = write_string_file(fs, "", 0);
93 if (r < 0)
94 return r;
95
96@@ -1814,7 +1814,7 @@ int cg_set_attribute(const char *control
97 if (r < 0)
98 return r;
99
100- return write_string_file(p, value, WRITE_STRING_FILE_DISABLE_BUFFER);
101+ return write_string_file(p, value, 0);
102 }
103
104 int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) {
105--- a/src/basic/namespace-util.c
106+++ b/src/basic/namespace-util.c
107@@ -227,12 +227,12 @@ int userns_acquire(const char *uid_map,
108 freeze();
109
110 xsprintf(path, "/proc/" PID_FMT "/uid_map", pid);
111- r = write_string_file(path, uid_map, WRITE_STRING_FILE_DISABLE_BUFFER);
112+ r = write_string_file(path, uid_map, 0);
113 if (r < 0)
114 return log_error_errno(r, "Failed to write UID map: %m");
115
116 xsprintf(path, "/proc/" PID_FMT "/gid_map", pid);
117- r = write_string_file(path, gid_map, WRITE_STRING_FILE_DISABLE_BUFFER);
118+ r = write_string_file(path, gid_map, 0);
119 if (r < 0)
120 return log_error_errno(r, "Failed to write GID map: %m");
121
122--- a/src/basic/procfs-util.c
123+++ b/src/basic/procfs-util.c
124@@ -64,13 +64,13 @@ int procfs_tasks_set_limit(uint64_t limi
125 * decrease it, as threads-max is the much more relevant sysctl. */
126 if (limit > pid_max-1) {
127 sprintf(buffer, "%" PRIu64, limit+1); /* Add one, since PID 0 is not a valid PID */
128- r = write_string_file("/proc/sys/kernel/pid_max", buffer, WRITE_STRING_FILE_DISABLE_BUFFER);
129+ r = write_string_file("/proc/sys/kernel/pid_max", buffer, 0);
130 if (r < 0)
131 return r;
132 }
133
134 sprintf(buffer, "%" PRIu64, limit);
135- r = write_string_file("/proc/sys/kernel/threads-max", buffer, WRITE_STRING_FILE_DISABLE_BUFFER);
136+ r = write_string_file("/proc/sys/kernel/threads-max", buffer, 0);
137 if (r < 0) {
138 uint64_t threads_max;
139
140--- a/src/basic/sysctl-util.c
141+++ b/src/basic/sysctl-util.c
142@@ -58,7 +58,7 @@ int sysctl_write(const char *property, c
143
144 log_debug("Setting '%s' to '%s'", p, value);
145
146- return write_string_file(p, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER | WRITE_STRING_FILE_SUPPRESS_REDUNDANT_VIRTUAL);
147+ return write_string_file(p, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_SUPPRESS_REDUNDANT_VIRTUAL);
148 }
149
150 int sysctl_writef(const char *property, const char *format, ...) {
151--- a/src/binfmt/binfmt.c
152+++ b/src/binfmt/binfmt.c
153@@ -30,7 +30,7 @@ static bool arg_unregister = false;
154
155 static int delete_rule(const char *rulename) {
156 const char *fn = strjoina("/proc/sys/fs/binfmt_misc/", rulename);
157- return write_string_file(fn, "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
158+ return write_string_file(fn, "-1", 0);
159 }
160
161 static int apply_rule(const char *filename, unsigned line, const char *rule) {
162@@ -58,7 +58,7 @@ static int apply_rule(const char *filena
163 if (r >= 0)
164 log_debug("%s:%u: Rule '%s' deleted.", filename, line, rulename);
165
166- r = write_string_file("/proc/sys/fs/binfmt_misc/register", rule, WRITE_STRING_FILE_DISABLE_BUFFER);
167+ r = write_string_file("/proc/sys/fs/binfmt_misc/register", rule, 0);
168 if (r < 0)
169 return log_error_errno(r, "%s:%u: Failed to add binary format '%s': %m",
170 filename, line, rulename);
171@@ -248,7 +248,7 @@ static int run(int argc, char *argv[]) {
172 return r;
173
174 /* Flush out all rules */
175- r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
176+ r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", 0);
177 if (r < 0)
178 log_warning_errno(r, "Failed to flush binfmt_misc rules, ignoring: %m");
179 else
180--- a/src/core/cgroup.c
181+++ b/src/core/cgroup.c
182@@ -4578,7 +4578,7 @@ int unit_cgroup_freezer_action(Unit *u,
183 u->freezer_state = FREEZER_THAWING;
184 }
185
186- r = write_string_file(path, one_zero(action == FREEZER_FREEZE), WRITE_STRING_FILE_DISABLE_BUFFER);
187+ r = write_string_file(path, one_zero(action == FREEZER_FREEZE), 0);
188 if (r < 0)
189 return r;
190
191--- a/src/core/main.c
192+++ b/src/core/main.c
193@@ -1678,7 +1678,7 @@ static void initialize_core_pattern(bool
194 if (getpid_cached() != 1)
195 return;
196
197- r = write_string_file("/proc/sys/kernel/core_pattern", arg_early_core_pattern, WRITE_STRING_FILE_DISABLE_BUFFER);
198+ r = write_string_file("/proc/sys/kernel/core_pattern", arg_early_core_pattern, 0);
199 if (r < 0)
200 log_warning_errno(r, "Failed to write '%s' to /proc/sys/kernel/core_pattern, ignoring: %m",
201 arg_early_core_pattern);
202--- a/src/core/smack-setup.c
203+++ b/src/core/smack-setup.c
204@@ -321,17 +321,17 @@ int mac_smack_setup(bool *loaded_policy)
205 }
206
207 #if HAVE_SMACK_RUN_LABEL
208- r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
209+ r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, 0);
210 if (r < 0)
211 log_warning_errno(r, "Failed to set SMACK label \"" SMACK_RUN_LABEL "\" on self: %m");
212- r = write_string_file("/sys/fs/smackfs/ambient", SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
213+ r = write_string_file("/sys/fs/smackfs/ambient", SMACK_RUN_LABEL, 0);
214 if (r < 0)
215 log_warning_errno(r, "Failed to set SMACK ambient label \"" SMACK_RUN_LABEL "\": %m");
216 r = write_string_file("/sys/fs/smackfs/netlabel",
217- "0.0.0.0/0 " SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
218+ "0.0.0.0/0 " SMACK_RUN_LABEL, 0);
219 if (r < 0)
220 log_warning_errno(r, "Failed to set SMACK netlabel rule \"0.0.0.0/0 " SMACK_RUN_LABEL "\": %m");
221- r = write_string_file("/sys/fs/smackfs/netlabel", "127.0.0.1 -CIPSO", WRITE_STRING_FILE_DISABLE_BUFFER);
222+ r = write_string_file("/sys/fs/smackfs/netlabel", "127.0.0.1 -CIPSO", 0);
223 if (r < 0)
224 log_warning_errno(r, "Failed to set SMACK netlabel rule \"127.0.0.1 -CIPSO\": %m");
225 #endif
226--- a/src/home/homework.c
227+++ b/src/home/homework.c
228@@ -278,7 +278,7 @@ static void drop_caches_now(void) {
229 * for details. We write "2" into /proc/sys/vm/drop_caches to ensure dentries/inodes are flushed, but
230 * not more. */
231
232- r = write_string_file("/proc/sys/vm/drop_caches", "2\n", WRITE_STRING_FILE_DISABLE_BUFFER);
233+ r = write_string_file("/proc/sys/vm/drop_caches", "2\n", 0);
234 if (r < 0)
235 log_warning_errno(r, "Failed to drop caches, ignoring: %m");
236 else
237--- a/src/libsystemd/sd-device/sd-device.c
238+++ b/src/libsystemd/sd-device/sd-device.c
239@@ -2516,7 +2516,7 @@ _public_ int sd_device_set_sysattr_value
240 if (!value)
241 return -ENOMEM;
242
243- r = write_string_file(path, value, WRITE_STRING_FILE_DISABLE_BUFFER | WRITE_STRING_FILE_NOFOLLOW);
244+ r = write_string_file(path, value, 0 | WRITE_STRING_FILE_NOFOLLOW);
245 if (r < 0) {
246 /* On failure, clear cache entry, as we do not know how it fails. */
247 device_remove_cached_sysattr_value(device, sysattr);
248--- a/src/nspawn/nspawn-cgroup.c
249+++ b/src/nspawn/nspawn-cgroup.c
250@@ -124,7 +124,7 @@ int sync_cgroup(pid_t pid, CGroupUnified
251 fn = strjoina(tree, cgroup, "/cgroup.procs");
252
253 sprintf(pid_string, PID_FMT, pid);
254- r = write_string_file(fn, pid_string, WRITE_STRING_FILE_DISABLE_BUFFER|WRITE_STRING_FILE_MKDIR_0755);
255+ r = write_string_file(fn, pid_string, WRITE_STRING_FILE_MKDIR_0755);
256 if (r < 0) {
257 log_error_errno(r, "Failed to move process: %m");
258 goto finish;
259--- a/src/nspawn/nspawn.c
260+++ b/src/nspawn/nspawn.c
261@@ -2690,7 +2690,7 @@ static int reset_audit_loginuid(void) {
262 if (streq(p, "4294967295"))
263 return 0;
264
265- r = write_string_file("/proc/self/loginuid", "4294967295", WRITE_STRING_FILE_DISABLE_BUFFER);
266+ r = write_string_file("/proc/self/loginuid", "4294967295", 0);
267 if (r < 0) {
268 log_error_errno(r,
269 "Failed to reset audit login UID. This probably means that your kernel is too\n"
270@@ -4143,7 +4143,7 @@ static int setup_uid_map(
271 return log_oom();
272
273 xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid);
274- r = write_string_file(uid_map, s, WRITE_STRING_FILE_DISABLE_BUFFER);
275+ r = write_string_file(uid_map, s, 0);
276 if (r < 0)
277 return log_error_errno(r, "Failed to write UID map: %m");
278
279@@ -4153,7 +4153,7 @@ static int setup_uid_map(
280 return log_oom();
281
282 xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid);
283- r = write_string_file(uid_map, s, WRITE_STRING_FILE_DISABLE_BUFFER);
284+ r = write_string_file(uid_map, s, 0);
285 if (r < 0)
286 return log_error_errno(r, "Failed to write GID map: %m");
287
288--- a/src/shared/binfmt-util.c
289+++ b/src/shared/binfmt-util.c
290@@ -46,7 +46,7 @@ int disable_binfmt(void) {
291 return 0;
292 }
293
294- r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
295+ r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", 0);
296 if (r < 0)
297 return log_warning_errno(r, "Failed to unregister binfmt_misc entries: %m");
298
299--- a/src/shared/cgroup-setup.c
300+++ b/src/shared/cgroup-setup.c
301@@ -351,7 +351,7 @@ int cg_attach(const char *controller, co
302
303 xsprintf(c, PID_FMT "\n", pid);
304
305- r = write_string_file(fs, c, WRITE_STRING_FILE_DISABLE_BUFFER);
306+ r = write_string_file(fs, c, 0);
307 if (r == -EOPNOTSUPP && cg_is_threaded(path) > 0)
308 /* When the threaded mode is used, we cannot read/write the file. Let's return recognizable error. */
309 return -EUCLEAN;
310@@ -966,7 +966,7 @@ int cg_enable_everywhere(
311 return log_debug_errno(errno, "Failed to open cgroup.subtree_control file of %s: %m", p);
312 }
313
314- r = write_string_stream(f, s, WRITE_STRING_FILE_DISABLE_BUFFER);
315+ r = write_string_stream(f, s, 0);
316 if (r < 0) {
317 log_debug_errno(r, "Failed to %s controller %s for %s (%s): %m",
318 FLAGS_SET(mask, bit) ? "enable" : "disable", n, p, fs);
319--- a/src/shared/coredump-util.c
320+++ b/src/shared/coredump-util.c
321@@ -163,7 +163,7 @@ int set_coredump_filter(uint64_t value)
322 xsprintf(t, "0x%"PRIx64, value);
323
324 return write_string_file("/proc/self/coredump_filter", t,
325- WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER);
326+ 0);
327 }
328
329 /* Turn off core dumps but only if we're running outside of a container. */
330@@ -173,7 +173,7 @@ void disable_coredumps(void) {
331 if (detect_container() > 0)
332 return;
333
334- r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", WRITE_STRING_FILE_DISABLE_BUFFER);
335+ r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0);
336 if (r < 0)
337 log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m");
338 }
339--- a/src/shared/hibernate-util.c
340+++ b/src/shared/hibernate-util.c
341@@ -501,7 +501,7 @@ int write_resume_config(dev_t devno, uin
342
343 /* We write the offset first since it's safer. Note that this file is only available in 4.17+, so
344 * fail gracefully if it doesn't exist and we're only overwriting it with 0. */
345- r = write_string_file("/sys/power/resume_offset", offset_str, WRITE_STRING_FILE_DISABLE_BUFFER);
346+ r = write_string_file("/sys/power/resume_offset", offset_str, 0);
347 if (r == -ENOENT) {
348 if (offset != 0)
349 return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP),
350@@ -517,7 +517,7 @@ int write_resume_config(dev_t devno, uin
351 log_debug("Wrote resume_offset=%s for device '%s' to /sys/power/resume_offset.",
352 offset_str, device);
353
354- r = write_string_file("/sys/power/resume", devno_str, WRITE_STRING_FILE_DISABLE_BUFFER);
355+ r = write_string_file("/sys/power/resume", devno_str, 0);
356 if (r < 0)
357 return log_error_errno(r,
358 "Failed to write device '%s' (%s) to /sys/power/resume: %m",
359--- a/src/shared/smack-util.c
360+++ b/src/shared/smack-util.c
361@@ -113,7 +113,7 @@ int mac_smack_apply_pid(pid_t pid, const
362 return 0;
363
364 p = procfs_file_alloca(pid, "attr/current");
365- r = write_string_file(p, label, WRITE_STRING_FILE_DISABLE_BUFFER);
366+ r = write_string_file(p, label, 0);
367 if (r < 0)
368 return r;
369
370--- a/src/shared/watchdog.c
371+++ b/src/shared/watchdog.c
372@@ -93,7 +93,7 @@ static int set_pretimeout_governor(const
373
374 r = write_string_file(sys_fn,
375 governor,
376- WRITE_STRING_FILE_DISABLE_BUFFER | WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE);
377+ WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE);
378 if (r < 0)
379 return log_error_errno(r, "Failed to set watchdog pretimeout_governor to '%s': %m", governor);
380
381--- a/src/sleep/sleep.c
382+++ b/src/sleep/sleep.c
383@@ -137,7 +137,7 @@ static int write_state(int fd, char * co
384 if (k < 0)
385 return RET_GATHER(r, k);
386
387- k = write_string_stream(f, *state, WRITE_STRING_FILE_DISABLE_BUFFER);
388+ k = write_string_stream(f, *state, 0);
389 if (k >= 0) {
390 log_debug("Using sleep state '%s'.", *state);
391 return 0;
392@@ -155,7 +155,7 @@ static int write_mode(char * const *mode
393 STRV_FOREACH(mode, modes) {
394 int k;
395
396- k = write_string_file("/sys/power/disk", *mode, WRITE_STRING_FILE_DISABLE_BUFFER);
397+ k = write_string_file("/sys/power/disk", *mode, 0);
398 if (k >= 0) {
399 log_debug("Using sleep disk mode '%s'.", *mode);
400 return 0;
401--- a/src/storagetm/storagetm.c
402+++ b/src/storagetm/storagetm.c
403@@ -186,7 +186,7 @@ static int nvme_subsystem_unlink(NvmeSub
404 if (!enable_fn)
405 return log_oom();
406
407- r = write_string_file_at(namespaces_fd, enable_fn, "0", WRITE_STRING_FILE_DISABLE_BUFFER);
408+ r = write_string_file_at(namespaces_fd, enable_fn, "0", 0);
409 if (r < 0)
410 log_warning_errno(r, "Failed to disable namespace '%s' of NVME subsystem '%s', ignoring: %m", e->d_name, s->name);
411
412@@ -254,7 +254,7 @@ static int nvme_subsystem_write_metadata
413 _cleanup_free_ char *truncated = strndup(w, 40); /* kernel refuses more than 40 chars (as per nvme spec) */
414
415 /* The default string stored in 'attr_model' is "Linux" btw. */
416- r = write_string_file_at(subsystem_fd, "attr_model", truncated, WRITE_STRING_FILE_DISABLE_BUFFER);
417+ r = write_string_file_at(subsystem_fd, "attr_model", truncated, 0);
418 if (r < 0)
419 log_warning_errno(r, "Failed to set model of subsystem to '%s', ignoring: %m", w);
420 }
421@@ -268,7 +268,7 @@ static int nvme_subsystem_write_metadata
422 return log_oom();
423
424 /* The default string stored in 'attr_firmware' is `uname -r` btw, but truncated to 8 chars. */
425- r = write_string_file_at(subsystem_fd, "attr_firmware", truncated, WRITE_STRING_FILE_DISABLE_BUFFER);
426+ r = write_string_file_at(subsystem_fd, "attr_firmware", truncated, 0);
427 if (r < 0)
428 log_warning_errno(r, "Failed to set model of subsystem to '%s', ignoring: %m", truncated);
429 }
430@@ -295,7 +295,7 @@ static int nvme_subsystem_write_metadata
431 if (!truncated)
432 return log_oom();
433
434- r = write_string_file_at(subsystem_fd, "attr_serial", truncated, WRITE_STRING_FILE_DISABLE_BUFFER);
435+ r = write_string_file_at(subsystem_fd, "attr_serial", truncated, 0);
436 if (r < 0)
437 log_warning_errno(r, "Failed to set serial of subsystem to '%s', ignoring: %m", truncated);
438 }
439@@ -345,7 +345,7 @@ static int nvme_namespace_write_metadata
440 id = id128_digest(j, l);
441 }
442
443- r = write_string_file_at(namespace_fd, "device_uuid", SD_ID128_TO_UUID_STRING(id), WRITE_STRING_FILE_DISABLE_BUFFER);
444+ r = write_string_file_at(namespace_fd, "device_uuid", SD_ID128_TO_UUID_STRING(id), 0);
445 if (r < 0)
446 log_warning_errno(r, "Failed to set uuid of namespace to '%s', ignoring: %m", SD_ID128_TO_UUID_STRING(id));
447
448@@ -408,7 +408,7 @@ static int nvme_subsystem_add(const char
449 if (subsystem_fd < 0)
450 return log_error_errno(subsystem_fd, "Failed to create NVME subsystem '%s': %m", j);
451
452- r = write_string_file_at(subsystem_fd, "attr_allow_any_host", "1", WRITE_STRING_FILE_DISABLE_BUFFER);
453+ r = write_string_file_at(subsystem_fd, "attr_allow_any_host", "1", 0);
454 if (r < 0)
455 return log_error_errno(r, "Failed to set 'attr_allow_any_host' flag: %m");
456
457@@ -423,11 +423,11 @@ static int nvme_subsystem_add(const char
458
459 /* We use /proc/$PID/fd/$FD rather than /proc/self/fd/$FD, because this string is visible to others
460 * via configfs, and by including the PID it's clear to who the stuff belongs. */
461- r = write_string_file_at(namespace_fd, "device_path", FORMAT_PROC_PID_FD_PATH(0, fd), WRITE_STRING_FILE_DISABLE_BUFFER);
462+ r = write_string_file_at(namespace_fd, "device_path", FORMAT_PROC_PID_FD_PATH(0, fd), 0);
463 if (r < 0)
464 return log_error_errno(r, "Failed to write 'device_path' attribute: %m");
465
466- r = write_string_file_at(namespace_fd, "enable", "1", WRITE_STRING_FILE_DISABLE_BUFFER);
467+ r = write_string_file_at(namespace_fd, "enable", "1", 0);
468 if (r < 0)
469 return log_error_errno(r, "Failed to write 'enable' attribute: %m");
470
471@@ -557,19 +557,19 @@ static int nvme_port_add_portnr(
472 return 0;
473 }
474
475- r = write_string_file_at(port_fd, "addr_adrfam", af_to_ipv4_ipv6(ip_family), WRITE_STRING_FILE_DISABLE_BUFFER);
476+ r = write_string_file_at(port_fd, "addr_adrfam", af_to_ipv4_ipv6(ip_family), 0);
477 if (r < 0)
478 return log_error_errno(r, "Failed to set address family on NVME port %" PRIu16 ": %m", portnr);
479
480- r = write_string_file_at(port_fd, "addr_trtype", "tcp", WRITE_STRING_FILE_DISABLE_BUFFER);
481+ r = write_string_file_at(port_fd, "addr_trtype", "tcp", 0);
482 if (r < 0)
483 return log_error_errno(r, "Failed to set transport type on NVME port %" PRIu16 ": %m", portnr);
484
485- r = write_string_file_at(port_fd, "addr_trsvcid", fname, WRITE_STRING_FILE_DISABLE_BUFFER);
486+ r = write_string_file_at(port_fd, "addr_trsvcid", fname, 0);
487 if (r < 0)
488 return log_error_errno(r, "Failed to set IP port on NVME port %" PRIu16 ": %m", portnr);
489
490- r = write_string_file_at(port_fd, "addr_traddr", ip_family == AF_INET6 ? "::" : "0.0.0.0", WRITE_STRING_FILE_DISABLE_BUFFER);
491+ r = write_string_file_at(port_fd, "addr_traddr", ip_family == AF_INET6 ? "::" : "0.0.0.0", 0);
492 if (r < 0)
493 return log_error_errno(r, "Failed to set IP address on NVME port %" PRIu16 ": %m", portnr);
494
495--- a/src/udev/udev-rules.c
496+++ b/src/udev/udev-rules.c
497@@ -2711,7 +2711,6 @@ static int udev_rule_apply_token_to_even
498 log_event_debug(dev, token, "ATTR '%s' writing '%s'", buf, value);
499 r = write_string_file(buf, value,
500 WRITE_STRING_FILE_VERIFY_ON_FAILURE |
501- WRITE_STRING_FILE_DISABLE_BUFFER |
502 WRITE_STRING_FILE_AVOID_NEWLINE |
503 WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE);
504 if (r < 0)
505--- a/src/vconsole/vconsole-setup.c
506+++ b/src/vconsole/vconsole-setup.c
507@@ -261,7 +261,7 @@ static int toggle_utf8_vc(const char *na
508 static int toggle_utf8_sysfs(bool utf8) {
509 int r;
510
511- r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), WRITE_STRING_FILE_DISABLE_BUFFER);
512+ r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), 0);
513 if (r < 0)
514 return log_warning_errno(r, "Failed to %s sysfs UTF-8 flag: %m", enable_disable(utf8));
515
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0013-Handle-__cpu_mask-usage.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0013-Handle-__cpu_mask-usage.patch
deleted file mode 100644
index 43f75373a6..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0013-Handle-__cpu_mask-usage.patch
+++ /dev/null
@@ -1,60 +0,0 @@
1From 2f90f8463423cfbb7e83fcef42f1071018c3b56e Mon Sep 17 00:00:00 2001
2From: Scott Murray <scott.murray@konsulko.com>
3Date: Fri, 13 Sep 2019 19:26:27 -0400
4Subject: [PATCH 13/22] Handle __cpu_mask usage
5
6Fixes errors:
7
8src/test/test-cpu-set-util.c:18:54: error: '__cpu_mask' undeclared (first use in this function)
9src/test/test-sizeof.c:73:14: error: '__cpu_mask' undeclared (first use in this function)
10
11__cpu_mask is an internal type of glibc's cpu_set implementation, not
12part of the POSIX definition, which is problematic when building with
13musl, which does not define a matching type. From inspection of musl's
14sched.h, however, it is clear that the corresponding type would be
15unsigned long, which does match glibc's actual __CPU_MASK_TYPE. So,
16add a typedef to cpu-set-util.h defining __cpu_mask appropriately.
17
18Upstream-Status: Inappropriate [musl specific]
19
20Signed-off-by: Scott Murray <scott.murray@konsulko.com>
21---
22 src/shared/cpu-set-util.h | 2 ++
23 src/test/test-sizeof.c | 2 +-
24 2 files changed, 3 insertions(+), 1 deletion(-)
25
26diff --git a/src/shared/cpu-set-util.h b/src/shared/cpu-set-util.h
27index 3c63a58826..4c2d4347fc 100644
28--- a/src/shared/cpu-set-util.h
29+++ b/src/shared/cpu-set-util.h
30@@ -6,6 +6,8 @@
31 #include "macro.h"
32 #include "missing_syscall.h"
33
34+typedef unsigned long __cpu_mask;
35+
36 /* This wraps the libc interface with a variable to keep the allocated size. */
37 typedef struct CPUSet {
38 cpu_set_t *set;
39diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
40index ea0c58770e..b65c0bd370 100644
41--- a/src/test/test-sizeof.c
42+++ b/src/test/test-sizeof.c
43@@ -1,6 +1,5 @@
44 /* SPDX-License-Identifier: LGPL-2.1-or-later */
45
46-#include <sched.h>
47 #include <stdio.h>
48 #include <string.h>
49 #include <sys/resource.h>
50@@ -12,6 +11,7 @@
51 #include <float.h>
52
53 #include "time-util.h"
54+#include "cpu-set-util.h"
55
56 /* Print information about various types. Useful when diagnosing
57 * gcc diagnostics on an unfamiliar architecture. */
58--
592.34.1
60
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0014-Handle-missing-gshadow.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0014-Handle-missing-gshadow.patch
deleted file mode 100644
index a751e1ba6f..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0014-Handle-missing-gshadow.patch
+++ /dev/null
@@ -1,173 +0,0 @@
1From b7c827bb44edbb6251c9fcdb80aa03982c0e7bf3 Mon Sep 17 00:00:00 2001
2From: Alex Kiernan <alex.kiernan@gmail.com>
3Date: Tue, 10 Mar 2020 11:05:20 +0000
4Subject: [PATCH 14/22] Handle missing gshadow
5
6gshadow usage is now present in the userdb code. Mask all uses of it to
7allow compilation on musl
8
9Upstream-Status: Inappropriate [musl specific]
10Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
11[Rebased for v247]
12Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
13---
14 src/shared/user-record-nss.c | 20 ++++++++++++++++++++
15 src/shared/user-record-nss.h | 4 ++++
16 src/shared/userdb.c | 7 ++++++-
17 3 files changed, 30 insertions(+), 1 deletion(-)
18
19diff --git a/src/shared/user-record-nss.c b/src/shared/user-record-nss.c
20index 414a49331b..1a4e1b628c 100644
21--- a/src/shared/user-record-nss.c
22+++ b/src/shared/user-record-nss.c
23@@ -329,8 +329,10 @@ int nss_group_to_group_record(
24 if (isempty(grp->gr_name))
25 return -EINVAL;
26
27+#if ENABLE_GSHADOW
28 if (sgrp && !streq_ptr(sgrp->sg_namp, grp->gr_name))
29 return -EINVAL;
30+#endif
31
32 g = group_record_new();
33 if (!g)
34@@ -346,6 +348,7 @@ int nss_group_to_group_record(
35
36 g->gid = grp->gr_gid;
37
38+#if ENABLE_GSHADOW
39 if (sgrp) {
40 if (looks_like_hashed_password(utf8_only(sgrp->sg_passwd))) {
41 g->hashed_password = strv_new(sgrp->sg_passwd);
42@@ -361,6 +364,7 @@ int nss_group_to_group_record(
43 if (r < 0)
44 return r;
45 }
46+#endif
47
48 r = json_build(&g->json, JSON_BUILD_OBJECT(
49 JSON_BUILD_PAIR("groupName", JSON_BUILD_STRING(g->group_name)),
50@@ -387,6 +391,7 @@ int nss_sgrp_for_group(const struct group *grp, struct sgrp *ret_sgrp, char **re
51 assert(ret_sgrp);
52 assert(ret_buffer);
53
54+#if ENABLE_GSHADOW
55 for (;;) {
56 _cleanup_free_ char *buf = NULL;
57 struct sgrp sgrp, *result;
58@@ -415,6 +420,9 @@ int nss_sgrp_for_group(const struct group *grp, struct sgrp *ret_sgrp, char **re
59 buflen *= 2;
60 buf = mfree(buf);
61 }
62+#else
63+ return -ESRCH;
64+#endif
65 }
66
67 int nss_group_record_by_name(
68@@ -426,7 +434,9 @@ int nss_group_record_by_name(
69 struct group grp, *result;
70 bool incomplete = false;
71 size_t buflen = 4096;
72+#if ENABLE_GSHADOW
73 struct sgrp sgrp, *sresult = NULL;
74+#endif
75 int r;
76
77 assert(name);
78@@ -455,6 +465,7 @@ int nss_group_record_by_name(
79 buf = mfree(buf);
80 }
81
82+#if ENABLE_GSHADOW
83 if (with_shadow) {
84 r = nss_sgrp_for_group(result, &sgrp, &sbuf);
85 if (r < 0) {
86@@ -466,6 +477,9 @@ int nss_group_record_by_name(
87 incomplete = true;
88
89 r = nss_group_to_group_record(result, sresult, ret);
90+#else
91+ r = nss_group_to_group_record(result, NULL, ret);
92+#endif
93 if (r < 0)
94 return r;
95
96@@ -483,7 +497,9 @@ int nss_group_record_by_gid(
97 struct group grp, *result;
98 bool incomplete = false;
99 size_t buflen = 4096;
100+#if ENABLE_GSHADOW
101 struct sgrp sgrp, *sresult = NULL;
102+#endif
103 int r;
104
105 for (;;) {
106@@ -509,6 +525,7 @@ int nss_group_record_by_gid(
107 buf = mfree(buf);
108 }
109
110+#if ENABLE_GSHADOW
111 if (with_shadow) {
112 r = nss_sgrp_for_group(result, &sgrp, &sbuf);
113 if (r < 0) {
114@@ -520,6 +537,9 @@ int nss_group_record_by_gid(
115 incomplete = true;
116
117 r = nss_group_to_group_record(result, sresult, ret);
118+#else
119+ r = nss_group_to_group_record(result, NULL, ret);
120+#endif
121 if (r < 0)
122 return r;
123
124diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
125index 22ab04d6ee..4e52e7a911 100644
126--- a/src/shared/user-record-nss.h
127+++ b/src/shared/user-record-nss.h
128@@ -2,7 +2,11 @@
129 #pragma once
130
131 #include <grp.h>
132+#if ENABLE_GSHADOW
133 #include <gshadow.h>
134+#else
135+struct sgrp;
136+#endif
137 #include <pwd.h>
138 #include <shadow.h>
139
140diff --git a/src/shared/userdb.c b/src/shared/userdb.c
141index f60d48ace4..e878199a28 100644
142--- a/src/shared/userdb.c
143+++ b/src/shared/userdb.c
144@@ -1038,13 +1038,15 @@ int groupdb_iterator_get(UserDBIterator *iterator, GroupRecord **ret) {
145 if (gr) {
146 _cleanup_free_ char *buffer = NULL;
147 bool incomplete = false;
148+#if ENABLE_GSHADOW
149 struct sgrp sgrp;
150-
151+#endif
152 if (streq_ptr(gr->gr_name, "root"))
153 iterator->synthesize_root = false;
154 if (gr->gr_gid == GID_NOBODY)
155 iterator->synthesize_nobody = false;
156
157+#if ENABLE_GSHADOW
158 if (!FLAGS_SET(iterator->flags, USERDB_SUPPRESS_SHADOW)) {
159 r = nss_sgrp_for_group(gr, &sgrp, &buffer);
160 if (r < 0) {
161@@ -1057,6 +1059,9 @@ int groupdb_iterator_get(UserDBIterator *iterator, GroupRecord **ret) {
162 }
163
164 r = nss_group_to_group_record(gr, r >= 0 ? &sgrp : NULL, ret);
165+#else
166+ r = nss_group_to_group_record(gr, NULL, ret);
167+#endif
168 if (r < 0)
169 return r;
170
171--
1722.34.1
173
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch
deleted file mode 100644
index e112766a9b..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1From 3dc9d9d410bcce54fddfd94f43f7f77f3aa8e281 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 12 Apr 2021 23:44:53 -0700
4Subject: [PATCH 15/22] missing_syscall.h: Define MIPS ABI defines for musl
5
6musl does not define _MIPS_SIM_ABI32, _MIPS_SIM_NABI32, _MIPS_SIM_ABI64
7unlike glibc where these are provided by libc headers, therefore define
8them here in case they are undefined
9
10Upstream-Status: Pending
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 src/basic/missing_syscall.h | 6 ++++++
15 src/shared/base-filesystem.c | 1 +
16 2 files changed, 7 insertions(+)
17
18diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
19index d795efd8f2..d6729d3c1d 100644
20--- a/src/basic/missing_syscall.h
21+++ b/src/basic/missing_syscall.h
22@@ -20,6 +20,12 @@
23 #include <asm/sgidefs.h>
24 #endif
25
26+#ifndef _MIPS_SIM_ABI32
27+#define _MIPS_SIM_ABI32 1
28+#define _MIPS_SIM_NABI32 2
29+#define _MIPS_SIM_ABI64 3
30+#endif
31+
32 #include "macro.h"
33 #include "missing_keyctl.h"
34 #include "missing_stat.h"
35diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
36index 7ae921a113..0ef9d1fd39 100644
37--- a/src/shared/base-filesystem.c
38+++ b/src/shared/base-filesystem.c
39@@ -20,6 +20,7 @@
40 #include "string-util.h"
41 #include "umask-util.h"
42 #include "user-util.h"
43+#include "missing_syscall.h"
44
45 typedef struct BaseFilesystem {
46 const char *dir; /* directory or symlink to create */
47--
482.34.1
49
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0016-pass-correct-parameters-to-getdents64.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0016-pass-correct-parameters-to-getdents64.patch
deleted file mode 100644
index 0be817e62d..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0016-pass-correct-parameters-to-getdents64.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From 0994b59dba9f248ad31cb7087046dc00b72cb4ea Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 21 Jan 2022 15:15:11 -0800
4Subject: [PATCH 16/22] pass correct parameters to getdents64
5
6Fixes
7../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
8 n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
9 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10
11../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
12 n = getdents64(fd, &buffer, sizeof(buffer));
13 ^~~~~~~
14
15Upstream-Status: Inappropriate [musl specific]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
18---
19 src/basic/recurse-dir.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
23index 5e98b7a5d8..aef065047b 100644
24--- a/src/basic/recurse-dir.c
25+++ b/src/basic/recurse-dir.c
26@@ -55,7 +55,7 @@ int readdir_all(int dir_fd,
27 bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
28 assert(bs > de->buffer_size);
29
30- n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
31+ n = getdents64(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
32 if (n < 0)
33 return -errno;
34 if (n == 0)
35--
362.34.1
37
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0017-Adjust-for-musl-headers.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0017-Adjust-for-musl-headers.patch
deleted file mode 100644
index 4176522a1c..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0017-Adjust-for-musl-headers.patch
+++ /dev/null
@@ -1,572 +0,0 @@
1From 3c094d443ca30f19114392fd8ef274af6eabc12d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 21 Jan 2022 22:19:37 -0800
4Subject: [PATCH 17/22] Adjust for musl headers
5
6Upstream-Status: Inappropriate [musl specific]
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9
10[Rebased for v255.1]
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 src/libsystemd-network/sd-dhcp6-client.c | 2 +-
14 src/network/netdev/bareudp.c | 2 +-
15 src/network/netdev/batadv.c | 2 +-
16 src/network/netdev/bond.c | 2 +-
17 src/network/netdev/bridge.c | 2 +-
18 src/network/netdev/dummy.c | 2 +-
19 src/network/netdev/geneve.c | 2 +-
20 src/network/netdev/ifb.c | 2 +-
21 src/network/netdev/ipoib.c | 2 +-
22 src/network/netdev/ipvlan.c | 2 +-
23 src/network/netdev/macsec.c | 2 +-
24 src/network/netdev/macvlan.c | 2 +-
25 src/network/netdev/netdev.c | 2 +-
26 src/network/netdev/netdevsim.c | 2 +-
27 src/network/netdev/nlmon.c | 2 +-
28 src/network/netdev/tunnel.c | 2 +-
29 src/network/netdev/vcan.c | 2 +-
30 src/network/netdev/veth.c | 2 +-
31 src/network/netdev/vlan.c | 2 +-
32 src/network/netdev/vrf.c | 2 +-
33 src/network/netdev/vxcan.c | 2 +-
34 src/network/netdev/vxlan.c | 2 +-
35 src/network/netdev/wireguard.c | 2 +-
36 src/network/netdev/xfrm.c | 2 +-
37 src/network/networkd-bridge-mdb.c | 4 ++--
38 src/network/networkd-dhcp-common.c | 3 ++-
39 src/network/networkd-dhcp-prefix-delegation.c | 3 ++-
40 src/network/networkd-dhcp-server.c | 2 +-
41 src/network/networkd-dhcp4.c | 2 +-
42 src/network/networkd-ipv6ll.c | 2 +-
43 src/network/networkd-link.c | 2 +-
44 src/network/networkd-ndisc.c | 2 +-
45 src/network/networkd-route.c | 8 ++++----
46 src/network/networkd-setlink.c | 2 +-
47 src/network/networkd-sysctl.c | 2 +-
48 src/shared/linux/ethtool.h | 3 ++-
49 src/shared/netif-util.c | 2 +-
50 src/udev/udev-builtin-net_id.c | 2 +-
51 38 files changed, 45 insertions(+), 42 deletions(-)
52
53diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
54index c20367dfc9..b8d4cd8c2a 100644
55--- a/src/libsystemd-network/sd-dhcp6-client.c
56+++ b/src/libsystemd-network/sd-dhcp6-client.c
57@@ -5,7 +5,7 @@
58
59 #include <errno.h>
60 #include <sys/ioctl.h>
61-#include <linux/if_arp.h>
62+//#include <linux/if_arp.h>
63 #include <linux/if_infiniband.h>
64
65 #include "sd-dhcp6-client.h"
66diff --git a/src/network/netdev/bareudp.c b/src/network/netdev/bareudp.c
67index 1df886573b..c8b6714726 100644
68--- a/src/network/netdev/bareudp.c
69+++ b/src/network/netdev/bareudp.c
70@@ -2,7 +2,7 @@
71 * Copyright © 2020 VMware, Inc. */
72
73 #include <netinet/in.h>
74-#include <linux/if_arp.h>
75+//#include <linux/if_arp.h>
76
77 #include "bareudp.h"
78 #include "netlink-util.h"
79diff --git a/src/network/netdev/batadv.c b/src/network/netdev/batadv.c
80index 26da0231d4..2e8002af8c 100644
81--- a/src/network/netdev/batadv.c
82+++ b/src/network/netdev/batadv.c
83@@ -3,7 +3,7 @@
84 #include <inttypes.h>
85 #include <netinet/in.h>
86 #include <linux/genetlink.h>
87-#include <linux/if_arp.h>
88+//#include <linux/if_arp.h>
89
90 #include "batadv.h"
91 #include "fileio.h"
92diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c
93index 4d75a0d6bf..985b3197e0 100644
94--- a/src/network/netdev/bond.c
95+++ b/src/network/netdev/bond.c
96@@ -1,7 +1,7 @@
97 /* SPDX-License-Identifier: LGPL-2.1-or-later */
98
99 #include <netinet/in.h>
100-#include <linux/if_arp.h>
101+//#include <linux/if_arp.h>
102
103 #include "alloc-util.h"
104 #include "bond.h"
105diff --git a/src/network/netdev/bridge.c b/src/network/netdev/bridge.c
106index 3e394edadf..f12f667687 100644
107--- a/src/network/netdev/bridge.c
108+++ b/src/network/netdev/bridge.c
109@@ -2,7 +2,7 @@
110
111 #include <net/if.h>
112 #include <netinet/in.h>
113-#include <linux/if_arp.h>
114+//#include <linux/if_arp.h>
115 #include <linux/if_bridge.h>
116
117 #include "bridge.h"
118diff --git a/src/network/netdev/dummy.c b/src/network/netdev/dummy.c
119index 00df1d2787..77b506b422 100644
120--- a/src/network/netdev/dummy.c
121+++ b/src/network/netdev/dummy.c
122@@ -1,6 +1,6 @@
123 /* SPDX-License-Identifier: LGPL-2.1-or-later */
124
125-#include <linux/if_arp.h>
126+//#include <linux/if_arp.h>
127
128 #include "dummy.h"
129
130diff --git a/src/network/netdev/geneve.c b/src/network/netdev/geneve.c
131index bc655ec7ff..a77e8e17e4 100644
132--- a/src/network/netdev/geneve.c
133+++ b/src/network/netdev/geneve.c
134@@ -2,7 +2,7 @@
135
136 #include <net/if.h>
137 #include <netinet/in.h>
138-#include <linux/if_arp.h>
139+//#include <linux/if_arp.h>
140
141 #include "alloc-util.h"
142 #include "conf-parser.h"
143diff --git a/src/network/netdev/ifb.c b/src/network/netdev/ifb.c
144index d7ff44cb9e..e037629ae4 100644
145--- a/src/network/netdev/ifb.c
146+++ b/src/network/netdev/ifb.c
147@@ -1,7 +1,7 @@
148 /* SPDX-License-Identifier: LGPL-2.1-or-later
149 * Copyright © 2019 VMware, Inc. */
150
151-#include <linux/if_arp.h>
152+//#include <linux/if_arp.h>
153
154 #include "ifb.h"
155
156diff --git a/src/network/netdev/ipoib.c b/src/network/netdev/ipoib.c
157index d5fe299b7b..c9c8002eac 100644
158--- a/src/network/netdev/ipoib.c
159+++ b/src/network/netdev/ipoib.c
160@@ -1,6 +1,6 @@
161 /* SPDX-License-Identifier: LGPL-2.1-or-later */
162
163-#include <linux/if_arp.h>
164+//#include <linux/if_arp.h>
165 #include <linux/if_link.h>
166
167 #include "ipoib.h"
168diff --git a/src/network/netdev/ipvlan.c b/src/network/netdev/ipvlan.c
169index 05d5d010f6..d440f49537 100644
170--- a/src/network/netdev/ipvlan.c
171+++ b/src/network/netdev/ipvlan.c
172@@ -2,7 +2,7 @@
173
174 #include <net/if.h>
175 #include <netinet/in.h>
176-#include <linux/if_arp.h>
177+//#include <linux/if_arp.h>
178
179 #include "conf-parser.h"
180 #include "ipvlan.h"
181diff --git a/src/network/netdev/macsec.c b/src/network/netdev/macsec.c
182index 17d6acefb6..679d0984f9 100644
183--- a/src/network/netdev/macsec.c
184+++ b/src/network/netdev/macsec.c
185@@ -1,7 +1,7 @@
186 /* SPDX-License-Identifier: LGPL-2.1-or-later */
187
188 #include <netinet/in.h>
189-#include <linux/if_arp.h>
190+//#include <linux/if_arp.h>
191 #include <linux/if_ether.h>
192 #include <linux/if_macsec.h>
193 #include <linux/genetlink.h>
194diff --git a/src/network/netdev/macvlan.c b/src/network/netdev/macvlan.c
195index 203807e3a5..8ab09a387e 100644
196--- a/src/network/netdev/macvlan.c
197+++ b/src/network/netdev/macvlan.c
198@@ -2,7 +2,7 @@
199
200 #include <net/if.h>
201 #include <netinet/in.h>
202-#include <linux/if_arp.h>
203+//#include <linux/if_arp.h>
204
205 #include "conf-parser.h"
206 #include "macvlan.h"
207diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c
208index 57127a861a..7f787d0b9f 100644
209--- a/src/network/netdev/netdev.c
210+++ b/src/network/netdev/netdev.c
211@@ -2,7 +2,7 @@
212
213 #include <net/if.h>
214 #include <netinet/in.h>
215-#include <linux/if_arp.h>
216+//#include <linux/if_arp.h>
217 #include <unistd.h>
218
219 #include "alloc-util.h"
220diff --git a/src/network/netdev/netdevsim.c b/src/network/netdev/netdevsim.c
221index 15d5c132f9..a3ffa48b15 100644
222--- a/src/network/netdev/netdevsim.c
223+++ b/src/network/netdev/netdevsim.c
224@@ -1,6 +1,6 @@
225 /* SPDX-License-Identifier: LGPL-2.1-or-later */
226
227-#include <linux/if_arp.h>
228+//#include <linux/if_arp.h>
229
230 #include "netdevsim.h"
231
232diff --git a/src/network/netdev/nlmon.c b/src/network/netdev/nlmon.c
233index ff372092e6..eef66811f4 100644
234--- a/src/network/netdev/nlmon.c
235+++ b/src/network/netdev/nlmon.c
236@@ -1,6 +1,6 @@
237 /* SPDX-License-Identifier: LGPL-2.1-or-later */
238
239-#include <linux/if_arp.h>
240+//#include <linux/if_arp.h>
241
242 #include "nlmon.h"
243
244diff --git a/src/network/netdev/tunnel.c b/src/network/netdev/tunnel.c
245index db84e7cf6e..93d5642962 100644
246--- a/src/network/netdev/tunnel.c
247+++ b/src/network/netdev/tunnel.c
248@@ -2,7 +2,7 @@
249
250 #include <netinet/in.h>
251 #include <linux/fou.h>
252-#include <linux/if_arp.h>
253+//#include <linux/if_arp.h>
254 #include <linux/if_tunnel.h>
255 #include <linux/ip.h>
256 #include <linux/ip6_tunnel.h>
257diff --git a/src/network/netdev/vcan.c b/src/network/netdev/vcan.c
258index 380547ee1e..137c1adf8a 100644
259--- a/src/network/netdev/vcan.c
260+++ b/src/network/netdev/vcan.c
261@@ -1,6 +1,6 @@
262 /* SPDX-License-Identifier: LGPL-2.1-or-later */
263
264-#include <linux/if_arp.h>
265+//#include <linux/if_arp.h>
266
267 #include "vcan.h"
268
269diff --git a/src/network/netdev/veth.c b/src/network/netdev/veth.c
270index e0f5b4ebb1..8a424ed03d 100644
271--- a/src/network/netdev/veth.c
272+++ b/src/network/netdev/veth.c
273@@ -3,7 +3,7 @@
274 #include <errno.h>
275 #include <net/if.h>
276 #include <netinet/in.h>
277-#include <linux/if_arp.h>
278+//#include <linux/if_arp.h>
279 #include <linux/veth.h>
280
281 #include "netlink-util.h"
282diff --git a/src/network/netdev/vlan.c b/src/network/netdev/vlan.c
283index 2390206993..efec630e30 100644
284--- a/src/network/netdev/vlan.c
285+++ b/src/network/netdev/vlan.c
286@@ -2,7 +2,7 @@
287
288 #include <errno.h>
289 #include <net/if.h>
290-#include <linux/if_arp.h>
291+//#include <linux/if_arp.h>
292 #include <linux/if_vlan.h>
293
294 #include "parse-util.h"
295diff --git a/src/network/netdev/vrf.c b/src/network/netdev/vrf.c
296index b75ec2bcc6..6aeeea640b 100644
297--- a/src/network/netdev/vrf.c
298+++ b/src/network/netdev/vrf.c
299@@ -2,7 +2,7 @@
300
301 #include <net/if.h>
302 #include <netinet/in.h>
303-#include <linux/if_arp.h>
304+//#include <linux/if_arp.h>
305
306 #include "vrf.h"
307
308diff --git a/src/network/netdev/vxcan.c b/src/network/netdev/vxcan.c
309index c0343f45b6..f9e718f40b 100644
310--- a/src/network/netdev/vxcan.c
311+++ b/src/network/netdev/vxcan.c
312@@ -1,7 +1,7 @@
313 /* SPDX-License-Identifier: LGPL-2.1-or-later */
314
315 #include <linux/can/vxcan.h>
316-#include <linux/if_arp.h>
317+//#include <linux/if_arp.h>
318
319 #include "vxcan.h"
320
321diff --git a/src/network/netdev/vxlan.c b/src/network/netdev/vxlan.c
322index b11fdbbd0d..a971a917f0 100644
323--- a/src/network/netdev/vxlan.c
324+++ b/src/network/netdev/vxlan.c
325@@ -2,7 +2,7 @@
326
327 #include <net/if.h>
328 #include <netinet/in.h>
329-#include <linux/if_arp.h>
330+//#include <linux/if_arp.h>
331
332 #include "conf-parser.h"
333 #include "alloc-util.h"
334diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c
335index 4c7d837c41..6df6dfb816 100644
336--- a/src/network/netdev/wireguard.c
337+++ b/src/network/netdev/wireguard.c
338@@ -6,7 +6,7 @@
339 #include <sys/ioctl.h>
340 #include <net/if.h>
341 #include <netinet/in.h>
342-#include <linux/if_arp.h>
343+//#include <linux/if_arp.h>
344 #include <linux/ipv6_route.h>
345
346 #include "sd-resolve.h"
347diff --git a/src/network/netdev/xfrm.c b/src/network/netdev/xfrm.c
348index 905bfc0bdf..39e34dbb3b 100644
349--- a/src/network/netdev/xfrm.c
350+++ b/src/network/netdev/xfrm.c
351@@ -1,6 +1,6 @@
352 /* SPDX-License-Identifier: LGPL-2.1-or-later */
353
354-#include <linux/if_arp.h>
355+//#include <linux/if_arp.h>
356
357 #include "missing_network.h"
358 #include "xfrm.h"
359diff --git a/src/network/networkd-bridge-mdb.c b/src/network/networkd-bridge-mdb.c
360index bd1a9745dc..949d3da029 100644
361--- a/src/network/networkd-bridge-mdb.c
362+++ b/src/network/networkd-bridge-mdb.c
363@@ -1,7 +1,5 @@
364 /* SPDX-License-Identifier: LGPL-2.1-or-later */
365
366-#include <net/if.h>
367-#include <linux/if_bridge.h>
368
369 #include "netlink-util.h"
370 #include "networkd-bridge-mdb.h"
371@@ -11,6 +9,8 @@
372 #include "networkd-queue.h"
373 #include "string-util.h"
374 #include "vlan-util.h"
375+#include <net/if.h>
376+#include <linux/if_bridge.h>
377
378 #define STATIC_BRIDGE_MDB_ENTRIES_PER_NETWORK_MAX 1024U
379
380diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c
381index 080b15387c..efe8283957 100644
382--- a/src/network/networkd-dhcp-common.c
383+++ b/src/network/networkd-dhcp-common.c
384@@ -1,7 +1,8 @@
385 /* SPDX-License-Identifier: LGPL-2.1-or-later */
386
387 #include <netinet/in.h>
388-#include <linux/if_arp.h>
389+//#include <linux/if_arp.h>
390+#include <net/if.h>
391
392 #include "bus-error.h"
393 #include "bus-locator.h"
394diff --git a/src/network/networkd-dhcp-prefix-delegation.c b/src/network/networkd-dhcp-prefix-delegation.c
395index af2fe9efcd..511565700f 100644
396--- a/src/network/networkd-dhcp-prefix-delegation.c
397+++ b/src/network/networkd-dhcp-prefix-delegation.c
398@@ -1,6 +1,5 @@
399 /* SPDX-License-Identifier: LGPL-2.1-or-later */
400
401-#include <linux/ipv6_route.h>
402
403 #include "dhcp6-lease-internal.h"
404 #include "hashmap.h"
405@@ -20,6 +19,8 @@
406 #include "strv.h"
407 #include "tunnel.h"
408
409+#include <linux/ipv6_route.h>
410+
411 bool link_dhcp_pd_is_enabled(Link *link) {
412 assert(link);
413
414diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c
415index 607fe0053c..9ce4005874 100644
416--- a/src/network/networkd-dhcp-server.c
417+++ b/src/network/networkd-dhcp-server.c
418@@ -1,7 +1,7 @@
419 /* SPDX-License-Identifier: LGPL-2.1-or-later */
420
421 #include <netinet/in.h>
422-#include <linux/if_arp.h>
423+//#include <linux/if_arp.h>
424 #include <linux/if.h>
425
426 #include "sd-dhcp-server.h"
427diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
428index efbae6d868..1ea2151d50 100644
429--- a/src/network/networkd-dhcp4.c
430+++ b/src/network/networkd-dhcp4.c
431@@ -3,7 +3,7 @@
432 #include <netinet/in.h>
433 #include <netinet/ip.h>
434 #include <linux/if.h>
435-#include <linux/if_arp.h>
436+//#include <linux/if_arp.h>
437
438 #include "alloc-util.h"
439 #include "dhcp-client-internal.h"
440diff --git a/src/network/networkd-ipv6ll.c b/src/network/networkd-ipv6ll.c
441index 32229a3fc7..662a345d6e 100644
442--- a/src/network/networkd-ipv6ll.c
443+++ b/src/network/networkd-ipv6ll.c
444@@ -1,7 +1,7 @@
445 /* SPDX-License-Identifier: LGPL-2.1-or-later */
446
447 #include <linux/if.h>
448-#include <linux/if_arp.h>
449+//#include <linux/if_arp.h>
450
451 #include "in-addr-util.h"
452 #include "networkd-address.h"
453diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
454index ee5f0f2c0a..ea5269a2de 100644
455--- a/src/network/networkd-link.c
456+++ b/src/network/networkd-link.c
457@@ -3,7 +3,7 @@
458 #include <net/if.h>
459 #include <netinet/in.h>
460 #include <linux/if.h>
461-#include <linux/if_arp.h>
462+//#include <linux/if_arp.h>
463 #include <linux/if_link.h>
464 #include <linux/netdevice.h>
465 #include <sys/socket.h>
466diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c
467index ab9eeb13a5..dd96fe7483 100644
468--- a/src/network/networkd-ndisc.c
469+++ b/src/network/networkd-ndisc.c
470@@ -6,7 +6,7 @@
471 #include <arpa/inet.h>
472 #include <netinet/icmp6.h>
473 #include <linux/if.h>
474-#include <linux/if_arp.h>
475+//#include <linux/if_arp.h>
476
477 #include "sd-ndisc.h"
478
479diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
480index 7218d799fc..30d5574eae 100644
481--- a/src/network/networkd-route.c
482+++ b/src/network/networkd-route.c
483@@ -1,9 +1,5 @@
484 /* SPDX-License-Identifier: LGPL-2.1-or-later */
485
486-#include <linux/icmpv6.h>
487-#include <linux/ipv6_route.h>
488-#include <linux/nexthop.h>
489-
490 #include "alloc-util.h"
491 #include "event-util.h"
492 #include "netlink-util.h"
493@@ -21,6 +17,10 @@
494 #include "vrf.h"
495 #include "wireguard.h"
496
497+#include <linux/icmpv6.h>
498+#include <linux/ipv6_route.h>
499+#include <linux/nexthop.h>
500+
501 int route_new(Route **ret) {
502 _cleanup_(route_freep) Route *route = NULL;
503
504diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c
505index 2298f9ea3a..7d5f87de53 100644
506--- a/src/network/networkd-setlink.c
507+++ b/src/network/networkd-setlink.c
508@@ -2,7 +2,7 @@
509
510 #include <netinet/in.h>
511 #include <linux/if.h>
512-#include <linux/if_arp.h>
513+//#include <linux/if_arp.h>
514 #include <linux/if_bridge.h>
515
516 #include "missing_network.h"
517diff --git a/src/network/networkd-sysctl.c b/src/network/networkd-sysctl.c
518index 2b226b2e2a..f12a474e2f 100644
519--- a/src/network/networkd-sysctl.c
520+++ b/src/network/networkd-sysctl.c
521@@ -2,7 +2,7 @@
522
523 #include <netinet/in.h>
524 #include <linux/if.h>
525-#include <linux/if_arp.h>
526+//#include <linux/if_arp.h>
527
528 #include "missing_network.h"
529 #include "networkd-link.h"
530diff --git a/src/shared/linux/ethtool.h b/src/shared/linux/ethtool.h
531index 3d1da515c0..3fca9a4faf 100644
532--- a/src/shared/linux/ethtool.h
533+++ b/src/shared/linux/ethtool.h
534@@ -16,7 +16,8 @@
535
536 #include <linux/const.h>
537 #include <linux/types.h>
538-#include <linux/if_ether.h>
539+#include <netinet/if_ether.h>
540+//#include <linux/if_ether.h>
541
542 #include <limits.h> /* for INT_MAX */
543
544diff --git a/src/shared/netif-util.c b/src/shared/netif-util.c
545index f56c5646c1..5af28ff119 100644
546--- a/src/shared/netif-util.c
547+++ b/src/shared/netif-util.c
548@@ -1,7 +1,7 @@
549 /* SPDX-License-Identifier: LGPL-2.1-or-later */
550
551 #include <linux/if.h>
552-#include <linux/if_arp.h>
553+//#include <linux/if_arp.h>
554
555 #include "arphrd-util.h"
556 #include "device-util.h"
557diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
558index f528a46b8e..830318cda5 100644
559--- a/src/udev/udev-builtin-net_id.c
560+++ b/src/udev/udev-builtin-net_id.c
561@@ -18,7 +18,7 @@
562 #include <stdarg.h>
563 #include <unistd.h>
564 #include <linux/if.h>
565-#include <linux/if_arp.h>
566+//#include <linux/if_arp.h>
567 #include <linux/netdevice.h>
568 #include <linux/pci_regs.h>
569
570--
5712.34.1
572
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch
deleted file mode 100644
index 75f6b9094a..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch
+++ /dev/null
@@ -1,52 +0,0 @@
1From be02bd0876a061728661535a709d313e39fe1ac3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 8 Nov 2022 13:31:34 -0800
4Subject: [PATCH 18/22] test-bus-error: strerror() is assumed to be GNU
5 specific version mark it so
6
7Upstream-Status: Inappropriate [Upstream systemd only supports glibc]
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/libsystemd/sd-bus/test-bus-error.c | 2 ++
12 src/test/test-errno-util.c | 3 ++-
13 2 files changed, 4 insertions(+), 1 deletion(-)
14
15diff --git a/src/libsystemd/sd-bus/test-bus-error.c b/src/libsystemd/sd-bus/test-bus-error.c
16index a55f3f9856..4123bf3da0 100644
17--- a/src/libsystemd/sd-bus/test-bus-error.c
18+++ b/src/libsystemd/sd-bus/test-bus-error.c
19@@ -99,7 +99,9 @@ TEST(error) {
20 assert_se(!sd_bus_error_is_set(&error));
21 assert_se(sd_bus_error_set_errno(&error, EBUSY) == -EBUSY);
22 assert_se(streq(error.name, "System.Error.EBUSY"));
23+#ifdef __GLIBC__
24 assert_se(streq(error.message, STRERROR(EBUSY)));
25+#endif
26 assert_se(sd_bus_error_has_name(&error, "System.Error.EBUSY"));
27 assert_se(sd_bus_error_get_errno(&error) == EBUSY);
28 assert_se(sd_bus_error_is_set(&error));
29diff --git a/src/test/test-errno-util.c b/src/test/test-errno-util.c
30index 376d532281..967cfd4d67 100644
31--- a/src/test/test-errno-util.c
32+++ b/src/test/test-errno-util.c
33@@ -4,7 +4,7 @@
34 #include "stdio-util.h"
35 #include "string-util.h"
36 #include "tests.h"
37-
38+#ifdef __GLIBC__
39 TEST(strerror_not_threadsafe) {
40 /* Just check that strerror really is not thread-safe. */
41 log_info("strerror(%d) → %s", 200, strerror(200));
42@@ -46,6 +46,7 @@ TEST(STRERROR_OR_ELSE) {
43 log_info("STRERROR_OR_ELSE(EPERM, \"EOF\") → %s", STRERROR_OR_EOF(EPERM));
44 log_info("STRERROR_OR_ELSE(-EPERM, \"EOF\") → %s", STRERROR_OR_EOF(-EPERM));
45 }
46+#endif /* __GLIBC__ */
47
48 TEST(PROTECT_ERRNO) {
49 errno = 12;
50--
512.34.1
52
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch
deleted file mode 100644
index e038b73678..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From 46d80840bfe37e67d4f18c37a77751ea1fe63a07 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 23 Jan 2023 23:39:46 -0800
4Subject: [PATCH 19/22] errno-util: Make STRERROR portable for musl
5
6Sadly, systemd has decided to use yet another GNU extention in a macro
7lets make this such that we can use XSI compliant strerror_r() for
8non-glibc hosts
9
10Upstream-Status: Inappropriate [musl specific]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 src/basic/errno-util.h | 12 ++++++++++--
15 1 file changed, 10 insertions(+), 2 deletions(-)
16
17diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
18index 27804e6382..274c1c6ef1 100644
19--- a/src/basic/errno-util.h
20+++ b/src/basic/errno-util.h
21@@ -15,8 +15,16 @@
22 * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
23 *
24 * Note that we use the GNU variant of strerror_r() here. */
25-#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
26-
27+static inline const char * STRERROR(int errnum);
28+
29+static inline const char * STRERROR(int errnum) {
30+#ifdef __GLIBC__
31+ return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
32+#else
33+ static __thread char buf[ERRNO_BUF_LEN];
34+ return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
35+#endif
36+}
37 /* A helper to print an error message or message for functions that return 0 on EOF.
38 * Note that we can't use ({ … }) to define a temporary variable, so errnum is
39 * evaluated twice. */
40--
412.34.1
42
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch
deleted file mode 100644
index b83fffe793..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From 9eb4867b4e2dbdb2484ae854022aff97e2f0feb3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 2 Aug 2023 12:06:27 -0700
4Subject: [PATCH 20/22] sd-event: Make malloc_trim() conditional on glibc
5
6musl does not have this API
7
8Upstream-Status: Inappropriate [musl-specific]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/libsystemd/sd-event/sd-event.c | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
13
14diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
15index 288798a0dc..6419a7f216 100644
16--- a/src/libsystemd/sd-event/sd-event.c
17+++ b/src/libsystemd/sd-event/sd-event.c
18@@ -1874,7 +1874,7 @@ _public_ int sd_event_add_exit(
19 }
20
21 _public_ int sd_event_trim_memory(void) {
22- int r;
23+ int r = 0;
24
25 /* A default implementation of a memory pressure callback. Simply releases our own allocation caches
26 * and glibc's. This is automatically used when people call sd_event_add_memory_pressure() with a
27@@ -1888,7 +1888,9 @@ _public_ int sd_event_trim_memory(void) {
28
29 usec_t before_timestamp = now(CLOCK_MONOTONIC);
30 hashmap_trim_pools();
31+#ifdef __GLIBC__
32 r = malloc_trim(0);
33+#endif
34 usec_t after_timestamp = now(CLOCK_MONOTONIC);
35
36 if (r > 0)
37--
382.34.1
39
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0021-shared-Do-not-use-malloc_info-on-musl.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0021-shared-Do-not-use-malloc_info-on-musl.patch
deleted file mode 100644
index 7eff069bb7..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0021-shared-Do-not-use-malloc_info-on-musl.patch
+++ /dev/null
@@ -1,57 +0,0 @@
1From 502597b9ddd6b145541b23fadca0b1d3ca9f6367 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 2 Aug 2023 12:20:40 -0700
4Subject: [PATCH 21/22] shared: Do not use malloc_info on musl
5
6Upstream-Status: Inappropriate [musl-specific]
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 src/shared/bus-util.c | 5 +++--
10 src/shared/common-signal.c | 4 ++--
11 2 files changed, 5 insertions(+), 4 deletions(-)
12
13diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
14index 74f148c8b4..2d862a123d 100644
15--- a/src/shared/bus-util.c
16+++ b/src/shared/bus-util.c
17@@ -611,15 +611,16 @@ static int method_dump_memory_state_by_fd(sd_bus_message *message, void *userdat
18 _cleanup_close_ int fd = -EBADF;
19 size_t dump_size;
20 FILE *f;
21- int r;
22+ int r = 0;
23
24 assert(message);
25
26 f = memstream_init(&m);
27 if (!f)
28 return -ENOMEM;
29-
30+#ifdef __GLIBC__
31 r = RET_NERRNO(malloc_info(/* options= */ 0, f));
32+#endif
33 if (r < 0)
34 return r;
35
36diff --git a/src/shared/common-signal.c b/src/shared/common-signal.c
37index 8e70e365dd..9e782caec9 100644
38--- a/src/shared/common-signal.c
39+++ b/src/shared/common-signal.c
40@@ -65,12 +65,12 @@ int sigrtmin18_handler(sd_event_source *s, const struct signalfd_siginfo *si, vo
41 log_oom();
42 break;
43 }
44-
45+#ifdef __GLIBC__
46 if (malloc_info(0, f) < 0) {
47 log_error_errno(errno, "Failed to invoke malloc_info(): %m");
48 break;
49 }
50-
51+#endif
52 (void) memstream_dump(LOG_INFO, &m);
53 break;
54 }
55--
562.34.1
57
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0022-avoid-missing-LOCK_EX-declaration.patch b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0022-avoid-missing-LOCK_EX-declaration.patch
deleted file mode 100644
index 56755ac559..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd/0022-avoid-missing-LOCK_EX-declaration.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From 97d3ed7834bd86615ba4acdbef984c677b7e7791 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 2 Jan 2024 11:03:27 +0800
4Subject: [PATCH] avoid missing LOCK_EX declaration
5
6This only happens on MUSL. Include sys/file.h to avoid compilation
7error about missing LOCK_EX declaration.
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 src/core/exec-invoke.c | 1 +
14 src/shared/dev-setup.h | 1 +
15 2 files changed, 2 insertions(+)
16
17--- a/src/core/exec-invoke.c
18+++ b/src/core/exec-invoke.c
19@@ -4,6 +4,7 @@
20 #include <sys/ioctl.h>
21 #include <sys/mount.h>
22 #include <sys/prctl.h>
23+#include <sys/file.h>
24
25 #if HAVE_PAM
26 #include <security/pam_appl.h>
27--- a/src/shared/dev-setup.h
28+++ b/src/shared/dev-setup.h
29@@ -2,6 +2,7 @@
30 #pragma once
31
32 #include <sys/types.h>
33+#include <sys/file.h>
34
35 int lock_dev_console(void);
36
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd_255.6.bb b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd_255.6.bb
deleted file mode 100644
index 9c39d40d23..0000000000
--- a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd_255.6.bb
+++ /dev/null
@@ -1,76 +0,0 @@
1SUMMARY = "libsystemd static library"
2DESCRIPTION = "libsystemd static library built specifically as an integral component of sdbus-c++"
3
4SECTION = "libs"
5
6LICENSE = "LGPL-2.1-or-later"
7LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
8
9inherit meson pkgconfig
10
11DEPENDS += "gperf-native gettext-native util-linux libcap util-linux python3-jinja2-native"
12
13SRCREV = "5810c25792d4268282dd3892af1a253b690423c9"
14SRCBRANCH = "v255-stable"
15SRC_URI = "git://github.com/systemd/systemd-stable.git;protocol=https;branch=${SRCBRANCH} \
16 file://static-libsystemd-pkgconfig.patch \
17 "
18
19# patches needed by musl
20SRC_URI:append:libc-musl = " ${SRC_URI_MUSL}"
21
22SRC_URI_MUSL = "\
23 file://0001-missing_type.h-add-comparison_fn_t.patch \
24 file://0002-add-fallback-parse_printf_format-implementation.patch \
25 file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
26 file://0003-src-basic-missing.h-check-for-missing-strndupa.patch \
27 file://0004-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
28 file://0005-add-missing-FTW_-macros-for-musl.patch \
29 file://0006-Use-uintmax_t-for-handling-rlim_t.patch \
30 file://0007-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
31 file://0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
32 file://0008-implment-systemd-sysv-install-for-OE.patch \
33 file://0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
34 file://0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
35 file://0011-avoid-redefinition-of-prctl_mm_map-structure.patch \
36 file://0012-do-not-disable-buffer-in-writing-files.patch \
37 file://0013-Handle-__cpu_mask-usage.patch \
38 file://0014-Handle-missing-gshadow.patch \
39 file://0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch \
40 file://0016-pass-correct-parameters-to-getdents64.patch \
41 file://0017-Adjust-for-musl-headers.patch \
42 file://0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch \
43 file://0019-errno-util-Make-STRERROR-portable-for-musl.patch \
44 file://0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch \
45 file://0021-shared-Do-not-use-malloc_info-on-musl.patch \
46 file://0022-avoid-missing-LOCK_EX-declaration.patch \
47"
48
49PACKAGECONFIG ??= "gshadow idn"
50PACKAGECONFIG:remove:libc-musl = " gshadow idn"
51PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
52PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
53
54CFLAGS:append:libc-musl = " -D__UAPI_DEF_ETHHDR=0 "
55
56EXTRA_OEMESON += "-Dstatic-libsystemd=pic"
57
58
59RDEPENDS:${PN}-dev = ""
60
61do_compile() {
62 ninja -v ${PARALLEL_MAKE} version.h
63 ninja -v ${PARALLEL_MAKE} libsystemd.a
64 ninja -v ${PARALLEL_MAKE} src/libsystemd/libsystemd.pc
65}
66
67do_install () {
68 install -d ${D}${libdir}
69 install ${B}/libsystemd.a ${D}${libdir}
70
71 install -d ${D}${includedir}/systemd
72 install ${S}/src/systemd/*.h ${D}${includedir}/systemd
73
74 install -d ${D}${libdir}/pkgconfig
75 install ${B}/src/libsystemd/libsystemd.pc ${D}${libdir}/pkgconfig
76}
diff --git a/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd_259.5.bb b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd_259.5.bb
new file mode 100644
index 0000000000..63a7bc7c27
--- /dev/null
+++ b/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd_259.5.bb
@@ -0,0 +1,45 @@
1SUMMARY = "libsystemd static library"
2DESCRIPTION = "libsystemd static library built specifically as an integral component of sdbus-c++"
3
4SECTION = "libs"
5
6LICENSE = "LGPL-2.1-or-later"
7LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=be0aaf4a380f73f7e00b420a007368f2"
8
9inherit meson pkgconfig
10
11DEPENDS += "gperf-native gettext-native util-linux libcap util-linux python3-jinja2-native"
12
13SRCREV = "b3d8fc43e9cb531d958c17ef2cd93b374bc14e8a"
14SRCBRANCH = "v259-stable"
15SRC_URI = "git://github.com/systemd/systemd;protocol=https;branch=${SRCBRANCH};tag=v${PV} \
16 file://static-libsystemd-pkgconfig.patch \
17 "
18
19PACKAGECONFIG ??= "gshadow idn"
20PACKAGECONFIG:remove:libc-musl = " gshadow idn"
21PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
22PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
23
24CFLAGS:append:libc-musl = " -D__UAPI_DEF_ETHHDR=0 "
25
26EXTRA_OEMESON += "-Dstatic-libsystemd=pic"
27
28
29RDEPENDS:${PN}-dev = ""
30
31do_compile() {
32 ninja -v ${PARALLEL_MAKE} libsystemd.a
33 ninja -v ${PARALLEL_MAKE} src/libsystemd/libsystemd.pc
34}
35
36do_install () {
37 install -d ${D}${libdir}
38 install ${B}/libsystemd.a ${D}${libdir}
39
40 install -d ${D}${includedir}/systemd
41 install ${S}/src/systemd/*.h ${D}${includedir}/systemd
42
43 install -d ${D}${libdir}/pkgconfig
44 install ${B}/src/libsystemd/libsystemd.pc ${D}${libdir}/pkgconfig
45}