summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd')
-rw-r--r--meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch34
-rw-r--r--meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch28
-rw-r--r--meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch10
-rw-r--r--meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch (renamed from meta/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch)22
-rw-r--r--meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch19
-rw-r--r--meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch110
-rw-r--r--meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch (renamed from meta/recipes-core/systemd/systemd/0022-don-t-use-glibc-specific-qsort_r.patch)108
-rw-r--r--meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch (renamed from meta/recipes-core/systemd/systemd/0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch)16
-rw-r--r--meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch40
-rw-r--r--meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch (renamed from meta/recipes-core/systemd/systemd/0004-implment-systemd-sysv-install-for-OE.patch)10
-rw-r--r--meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch (renamed from meta/recipes-core/systemd/systemd/0013-add-fallback-parse_printf_format-implementation.patch)49
-rw-r--r--meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch (renamed from meta/recipes-core/systemd/systemd/0005-rules-whitelist-hd-devices.patch)8
-rw-r--r--meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch (renamed from meta/recipes-core/systemd/systemd/0006-Make-root-s-home-directory-configurable.patch)34
-rw-r--r--meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch29
-rw-r--r--meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch63
-rw-r--r--meta/recipes-core/systemd/systemd/0006-src-basic-missing.h-check-for-missing-strndupa.patch (renamed from meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch)66
-rw-r--r--meta/recipes-core/systemd/systemd/0007-Include-netinet-if_ether.h.patch (renamed from meta/recipes-core/systemd/systemd/0017-Include-netinet-if_ether.h.patch)51
-rw-r--r--meta/recipes-core/systemd/systemd/0007-Revert-rules-remove-firmware-loading-rules.patch28
-rw-r--r--meta/recipes-core/systemd/systemd/0007-rules-watch-metadata-changes-in-ide-devices.patch (renamed from meta/recipes-core/systemd/systemd/0012-rules-watch-metadata-changes-in-ide-devices.patch)6
-rw-r--r--meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch (renamed from meta/recipes-core/systemd/systemd/0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch)16
-rw-r--r--meta/recipes-core/systemd/systemd/0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch377
-rw-r--r--meta/recipes-core/systemd/systemd/0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch (renamed from meta/recipes-core/systemd/systemd/0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch)86
-rw-r--r--meta/recipes-core/systemd/systemd/0009-add-missing-FTW_-macros-for-musl.patch (renamed from meta/recipes-core/systemd/systemd/0028-add-missing-FTW_-macros-for-musl.patch)12
-rw-r--r--meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch (renamed from meta/recipes-core/systemd/systemd/0029-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch)10
-rw-r--r--meta/recipes-core/systemd/systemd/0009-remove-duplicate-include-uchar.h.patch41
-rw-r--r--meta/recipes-core/systemd/systemd/0010-check-for-uchar.h-in-meson.build.patch45
-rw-r--r--meta/recipes-core/systemd/systemd/0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch (renamed from meta/recipes-core/systemd/systemd/0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch)17
-rw-r--r--meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch (renamed from meta/recipes-core/systemd/systemd/0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch)23
-rw-r--r--meta/recipes-core/systemd/systemd/0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch (renamed from meta/recipes-core/systemd/systemd/0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch)18
-rw-r--r--meta/recipes-core/systemd/systemd/0013-Use-uintmax_t-for-handling-rlim_t.patch (renamed from meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch)33
-rw-r--r--meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch (renamed from meta/recipes-core/systemd/systemd/0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch)12
-rw-r--r--meta/recipes-core/systemd/systemd/0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch (renamed from meta/recipes-core/systemd/systemd/0020-test-hexdecoct.c-Include-missing.h-for-strndupa.patch)12
-rw-r--r--meta/recipes-core/systemd/systemd/0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch (renamed from meta/recipes-core/systemd/systemd/0021-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch)14
-rw-r--r--meta/recipes-core/systemd/systemd/0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch (renamed from meta/recipes-core/systemd/systemd/0023-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch)20
-rw-r--r--meta/recipes-core/systemd/systemd/0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch (renamed from meta/recipes-core/systemd/systemd/0035-Define-glibc-compatible-basename-for-non-glibc-syste.patch)11
-rw-r--r--meta/recipes-core/systemd/systemd/0018-check-for-missing-canonicalize_file_name.patch47
-rw-r--r--meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch39
-rw-r--r--meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch62
-rw-r--r--meta/recipes-core/systemd/systemd/0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch31
-rw-r--r--meta/recipes-core/systemd/systemd/0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch43
-rw-r--r--meta/recipes-core/systemd/systemd/0027-remove-nobody-user-group-checking.patch63
-rw-r--r--meta/recipes-core/systemd/systemd/0032-memfd.patch272
-rw-r--r--meta/recipes-core/systemd/systemd/0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch203
-rw-r--r--meta/recipes-core/systemd/systemd/0034-Fix-format-truncation-compile-failure-by-typecasting.patch173
-rw-r--r--meta/recipes-core/systemd/systemd/0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch53
-rw-r--r--meta/recipes-core/systemd/systemd/libmount.patch75
46 files changed, 741 insertions, 1798 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch b/meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
deleted file mode 100644
index 2cffc42..0000000
--- a/meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From 687a5af8dc5d38f918a6ce08fed5297234bf8346 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 2 Mar 2018 18:00:17 -0800
4Subject: [PATCH] Hide __start_BUS_ERROR_MAP and __stop_BUS_ERROR_MAP
5
6for currently unknown reasons they get exported to the shared libries
7even without being listed in the sym file
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11
12Upstream-Status: Pending [ Conditional on master needing this, 234 does need it ]
13
14 src/libsystemd/sd-bus/bus-error.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
18index 378f7a377..49d797abd 100644
19--- a/src/libsystemd/sd-bus/bus-error.c
20+++ b/src/libsystemd/sd-bus/bus-error.c
21@@ -71,8 +71,8 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
22 };
23
24 /* GCC maps this magically to the beginning and end of the BUS_ERROR_MAP section */
25-extern const sd_bus_error_map __start_BUS_ERROR_MAP[];
26-extern const sd_bus_error_map __stop_BUS_ERROR_MAP[];
27+extern const sd_bus_error_map __start_BUS_ERROR_MAP[] _hidden_;
28+extern const sd_bus_error_map __stop_BUS_ERROR_MAP[] _hidden_;
29
30 /* Additional maps registered with sd_bus_error_add_map() are in this
31 * NULL terminated array */
32--
332.16.2
34
diff --git a/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch b/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch
index e913e3f..d745800 100644
--- a/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch
+++ b/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch
@@ -1,6 +1,6 @@
1From e361f6b4aefae57efff7e457df8db4d1067bec23 Mon Sep 17 00:00:00 2001 1From 9e3816bcaa36e1a11647ca0cf4f8044449c77fe0 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 28 Feb 2018 21:50:23 -0800 3Date: Mon, 2 Jul 2018 15:28:22 +0800
4Subject: [PATCH] Remove fstack-protector flags to workaround musl build 4Subject: [PATCH] Remove fstack-protector flags to workaround musl build
5 5
6Remove fstack-protector and fstack-protector-strong flags to fix 6Remove fstack-protector and fstack-protector-strong flags to fix
@@ -8,7 +8,7 @@ the following build failure for qemux86 and qemuppc with musl.
8 8
9 undefined reference to `__stack_chk_fail_local' 9 undefined reference to `__stack_chk_fail_local'
10 10
11Upstream-Status: Inappropriate [OE Specific] 11Upstream-Status: Inappropriate [musl Specific]
12 12
13Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 13Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14--- 14---
@@ -16,18 +16,18 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
16 1 file changed, 2 deletions(-) 16 1 file changed, 2 deletions(-)
17 17
18diff --git a/meson.build b/meson.build 18diff --git a/meson.build b/meson.build
19index 7610ab12b..591b9cbab 100644 19index f432ea072..a734a295c 100644
20--- a/meson.build 20--- a/meson.build
21+++ b/meson.build 21+++ b/meson.build
22@@ -329,8 +329,6 @@ foreach arg : ['-Wextra', 22@@ -333,8 +333,6 @@ possible_cc_flags = [
23 '-fdiagnostics-show-option', 23 '-fdiagnostics-show-option',
24 '-fno-strict-aliasing', 24 '-fno-strict-aliasing',
25 '-fvisibility=hidden', 25 '-fvisibility=hidden',
26- '-fstack-protector', 26- '-fstack-protector',
27- '-fstack-protector-strong', 27- '-fstack-protector-strong',
28 '--param=ssp-buffer-size=4', 28 '--param=ssp-buffer-size=4',
29 ] 29 ]
30 if cc.has_argument(arg) 30
31-- 31--
322.13.0 322.11.0
33 33
diff --git a/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch b/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
index f4c15e1..03f6ead 100644
--- a/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
+++ b/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
@@ -1,7 +1,7 @@
1From b1192a6e171413291d9d64fafc04773c6bbc9cab Mon Sep 17 00:00:00 2001 1From 6dd136512896979feb6883a16226d640a7e5ca74 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 23 Feb 2018 10:04:48 +0800 3Date: Fri, 23 Feb 2018 10:04:48 +0800
4Subject: [PATCH 01/31] Use getenv when secure versions are not available 4Subject: [PATCH 01/19] Use getenv when secure versions are not available
5 5
6musl doesnt implement secure version, so we default 6musl doesnt implement secure version, so we default
7to it if configure does not detect a secure implementation 7to it if configure does not detect a secure implementation
@@ -16,10 +16,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
16 1 file changed, 1 insertion(+), 1 deletion(-) 16 1 file changed, 1 insertion(+), 1 deletion(-)
17 17
18diff --git a/src/basic/missing.h b/src/basic/missing.h 18diff --git a/src/basic/missing.h b/src/basic/missing.h
19index 1280e6c41..39c1fb700 100644 19index 71a07d057..0e33abb9f 100644
20--- a/src/basic/missing.h 20--- a/src/basic/missing.h
21+++ b/src/basic/missing.h 21+++ b/src/basic/missing.h
22@@ -605,7 +605,7 @@ struct btrfs_ioctl_quota_ctl_args { 22@@ -592,7 +592,7 @@ struct btrfs_ioctl_quota_ctl_args {
23 # if HAVE___SECURE_GETENV 23 # if HAVE___SECURE_GETENV
24 # define secure_getenv __secure_getenv 24 # define secure_getenv __secure_getenv
25 # else 25 # else
@@ -29,5 +29,5 @@ index 1280e6c41..39c1fb700 100644
29 #endif 29 #endif
30 30
31-- 31--
322.13.0 322.11.0
33 33
diff --git a/meta/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch b/meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch
index c3f4b39..e24e7f8 100644
--- a/meta/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch
+++ b/meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch
@@ -1,7 +1,7 @@
1From c93eb6cdec03f5e243e59e95dc49273fcb90e7c1 Mon Sep 17 00:00:00 2001 1From 87dd61be2e28e78ce4f9f173794812e6c2d904d1 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 23 Feb 2018 10:23:40 +0800 3Date: Wed, 27 Jun 2018 16:01:22 +0800
4Subject: [PATCH 02/31] binfmt: Don't install dependency links at install time 4Subject: [PATCH 1/9] binfmt: Don't install dependency links at install time
5 for the binfmt services 5 for the binfmt services
6 6
7use [Install] blocks so that they get created when the service is enabled 7use [Install] blocks so that they get created when the service is enabled
@@ -23,10 +23,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
23 3 files changed, 9 insertions(+), 4 deletions(-) 23 3 files changed, 9 insertions(+), 4 deletions(-)
24 24
25diff --git a/units/meson.build b/units/meson.build 25diff --git a/units/meson.build b/units/meson.build
26index 814ee7885..49ace0d0f 100644 26index e4ac6ced6..698734e44 100644
27--- a/units/meson.build 27--- a/units/meson.build
28+++ b/units/meson.build 28+++ b/units/meson.build
29@@ -60,8 +60,7 @@ units = [ 29@@ -46,8 +46,7 @@ units = [
30 ['poweroff.target', '', 30 ['poweroff.target', '',
31 'runlevel0.target'], 31 'runlevel0.target'],
32 ['printer.target', ''], 32 ['printer.target', ''],
@@ -36,7 +36,7 @@ index 814ee7885..49ace0d0f 100644
36 ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'], 36 ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'],
37 ['reboot.target', '', 37 ['reboot.target', '',
38 'runlevel6.target ctrl-alt-del.target'], 38 'runlevel6.target ctrl-alt-del.target'],
39@@ -144,8 +143,7 @@ in_units = [ 39@@ -130,8 +129,7 @@ in_units = [
40 ['systemd-ask-password-console.service', ''], 40 ['systemd-ask-password-console.service', ''],
41 ['systemd-ask-password-wall.service', ''], 41 ['systemd-ask-password-wall.service', ''],
42 ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'], 42 ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'],
@@ -58,18 +58,18 @@ index 30a6bc991..4231f3b70 100644
58+[Install] 58+[Install]
59+WantedBy=sysinit.target 59+WantedBy=sysinit.target
60diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in 60diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
61index df9396d89..0687f4648 100644 61index e940c7c9a..6be7f5cc9 100644
62--- a/units/systemd-binfmt.service.in 62--- a/units/systemd-binfmt.service.in
63+++ b/units/systemd-binfmt.service.in 63+++ b/units/systemd-binfmt.service.in
64@@ -13,6 +13,7 @@ Documentation=man:systemd-binfmt.service(8) man:binfmt.d(5) 64@@ -14,6 +14,7 @@ Documentation=https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.htm
65 Documentation=https://www.kernel.org/doc/Documentation/binfmt_misc.txt 65 Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
66 DefaultDependencies=no 66 DefaultDependencies=no
67 Conflicts=shutdown.target 67 Conflicts=shutdown.target
68+Wants=proc-sys-fs-binfmt_misc.automount 68+Wants=proc-sys-fs-binfmt_misc.automount
69 After=proc-sys-fs-binfmt_misc.automount 69 After=proc-sys-fs-binfmt_misc.automount
70 Before=sysinit.target shutdown.target 70 Before=sysinit.target shutdown.target
71 ConditionPathIsReadWrite=/proc/sys/ 71 ConditionPathIsReadWrite=/proc/sys/
72@@ -27,3 +28,6 @@ Type=oneshot 72@@ -28,3 +29,6 @@ Type=oneshot
73 RemainAfterExit=yes 73 RemainAfterExit=yes
74 ExecStart=@rootlibexecdir@/systemd-binfmt 74 ExecStart=@rootlibexecdir@/systemd-binfmt
75 TimeoutSec=90s 75 TimeoutSec=90s
@@ -77,5 +77,5 @@ index df9396d89..0687f4648 100644
77+[Install] 77+[Install]
78+WantedBy=sysinit.target 78+WantedBy=sysinit.target
79-- 79--
802.13.0 802.11.0
81 81
diff --git a/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch b/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
index 98c8362..fd7bf3f 100644
--- a/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
+++ b/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
@@ -1,7 +1,9 @@
1From 7844e070745611a52e355b73e7890f360dd540d0 Mon Sep 17 00:00:00 2001 1From 2925c0c3b6ce4056622b86c1c61ee14add430790 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 14 Dec 2015 04:09:19 +0000 3Date: Thu, 28 Jun 2018 10:56:29 +0800
4Subject: [PATCH] core/device.c: Change the default device timeout to 240 sec. 4Subject: [PATCH] core/device.c: Change the default device timeout to 240 sec.
5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8
6 Content-Transfer-Encoding: 8bit
5MIME-Version: 1.0 7MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8 8Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit 9Content-Transfer-Encoding: 8bit
@@ -10,16 +12,16 @@ Upstream-Status: Inappropriate [Specific case QEMU/AB]
10 12
11Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> 13Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
12Signed-off-by: Khem Raj <raj.khem@gmail.com> 14Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 15Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14--- 16---
15 src/core/device.c | 2 +- 17 src/core/device.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-) 18 1 file changed, 1 insertion(+), 1 deletion(-)
17 19
18diff --git a/src/core/device.c b/src/core/device.c 20diff --git a/src/core/device.c b/src/core/device.c
19index a43664d3b..4b16a8aec 100644 21index a2d00a0fb..f26e55ebb 100644
20--- a/src/core/device.c 22--- a/src/core/device.c
21+++ b/src/core/device.c 23+++ b/src/core/device.c
22@@ -113,7 +113,7 @@ static void device_init(Unit *u) { 24@@ -95,7 +95,7 @@ static void device_init(Unit *u) {
23 * indefinitely for plugged in devices, something which cannot 25 * indefinitely for plugged in devices, something which cannot
24 * happen for the other units since their operations time out 26 * happen for the other units since their operations time out
25 * anyway. */ 27 * anyway. */
@@ -27,4 +29,7 @@ index a43664d3b..4b16a8aec 100644
27+ u->job_running_timeout = (240 * USEC_PER_SEC); 29+ u->job_running_timeout = (240 * USEC_PER_SEC);
28 30
29 u->ignore_on_isolate = true; 31 u->ignore_on_isolate = true;
30 } 32
33--
342.11.0
35
diff --git a/meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch b/meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch
new file mode 100644
index 0000000..ba08e34
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch
@@ -0,0 +1,110 @@
1From 86d18f3b09ec984ef3732567af992adb2dc77a8a Mon Sep 17 00:00:00 2001
2From: Yu Watanabe <watanabe.yu+github@gmail.com>
3Date: Mon, 9 Jul 2018 14:05:20 +0900
4Subject: [PATCH] login: use parse_uid() when unmounting user runtime directory
5
6When unmounting user runtime directory, only UID is necessary,
7and the corresponding user may not exist anymore.
8This makes first try to parse the input by parse_uid(), and only if it
9fails, prase the input by get_user_creds().
10
11Fixes #9541.
12
13Upstream-Status: Backport
14---
15 src/login/user-runtime-dir.c | 57 ++++++++++++++++++++++++++++----------------
16 1 file changed, 36 insertions(+), 21 deletions(-)
17
18diff --git a/src/login/user-runtime-dir.c b/src/login/user-runtime-dir.c
19index 1bb26c99e..de4061c75 100644
20--- a/src/login/user-runtime-dir.c
21+++ b/src/login/user-runtime-dir.c
22@@ -111,8 +111,22 @@ static int user_remove_runtime_path(const char *runtime_path) {
23 return r;
24 }
25
26-static int do_mount(const char *runtime_path, uid_t uid, gid_t gid) {
27+static int do_mount(const char *user) {
28+ char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)];
29 size_t runtime_dir_size;
30+ uid_t uid;
31+ gid_t gid;
32+ int r;
33+
34+ r = get_user_creds(&user, &uid, &gid, NULL, NULL);
35+ if (r < 0)
36+ return log_error_errno(r,
37+ r == -ESRCH ? "No such user \"%s\"" :
38+ r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group"
39+ : "Failed to look up user \"%s\": %m",
40+ user);
41+
42+ xsprintf(runtime_path, "/run/user/" UID_FMT, uid);
43
44 assert_se(gather_configuration(&runtime_dir_size) == 0);
45
46@@ -120,16 +134,30 @@ static int do_mount(const char *runtime_path, uid_t uid, gid_t gid) {
47 return user_mkdir_runtime_path(runtime_path, uid, gid, runtime_dir_size);
48 }
49
50-static int do_umount(const char *runtime_path) {
51+static int do_umount(const char *user) {
52+ char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)];
53+ uid_t uid;
54+ int r;
55+
56+ /* The user may be already removed. So, first try to parse the string by parse_uid(),
57+ * and if it fails, fallback to get_user_creds().*/
58+ if (parse_uid(user, &uid) < 0) {
59+ r = get_user_creds(&user, &uid, NULL, NULL, NULL);
60+ if (r < 0)
61+ return log_error_errno(r,
62+ r == -ESRCH ? "No such user \"%s\"" :
63+ r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group"
64+ : "Failed to look up user \"%s\": %m",
65+ user);
66+ }
67+
68+ xsprintf(runtime_path, "/run/user/" UID_FMT, uid);
69+
70 log_debug("Will remove %s", runtime_path);
71 return user_remove_runtime_path(runtime_path);
72 }
73
74 int main(int argc, char *argv[]) {
75- const char *user;
76- uid_t uid;
77- gid_t gid;
78- char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)];
79 int r;
80
81 log_parse_environment();
82@@ -146,23 +174,10 @@ int main(int argc, char *argv[]) {
83
84 umask(0022);
85
86- user = argv[2];
87- r = get_user_creds(&user, &uid, &gid, NULL, NULL);
88- if (r < 0) {
89- log_error_errno(r,
90- r == -ESRCH ? "No such user \"%s\"" :
91- r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group"
92- : "Failed to look up user \"%s\": %m",
93- user);
94- return EXIT_FAILURE;
95- }
96-
97- xsprintf(runtime_path, "/run/user/" UID_FMT, uid);
98-
99 if (streq(argv[1], "start"))
100- r = do_mount(runtime_path, uid, gid);
101+ r = do_mount(argv[2]);
102 else if (streq(argv[1], "stop"))
103- r = do_umount(runtime_path);
104+ r = do_umount(argv[2]);
105 else
106 assert_not_reached("Unknown verb!");
107
108--
1092.11.0
110
diff --git a/meta/recipes-core/systemd/systemd/0022-don-t-use-glibc-specific-qsort_r.patch b/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
index a5f7442..f07211b 100644
--- a/meta/recipes-core/systemd/systemd/0022-don-t-use-glibc-specific-qsort_r.patch
+++ b/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
@@ -1,21 +1,99 @@
1From d343757d629402c70ca8e5eaa551deaf175c96f3 Mon Sep 17 00:00:00 2001 1From d43faf6d253db789225b7c454c8f255fbc68857e Mon Sep 17 00:00:00 2001
2From: Emil Renner Berthing <systemd@esmil.dk> 2From: Emil Renner Berthing <systemd@esmil.dk>
3Date: Thu, 18 Sep 2014 15:24:56 +0200 3Date: Thu, 18 Sep 2014 15:24:56 +0200
4Subject: [PATCH 22/31] don't use glibc-specific qsort_r 4Subject: [PATCH 02/19] don't use glibc-specific qsort_r
5 5
6Upstream-Status: Pending 6Upstream-Status: Inappropriate [musl specific]
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9--- 9---
10 src/hwdb/hwdb.c | 18 +++++++++++------- 10 src/basic/format-table.c | 27 ++++++++++++++++-----------
11 src/udev/udevadm-hwdb.c | 16 ++++++++++------ 11 src/basic/util.h | 7 -------
12 2 files changed, 21 insertions(+), 13 deletions(-) 12 src/hwdb/hwdb.c | 18 +++++++++++-------
13 src/udev/udevadm-hwdb.c | 16 ++++++++++------
14 4 files changed, 37 insertions(+), 31 deletions(-)
13 15
16diff --git a/src/basic/format-table.c b/src/basic/format-table.c
17index 94e796d1c..f7b4eade9 100644
18--- a/src/basic/format-table.c
19+++ b/src/basic/format-table.c
20@@ -745,29 +745,29 @@ static int cell_data_compare(TableData *a, size_t index_a, TableData *b, size_t
21 return 0;
22 }
23
24-static int table_data_compare(const void *x, const void *y, void *userdata) {
25+static Table *user_table;
26+static int table_data_compare(const void *x, const void *y) {
27 const size_t *a = x, *b = y;
28- Table *t = userdata;
29 size_t i;
30 int r;
31
32- assert(t);
33- assert(t->sort_map);
34+ assert(user_table);
35+ assert(user_table->sort_map);
36
37 /* Make sure the header stays at the beginning */
38- if (*a < t->n_columns && *b < t->n_columns)
39+ if (*a < user_table->n_columns && *b < user_table->n_columns)
40 return 0;
41- if (*a < t->n_columns)
42+ if (*a < user_table->n_columns)
43 return -1;
44- if (*b < t->n_columns)
45+ if (*b < user_table->n_columns)
46 return 1;
47
48 /* Order other lines by the sorting map */
49- for (i = 0; i < t->n_sort_map; i++) {
50+ for (i = 0; i < user_table->n_sort_map; i++) {
51 TableData *d, *dd;
52
53- d = t->data[*a + t->sort_map[i]];
54- dd = t->data[*b + t->sort_map[i]];
55+ d = user_table->data[*a + user_table->sort_map[i]];
56+ dd = user_table->data[*b + user_table->sort_map[i]];
57
58 r = cell_data_compare(d, *a, dd, *b);
59 if (r != 0)
60@@ -960,7 +960,12 @@ int table_print(Table *t, FILE *f) {
61 for (i = 0; i < n_rows; i++)
62 sorted[i] = i * t->n_columns;
63
64- qsort_r_safe(sorted, n_rows, sizeof(size_t), table_data_compare, t);
65+ if (n_rows <= 1)
66+ return;
67+ assert(sorted);
68+ user_table = t;
69+ qsort(sorted, n_rows, sizeof(size_t), table_data_compare);
70+ user_table = NULL;
71 }
72
73 if (t->display_map)
74diff --git a/src/basic/util.h b/src/basic/util.h
75index 9699d228f..40eaf518c 100644
76--- a/src/basic/util.h
77+++ b/src/basic/util.h
78@@ -105,13 +105,6 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_
79 qsort_safe((p), (n), sizeof((p)[0]), (__compar_fn_t) _func_); \
80 })
81
82-static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void*, const void*, void*), void *userdata) {
83- if (nmemb <= 1)
84- return;
85-
86- assert(base);
87- qsort_r(base, nmemb, size, compar, userdata);
88-}
89
90 /**
91 * Normal memcpy requires src to be nonnull. We do nothing if n is 0.
14diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c 92diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
15index 4540260f9..81aca7a9b 100644 93index 317cad8a6..701d59a1e 100644
16--- a/src/hwdb/hwdb.c 94--- a/src/hwdb/hwdb.c
17+++ b/src/hwdb/hwdb.c 95+++ b/src/hwdb/hwdb.c
18@@ -152,13 +152,12 @@ static void trie_free(struct trie *trie) { 96@@ -135,13 +135,12 @@ static void trie_free(struct trie *trie) {
19 97
20 DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free); 98 DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free);
21 99
@@ -33,7 +111,7 @@ index 4540260f9..81aca7a9b 100644
33 } 111 }
34 112
35 static int trie_node_add_value(struct trie *trie, struct trie_node *node, 113 static int trie_node_add_value(struct trie *trie, struct trie_node *node,
36@@ -183,7 +182,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node, 114@@ -166,7 +165,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
37 .value_off = v, 115 .value_off = v,
38 }; 116 };
39 117
@@ -45,7 +123,7 @@ index 4540260f9..81aca7a9b 100644
45 if (val) { 123 if (val) {
46 /* At this point we have 2 identical properties on the same match-string. 124 /* At this point we have 2 identical properties on the same match-string.
47 * Since we process files in order, we just replace the previous value. 125 * Since we process files in order, we just replace the previous value.
48@@ -208,7 +210,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node, 126@@ -191,7 +193,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
49 node->values[node->values_count].file_priority = file_priority; 127 node->values[node->values_count].file_priority = file_priority;
50 node->values[node->values_count].line_number = line_number; 128 node->values[node->values_count].line_number = line_number;
51 node->values_count++; 129 node->values_count++;
@@ -57,10 +135,10 @@ index 4540260f9..81aca7a9b 100644
57 } 135 }
58 136
59diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c 137diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
60index ab5dc7ab6..c777e30ab 100644 138index 02408a428..491d367d1 100644
61--- a/src/udev/udevadm-hwdb.c 139--- a/src/udev/udevadm-hwdb.c
62+++ b/src/udev/udevadm-hwdb.c 140+++ b/src/udev/udevadm-hwdb.c
63@@ -130,13 +130,13 @@ static void trie_node_cleanup(struct trie_node *node) { 141@@ -114,13 +114,13 @@ static void trie_node_cleanup(struct trie_node *node) {
64 free(node); 142 free(node);
65 } 143 }
66 144
@@ -78,7 +156,7 @@ index ab5dc7ab6..c777e30ab 100644
78 } 156 }
79 157
80 static int trie_node_add_value(struct trie *trie, struct trie_node *node, 158 static int trie_node_add_value(struct trie *trie, struct trie_node *node,
81@@ -157,7 +157,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node, 159@@ -141,7 +141,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
82 .value_off = v, 160 .value_off = v,
83 }; 161 };
84 162
@@ -89,7 +167,7 @@ index ab5dc7ab6..c777e30ab 100644
89 if (val) { 167 if (val) {
90 /* replace existing earlier key with new value */ 168 /* replace existing earlier key with new value */
91 val->value_off = v; 169 val->value_off = v;
92@@ -174,7 +176,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node, 170@@ -158,7 +160,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
93 node->values[node->values_count].key_off = k; 171 node->values[node->values_count].key_off = k;
94 node->values[node->values_count].value_off = v; 172 node->values[node->values_count].value_off = v;
95 node->values_count++; 173 node->values_count++;
@@ -101,5 +179,5 @@ index ab5dc7ab6..c777e30ab 100644
101 } 179 }
102 180
103-- 181--
1042.13.0 1822.11.0
105 183
diff --git a/meta/recipes-core/systemd/systemd/0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch b/meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
index 28f1b21..1d7f523 100644
--- a/meta/recipes-core/systemd/systemd/0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
+++ b/meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
@@ -1,8 +1,8 @@
1From 8b9d194e956848e0d1fb35ef2fba714b2691ebe6 Mon Sep 17 00:00:00 2001 1From 6e62be87a2722fbe531310a1b052c1301bdf06fb Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 28 Feb 2018 20:47:49 -0800 3Date: Wed, 27 Jun 2018 16:09:24 +0800
4Subject: [PATCH 03/31] use lnr wrapper instead of looking for --relative 4Subject: [PATCH 2/9] use lnr wrapper instead of looking for --relative option
5 option for ln 5 for ln
6 6
7Remove file manually to avoid the 'File Exists' error when creating 7Remove file manually to avoid the 'File Exists' error when creating
8symlink. This is because the original 'ln' command uses '-f' option. 8symlink. This is because the original 'ln' command uses '-f' option.
@@ -18,15 +18,15 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
18 3 files changed, 8 insertions(+), 6 deletions(-) 18 3 files changed, 8 insertions(+), 6 deletions(-)
19 19
20diff --git a/meson.build b/meson.build 20diff --git a/meson.build b/meson.build
21index 36a62d280..7347ea880 100644 21index 04331dd41..6d5edcb4e 100644
22--- a/meson.build 22--- a/meson.build
23+++ b/meson.build 23+++ b/meson.build
24@@ -570,10 +570,6 @@ endforeach 24@@ -558,10 +558,6 @@ endforeach
25 25
26 conf.set_quoted('TELINIT', get_option('telinit-path')) 26 conf.set_quoted('TELINIT', get_option('telinit-path'))
27 27
28-if run_command('ln', '--relative', '--help').returncode() != 0 28-if run_command('ln', '--relative', '--help').returncode() != 0
29- error('ln does not support --relative') 29- error('ln does not support --relative (added in coreutils 8.16)')
30-endif 30-endif
31- 31-
32 ############################################################ 32 ############################################################
@@ -60,5 +60,5 @@ index 70f7172ae..a42666aac 100755
60+ lnr "$unitpath" "$dir" 60+ lnr "$unitpath" "$dir"
61+fi 61+fi
62-- 62--
632.13.0 632.11.0
64 64
diff --git a/meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch b/meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
new file mode 100644
index 0000000..115fb33
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
@@ -0,0 +1,40 @@
1From e965e748c7030df0709e63128db2f023540a06ba Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 12 Sep 2015 18:53:31 +0000
4Subject: [PATCH 03/19] comparison_fn_t is glibc specific, use raw signature in
5 function pointer
6
7make it work with musl where comparison_fn_t is not provided
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 src/basic/util.h | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/src/basic/util.h b/src/basic/util.h
17index 40eaf518c..c58392397 100644
18--- a/src/basic/util.h
19+++ b/src/basic/util.h
20@@ -77,7 +77,7 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
21 * that only if nmemb > 0.
22 */
23 static inline void* bsearch_safe(const void *key, const void *base,
24- size_t nmemb, size_t size, comparison_fn_t compar) {
25+ size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
26 if (nmemb <= 0)
27 return NULL;
28
29@@ -89,7 +89,7 @@ static inline void* bsearch_safe(const void *key, const void *base,
30 * Normal qsort requires base to be nonnull. Here were require
31 * that only if nmemb > 0.
32 */
33-static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
34+static inline void qsort_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
35 if (nmemb <= 1)
36 return;
37
38--
392.11.0
40
diff --git a/meta/recipes-core/systemd/systemd/0004-implment-systemd-sysv-install-for-OE.patch b/meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch
index 83fdb53..6c595ae 100644
--- a/meta/recipes-core/systemd/systemd/0004-implment-systemd-sysv-install-for-OE.patch
+++ b/meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch
@@ -1,7 +1,7 @@
1From 70d456fb21de2a80697fa364f08475339d6396c1 Mon Sep 17 00:00:00 2001 1From 0fcb6e646401205e17cc6c129441a49023c62cef Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 5 Sep 2015 06:31:47 +0000 3Date: Sat, 5 Sep 2015 06:31:47 +0000
4Subject: [PATCH 04/31] implment systemd-sysv-install for OE 4Subject: [PATCH 3/9] implment systemd-sysv-install for OE
5 5
6Use update-rc.d for enabling/disabling and status command 6Use update-rc.d for enabling/disabling and status command
7to check the status of the sysv service 7to check the status of the sysv service
@@ -14,10 +14,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 3 insertions(+), 3 deletions(-) 14 1 file changed, 3 insertions(+), 3 deletions(-)
15 15
16diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON 16diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON
17index a53a3e622..5d877b06e 100755 17index 8c16cf999..9f078a121 100755
18--- a/src/systemctl/systemd-sysv-install.SKELETON 18--- a/src/systemctl/systemd-sysv-install.SKELETON
19+++ b/src/systemctl/systemd-sysv-install.SKELETON 19+++ b/src/systemctl/systemd-sysv-install.SKELETON
20@@ -30,17 +30,17 @@ case "$1" in 20@@ -32,17 +32,17 @@ case "$1" in
21 enable) 21 enable)
22 # call the command to enable SysV init script $NAME here 22 # call the command to enable SysV init script $NAME here
23 # (consider optional $ROOT) 23 # (consider optional $ROOT)
@@ -39,5 +39,5 @@ index a53a3e622..5d877b06e 100755
39 *) 39 *)
40 usage ;; 40 usage ;;
41-- 41--
422.13.0 422.11.0
43 43
diff --git a/meta/recipes-core/systemd/systemd/0013-add-fallback-parse_printf_format-implementation.patch b/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch
index 9c9278d..7652a2d 100644
--- a/meta/recipes-core/systemd/systemd/0013-add-fallback-parse_printf_format-implementation.patch
+++ b/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch
@@ -1,29 +1,29 @@
1From 580d23cf0b32e36a8fb96710336ffef432b3c7ce Mon Sep 17 00:00:00 2001 1From 582af7ec13131dfcc620ed81de7b211914c4cb03 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 28 Feb 2018 21:10:58 -0800 3Date: Fri, 29 Jun 2018 13:43:49 +0800
4Subject: [PATCH] add fallback parse_printf_format implementation 4Subject: [PATCH 04/19] add fallback parse_printf_format implementation
5 5
6Upstream-Status: Pending 6Upstream-Status: Inappropriate [musl specific]
7 7
8Signed-off-by: Emil Renner Berthing <systemd@esmil.dk> 8Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
9Signed-off-by: Khem Raj <raj.khem@gmail.com> 9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 10Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
11--- 11---
12 meson.build | 1 + 12 meson.build | 1 +
13 src/basic/meson.build | 4 + 13 src/basic/meson.build | 5 +
14 src/basic/parse-printf-format.c | 273 ++++++++++++++++++++++++++++++++++++++++ 14 src/basic/parse-printf-format.c | 273 ++++++++++++++++++++++++++++++++++++++++
15 src/basic/parse-printf-format.h | 57 +++++++++ 15 src/basic/parse-printf-format.h | 57 +++++++++
16 src/basic/stdio-util.h | 2 +- 16 src/basic/stdio-util.h | 2 +-
17 src/journal/journal-send.c | 2 +- 17 src/journal/journal-send.c | 2 +-
18 6 files changed, 337 insertions(+), 2 deletions(-) 18 6 files changed, 338 insertions(+), 2 deletions(-)
19 create mode 100644 src/basic/parse-printf-format.c 19 create mode 100644 src/basic/parse-printf-format.c
20 create mode 100644 src/basic/parse-printf-format.h 20 create mode 100644 src/basic/parse-printf-format.h
21 21
22diff --git a/meson.build b/meson.build 22diff --git a/meson.build b/meson.build
23index 94a16712b..4eabaafe8 100644 23index e045b9224..8c16bc979 100644
24--- a/meson.build 24--- a/meson.build
25+++ b/meson.build 25+++ b/meson.build
26@@ -620,6 +620,7 @@ foreach header : ['crypt.h', 26@@ -598,6 +598,7 @@ foreach header : ['crypt.h',
27 'linux/btrfs.h', 27 'linux/btrfs.h',
28 'linux/memfd.h', 28 'linux/memfd.h',
29 'linux/vm_sockets.h', 29 'linux/vm_sockets.h',
@@ -32,20 +32,21 @@ index 94a16712b..4eabaafe8 100644
32 'valgrind/memcheck.h', 32 'valgrind/memcheck.h',
33 'valgrind/valgrind.h', 33 'valgrind/valgrind.h',
34diff --git a/src/basic/meson.build b/src/basic/meson.build 34diff --git a/src/basic/meson.build b/src/basic/meson.build
35index 44cd31ecb..435c6ee02 100644 35index 31625b178..0c27528e7 100644
36--- a/src/basic/meson.build 36--- a/src/basic/meson.build
37+++ b/src/basic/meson.build 37+++ b/src/basic/meson.build
38@@ -310,6 +310,10 @@ endforeach 38@@ -302,6 +302,11 @@ foreach item : [['af', af_list_txt, 'af', ''],
39 endforeach
39 40
40 basic_sources += [missing_h] + generated_gperf_headers 41 basic_sources += [missing_h] + generated_gperf_headers
41 42+
42+if conf.get('HAVE_PRINTF_H') != 1 43+if conf.get('HAVE_PRINTF_H') != 1
43+ basic_sources += [files('parse-printf-format.c')] 44+ basic_sources += [files('parse-printf-format.c')]
44+endif 45+endif
45+ 46+
46 libbasic = static_library( 47 basic_gcrypt_sources = files(
47 'basic', 48 'gcrypt-util.c',
48 basic_sources, 49 'gcrypt-util.h')
49diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c 50diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c
50new file mode 100644 51new file mode 100644
51index 000000000..49437e544 52index 000000000..49437e544
@@ -389,12 +390,12 @@ index 000000000..47be7522d
389+ 390+
390+#endif /* HAVE_PRINTF_H */ 391+#endif /* HAVE_PRINTF_H */
391diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h 392diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h
392index dbfafba26..8038380d6 100644 393index 73c03274c..30192cd71 100644
393--- a/src/basic/stdio-util.h 394--- a/src/basic/stdio-util.h
394+++ b/src/basic/stdio-util.h 395+++ b/src/basic/stdio-util.h
395@@ -20,12 +20,12 @@ 396@@ -1,12 +1,12 @@
396 along with systemd; If not, see <http://www.gnu.org/licenses/>. 397 /* SPDX-License-Identifier: LGPL-2.1+ */
397 ***/ 398 #pragma once
398 399
399-#include <printf.h> 400-#include <printf.h>
400 #include <stdarg.h> 401 #include <stdarg.h>
@@ -404,13 +405,13 @@ index dbfafba26..8038380d6 100644
404 #include "macro.h" 405 #include "macro.h"
405+#include "parse-printf-format.h" 406+#include "parse-printf-format.h"
406 407
407 #define xsprintf(buf, fmt, ...) \ 408 #define snprintf_ok(buf, len, fmt, ...) \
408 assert_message_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf), "xsprintf: " #buf "[] must be big enough") 409 ((size_t) snprintf(buf, len, fmt, __VA_ARGS__) < (len))
409diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c 410diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
410index 73329ba02..70bb9e0e8 100644 411index a0621524a..65bcbcd2e 100644
411--- a/src/journal/journal-send.c 412--- a/src/journal/journal-send.c
412+++ b/src/journal/journal-send.c 413+++ b/src/journal/journal-send.c
413@@ -20,7 +20,6 @@ 414@@ -2,7 +2,6 @@
414 415
415 #include <errno.h> 416 #include <errno.h>
416 #include <fcntl.h> 417 #include <fcntl.h>
@@ -418,7 +419,7 @@ index 73329ba02..70bb9e0e8 100644
418 #include <stddef.h> 419 #include <stddef.h>
419 #include <sys/socket.h> 420 #include <sys/socket.h>
420 #include <sys/un.h> 421 #include <sys/un.h>
421@@ -39,6 +38,7 @@ 422@@ -21,6 +20,7 @@
422 #include "stdio-util.h" 423 #include "stdio-util.h"
423 #include "string-util.h" 424 #include "string-util.h"
424 #include "util.h" 425 #include "util.h"
@@ -427,5 +428,5 @@ index 73329ba02..70bb9e0e8 100644
427 #define SNDBUF_SIZE (8*1024*1024) 428 #define SNDBUF_SIZE (8*1024*1024)
428 429
429-- 430--
4302.13.0 4312.11.0
431 432
diff --git a/meta/recipes-core/systemd/systemd/0005-rules-whitelist-hd-devices.patch b/meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch
index e4421c8..7e37cbc 100644
--- a/meta/recipes-core/systemd/systemd/0005-rules-whitelist-hd-devices.patch
+++ b/meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch
@@ -1,7 +1,7 @@
1From 7b5b34993002b4418ba8a3c2ae661a7337fd8ed0 Mon Sep 17 00:00:00 2001 1From 5d8128f3832fd11fd046d1d1ad86c4ee7bc1dff0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 9 Nov 2016 19:41:13 -0800 3Date: Wed, 9 Nov 2016 19:41:13 -0800
4Subject: [PATCH 05/31] rules: whitelist hd* devices 4Subject: [PATCH 4/9] rules: whitelist hd* devices
5 5
6qemu by default emulates IDE and the linux-yocto kernel(s) use 6qemu by default emulates IDE and the linux-yocto kernel(s) use
7CONFIG_IDE instead of the more modern libsata, so disks appear as 7CONFIG_IDE instead of the more modern libsata, so disks appear as
@@ -16,7 +16,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
16 1 file changed, 1 insertion(+), 1 deletion(-) 16 1 file changed, 1 insertion(+), 1 deletion(-)
17 17
18diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules 18diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
19index 0de8cf3a1..d3f58f153 100644 19index 8ddb7577c..811e948ad 100644
20--- a/rules/60-persistent-storage.rules 20--- a/rules/60-persistent-storage.rules
21+++ b/rules/60-persistent-storage.rules 21+++ b/rules/60-persistent-storage.rules
22@@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end" 22@@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end"
@@ -29,5 +29,5 @@ index 0de8cf3a1..d3f58f153 100644
29 # ignore partitions that span the entire disk 29 # ignore partitions that span the entire disk
30 TEST=="whole_disk", GOTO="persistent_storage_end" 30 TEST=="whole_disk", GOTO="persistent_storage_end"
31-- 31--
322.13.0 322.11.0
33 33
diff --git a/meta/recipes-core/systemd/systemd/0006-Make-root-s-home-directory-configurable.patch b/meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch
index 5ba9661..c137087 100644
--- a/meta/recipes-core/systemd/systemd/0006-Make-root-s-home-directory-configurable.patch
+++ b/meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch
@@ -1,7 +1,7 @@
1From 9d63227420f0c4f093c1c2066eafe2b6152070cf Mon Sep 17 00:00:00 2001 1From 8b82663aeeedf9ca58e3b97116b4c4da5229e0f5 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 23 Feb 2018 13:47:37 +0800 3Date: Wed, 27 Jun 2018 16:46:45 +0800
4Subject: [PATCH 06/31] Make root's home directory configurable 4Subject: [PATCH 5/9] Make root's home directory configurable
5 5
6OpenEmbedded has a configurable home directory for root. Allow 6OpenEmbedded has a configurable home directory for root. Allow
7systemd to be built using its idea of what root's home directory 7systemd to be built using its idea of what root's home directory
@@ -16,15 +16,15 @@ Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
16Signed-off-by: Khem Raj <raj.khem@gmail.com> 16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 17Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
18--- 18---
19 meson.build | 8 ++++++++ 19 meson.build | 7 +++++++
20 meson_options.txt | 2 ++ 20 meson_options.txt | 2 ++
21 2 files changed, 10 insertions(+) 21 2 files changed, 9 insertions(+)
22 22
23diff --git a/meson.build b/meson.build 23diff --git a/meson.build b/meson.build
24index 7347ea880..918101d6b 100644 24index 6d5edcb4e..323146fe1 100644
25--- a/meson.build 25--- a/meson.build
26+++ b/meson.build 26+++ b/meson.build
27@@ -94,6 +94,11 @@ if rootlibdir == '' 27@@ -89,6 +89,11 @@ if rootlibdir == ''
28 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1]) 28 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
29 endif 29 endif
30 30
@@ -36,7 +36,7 @@ index 7347ea880..918101d6b 100644
36 # Dirs of external packages 36 # Dirs of external packages
37 pkgconfigdatadir = join_paths(datadir, 'pkgconfig') 37 pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
38 pkgconfiglibdir = join_paths(libdir, 'pkgconfig') 38 pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
39@@ -205,6 +210,7 @@ conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir) 39@@ -210,6 +215,7 @@ conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
40 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent')) 40 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
41 conf.set_quoted('LIBDIR', libdir) 41 conf.set_quoted('LIBDIR', libdir)
42 conf.set_quoted('ROOTLIBDIR', rootlibdir) 42 conf.set_quoted('ROOTLIBDIR', rootlibdir)
@@ -44,7 +44,7 @@ index 7347ea880..918101d6b 100644
44 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir) 44 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
45 conf.set_quoted('BOOTLIBDIR', bootlibdir) 45 conf.set_quoted('BOOTLIBDIR', bootlibdir)
46 conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull')) 46 conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
47@@ -221,6 +227,7 @@ substs.set('prefix', prefixdir) 47@@ -228,6 +234,7 @@ substs.set('prefix', prefixdir)
48 substs.set('exec_prefix', prefixdir) 48 substs.set('exec_prefix', prefixdir)
49 substs.set('libdir', libdir) 49 substs.set('libdir', libdir)
50 substs.set('rootlibdir', rootlibdir) 50 substs.set('rootlibdir', rootlibdir)
@@ -52,19 +52,11 @@ index 7347ea880..918101d6b 100644
52 substs.set('includedir', includedir) 52 substs.set('includedir', includedir)
53 substs.set('pkgsysconfdir', pkgsysconfdir) 53 substs.set('pkgsysconfdir', pkgsysconfdir)
54 substs.set('bindir', bindir) 54 substs.set('bindir', bindir)
55@@ -2705,6 +2712,7 @@ status = [
56 'include directory: @0@'.format(includedir),
57 'lib directory: @0@'.format(libdir),
58 'rootlib directory: @0@'.format(rootlibdir),
59+ 'roothome directory: @0@'.format(roothomedir),
60 'SysV init scripts: @0@'.format(sysvinit_path),
61 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
62 'PAM modules directory: @0@'.format(pamlibdir),
63diff --git a/meson_options.txt b/meson_options.txt 55diff --git a/meson_options.txt b/meson_options.txt
64index 39822d6cd..0b24f0e0f 100644 56index 16c1f2b2f..aa9a33368 100644
65--- a/meson_options.txt 57--- a/meson_options.txt
66+++ b/meson_options.txt 58+++ b/meson_options.txt
67@@ -22,6 +22,8 @@ option('rootlibdir', type : 'string', 59@@ -9,6 +9,8 @@ option('rootlibdir', type : 'string',
68 description : '''[/usr]/lib/x86_64-linux-gnu or such''') 60 description : '''[/usr]/lib/x86_64-linux-gnu or such''')
69 option('rootprefix', type : 'string', 61 option('rootprefix', type : 'string',
70 description : '''override the root prefix''') 62 description : '''override the root prefix''')
@@ -72,7 +64,7 @@ index 39822d6cd..0b24f0e0f 100644
72+ description : '''override the root home directory''') 64+ description : '''override the root home directory''')
73 option('link-udev-shared', type : 'boolean', 65 option('link-udev-shared', type : 'boolean',
74 description : 'link systemd-udev and its helpers to libsystemd-shared.so') 66 description : 'link systemd-udev and its helpers to libsystemd-shared.so')
75 67 option('link-systemctl-shared', type: 'boolean',
76-- 68--
772.13.0 692.11.0
78 70
diff --git a/meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch b/meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch
new file mode 100644
index 0000000..6d5faf5
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch
@@ -0,0 +1,29 @@
1From a2c4d46944892174930135672508389a04e191f0 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 29 Jun 2018 13:53:29 +0800
4Subject: [PATCH 05/19] include gshadow only if ENABLE_GSHADOW is 1
5
6Upstream-Status: Inappropriate [musl]
7
8Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9---
10 src/basic/user-util.h | 2 ++
11 1 file changed, 2 insertions(+)
12
13diff --git a/src/basic/user-util.h b/src/basic/user-util.h
14index b74f16885..f9c1e29c4 100644
15--- a/src/basic/user-util.h
16+++ b/src/basic/user-util.h
17@@ -2,7 +2,9 @@
18 #pragma once
19
20 #include <grp.h>
21+#if ENABLE_GSHADOW
22 #include <gshadow.h>
23+#endif
24 #include <pwd.h>
25 #include <shadow.h>
26 #include <stdbool.h>
27--
282.11.0
29
diff --git a/meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch b/meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch
new file mode 100644
index 0000000..eb6eb8b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch
@@ -0,0 +1,63 @@
1From 5199ae5dec9b8a9c9e20477d5090f1732735fbe2 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 28 Jun 2018 09:38:12 +0800
4Subject: [PATCH 6/9] remove nobody user/group checking
5
6Upstream-Status: Inappropriate [OE Specific]
7
8Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9---
10 meson.build | 37 -------------------------------------
11 1 file changed, 37 deletions(-)
12
13diff --git a/meson.build b/meson.build
14index 323146fe1..3bb087fef 100644
15--- a/meson.build
16+++ b/meson.build
17@@ -681,43 +681,6 @@ substs.set('containeruidbasemax', container_uid_base_max)
18 nobody_user = get_option('nobody-user')
19 nobody_group = get_option('nobody-group')
20
21-getent_result = run_command('getent', 'passwd', '65534')
22-if getent_result.returncode() == 0
23- name = getent_result.stdout().split(':')[0]
24- if name != nobody_user
25- warning('\n' +
26- 'The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) +
27- 'Your build will result in an user table setup that is incompatible with the local system.')
28- endif
29-endif
30-id_result = run_command('id', '-u', nobody_user)
31-if id_result.returncode() == 0
32- id = id_result.stdout().to_int()
33- if id != 65534
34- warning('\n' +
35- 'The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) +
36- 'Your build will result in an user table setup that is incompatible with the local system.')
37- endif
38-endif
39-
40-getent_result = run_command('getent', 'group', '65534')
41-if getent_result.returncode() == 0
42- name = getent_result.stdout().split(':')[0]
43- if name != nobody_group
44- warning('\n' +
45- 'The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) +
46- 'Your build will result in an group table setup that is incompatible with the local system.')
47- endif
48-endif
49-id_result = run_command('id', '-g', nobody_group)
50-if id_result.returncode() == 0
51- id = id_result.stdout().to_int()
52- if id != 65534
53- warning('\n' +
54- 'The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) +
55- 'Your build will result in an group table setup that is incompatible with the local system.')
56- endif
57-endif
58 if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
59 warning('\n' +
60 'The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
61--
622.11.0
63
diff --git a/meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch b/meta/recipes-core/systemd/systemd/0006-src-basic-missing.h-check-for-missing-strndupa.patch
index 9f62cbb..107a794 100644
--- a/meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch
+++ b/meta/recipes-core/systemd/systemd/0006-src-basic-missing.h-check-for-missing-strndupa.patch
@@ -1,11 +1,11 @@
1From 33be9052315cc4ec8e929fa238e1f0cc0161ad07 Mon Sep 17 00:00:00 2001 1From 03fd19fc87573276e0d359260c8fe591f5f0216a Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 28 Feb 2018 21:15:28 -0800 3Date: Fri, 29 Jun 2018 16:34:50 +0800
4Subject: [PATCH] src/basic/missing.h: check for missing strndupa 4Subject: [PATCH 06/19] src/basic/missing.h: check for missing strndupa
5 5
6include missing.h for definition of strndupa 6include missing.h for definition of strndupa
7 7
8Upstream-Status: Pending 8Upstream-Status: Inappropriate [musl specific]
9 9
10Signed-off-by: Khem Raj <raj.khem@gmail.com> 10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
@@ -13,29 +13,29 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13 meson.build | 1 + 13 meson.build | 1 +
14 src/basic/missing.h | 11 +++++++++++ 14 src/basic/missing.h | 11 +++++++++++
15 src/basic/mkdir.c | 1 + 15 src/basic/mkdir.c | 1 +
16 src/basic/pager.c | 1 +
16 src/basic/parse-util.c | 1 + 17 src/basic/parse-util.c | 1 +
17 src/basic/procfs-util.c | 1 + 18 src/basic/procfs-util.c | 1 +
18 src/shared/pager.c | 1 +
19 src/shared/uid-range.c | 1 + 19 src/shared/uid-range.c | 1 +
20 7 files changed, 17 insertions(+) 20 7 files changed, 17 insertions(+)
21 21
22diff --git a/meson.build b/meson.build 22diff --git a/meson.build b/meson.build
23index 4eabaafe8..12811b3f3 100644 23index 8c16bc979..a734a295c 100644
24--- a/meson.build 24--- a/meson.build
25+++ b/meson.build 25+++ b/meson.build
26@@ -525,6 +525,7 @@ foreach ident : [ 26@@ -503,6 +503,7 @@ foreach ident : [
27 ['bpf', '''#include <sys/syscall.h>
28 #include <unistd.h>'''], 27 #include <unistd.h>'''],
29 ['explicit_bzero' , '''#include <string.h>'''], 28 ['explicit_bzero' , '''#include <string.h>'''],
29 ['reallocarray', '''#include <malloc.h>'''],
30+ ['strndupa' , '''#include <string.h>'''], 30+ ['strndupa' , '''#include <string.h>'''],
31 ] 31 ]
32 32
33 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE') 33 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
34diff --git a/src/basic/missing.h b/src/basic/missing.h 34diff --git a/src/basic/missing.h b/src/basic/missing.h
35index 84d6d9167..07a8c8364 100644 35index 0e33abb9f..02397f1b6 100644
36--- a/src/basic/missing.h 36--- a/src/basic/missing.h
37+++ b/src/basic/missing.h 37+++ b/src/basic/missing.h
38@@ -1187,6 +1187,17 @@ struct input_mask { 38@@ -1184,6 +1184,17 @@ struct input_mask {
39 typedef int32_t key_serial_t; 39 typedef int32_t key_serial_t;
40 #endif 40 #endif
41 41
@@ -54,22 +54,34 @@ index 84d6d9167..07a8c8364 100644
54 #define KEYCTL_JOIN_SESSION_KEYRING 1 54 #define KEYCTL_JOIN_SESSION_KEYRING 1
55 #endif 55 #endif
56diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c 56diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
57index de4746c86..d51518a5a 100644 57index 6ab1b4422..77c3e0863 100644
58--- a/src/basic/mkdir.c 58--- a/src/basic/mkdir.c
59+++ b/src/basic/mkdir.c 59+++ b/src/basic/mkdir.c
60@@ -30,6 +30,7 @@ 60@@ -13,6 +13,7 @@
61 #include "path-util.h"
62 #include "stat-util.h" 61 #include "stat-util.h"
62 #include "stdio-util.h"
63 #include "user-util.h" 63 #include "user-util.h"
64+#include "missing.h" 64+#include "missing.h"
65 65
66 int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, bool follow_symlink, mkdir_func_t _mkdir) { 66 int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdir_func_t _mkdir) {
67 struct stat st; 67 struct stat st;
68diff --git a/src/basic/pager.c b/src/basic/pager.c
69index f24126111..8223bff02 100644
70--- a/src/basic/pager.c
71+++ b/src/basic/pager.c
72@@ -21,6 +21,7 @@
73 #include "string-util.h"
74 #include "strv.h"
75 #include "terminal-util.h"
76+#include "missing.h"
77
78 static pid_t pager_pid = 0;
79
68diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c 80diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
69index 2c22753de..97533721d 100644 81index 6becf8587..52576f536 100644
70--- a/src/basic/parse-util.c 82--- a/src/basic/parse-util.c
71+++ b/src/basic/parse-util.c 83+++ b/src/basic/parse-util.c
72@@ -33,6 +33,7 @@ 84@@ -17,6 +17,7 @@
73 #include "parse-util.h" 85 #include "parse-util.h"
74 #include "process-util.h" 86 #include "process-util.h"
75 #include "string-util.h" 87 #include "string-util.h"
@@ -78,10 +90,10 @@ index 2c22753de..97533721d 100644
78 int parse_boolean(const char *v) { 90 int parse_boolean(const char *v) {
79 assert(v); 91 assert(v);
80diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c 92diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c
81index 9bb42cc7b..23bbd9e67 100644 93index a159e344b..ebc427d6b 100644
82--- a/src/basic/procfs-util.c 94--- a/src/basic/procfs-util.c
83+++ b/src/basic/procfs-util.c 95+++ b/src/basic/procfs-util.c
84@@ -9,6 +9,7 @@ 96@@ -11,6 +11,7 @@
85 #include "procfs-util.h" 97 #include "procfs-util.h"
86 #include "stdio-util.h" 98 #include "stdio-util.h"
87 #include "string-util.h" 99 #include "string-util.h"
@@ -89,23 +101,11 @@ index 9bb42cc7b..23bbd9e67 100644
89 101
90 int procfs_tasks_get_limit(uint64_t *ret) { 102 int procfs_tasks_get_limit(uint64_t *ret) {
91 _cleanup_free_ char *value = NULL; 103 _cleanup_free_ char *value = NULL;
92diff --git a/src/shared/pager.c b/src/shared/pager.c
93index 75db3c985..84f06bf7d 100644
94--- a/src/shared/pager.c
95+++ b/src/shared/pager.c
96@@ -39,6 +39,7 @@
97 #include "string-util.h"
98 #include "strv.h"
99 #include "terminal-util.h"
100+#include "missing.h"
101
102 static pid_t pager_pid = 0;
103
104diff --git a/src/shared/uid-range.c b/src/shared/uid-range.c 104diff --git a/src/shared/uid-range.c b/src/shared/uid-range.c
105index c38b7cc98..8ec6bf08d 100644 105index 434ce6ff4..37093ab7b 100644
106--- a/src/shared/uid-range.c 106--- a/src/shared/uid-range.c
107+++ b/src/shared/uid-range.c 107+++ b/src/shared/uid-range.c
108@@ -25,6 +25,7 @@ 108@@ -8,6 +8,7 @@
109 #include "macro.h" 109 #include "macro.h"
110 #include "uid-range.h" 110 #include "uid-range.h"
111 #include "user-util.h" 111 #include "user-util.h"
@@ -114,5 +114,5 @@ index c38b7cc98..8ec6bf08d 100644
114 static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) { 114 static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) {
115 assert(range); 115 assert(range);
116-- 116--
1172.13.0 1172.11.0
118 118
diff --git a/meta/recipes-core/systemd/systemd/0017-Include-netinet-if_ether.h.patch b/meta/recipes-core/systemd/systemd/0007-Include-netinet-if_ether.h.patch
index a09cfdd..2df8cf9 100644
--- a/meta/recipes-core/systemd/systemd/0017-Include-netinet-if_ether.h.patch
+++ b/meta/recipes-core/systemd/systemd/0007-Include-netinet-if_ether.h.patch
@@ -1,14 +1,14 @@
1From f2b0173cd9807864db1ef3b102abaa76ef37e506 Mon Sep 17 00:00:00 2001 1From aab90d0dfa934d33879eaec1a878e93b201d33f1 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 28 Feb 2018 21:19:12 -0800 3Date: Fri, 29 Jun 2018 16:44:43 +0800
4Subject: [PATCH 17/31] Include netinet/if_ether.h 4Subject: [PATCH 07/19] Include netinet/if_ether.h
5 5
6Fixes 6Fixes
7/path/to/systemd/recipe-sysroot/usr/include/netinet/if_ether.h:101:8: error: redefinition of 'struct ethhdr' 7/path/to/systemd/recipe-sysroot/usr/include/netinet/if_ether.h:101:8: error: redefinition of 'struct ethhdr'
8 struct ethhdr { 8 struct ethhdr {
9 ^~~~~~ 9 ^~~~~~
10 10
11Upstream-Status: Pending 11Upstream-Status: Inappropriate [musl specific]
12 12
13Signed-off-by: Khem Raj <raj.khem@gmail.com> 13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 14Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
@@ -17,14 +17,15 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
17 src/network/netdev/tuntap.c | 1 + 17 src/network/netdev/tuntap.c | 1 +
18 src/network/networkd-brvlan.c | 1 + 18 src/network/networkd-brvlan.c | 1 +
19 src/udev/net/ethtool-util.c | 1 + 19 src/udev/net/ethtool-util.c | 1 +
20 src/udev/net/ethtool-util.h | 1 +
20 src/udev/udev-builtin-net_setup_link.c | 1 + 21 src/udev/udev-builtin-net_setup_link.c | 1 +
21 5 files changed, 5 insertions(+) 22 6 files changed, 6 insertions(+)
22 23
23diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c 24diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
24index 0ee7d6f0d..ef75893a6 100644 25index c93fe9cb4..2013d06e1 100644
25--- a/src/libsystemd/sd-netlink/netlink-types.c 26--- a/src/libsystemd/sd-netlink/netlink-types.c
26+++ b/src/libsystemd/sd-netlink/netlink-types.c 27+++ b/src/libsystemd/sd-netlink/netlink-types.c
27@@ -21,6 +21,7 @@ 28@@ -3,6 +3,7 @@
28 #include <netinet/in.h> 29 #include <netinet/in.h>
29 #include <stdint.h> 30 #include <stdint.h>
30 #include <sys/socket.h> 31 #include <sys/socket.h>
@@ -33,10 +34,10 @@ index 0ee7d6f0d..ef75893a6 100644
33 #include <linux/rtnetlink.h> 34 #include <linux/rtnetlink.h>
34 #include <linux/genetlink.h> 35 #include <linux/genetlink.h>
35diff --git a/src/network/netdev/tuntap.c b/src/network/netdev/tuntap.c 36diff --git a/src/network/netdev/tuntap.c b/src/network/netdev/tuntap.c
36index 4fc9b610a..628c61c57 100644 37index 21fb7ab06..0afe5170c 100644
37--- a/src/network/netdev/tuntap.c 38--- a/src/network/netdev/tuntap.c
38+++ b/src/network/netdev/tuntap.c 39+++ b/src/network/netdev/tuntap.c
39@@ -20,6 +20,7 @@ 40@@ -2,6 +2,7 @@
40 41
41 #include <errno.h> 42 #include <errno.h>
42 #include <fcntl.h> 43 #include <fcntl.h>
@@ -45,10 +46,10 @@ index 4fc9b610a..628c61c57 100644
45 #include <net/if.h> 46 #include <net/if.h>
46 #include <netinet/if_ether.h> 47 #include <netinet/if_ether.h>
47diff --git a/src/network/networkd-brvlan.c b/src/network/networkd-brvlan.c 48diff --git a/src/network/networkd-brvlan.c b/src/network/networkd-brvlan.c
48index 99dd41629..90407c9d8 100644 49index 8e8a618e2..52d523a67 100644
49--- a/src/network/networkd-brvlan.c 50--- a/src/network/networkd-brvlan.c
50+++ b/src/network/networkd-brvlan.c 51+++ b/src/network/networkd-brvlan.c
51@@ -19,6 +19,7 @@ 52@@ -4,6 +4,7 @@
52 ***/ 53 ***/
53 54
54 #include <netinet/in.h> 55 #include <netinet/in.h>
@@ -57,29 +58,39 @@ index 99dd41629..90407c9d8 100644
57 #include <stdbool.h> 58 #include <stdbool.h>
58 59
59diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c 60diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c
60index 9bdaef8d9..948f89cf8 100644 61index 4bb4216ac..5f7383483 100644
61--- a/src/udev/net/ethtool-util.c 62--- a/src/udev/net/ethtool-util.c
62+++ b/src/udev/net/ethtool-util.c 63+++ b/src/udev/net/ethtool-util.c
63@@ -18,6 +18,7 @@ 64@@ -1,5 +1,6 @@
64 along with systemd; If not, see <http://www.gnu.org/licenses/>. 65 /* SPDX-License-Identifier: LGPL-2.1+ */
65 ***/
66 66
67+#include <netinet/if_ether.h> 67+#include <netinet/if_ether.h>
68 #include <net/if.h> 68 #include <net/if.h>
69 #include <sys/ioctl.h> 69 #include <sys/ioctl.h>
70 #include <linux/ethtool.h> 70 #include <linux/ethtool.h>
71diff --git a/src/udev/net/ethtool-util.h b/src/udev/net/ethtool-util.h
72index 064bf4d2b..ee0d4fb2a 100644
73--- a/src/udev/net/ethtool-util.h
74+++ b/src/udev/net/ethtool-util.h
75@@ -3,6 +3,7 @@
76
77
78 #include <macro.h>
79+#include <netinet/if_ether.h>
80 #include <linux/ethtool.h>
81
82 #include "missing.h"
71diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c 83diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
72index 40158e0af..b24b3fce8 100644 84index 8bed6399a..a3a96959b 100644
73--- a/src/udev/udev-builtin-net_setup_link.c 85--- a/src/udev/udev-builtin-net_setup_link.c
74+++ b/src/udev/udev-builtin-net_setup_link.c 86+++ b/src/udev/udev-builtin-net_setup_link.c
75@@ -18,6 +18,7 @@ 87@@ -1,5 +1,6 @@
76 along with systemd; If not, see <http://www.gnu.org/licenses/>. 88 /* SPDX-License-Identifier: LGPL-2.1+ */
77 ***/
78 89
79+#include <netinet/if_ether.h> 90+#include <netinet/if_ether.h>
80 #include "alloc-util.h" 91 #include "alloc-util.h"
81 #include "link-config.h" 92 #include "link-config.h"
82 #include "log.h" 93 #include "log.h"
83-- 94--
842.13.0 952.11.0
85 96
diff --git a/meta/recipes-core/systemd/systemd/0007-Revert-rules-remove-firmware-loading-rules.patch b/meta/recipes-core/systemd/systemd/0007-Revert-rules-remove-firmware-loading-rules.patch
deleted file mode 100644
index bb12d30..0000000
--- a/meta/recipes-core/systemd/systemd/0007-Revert-rules-remove-firmware-loading-rules.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 35d6d384e83ac38077603611bb791969ef95fe68 Mon Sep 17 00:00:00 2001
2From: Jonathan Liu <net147@gmail.com>
3Date: Thu, 19 Mar 2015 15:01:29 +1100
4Subject: [PATCH 07/31] Revert "rules: remove firmware loading rules"
5
6This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19.
7Userspace firmware loading support is needed for Linux < 3.7.
8
9Upstream-Status: Inappropriate [OE specific]
10
11Signed-off-by: Jonathan Liu <net147@gmail.com>
12---
13 rules/50-firmware.rules | 3 +++
14 1 file changed, 3 insertions(+)
15 create mode 100644 rules/50-firmware.rules
16
17diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules
18new file mode 100644
19index 000000000..f0ae68451
20--- /dev/null
21+++ b/rules/50-firmware.rules
22@@ -0,0 +1,3 @@
23+# do not edit this file, it will be overwritten on update
24+
25+SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
26--
272.13.0
28
diff --git a/meta/recipes-core/systemd/systemd/0012-rules-watch-metadata-changes-in-ide-devices.patch b/meta/recipes-core/systemd/systemd/0007-rules-watch-metadata-changes-in-ide-devices.patch
index 7207863..a5f65e6 100644
--- a/meta/recipes-core/systemd/systemd/0012-rules-watch-metadata-changes-in-ide-devices.patch
+++ b/meta/recipes-core/systemd/systemd/0007-rules-watch-metadata-changes-in-ide-devices.patch
@@ -1,7 +1,7 @@
1From 406a4c8692316e8c7e14c78f9a802689be304a95 Mon Sep 17 00:00:00 2001 1From 9302b72e5e69512aaa7106197b00c55baeb35b3c Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Fri, 17 Nov 2017 09:46:00 +0800 3Date: Fri, 17 Nov 2017 09:46:00 +0800
4Subject: [PATCH 12/31] rules: watch metadata changes in ide devices 4Subject: [PATCH 7/9] rules: watch metadata changes in ide devices
5 5
6Formatting IDE storage does not trigger "change" uevents. As a result 6Formatting IDE storage does not trigger "change" uevents. As a result
7clients using udev API don't get any updates afterwards and get outdated 7clients using udev API don't get any updates afterwards and get outdated
@@ -39,5 +39,5 @@ index 343fc06f8..b5237dac4 100644
39-ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*", OPTIONS+="watch" 39-ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*", OPTIONS+="watch"
40+ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*|hd*", OPTIONS+="watch" 40+ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*|hd*", OPTIONS+="watch"
41-- 41--
422.13.0 422.11.0
43 43
diff --git a/meta/recipes-core/systemd/systemd/0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch b/meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch
index 16b21a0..abecdc7 100644
--- a/meta/recipes-core/systemd/systemd/0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch
+++ b/meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch
@@ -1,7 +1,7 @@
1From f5f313915d78bc43eb96e2aafb8ce3cda304c277 Mon Sep 17 00:00:00 2001 1From b6ba596fd1313a162cdc2eb88161dcf24d19ede7 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 26 Feb 2018 17:27:56 +0800 3Date: Thu, 28 Jun 2018 10:10:02 +0800
4Subject: [PATCH 19/31] Do not enable nss tests if nss-systemd is not enabled 4Subject: [PATCH 8/9] Do not enable nss tests if nss-systemd is not enabled
5 5
6Upstream-Status: Pending 6Upstream-Status: Pending
7 7
@@ -12,18 +12,18 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12 1 file changed, 1 insertion(+), 1 deletion(-) 12 1 file changed, 1 insertion(+), 1 deletion(-)
13 13
14diff --git a/src/test/meson.build b/src/test/meson.build 14diff --git a/src/test/meson.build b/src/test/meson.build
15index 1db8aa107..df3a1f5c5 100644 15index 7da7e3a22..7b7c257ff 100644
16--- a/src/test/meson.build 16--- a/src/test/meson.build
17+++ b/src/test/meson.build 17+++ b/src/test/meson.build
18@@ -646,7 +646,7 @@ tests += [ 18@@ -645,7 +645,7 @@ tests += [
19 [['src/test/test-nss.c'], 19 [['src/test/test-nss.c'],
20 [], 20 [],
21 [libdl], 21 [libdl],
22- '', 'manual'], 22- '', 'manual'],
23+ 'ENABLE_NSS_SYSTEMD', 'manual'], 23+ 'ENABLE_NSS_SYSTEMD', 'manual'],
24 ]
25 24
26 ############################################################ 25 [['src/test/test-umount.c',
26 'src/core/mount-setup.c',
27-- 27--
282.13.0 282.11.0
29 29
diff --git a/meta/recipes-core/systemd/systemd/0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch b/meta/recipes-core/systemd/systemd/0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch
deleted file mode 100644
index 15d7e02..0000000
--- a/meta/recipes-core/systemd/systemd/0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch
+++ /dev/null
@@ -1,377 +0,0 @@
1From 5cce7626f33e92f624ac06b613125813fb47d445 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 28 Feb 2018 21:05:39 -0800
4Subject: [PATCH 08/31] Revert "udev: remove userspace firmware loading
5 support"
6
7This reverts commit be2ea723b1d023b3d385d3b791ee4607cbfb20ca.
8Userspace firmware loading support is needed for Linux < 3.7.
9
10Upstream-Status: Inappropriate [OE specific]
11
12Signed-off-by: Jonathan Liu <net147@gmail.com>
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
15---
16 README | 4 +-
17 TODO | 1 +
18 meson.build | 9 +++
19 meson_options.txt | 2 +
20 rules/meson.build | 4 +
21 src/udev/meson.build | 4 +
22 src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++
23 src/udev/udev-builtin.c | 3 +
24 src/udev/udev.h | 6 ++
25 src/udev/udevd.c | 12 +++
26 10 files changed, 197 insertions(+), 2 deletions(-)
27 create mode 100644 src/udev/udev-builtin-firmware.c
28
29diff --git a/README b/README
30index 8807e5cfe..bfd7a35de 100644
31--- a/README
32+++ b/README
33@@ -58,8 +58,8 @@ REQUIREMENTS:
34 Legacy hotplug slows down the system and confuses udev:
35 CONFIG_UEVENT_HELPER_PATH=""
36
37- Userspace firmware loading is not supported and should
38- be disabled in the kernel:
39+ Userspace firmware loading is deprecated, will go away, and
40+ sometimes causes problems:
41 CONFIG_FW_LOADER_USER_HELPER=n
42
43 Some udev rules and virtualization detection relies on it:
44diff --git a/TODO b/TODO
45index a77028c7b..39e72d7ec 100644
46--- a/TODO
47+++ b/TODO
48@@ -783,6 +783,7 @@ Features:
49 * initialize the hostname from the fs label of /, if /etc/hostname does not exist?
50
51 * udev:
52+ - remove src/udev/udev-builtin-firmware.c (CONFIG_FW_LOADER_USER_HELPER=n)
53 - move to LGPL
54 - kill scsi_id
55 - add trigger --subsystem-match=usb/usb_device device
56diff --git a/meson.build b/meson.build
57index 918101d6b..9c25022a4 100644
58--- a/meson.build
59+++ b/meson.build
60@@ -72,6 +72,12 @@ conf.set10('HAVE_SYSV_COMPAT', have,
61 description : 'SysV init scripts and rcN.d links are supported')
62 m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
63
64+firmware_path = get_option('firmware-path')
65+have = firmware_path != ''
66+conf.set10('HAVE_FIRMWARE', have,
67+ description : 'Userspace firmware loading is supported')
68+m4_defines += have ? ['-DHAVE_FIRMWARE'] : []
69+
70 # join_paths ignore the preceding arguments if an absolute component is
71 # encountered, so this should canonicalize various paths when they are
72 # absolute or relative.
73@@ -178,6 +184,7 @@ conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysc
74 conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
75 conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
76 conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
77+conf.set_quoted('FIRMWARE_PATH', firmware_path)
78 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
79 conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
80 conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
81@@ -258,6 +265,7 @@ substs.set('SYSTEMCTL', join_paths(rootbin
82 substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
83 substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
84 substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
85+substs.set('FIRMWARE_PATH', firmware_path)
86 substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
87 substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
88
89@@ -2715,6 +2723,7 @@ status = [
90 'roothome directory: @0@'.format(roothomedir),
91 'SysV init scripts: @0@'.format(sysvinit_path),
92 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
93+ 'firmware path: @0@'.format(firmware_path),
94 'PAM modules directory: @0@'.format(pamlibdir),
95 'PAM configuration directory: @0@'.format(pamconfdir),
96 'RPM macros directory: @0@'.format(rpmmacrosdir),
97diff --git a/meson_options.txt b/meson_options.txt
98index 0b24f0e0f..92d25fa35 100644
99--- a/meson_options.txt
100+++ b/meson_options.txt
101@@ -108,6 +108,8 @@ option('tmpfiles', type : 'boolean',
102 description : 'support for tmpfiles.d')
103 option('importd', type : 'combo', choices : ['auto', 'true', 'false'],
104 description : 'install the systemd-importd daemon')
105+option('firmware-path', type : 'string', value : '',
106+ description : 'Firmware search path')
107 option('hwdb', type : 'boolean',
108 description : 'support for the hardware database')
109 option('rfkill', type : 'boolean',
110diff --git a/rules/meson.build b/rules/meson.build
111index e253b9f59..5eee5fbca 100644
112--- a/rules/meson.build
113+++ b/rules/meson.build
114@@ -41,6 +41,10 @@ rules = files('''
115 install_data(rules,
116 install_dir : udevrulesdir)
117
118+if conf.get('HAVE_FIRMWARE') == 1
119+ install_data('50-firmware.rules', install_dir : udevrulesdir)
120+endif
121+
122 all_rules = rules
123
124 rules_in = '''
125diff --git a/src/udev/meson.build b/src/udev/meson.build
126index de2fd2d9c..b6b0ca006 100644
127--- a/src/udev/meson.build
128+++ b/src/udev/meson.build
129@@ -67,6 +67,10 @@ if conf.get('HAVE_ACL') == 1
130 sd_login_c]
131 endif
132
133+if conf.get('HAVE_FIRMWARE') == 1
134+ libudev_core_sources += ['udev-builtin-firmware.c']
135+endif
136+
137 ############################################################
138
139 generate_keyboard_keys_list = find_program('generate-keyboard-keys-list.sh')
140diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c
141new file mode 100644
142index 000000000..bd8c2fb96
143--- /dev/null
144+++ b/src/udev/udev-builtin-firmware.c
145@@ -0,0 +1,154 @@
146+/*
147+ * firmware - Kernel firmware loader
148+ *
149+ * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
150+ * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org>
151+ *
152+ * This program is free software; you can redistribute it and/or
153+ * modify it under the terms of the GNU General Public License as
154+ * published by the Free Software Foundation; either version 2 of the
155+ * License, or (at your option) any later version.
156+ *
157+ * This program is distributed in the hope that it will be useful, but
158+ * WITHOUT ANY WARRANTY; without even the implied warranty of
159+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
160+ * General Public License for more details:*
161+ */
162+
163+#include <unistd.h>
164+#include <stdlib.h>
165+#include <string.h>
166+#include <stdio.h>
167+#include <getopt.h>
168+#include <errno.h>
169+#include <stdbool.h>
170+#include <sys/utsname.h>
171+#include <sys/stat.h>
172+
173+#include "udev.h"
174+
175+static bool set_loading(struct udev *udev, char *loadpath, const char *state) {
176+ FILE *ldfile;
177+
178+ ldfile = fopen(loadpath, "we");
179+ if (ldfile == NULL) {
180+ log_error("error: can not open '%s'", loadpath);
181+ return false;
182+ };
183+ fprintf(ldfile, "%s\n", state);
184+ fclose(ldfile);
185+ return true;
186+}
187+
188+static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) {
189+ char *buf;
190+ FILE *fsource = NULL, *ftarget = NULL;
191+ bool ret = false;
192+
193+ buf = malloc(size);
194+ if (buf == NULL) {
195+ log_error("No memory available to load firmware file");
196+ return false;
197+ }
198+
199+ log_debug("writing '%s' (%zi) to '%s'", source, size, target);
200+
201+ fsource = fopen(source, "re");
202+ if (fsource == NULL)
203+ goto exit;
204+ ftarget = fopen(target, "we");
205+ if (ftarget == NULL)
206+ goto exit;
207+ if (fread(buf, size, 1, fsource) != 1)
208+ goto exit;
209+ if (fwrite(buf, size, 1, ftarget) == 1)
210+ ret = true;
211+exit:
212+ if (ftarget != NULL)
213+ fclose(ftarget);
214+ if (fsource != NULL)
215+ fclose(fsource);
216+ free(buf);
217+ return ret;
218+}
219+
220+static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) {
221+ struct udev *udev = udev_device_get_udev(dev);
222+ static const char *searchpath[] = { FIRMWARE_PATH };
223+ char loadpath[UTIL_PATH_SIZE];
224+ char datapath[UTIL_PATH_SIZE];
225+ char fwpath[UTIL_PATH_SIZE];
226+ const char *firmware;
227+ FILE *fwfile = NULL;
228+ struct utsname kernel;
229+ struct stat statbuf;
230+ unsigned int i;
231+ int rc = EXIT_SUCCESS;
232+
233+ firmware = udev_device_get_property_value(dev, "FIRMWARE");
234+ if (firmware == NULL) {
235+ log_error("firmware parameter missing");
236+ rc = EXIT_FAILURE;
237+ goto exit;
238+ }
239+
240+ /* lookup firmware file */
241+ uname(&kernel);
242+ for (i = 0; i < ELEMENTSOF(searchpath); i++) {
243+ strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL);
244+ fwfile = fopen(fwpath, "re");
245+ if (fwfile != NULL)
246+ break;
247+
248+ strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL);
249+ fwfile = fopen(fwpath, "re");
250+ if (fwfile != NULL)
251+ break;
252+ }
253+
254+ strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
255+
256+ if (fwfile == NULL) {
257+ log_debug("did not find firmware file '%s'", firmware);
258+ rc = EXIT_FAILURE;
259+ /*
260+ * Do not cancel the request in the initrd, the real root might have
261+ * the firmware file and the 'coldplug' run in the real root will find
262+ * this pending request and fulfill or cancel it.
263+ * */
264+ if (!in_initrd())
265+ set_loading(udev, loadpath, "-1");
266+ goto exit;
267+ }
268+
269+ if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) {
270+ if (!in_initrd())
271+ set_loading(udev, loadpath, "-1");
272+ rc = EXIT_FAILURE;
273+ goto exit;
274+ }
275+
276+ if (!set_loading(udev, loadpath, "1"))
277+ goto exit;
278+
279+ strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
280+ if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
281+ log_error("error sending firmware '%s' to device", firmware);
282+ set_loading(udev, loadpath, "-1");
283+ rc = EXIT_FAILURE;
284+ goto exit;
285+ };
286+
287+ set_loading(udev, loadpath, "0");
288+exit:
289+ if (fwfile)
290+ fclose(fwfile);
291+ return rc;
292+}
293+
294+const struct udev_builtin udev_builtin_firmware = {
295+ .name = "firmware",
296+ .cmd = builtin_firmware,
297+ .help = "kernel firmware loader",
298+ .run_once = true,
299+};
300diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
301index db2b6874f..ccd88638c 100644
302--- a/src/udev/udev-builtin.c
303+++ b/src/udev/udev-builtin.c
304@@ -32,6 +32,9 @@ static const struct udev_builtin *builtins[] = {
305 [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
306 #endif
307 [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
308+#if HAVE_FIRMWARE
309+ [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
310+#endif
311 [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
312 [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
313 [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
314diff --git a/src/udev/udev.h b/src/udev/udev.h
315index ea11c2d29..c47dd3d88 100644
316--- a/src/udev/udev.h
317+++ b/src/udev/udev.h
318@@ -151,6 +151,9 @@ enum udev_builtin_cmd {
319 UDEV_BUILTIN_BLKID,
320 #endif
321 UDEV_BUILTIN_BTRFS,
322+#if HAVE_FIRMWARE
323+ UDEV_BUILTIN_FIRMWARE,
324+#endif
325 UDEV_BUILTIN_HWDB,
326 UDEV_BUILTIN_INPUT_ID,
327 UDEV_BUILTIN_KEYBOARD,
328@@ -179,6 +182,9 @@ struct udev_builtin {
329 extern const struct udev_builtin udev_builtin_blkid;
330 #endif
331 extern const struct udev_builtin udev_builtin_btrfs;
332+#if HAVE_FIRMWARE
333+extern const struct udev_builtin udev_builtin_firmware;
334+#endif
335 extern const struct udev_builtin udev_builtin_hwdb;
336 extern const struct udev_builtin udev_builtin_input_id;
337 extern const struct udev_builtin udev_builtin_keyboard;
338diff --git a/src/udev/udevd.c b/src/udev/udevd.c
339index 5c757d513..2f3313007 100644
340--- a/src/udev/udevd.c
341+++ b/src/udev/udevd.c
342@@ -127,6 +127,9 @@ struct event {
343 bool is_block;
344 sd_event_source *timeout_warning;
345 sd_event_source *timeout;
346+#if HAVE_FIRMWARE
347+ bool nodelay;
348+#endif
349 };
350
351 static void event_queue_cleanup(Manager *manager, enum event_state type);
352@@ -609,6 +612,10 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) {
353 event->devnum = udev_device_get_devnum(dev);
354 event->is_block = streq("block", udev_device_get_subsystem(dev));
355 event->ifindex = udev_device_get_ifindex(dev);
356+#if HAVE_FIRMWARE
357+ if (streq(udev_device_get_subsystem(dev), "firmware"))
358+ event->nodelay = true;
359+#endif
360
361 log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
362 udev_device_get_action(dev), udev_device_get_subsystem(dev));
363@@ -692,6 +699,11 @@ static bool is_devpath_busy(Manager *manager, struct event *event) {
364 return true;
365 }
366
367+#if HAVE_FIRMWARE
368+ /* allow to bypass the dependency tracking */
369+ if (event->nodelay)
370+ continue;
371+#endif
372 /* parent device event found */
373 if (event->devpath[common] == '/') {
374 event->delaying_seqnum = loop_event->seqnum;
375--
3762.13.0
377
diff --git a/meta/recipes-core/systemd/systemd/0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch b/meta/recipes-core/systemd/systemd/0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
index 4509476..bee5fb6 100644
--- a/meta/recipes-core/systemd/systemd/0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
+++ b/meta/recipes-core/systemd/systemd/0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
@@ -1,7 +1,7 @@
1From b45cf4923c7e1f1165925e9b4d7db2108faf2eae Mon Sep 17 00:00:00 2001 1From 848e711d719a6d987bc7d14183e1c7b1f1c91c56 Mon Sep 17 00:00:00 2001
2From: Emil Renner Berthing <systemd@esmil.dk> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 23 Oct 2017 10:50:14 -0700 3Date: Fri, 29 Jun 2018 17:10:29 +0800
4Subject: [PATCH 15/31] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not 4Subject: [PATCH 08/19] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not
5 defined 5 defined
6 6
7If the standard library doesn't provide brace 7If the standard library doesn't provide brace
@@ -11,20 +11,21 @@ Dont use GNU GLOB extentions on non-glibc systems
11 11
12Conditionalize use of GLOB_ALTDIRFUNC 12Conditionalize use of GLOB_ALTDIRFUNC
13 13
14Upstream-Status: Pending 14Upstream-Status: Inappropriate [musl specific]
15 15
16Signed-off-by: Khem Raj <raj.khem@gmail.com> 16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
17--- 18---
18 src/basic/glob-util.c | 20 +++++++++++++++++--- 19 src/basic/glob-util.c | 13 +++++++++++--
19 src/test/test-glob-util.c | 17 +++++++++++++++-- 20 src/test/test-glob-util.c | 15 +++++++++++++++
20 src/tmpfiles/tmpfiles.c | 8 ++++++++ 21 src/tmpfiles/tmpfiles.c | 10 ++++++++++
21 3 files changed, 40 insertions(+), 5 deletions(-) 22 3 files changed, 36 insertions(+), 2 deletions(-)
22 23
23diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c 24diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c
24index 6e80a1e23..312bb3fd1 100644 25index 9fac676f2..8adb9559e 100644
25--- a/src/basic/glob-util.c 26--- a/src/basic/glob-util.c
26+++ b/src/basic/glob-util.c 27+++ b/src/basic/glob-util.c
27@@ -28,13 +28,18 @@ 28@@ -10,6 +10,11 @@
28 #include "macro.h" 29 #include "macro.h"
29 #include "path-util.h" 30 #include "path-util.h"
30 #include "strv.h" 31 #include "strv.h"
@@ -34,17 +35,17 @@ index 6e80a1e23..312bb3fd1 100644
34+#define GLOB_BRACE 0 35+#define GLOB_BRACE 0
35+#endif 36+#endif
36 37
38 static void closedir_wrapper(void* v) {
39 (void) closedir(v);
40@@ -18,6 +23,7 @@ static void closedir_wrapper(void* v) {
37 int safe_glob(const char *path, int flags, glob_t *pglob) { 41 int safe_glob(const char *path, int flags, glob_t *pglob) {
38 int k; 42 int k;
39 43
40+#ifdef GLOB_ALTDIRFUNC 44+#ifdef GLOB_ALTDIRFUNC
41 /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */ 45 /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */
42 assert(!(flags & GLOB_ALTDIRFUNC)); 46 assert(!(flags & GLOB_ALTDIRFUNC));
43- 47
44 if (!pglob->gl_closedir) 48@@ -31,10 +37,13 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
45 pglob->gl_closedir = (void (*)(void *)) closedir;
46 if (!pglob->gl_readdir)
47@@ -45,10 +50,13 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
48 pglob->gl_lstat = lstat; 49 pglob->gl_lstat = lstat;
49 if (!pglob->gl_stat) 50 if (!pglob->gl_stat)
50 pglob->gl_stat = stat; 51 pglob->gl_stat = stat;
@@ -60,24 +61,11 @@ index 6e80a1e23..312bb3fd1 100644
60 if (k == GLOB_NOMATCH) 61 if (k == GLOB_NOMATCH)
61 return -ENOENT; 62 return -ENOENT;
62 if (k == GLOB_NOSPACE) 63 if (k == GLOB_NOSPACE)
63@@ -61,6 +69,12 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
64 return 0;
65 }
66
67+/* Don't fail if the standard library
68+ * doesn't provide brace expansion */
69+#ifndef GLOB_BRACE
70+#define GLOB_BRACE 0
71+#endif
72+
73 int glob_exists(const char *path) {
74 _cleanup_globfree_ glob_t g = {};
75 int k;
76diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c 64diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c
77index bd2f8fcfd..a10c77427 100644 65index d78d6223c..f5943b26d 100644
78--- a/src/test/test-glob-util.c 66--- a/src/test/test-glob-util.c
79+++ b/src/test/test-glob-util.c 67+++ b/src/test/test-glob-util.c
80@@ -30,6 +30,11 @@ 68@@ -12,6 +12,11 @@
81 #include "glob-util.h" 69 #include "glob-util.h"
82 #include "macro.h" 70 #include "macro.h"
83 #include "rm-rf.h" 71 #include "rm-rf.h"
@@ -89,23 +77,21 @@ index bd2f8fcfd..a10c77427 100644
89 77
90 static void test_glob_exists(void) { 78 static void test_glob_exists(void) {
91 char name[] = "/tmp/test-glob_exists.XXXXXX"; 79 char name[] = "/tmp/test-glob_exists.XXXXXX";
92@@ -52,25 +57,33 @@ static void test_glob_exists(void) { 80@@ -40,11 +45,13 @@ static void test_glob_no_dot(void) {
93 static void test_glob_no_dot(void) {
94 char template[] = "/tmp/test-glob-util.XXXXXXX";
95 const char *fn; 81 const char *fn;
96- 82
97 _cleanup_globfree_ glob_t g = { 83 _cleanup_globfree_ glob_t g = {
98+#ifdef GLOB_ALTDIRFUNC 84+#ifdef GLOB_ALTDIRFUNC
99 .gl_closedir = (void (*)(void *)) closedir, 85 .gl_closedir = closedir_wrapper,
100 .gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot, 86 .gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot,
101 .gl_opendir = (void *(*)(const char *)) opendir, 87 .gl_opendir = (void *(*)(const char *)) opendir,
102 .gl_lstat = lstat, 88 .gl_lstat = lstat,
103 .gl_stat = stat, 89 .gl_stat = stat,
104+#endif 90+#endif
105 }; 91 };
106-
107 int r;
108 92
93 int r;
94@@ -52,11 +59,19 @@ static void test_glob_no_dot(void) {
109 assert_se(mkdtemp(template)); 95 assert_se(mkdtemp(template));
110 96
111 fn = strjoina(template, "/*"); 97 fn = strjoina(template, "/*");
@@ -126,25 +112,35 @@ index bd2f8fcfd..a10c77427 100644
126 112
127 (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL); 113 (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL);
128diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c 114diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
129index 38cbb739c..88cc543f0 100644 115index 927de35f3..5f0283da5 100644
130--- a/src/tmpfiles/tmpfiles.c 116--- a/src/tmpfiles/tmpfiles.c
131+++ b/src/tmpfiles/tmpfiles.c 117+++ b/src/tmpfiles/tmpfiles.c
132@@ -76,6 +76,12 @@ 118@@ -60,6 +60,12 @@
133 #include "umask-util.h"
134 #include "user-util.h" 119 #include "user-util.h"
135 #include "util.h" 120 #include "util.h"
121
136+/* Don't fail if the standard library 122+/* Don't fail if the standard library
137+ * doesn't provide brace expansion */ 123+ * doesn't provide brace expansion */
138+#ifndef GLOB_BRACE 124+#ifndef GLOB_BRACE
139+#define GLOB_BRACE 0 125+#define GLOB_BRACE 0
140+#endif 126+#endif
141+ 127+
142
143 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates 128 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
144 * them in the file system. This is intended to be used to create 129 * them in the file system. This is intended to be used to create
145@@ -1288,7 +1294,9 @@ static int item_do_children(Item *i, const char *path, action_t action) { 130 * properly owned directories beneath /tmp, /var/tmp, /run, which are
131@@ -1345,7 +1351,9 @@ finish:
132
133 static int glob_item(Item *i, action_t action) {
134 _cleanup_globfree_ glob_t g = {
135+#ifdef GLOB_ALTDIRFUNC
136 .gl_opendir = (void *(*)(const char *)) opendir_nomod,
137+#endif
138 };
139 int r = 0, k;
140 char **fn;
141@@ -1365,7 +1373,9 @@ static int glob_item(Item *i, action_t action) {
146 142
147 static int glob_item(Item *i, action_t action, bool recursive) { 143 static int glob_item_recursively(Item *i, fdaction_t action) {
148 _cleanup_globfree_ glob_t g = { 144 _cleanup_globfree_ glob_t g = {
149+#ifdef GLOB_ALTDIRFUNC 145+#ifdef GLOB_ALTDIRFUNC
150 .gl_opendir = (void *(*)(const char *)) opendir_nomod, 146 .gl_opendir = (void *(*)(const char *)) opendir_nomod,
@@ -153,5 +149,5 @@ index 38cbb739c..88cc543f0 100644
153 int r = 0, k; 149 int r = 0, k;
154 char **fn; 150 char **fn;
155-- 151--
1562.13.0 1522.11.0
157 153
diff --git a/meta/recipes-core/systemd/systemd/0028-add-missing-FTW_-macros-for-musl.patch b/meta/recipes-core/systemd/systemd/0009-add-missing-FTW_-macros-for-musl.patch
index 9ec3137..95287cce 100644
--- a/meta/recipes-core/systemd/systemd/0028-add-missing-FTW_-macros-for-musl.patch
+++ b/meta/recipes-core/systemd/systemd/0009-add-missing-FTW_-macros-for-musl.patch
@@ -1,13 +1,13 @@
1From 03cdd33be62db4c72a7fcf21b61d0d056c23c6a9 Mon Sep 17 00:00:00 2001 1From acc2c08082795802011e3c5f8626d63210021489 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 28 Feb 2018 21:36:32 -0800 3Date: Wed, 28 Feb 2018 21:36:32 -0800
4Subject: [PATCH 28/31] add missing FTW_ macros for musl 4Subject: [PATCH 09/19] add missing FTW_ macros for musl
5 5
6This is to avoid build failures like below for musl. 6This is to avoid build failures like below for musl.
7 7
8 locale-util.c:296:24: error: 'FTW_STOP' undeclared 8 locale-util.c:296:24: error: 'FTW_STOP' undeclared
9 9
10Upstream-Status: Pending 10Upstream-Status: Inappropriate [musl specific]
11 11
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13--- 13---
@@ -15,10 +15,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
15 1 file changed, 20 insertions(+) 15 1 file changed, 20 insertions(+)
16 16
17diff --git a/src/basic/missing.h b/src/basic/missing.h 17diff --git a/src/basic/missing.h b/src/basic/missing.h
18index 1aee3346a..5b9fde692 100644 18index 02397f1b6..6dc750eba 100644
19--- a/src/basic/missing.h 19--- a/src/basic/missing.h
20+++ b/src/basic/missing.h 20+++ b/src/basic/missing.h
21@@ -207,6 +207,26 @@ struct sockaddr_vm { 21@@ -189,6 +189,26 @@ struct sockaddr_vm {
22 #define BTRFS_QGROUP_LEVEL_SHIFT 48 22 #define BTRFS_QGROUP_LEVEL_SHIFT 48
23 #endif 23 #endif
24 24
@@ -46,5 +46,5 @@ index 1aee3346a..5b9fde692 100644
46 #define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \ 46 #define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \
47 struct btrfs_ioctl_qgroup_assign_args) 47 struct btrfs_ioctl_qgroup_assign_args)
48-- 48--
492.13.0 492.11.0
50 50
diff --git a/meta/recipes-core/systemd/systemd/0029-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch b/meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch
index 517249f..a635fa9 100644
--- a/meta/recipes-core/systemd/systemd/0029-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch
+++ b/meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch
@@ -1,7 +1,7 @@
1From 5845c82d1016a3e3f2696180d5ac91b46950540a Mon Sep 17 00:00:00 2001 1From f9625b5f3fd5dac3f3591dbeeb24dc9d6fda790d Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 27 Feb 2018 12:56:21 +0800 3Date: Tue, 27 Feb 2018 12:56:21 +0800
4Subject: [PATCH 29/31] nss-mymachines: Build conditionally when 4Subject: [PATCH 9/9] nss-mymachines: Build conditionally when
5 ENABLE_MYHOSTNAME is set 5 ENABLE_MYHOSTNAME is set
6 6
7Fixes build failures when building with --disable-myhostname 7Fixes build failures when building with --disable-myhostname
@@ -15,10 +15,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
15 1 file changed, 7 insertions(+), 4 deletions(-) 15 1 file changed, 7 insertions(+), 4 deletions(-)
16 16
17diff --git a/meson.build b/meson.build 17diff --git a/meson.build b/meson.build
18index 1b947adac..1ed4dde72 100644 18index 3bb087fef..73bd70b0b 100644
19--- a/meson.build 19--- a/meson.build
20+++ b/meson.build 20+++ b/meson.build
21@@ -1351,12 +1351,15 @@ test_dlopen = executable( 21@@ -1371,12 +1371,15 @@ test_dlopen = executable(
22 link_with : [libbasic], 22 link_with : [libbasic],
23 dependencies : [libdl]) 23 dependencies : [libdl])
24 24
@@ -39,5 +39,5 @@ index 1b947adac..1ed4dde72 100644
39 module = tuple[0] 39 module = tuple[0]
40 40
41-- 41--
422.13.0 422.11.0
43 43
diff --git a/meta/recipes-core/systemd/systemd/0009-remove-duplicate-include-uchar.h.patch b/meta/recipes-core/systemd/systemd/0009-remove-duplicate-include-uchar.h.patch
deleted file mode 100644
index 1b14369..0000000
--- a/meta/recipes-core/systemd/systemd/0009-remove-duplicate-include-uchar.h.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From ffdf9cb6ba0d932b81933d824f23a878c313a8d4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 22 Feb 2016 05:59:01 +0000
4Subject: [PATCH 09/31] remove duplicate include uchar.h
5
6missing.h already includes it
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Upstream-Status: Pending
10---
11 src/basic/escape.h | 1 -
12 src/basic/utf8.h | 1 -
13 2 files changed, 2 deletions(-)
14
15diff --git a/src/basic/escape.h b/src/basic/escape.h
16index de89f43a8..9921ccbbd 100644
17--- a/src/basic/escape.h
18+++ b/src/basic/escape.h
19@@ -24,7 +24,6 @@
20 #include <stddef.h>
21 #include <stdint.h>
22 #include <sys/types.h>
23-#include <uchar.h>
24
25 #include "string-util.h"
26 #include "missing.h"
27diff --git a/src/basic/utf8.h b/src/basic/utf8.h
28index b0a7485ae..fa06d2906 100644
29--- a/src/basic/utf8.h
30+++ b/src/basic/utf8.h
31@@ -23,7 +23,6 @@
32 #include <stdbool.h>
33 #include <stddef.h>
34 #include <stdint.h>
35-#include <uchar.h>
36
37 #include "macro.h"
38 #include "missing.h"
39--
402.13.0
41
diff --git a/meta/recipes-core/systemd/systemd/0010-check-for-uchar.h-in-meson.build.patch b/meta/recipes-core/systemd/systemd/0010-check-for-uchar.h-in-meson.build.patch
deleted file mode 100644
index 9a44b54..0000000
--- a/meta/recipes-core/systemd/systemd/0010-check-for-uchar.h-in-meson.build.patch
+++ /dev/null
@@ -1,45 +0,0 @@
1From ea4caaa1c6a6dc682bb04548ab05c5c73d0b45d6 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 26 Feb 2018 15:34:52 +0800
4Subject: [PATCH 10/31] check for uchar.h in meson.build
5
6Use #if HAVE_UCHAR_H to include uchar.h conditionally.
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Upstream-Status: Pending
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 meson.build | 1 +
14 src/basic/missing.h | 2 ++
15 2 files changed, 3 insertions(+)
16
17diff --git a/meson.build b/meson.build
18index 9c25022a4..94a16712b 100644
19--- a/meson.build
20+++ b/meson.build
21@@ -623,6 +623,7 @@ foreach header : ['crypt.h',
22 'sys/auxv.h',
23 'valgrind/memcheck.h',
24 'valgrind/valgrind.h',
25+ 'uchar.h',
26 ]
27
28 conf.set10('HAVE_' + header.underscorify().to_upper(),
29diff --git a/src/basic/missing.h b/src/basic/missing.h
30index 39c1fb700..84d6d9167 100644
31--- a/src/basic/missing.h
32+++ b/src/basic/missing.h
33@@ -38,7 +38,9 @@
34 #include <sys/resource.h>
35 #include <sys/socket.h>
36 #include <sys/syscall.h>
37+#if HAVE_UCHAR_H
38 #include <uchar.h>
39+#endif
40 #include <unistd.h>
41
42 #if HAVE_AUDIT
43--
442.13.0
45
diff --git a/meta/recipes-core/systemd/systemd/0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch b/meta/recipes-core/systemd/systemd/0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
index b0923d1..1654798 100644
--- a/meta/recipes-core/systemd/systemd/0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
+++ b/meta/recipes-core/systemd/systemd/0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
@@ -1,23 +1,22 @@
1From 60dd411e9756fc2b14c0e061ad803782b4aee874 Mon Sep 17 00:00:00 2001 1From a0bd587300744dbb8e9cfbb043233670ce781c98 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 26 Feb 2018 15:46:05 +0800 3Date: Mon, 2 Jul 2018 13:22:41 +0800
4Subject: [PATCH 11/31] socket-util: don't fail if libc doesn't support IDN 4Subject: [PATCH 10/19] socket-util: don't fail if libc doesn't support IDN
5 5
6Upstream-Status: Pending 6Upstream-Status: Inappropriate [musl specific]
7 7
8Signed-off-by: Emil Renner Berthing <systemd@esmil.dk> 8Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
9Signed-off-by: Khem Raj <raj.khem@gmail.com> 9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 10Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12--- 11---
13 src/basic/socket-util.c | 10 ++++++++++ 12 src/basic/socket-util.c | 10 ++++++++++
14 1 file changed, 10 insertions(+) 13 1 file changed, 10 insertions(+)
15 14
16diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c 15diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
17index 2c70cade1..67aedadd4 100644 16index a913102e1..0d0154805 100644
18--- a/src/basic/socket-util.c 17--- a/src/basic/socket-util.c
19+++ b/src/basic/socket-util.c 18+++ b/src/basic/socket-util.c
20@@ -50,6 +50,16 @@ 19@@ -32,6 +32,16 @@
21 #include "utf8.h" 20 #include "utf8.h"
22 #include "util.h" 21 #include "util.h"
23 22
@@ -32,8 +31,8 @@ index 2c70cade1..67aedadd4 100644
32+#endif 31+#endif
33+ 32+
34 #if ENABLE_IDN 33 #if ENABLE_IDN
35 # define IDN_FLAGS (NI_IDN|NI_IDN_USE_STD3_ASCII_RULES) 34 # define IDN_FLAGS NI_IDN
36 #else 35 #else
37-- 36--
382.13.0 372.11.0
39 38
diff --git a/meta/recipes-core/systemd/systemd/0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch b/meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch
index 53037ea..1a22ffd 100644
--- a/meta/recipes-core/systemd/systemd/0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch
+++ b/meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch
@@ -1,24 +1,25 @@
1From efc57856f961c1f3bf016c511c53d990db8abdff Mon Sep 17 00:00:00 2001 1From 045f205fd21e5e380edf813de04fcfbf5a487219 Mon Sep 17 00:00:00 2001
2From: Emil Renner Berthing <systemd@esmil.dk> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 23 Oct 2017 11:31:03 -0700 3Date: Mon, 2 Jul 2018 13:28:25 +0800
4Subject: [PATCH 16/31] src/basic/missing.h: check for missing __compar_fn_t 4Subject: [PATCH 11/19] src/basic/missing.h: check for missing __compar_fn_t
5 typedef 5 typedef
6 6
7include missing.h for missing __compar_fn_t 7include missing.h for missing __compar_fn_t
8 8
9Upstream-Status: Pending 9Upstream-Status: Inappropriate [musl specific]
10 10
11Signed-off-by: Khem Raj <raj.khem@gmail.com> 11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12--- 13---
13 src/basic/missing.h | 5 +++++ 14 src/basic/missing.h | 5 +++++
14 src/basic/strbuf.c | 1 + 15 src/basic/strbuf.c | 1 +
15 2 files changed, 6 insertions(+) 16 2 files changed, 6 insertions(+)
16 17
17diff --git a/src/basic/missing.h b/src/basic/missing.h 18diff --git a/src/basic/missing.h b/src/basic/missing.h
18index 07a8c8364..1aee3346a 100644 19index 6dc750eba..cd1cc109f 100644
19--- a/src/basic/missing.h 20--- a/src/basic/missing.h
20+++ b/src/basic/missing.h 21+++ b/src/basic/missing.h
21@@ -1162,6 +1162,11 @@ struct input_mask { 22@@ -1179,6 +1179,11 @@ struct input_mask {
22 #define RENAME_NOREPLACE (1 << 0) 23 #define RENAME_NOREPLACE (1 << 0)
23 #endif 24 #endif
24 25
@@ -31,17 +32,17 @@ index 07a8c8364..1aee3346a 100644
31 #define KCMP_FILE 0 32 #define KCMP_FILE 0
32 #endif 33 #endif
33diff --git a/src/basic/strbuf.c b/src/basic/strbuf.c 34diff --git a/src/basic/strbuf.c b/src/basic/strbuf.c
34index 8befffa66..bcb860f95 100644 35index e2ed776a0..4d3ebec4c 100644
35--- a/src/basic/strbuf.c 36--- a/src/basic/strbuf.c
36+++ b/src/basic/strbuf.c 37+++ b/src/basic/strbuf.c
37@@ -24,6 +24,7 @@ 38@@ -7,6 +7,7 @@
38
39 #include "alloc-util.h" 39 #include "alloc-util.h"
40 #include "strbuf.h" 40 #include "strbuf.h"
41 #include "util.h"
41+#include "missing.h" 42+#include "missing.h"
42 43
43 /* 44 /*
44 * Strbuf stores given strings in a single continuous allocated memory 45 * Strbuf stores given strings in a single continuous allocated memory
45-- 46--
462.13.0 472.11.0
47 48
diff --git a/meta/recipes-core/systemd/systemd/0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch b/meta/recipes-core/systemd/systemd/0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch
index 7f0b4bf..d41bc4a 100644
--- a/meta/recipes-core/systemd/systemd/0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch
+++ b/meta/recipes-core/systemd/systemd/0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch
@@ -1,9 +1,9 @@
1From b7eacdf0388f930fc5271bdecfa46612c71dd65c Mon Sep 17 00:00:00 2001 1From 1fadf805cb391e3bcbd9a0286a9e4b7adb9e7427 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 27 Feb 2018 13:27:47 +0800 3Date: Mon, 2 Jul 2018 13:34:09 +0800
4Subject: [PATCH 30/31] fix missing of __register_atfork for non-glibc builds 4Subject: [PATCH 12/19] fix missing of __register_atfork for non-glibc builds
5 5
6Upstream-Status: Pending 6Upstream-Status: Inappropriate [musl specific]
7 7
8Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 8Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9--- 9---
@@ -11,10 +11,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
11 1 file changed, 7 insertions(+) 11 1 file changed, 7 insertions(+)
12 12
13diff --git a/src/basic/process-util.c b/src/basic/process-util.c 13diff --git a/src/basic/process-util.c b/src/basic/process-util.c
14index dc7c9ef9e..85ce8a0cc 100644 14index 0a4f917cb..3543bc045 100644
15--- a/src/basic/process-util.c 15--- a/src/basic/process-util.c
16+++ b/src/basic/process-util.c 16+++ b/src/basic/process-util.c
17@@ -39,6 +39,9 @@ 17@@ -22,6 +22,9 @@
18 #if HAVE_VALGRIND_VALGRIND_H 18 #if HAVE_VALGRIND_VALGRIND_H
19 #include <valgrind/valgrind.h> 19 #include <valgrind/valgrind.h>
20 #endif 20 #endif
@@ -24,7 +24,7 @@ index dc7c9ef9e..85ce8a0cc 100644
24 24
25 #include "alloc-util.h" 25 #include "alloc-util.h"
26 #include "architecture.h" 26 #include "architecture.h"
27@@ -1112,11 +1115,15 @@ void reset_cached_pid(void) { 27@@ -1150,11 +1153,15 @@ void reset_cached_pid(void) {
28 cached_pid = CACHED_PID_UNSET; 28 cached_pid = CACHED_PID_UNSET;
29 } 29 }
30 30
@@ -39,7 +39,7 @@ index dc7c9ef9e..85ce8a0cc 100644
39+#endif 39+#endif
40 40
41 pid_t getpid_cached(void) { 41 pid_t getpid_cached(void) {
42 pid_t current_value; 42 static bool installed = false;
43-- 43--
442.13.0 442.11.0
45 45
diff --git a/meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch b/meta/recipes-core/systemd/systemd/0013-Use-uintmax_t-for-handling-rlim_t.patch
index 46d75ad..69b3c15 100644
--- a/meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch
+++ b/meta/recipes-core/systemd/systemd/0013-Use-uintmax_t-for-handling-rlim_t.patch
@@ -1,7 +1,7 @@
1From 88c48ea84db6fda19dfaeb64545fccf8fa0525ec Mon Sep 17 00:00:00 2001 1From a0ac0cfd90af6431c64d1b276f422a2092d569b3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 27 Oct 2017 13:00:41 -0700 3Date: Mon, 2 Jul 2018 13:44:21 +0800
4Subject: [PATCH 26/31] Use uintmax_t for handling rlim_t 4Subject: [PATCH 13/19] Use uintmax_t for handling rlim_t
5 5
6PRIu{32,64} is not right format to represent rlim_t type 6PRIu{32,64} is not right format to represent rlim_t type
7therefore use %ju and typecast the rlim_t variables to 7therefore use %ju and typecast the rlim_t variables to
@@ -15,9 +15,10 @@ execute.c:3446:36: error: format '%lu' expects argument of type 'long unsigned i
15| prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max); 15| prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
16| ~~~~~~~~~~~~~~~~~~~~~~ 16| ~~~~~~~~~~~~~~~~~~~~~~
17 17
18Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/7199] 18Upstream-Status: Denied [https://github.com/systemd/systemd/pull/7199]
19 19
20Signed-off-by: Khem Raj <raj.khem@gmail.com> 20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
21--- 22---
22 src/basic/format-util.h | 8 -------- 23 src/basic/format-util.h | 8 --------
23 src/basic/rlimit-util.c | 8 ++++---- 24 src/basic/rlimit-util.c | 8 ++++----
@@ -25,10 +26,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
25 3 files changed, 8 insertions(+), 16 deletions(-) 26 3 files changed, 8 insertions(+), 16 deletions(-)
26 27
27diff --git a/src/basic/format-util.h b/src/basic/format-util.h 28diff --git a/src/basic/format-util.h b/src/basic/format-util.h
28index d9a78f781..9a1bc21d7 100644 29index 160550cd6..61245d1e3 100644
29--- a/src/basic/format-util.h 30--- a/src/basic/format-util.h
30+++ b/src/basic/format-util.h 31+++ b/src/basic/format-util.h
31@@ -61,14 +61,6 @@ 32@@ -43,14 +43,6 @@
32 # define PRI_TIMEX "li" 33 # define PRI_TIMEX "li"
33 #endif 34 #endif
34 35
@@ -44,10 +45,10 @@ index d9a78f781..9a1bc21d7 100644
44 # define DEV_FMT "%" PRIu64 45 # define DEV_FMT "%" PRIu64
45 #elif SIZEOF_DEV_T == 4 46 #elif SIZEOF_DEV_T == 4
46diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c 47diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
47index 00648211d..df3d9ecc1 100644 48index be1ba615e..e328ce499 100644
48--- a/src/basic/rlimit-util.c 49--- a/src/basic/rlimit-util.c
49+++ b/src/basic/rlimit-util.c 50+++ b/src/basic/rlimit-util.c
50@@ -286,13 +286,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) { 51@@ -299,13 +299,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) {
51 if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY) 52 if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY)
52 s = strdup("infinity"); 53 s = strdup("infinity");
53 else if (rl->rlim_cur >= RLIM_INFINITY) 54 else if (rl->rlim_cur >= RLIM_INFINITY)
@@ -66,24 +67,24 @@ index 00648211d..df3d9ecc1 100644
66 if (!s) 67 if (!s)
67 return -ENOMEM; 68 return -ENOMEM;
68diff --git a/src/core/execute.c b/src/core/execute.c 69diff --git a/src/core/execute.c b/src/core/execute.c
69index 0df3971df..aabdddb68 100644 70index 8ac69d1a0..efedf3842 100644
70--- a/src/core/execute.c 71--- a/src/core/execute.c
71+++ b/src/core/execute.c 72+++ b/src/core/execute.c
72@@ -3991,10 +3991,10 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) { 73@@ -3976,10 +3976,10 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) {
73 74
74 for (i = 0; i < RLIM_NLIMITS; i++) 75 for (i = 0; i < RLIM_NLIMITS; i++)
75 if (c->rlimit[i]) { 76 if (c->rlimit[i]) {
76- fprintf(f, "%s%s: " RLIM_FMT "\n", 77- fprintf(f, "Limit%s%s: " RLIM_FMT "\n",
77- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max); 78- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
78- fprintf(f, "%s%sSoft: " RLIM_FMT "\n", 79- fprintf(f, "Limit%s%sSoft: " RLIM_FMT "\n",
79- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur); 80- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur);
80+ fprintf(f, "%s%s: %ju\n", 81+ fprintf(f, "Limit%s%s: %ju\n",
81+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max); 82+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max);
82+ fprintf(f, "%s%sSoft: %ju\n", 83+ fprintf(f, "Limit%s%sSoft: %ju\n",
83+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur); 84+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur);
84 } 85 }
85 86
86 if (c->ioprio_set) { 87 if (c->ioprio_set) {
87-- 88--
882.13.0 892.11.0
89 90
diff --git a/meta/recipes-core/systemd/systemd/0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch b/meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
index 319c4b6..258a631 100644
--- a/meta/recipes-core/systemd/systemd/0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
+++ b/meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
@@ -1,9 +1,9 @@
1From adcd7e426fcd80e754274a730221d1a1f49dbc21 Mon Sep 17 00:00:00 2001 1From cb59b3af54fb3bbd4d8264fef919810af8d08d16 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 27 Feb 2018 14:01:30 +0800 3Date: Tue, 27 Feb 2018 14:01:30 +0800
4Subject: [PATCH 31/31] fix missing ULONG_LONG_MAX definition in case of musl 4Subject: [PATCH 14/19] fix missing ULONG_LONG_MAX definition in case of musl
5 5
6Upstream-Status: Pending 6Upstream-Status: Inappropriate [musl]
7 7
8Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 8Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9--- 9---
@@ -11,10 +11,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
11 1 file changed, 4 insertions(+) 11 1 file changed, 4 insertions(+)
12 12
13diff --git a/src/basic/missing.h b/src/basic/missing.h 13diff --git a/src/basic/missing.h b/src/basic/missing.h
14index 5b9fde692..a922f1346 100644 14index cd1cc109f..144058a1a 100644
15--- a/src/basic/missing.h 15--- a/src/basic/missing.h
16+++ b/src/basic/missing.h 16+++ b/src/basic/missing.h
17@@ -72,6 +72,10 @@ struct sockaddr_vm { 17@@ -54,6 +54,10 @@ struct sockaddr_vm {
18 }; 18 };
19 #endif /* !HAVE_LINUX_VM_SOCKETS_H */ 19 #endif /* !HAVE_LINUX_VM_SOCKETS_H */
20 20
@@ -26,5 +26,5 @@ index 5b9fde692..a922f1346 100644
26 #define RLIMIT_RTTIME 15 26 #define RLIMIT_RTTIME 15
27 #endif 27 #endif
28-- 28--
292.13.0 292.11.0
30 30
diff --git a/meta/recipes-core/systemd/systemd/0020-test-hexdecoct.c-Include-missing.h-for-strndupa.patch b/meta/recipes-core/systemd/systemd/0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch
index ad49cfe..c7ca9cd 100644
--- a/meta/recipes-core/systemd/systemd/0020-test-hexdecoct.c-Include-missing.h-for-strndupa.patch
+++ b/meta/recipes-core/systemd/systemd/0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch
@@ -1,9 +1,9 @@
1From d63d2fedcd80e58ee53655aeaf2836d4b0a14652 Mon Sep 17 00:00:00 2001 1From b11109ecc41110c518a98b6ac39611ff86477021 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 23 Oct 2017 12:33:22 -0700 3Date: Mon, 23 Oct 2017 12:33:22 -0700
4Subject: [PATCH 20/31] test-hexdecoct.c: Include missing.h for strndupa 4Subject: [PATCH 15/19] test-hexdecoct.c: Include missing.h for strndupa
5 5
6Upstream-Status: Pending 6Upstream-Status: Inappropriate [musl specific]
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 9Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
@@ -12,10 +12,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12 1 file changed, 1 insertion(+) 12 1 file changed, 1 insertion(+)
13 13
14diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c 14diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
15index 3e25a0bac..ab3e508f1 100644 15index da9f3008b..7ff2dfe0c 100644
16--- a/src/test/test-hexdecoct.c 16--- a/src/test/test-hexdecoct.c
17+++ b/src/test/test-hexdecoct.c 17+++ b/src/test/test-hexdecoct.c
18@@ -24,6 +24,7 @@ 18@@ -6,6 +6,7 @@
19 #include "hexdecoct.h" 19 #include "hexdecoct.h"
20 #include "macro.h" 20 #include "macro.h"
21 #include "string-util.h" 21 #include "string-util.h"
@@ -24,5 +24,5 @@ index 3e25a0bac..ab3e508f1 100644
24 static void test_hexchar(void) { 24 static void test_hexchar(void) {
25 assert_se(hexchar(0xa) == 'a'); 25 assert_se(hexchar(0xa) == 'a');
26-- 26--
272.13.0 272.11.0
28 28
diff --git a/meta/recipes-core/systemd/systemd/0021-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch b/meta/recipes-core/systemd/systemd/0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
index 9c8aeca..c06a370 100644
--- a/meta/recipes-core/systemd/systemd/0021-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
+++ b/meta/recipes-core/systemd/systemd/0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
@@ -1,10 +1,10 @@
1From dfea4b98844795a0cd14fdaf40c67df389dbd27e Mon Sep 17 00:00:00 2001 1From c4bbf3efefffe0a4efadbf4e3f0adb54d76fe0e7 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 28 Feb 2018 21:25:22 -0800 3Date: Wed, 28 Feb 2018 21:25:22 -0800
4Subject: [PATCH 21/31] test-sizeof.c: Disable tests for missing typedefs in 4Subject: [PATCH 16/19] test-sizeof.c: Disable tests for missing typedefs in
5 musl 5 musl
6 6
7Upstream-Status: Pending 7Upstream-Status: Inappropriate [musl specific]
8 8
9Signed-off-by: Khem Raj <raj.khem@gmail.com> 9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 10Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
@@ -13,10 +13,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13 1 file changed, 4 insertions(+) 13 1 file changed, 4 insertions(+)
14 14
15diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c 15diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
16index aed6db842..0de6fa63c 100644 16index 7a1e496ed..386b314d5 100644
17--- a/src/test/test-sizeof.c 17--- a/src/test/test-sizeof.c
18+++ b/src/test/test-sizeof.c 18+++ b/src/test/test-sizeof.c
19@@ -50,8 +50,10 @@ int main(void) { 19@@ -40,8 +40,10 @@ int main(void) {
20 info(unsigned); 20 info(unsigned);
21 info(long unsigned); 21 info(long unsigned);
22 info(long long unsigned); 22 info(long long unsigned);
@@ -27,7 +27,7 @@ index aed6db842..0de6fa63c 100644
27 27
28 info(float); 28 info(float);
29 info(double); 29 info(double);
30@@ -61,7 +63,9 @@ int main(void) { 30@@ -59,7 +61,9 @@ int main(void) {
31 info(ssize_t); 31 info(ssize_t);
32 info(time_t); 32 info(time_t);
33 info(usec_t); 33 info(usec_t);
@@ -38,5 +38,5 @@ index aed6db842..0de6fa63c 100644
38 info(uid_t); 38 info(uid_t);
39 info(gid_t); 39 info(gid_t);
40-- 40--
412.13.0 412.11.0
42 42
diff --git a/meta/recipes-core/systemd/systemd/0023-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch b/meta/recipes-core/systemd/systemd/0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
index 09c2b5c..8e47c6f5 100644
--- a/meta/recipes-core/systemd/systemd/0023-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
+++ b/meta/recipes-core/systemd/systemd/0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
@@ -1,7 +1,7 @@
1From 7b802ada1207ed00ed3867b9804dd0f316641b9b Mon Sep 17 00:00:00 2001 1From 91bb4f5c9c11464468e8d3fa4746d98d59997264 Mon Sep 17 00:00:00 2001
2From: Andre McCurdy <armccurdy@gmail.com> 2From: Andre McCurdy <armccurdy@gmail.com>
3Date: Tue, 10 Oct 2017 14:33:30 -0700 3Date: Tue, 10 Oct 2017 14:33:30 -0700
4Subject: [PATCH 23/31] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat() 4Subject: [PATCH 17/19] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat()
5 5
6Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right 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: 7thing to do and it's not portable (not supported by musl). See:
@@ -22,7 +22,7 @@ The 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 22clear if or why it needs to return success for broken symlinks. Maybe
23just historical and not actually necessary or desired behaviour? 23just historical and not actually necessary or desired behaviour?
24 24
25Upstream-Status: Pending 25Upstream-Status: Inappropriate [musl specific]
26 26
27Signed-off-by: Andre McCurdy <armccurdy@gmail.com> 27Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
28--- 28---
@@ -31,10 +31,10 @@ Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
31 2 files changed, 24 insertions(+), 4 deletions(-) 31 2 files changed, 24 insertions(+), 4 deletions(-)
32 32
33diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h 33diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
34index 4dba1ea56..9c4b02ecc 100644 34index 28566773c..14b864cc5 100644
35--- a/src/basic/fs-util.h 35--- a/src/basic/fs-util.h
36+++ b/src/basic/fs-util.h 36+++ b/src/basic/fs-util.h
37@@ -50,7 +50,27 @@ int fchmod_umask(int fd, mode_t mode); 37@@ -32,7 +32,27 @@ int fchmod_opath(int fd, mode_t m);
38 38
39 int fd_warn_permissions(const char *path, int fd); 39 int fd_warn_permissions(const char *path, int fd);
40 40
@@ -64,10 +64,10 @@ index 4dba1ea56..9c4b02ecc 100644
64 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode); 64 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
65 int touch(const char *path); 65 int touch(const char *path);
66diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c 66diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
67index 3c25aa534..574ca71c7 100644 67index 89d7a7d59..34b4ad53a 100644
68--- a/src/shared/base-filesystem.c 68--- a/src/shared/base-filesystem.c
69+++ b/src/shared/base-filesystem.c 69+++ b/src/shared/base-filesystem.c
70@@ -71,7 +71,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { 70@@ -53,7 +53,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
71 return log_error_errno(errno, "Failed to open root file system: %m"); 71 return log_error_errno(errno, "Failed to open root file system: %m");
72 72
73 for (i = 0; i < ELEMENTSOF(table); i ++) { 73 for (i = 0; i < ELEMENTSOF(table); i ++) {
@@ -76,7 +76,7 @@ index 3c25aa534..574ca71c7 100644
76 continue; 76 continue;
77 77
78 if (table[i].target) { 78 if (table[i].target) {
79@@ -79,7 +79,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { 79@@ -61,7 +61,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
80 80
81 /* check if one of the targets exists */ 81 /* check if one of the targets exists */
82 NULSTR_FOREACH(s, table[i].target) { 82 NULSTR_FOREACH(s, table[i].target) {
@@ -85,7 +85,7 @@ index 3c25aa534..574ca71c7 100644
85 continue; 85 continue;
86 86
87 /* check if a specific file exists at the target path */ 87 /* check if a specific file exists at the target path */
88@@ -90,7 +90,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { 88@@ -72,7 +72,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
89 if (!p) 89 if (!p)
90 return log_oom(); 90 return log_oom();
91 91
@@ -95,5 +95,5 @@ index 3c25aa534..574ca71c7 100644
95 } 95 }
96 96
97-- 97--
982.13.0 982.11.0
99 99
diff --git a/meta/recipes-core/systemd/systemd/0035-Define-glibc-compatible-basename-for-non-glibc-syste.patch b/meta/recipes-core/systemd/systemd/0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch
index 736d525..1bd0d60 100644
--- a/meta/recipes-core/systemd/systemd/0035-Define-glibc-compatible-basename-for-non-glibc-syste.patch
+++ b/meta/recipes-core/systemd/systemd/0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch
@@ -1,7 +1,8 @@
1From 5f1f064c81ea30acf93cfa0fb466b38f094f488c Mon Sep 17 00:00:00 2001 1From 97fed07132533a1b2bce9c60e305a5d09aee2e9b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 27 May 2018 08:36:44 -0700 3Date: Sun, 27 May 2018 08:36:44 -0700
4Subject: [PATCH] Define glibc compatible basename() for non-glibc systems 4Subject: [PATCH 18/19] Define glibc compatible basename() for non-glibc
5 systems
5 6
6Fixes builds with musl, even though systemd is adamant about 7Fixes builds with musl, even though systemd is adamant about
7using non-posix basename implementation, we have a way out 8using non-posix basename implementation, we have a way out
@@ -14,10 +15,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 4 insertions(+) 15 1 file changed, 4 insertions(+)
15 16
16diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c 17diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
17index 2d7806491b..9a3bdb1d76 100644 18index 7f41465cc..cee8a5d43 100644
18--- a/src/machine/machine-dbus.c 19--- a/src/machine/machine-dbus.c
19+++ b/src/machine/machine-dbus.c 20+++ b/src/machine/machine-dbus.c
20@@ -29,6 +29,10 @@ 21@@ -11,6 +11,10 @@
21 #include <libgen.h> 22 #include <libgen.h>
22 #undef basename 23 #undef basename
23 24
@@ -29,5 +30,5 @@ index 2d7806491b..9a3bdb1d76 100644
29 #include "bus-common-errors.h" 30 #include "bus-common-errors.h"
30 #include "bus-internal.h" 31 #include "bus-internal.h"
31-- 32--
322.17.0 332.11.0
33 34
diff --git a/meta/recipes-core/systemd/systemd/0018-check-for-missing-canonicalize_file_name.patch b/meta/recipes-core/systemd/systemd/0018-check-for-missing-canonicalize_file_name.patch
deleted file mode 100644
index ab7edf5..0000000
--- a/meta/recipes-core/systemd/systemd/0018-check-for-missing-canonicalize_file_name.patch
+++ /dev/null
@@ -1,47 +0,0 @@
1From 690eeef9590c7ef1d9d2c31d8c1d5d8071da8c4c Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 26 Feb 2018 17:21:11 +0800
4Subject: [PATCH 18/31] check for missing canonicalize_file_name
5
6Upstream-Status: Pending
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
10---
11 meson.build | 2 ++
12 src/basic/missing_syscall.h | 6 ++++++
13 2 files changed, 8 insertions(+)
14
15diff --git a/meson.build b/meson.build
16index 12811b3f3..f6515e97c 100644
17--- a/meson.build
18+++ b/meson.build
19@@ -520,6 +520,8 @@ foreach ident : [
20 ['kcmp', '''#include <linux/kcmp.h>'''],
21 ['keyctl', '''#include <sys/types.h>
22 #include <keyutils.h>'''],
23+ ['canonicalize_file_name', '''#define _GNU_SOURCE
24+ #include <stdlib.h>'''],
25 ['copy_file_range', '''#include <sys/syscall.h>
26 #include <unistd.h>'''],
27 ['bpf', '''#include <sys/syscall.h>
28diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
29index c938d0d97..308b9472b 100644
30--- a/src/basic/missing_syscall.h
31+++ b/src/basic/missing_syscall.h
32@@ -31,6 +31,12 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
33 }
34 #endif
35
36+#if !HAVE_CANONICALIZE_FILE_NAME
37+static inline char *canonicalize_file_name(const char *path) {
38+ return realpath(path, NULL);
39+}
40+#endif
41+
42 /* ======================================================================= */
43
44 #if !HAVE_MEMFD_CREATE
45--
462.13.0
47
diff --git a/meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch b/meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
new file mode 100644
index 0000000..942f4c0
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
@@ -0,0 +1,39 @@
1From 8440348bcac34249cdf6ac2dcae9ac66d3c727db 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 19/19] 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---
21 src/basic/process-util.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24diff --git a/src/basic/process-util.c b/src/basic/process-util.c
25index 3543bc045..d0572e034 100644
26--- a/src/basic/process-util.c
27+++ b/src/basic/process-util.c
28@@ -1473,7 +1473,7 @@ int set_oom_score_adjust(int value) {
29 sprintf(t, "%i", value);
30
31 return write_string_file("/proc/self/oom_score_adj", t,
32- WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER);
33+ WRITE_STRING_FILE_VERIFY_ON_FAILURE);
34 }
35
36 static const char *const ioprio_class_table[] = {
37--