summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-07-17 10:05:11 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-18 10:18:42 +0100
commitada8a5d9175b141b4fe532f542f5c1f7ffa26d88 (patch)
tree64af2142c781c13ee7669004b615d41cfb787f92
parent219eed186d32b01a7132233c5110c08055ed6e27 (diff)
downloadpoky-ada8a5d9175b141b4fe532f542f5c1f7ffa26d88.tar.gz
systemd: upgrade to 239
Upgrade systemd to 239. 1. Patch Changes * Rebased Patches 0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch 0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch 0006-Make-root-s-home-directory-configurable.patch 0027-remove-nobody-user-group-checking.patch 0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch 0013-add-fallback-parse_printf_format-implementation.patch 0014-src-basic-missing.h-check-for-missing-strndupa.patch 0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch 0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch 0017-Include-netinet-if_ether.h.patch 0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch 0022-don-t-use-glibc-specific-qsort_r.patch 0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch 0026-Use-uintmax_t-for-handling-rlim_t.patch 0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch 0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch 0001-core-device.c-Change-the-default-device-timeout-to-2.patch 0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch * Dropped Patches and Reasons 0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch This patch is dropped because the problem has been fixed by binutils upstream. And this workaround could be dropped. https://sourceware.org/bugzilla/show_bug.cgi?id=18548 0007-Revert-rules-remove-firmware-loading-rules.patch 0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch These two patches are dropped because they are for kernel < 3.7. But the current minimal requirement of kernel to build systemd is as below. REQUIREMENTS: Linux kernel >= 3.13 Linux kernel >= 4.2 for unified cgroup hierarchy support So these two patches no long make any sense. Also remove non-exist firmware-path option 0009-remove-duplicate-include-uchar.h.patch 0010-check-for-uchar.h-in-meson.build.patch These two patches are dropped because musl has implemented uchar.h. See commit below from musl repo. """ ab9672ae73248f51e30f4553c4b8878525e46383 implement uchar.h (C11 UTF-16/32 conversion) interfaces """ 0018-check-for-missing-canonicalize_file_name.patch The above patch is dropped because current systemd does not need canonicalize_file_name. 0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch The above patch is dropped because utmp makes no sense in musl. Check code below from musl. include/utmp.h:#define _PATH_UTMP "/dev/null/utmp" And utmp PACKAGECONFIG has been explicitly disabled for musl. So we don't need this patch. 0032-memfd.patch 0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch libmount.patch 0034-Fix-format-truncation-compile-failure-by-typecasting.patch The above patches are dropped because they are backported patches. And current systemd has contained these patches. 0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch The above patch is dropped because it has been merged and is now in new version. * Newly Added Patch 0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch This patch is added to fix build for musl. 0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch This patch is added to fix the following error which caused system unable to boot up. systemd-udevd.service: Failed to adjust OOM setting: Invalid argument dbus.service: Failed to adjust OOM setting: Invalid argument 0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch This patch is added to fix segment fault error on musl systems. 0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch This patch is backported to solve a race condition between user-runtime-dir@xxx.service stop and user deletion. 2. PACKAGECONFIG and Dependency Changes * Add a new PACKAGECONFIG item 'gshadow'. Enable it by default for glibc but disable it by default for musl. This is because musl does not provide gshadow.h. * Add a new PACKAGECONFIG item 'portabled'. Default to disable it because it's still experimental, according to the announcement letter. """ Currently, the support is still experimental, but this is expected to change soon. Reflecting this experimental state, the "portablectl" binary is not installed into /usr/bin yet. """ * Change 'kmod' from a hard dependency to a PACKAGECONFIG item. Default to enable it. * Change 'acl' from a hard dependency to a PACKAGECONFIG item. Default to enable it. * Remove 'readline' from DEPENDS. systemd does not need it. * Remove 'libcgroup' from DEPENDS. The dependency on libcgroup has been removed from systemd a long time ago. We now remove this unnecessary dependency from DEPENDS. 3. update-alternatives changes The utilities like shutdown, poweroff, etc. are now created as symlinks at do_install. So there's no need to use update-alternatives mechanism anymore to create the symlinks now. In addtion, I don't think we now support multiple init systems at one running system, so there's really no need to use update-alternatives mechanism here. Also update the FILES_${PN} to include these files to avoid QA issue. (From OE-Core rev: 597f4645faf61486eb1d2ab73f3d974460ab9466) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/systemd/systemd.inc2
-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
-rw-r--r--meta/recipes-core/systemd/systemd_239.bb (renamed from meta/recipes-core/systemd/systemd_237.bb)126
48 files changed, 799 insertions, 1868 deletions
diff --git a/meta/recipes-core/systemd/systemd.inc b/meta/recipes-core/systemd/systemd.inc
index 5fa48e7ab1..736e0a0ea0 100644
--- a/meta/recipes-core/systemd/systemd.inc
+++ b/meta/recipes-core/systemd/systemd.inc
@@ -14,7 +14,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
14LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ 14LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
15 file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c" 15 file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
16 16
17SRCREV = "46659f7deb962f55c728e70597e37c2a3ab6326d" 17SRCREV = "de7436b02badc82200dc127ff190b8155769b8e7"
18 18
19SRC_URI = "git://github.com/systemd/systemd.git;protocol=git" 19SRC_URI = "git://github.com/systemd/systemd.git;protocol=git"
20 20
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 2cffc426ed..0000000000
--- 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 e913e3f7b5..d745800ced 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 f4c15e1c46..03f6ead131 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 c3f4b39345..e24e7f83fc 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 98c83620ff..fd7bf3fcf6 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 0000000000..ba08e34558
--- /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 a5f74421ac..f07211bd8a 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 28f1b217e0..1d7f5230a9 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 0000000000..115fb33c30
--- /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 83fdb530bf..6c595ae733 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 9c9278d3f3..7652a2d8cc 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 e4421c826f..7e37cbc2c1 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 5ba966168a..c13708728e 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 0000000000..6d5faf5fed
--- /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 0000000000..eb6eb8bfeb
--- /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 9f62cbbe69..107a794398 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 a09cfddaa8..2df8cf95fd 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 bb12d30a41..0000000000
--- 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 720786371c..a5f65e66bd 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 16b21a0683..abecdc764b 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 15d7e0290a..0000000000
--- 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 450947667b..bee5fb6511 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 9ec3137b09..95287cce10 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 517249f434..a635fa91d8 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 1b14369ce2..0000000000
--- 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 9a44b5484b..0000000000
--- 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 b0923d15f8..16547981d2 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 53037ea6d7..1a22ffd9e9 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 7f0b4bf818..d41bc4a0da 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 46d75ada75..69b3c15121 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 319c4b65fc..258a631cad 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 ad49cfe8f7..c7ca9cd4bd 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 9c8aeca9a5..c06a3706e9 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 09c2b5c109..8e47c6f50a 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 736d525ad3..1bd0d602a5 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 ab7edf5ca4..0000000000
--- 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 0000000000..942f4c0918
--- /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--
382.11.0
39
diff --git a/meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch b/meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
new file mode 100644
index 0000000000..5c78cabbaf
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
@@ -0,0 +1,62 @@
1From dd53dc9b9542cbd2c39a39096941dfed70d06506 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 10 Jul 2018 15:40:17 +0800
4Subject: [PATCH 20/20] distinguish XSI-compliant strerror_r from GNU-specifi
5 strerror_r
6
7XSI-compliant strerror_r and GNU-specifi strerror_r are different.
8
9 int strerror_r(int errnum, char *buf, size_t buflen);
10 /* XSI-compliant */
11
12 char *strerror_r(int errnum, char *buf, size_t buflen);
13 /* GNU-specific */
14
15We need to distinguish between them. Otherwise, we'll get an int value
16assigned to (char *) variable, resulting in segment fault.
17
18Upstream-Status: Inappropriate [musl specific]
19
20Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
21---
22 src/journal/journal-send.c | 5 +++++
23 src/libsystemd/sd-bus/bus-error.c | 5 +++++
24 2 files changed, 10 insertions(+)
25
26diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
27index 65bcbcd2e..aef80dd8f 100644
28--- a/src/journal/journal-send.c
29+++ b/src/journal/journal-send.c
30@@ -337,7 +337,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
31 char* j;
32
33 errno = 0;
34+#ifndef __GLIBC__
35+ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
36+ j = buffer + 8 + k;
37+#else
38 j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
39+#endif
40 if (errno == 0) {
41 char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
42
43diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
44index ec359ac13..d2aa86cea 100644
45--- a/src/libsystemd/sd-bus/bus-error.c
46+++ b/src/libsystemd/sd-bus/bus-error.c
47@@ -362,7 +362,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
48 return;
49
50 errno = 0;
51+#ifndef __GLIBC__
52+ strerror_r(error, m, k);
53+ x = m;
54+#else
55 x = strerror_r(error, m, k);
56+#endif
57 if (errno == ERANGE || strlen(x) >= k - 1) {
58 free(m);
59 k *= 2;
60--
612.11.0
62
diff --git a/meta/recipes-core/systemd/systemd/0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch b/meta/recipes-core/systemd/systemd/0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
deleted file mode 100644
index fe7e623ff1..0000000000
--- a/meta/recipes-core/systemd/systemd/0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 76c71aa889155f29be1d5d2b74a2c4faa5909c8c 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 24/31] 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: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 src/basic/util.h | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/src/basic/util.h b/src/basic/util.h
17index 9d1b10756..12db53a93 100644
18--- a/src/basic/util.h
19+++ b/src/basic/util.h
20@@ -95,7 +95,7 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
21 * Normal qsort requires base to be nonnull. Here were require
22 * that only if nmemb > 0.
23 */
24-static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
25+static inline void qsort_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
26 if (nmemb <= 1)
27 return;
28
29--
302.13.0
31
diff --git a/meta/recipes-core/systemd/systemd/0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch b/meta/recipes-core/systemd/systemd/0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch
deleted file mode 100644
index 9376a8f750..0000000000
--- a/meta/recipes-core/systemd/systemd/0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From a0b1496322f4d7ce83f4fbfd2a90b91d0721f643 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 24 Oct 2017 23:08:24 -0700
4Subject: [PATCH 25/31] Define _PATH_WTMPX and _PATH_UTMPX if not defined
5
6Musl needs these defines
7
8Upstream-Status: Pending
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/shared/utmp-wtmp.c | 8 ++++++++
13 1 file changed, 8 insertions(+)
14
15diff --git a/src/shared/utmp-wtmp.c b/src/shared/utmp-wtmp.c
16index cab1cd6a2..f5eedac18 100644
17--- a/src/shared/utmp-wtmp.c
18+++ b/src/shared/utmp-wtmp.c
19@@ -28,6 +28,7 @@
20 #include <sys/time.h>
21 #include <sys/utsname.h>
22 #include <unistd.h>
23+#include <utmp.h>
24 #include <utmpx.h>
25
26 #include "alloc-util.h"
27@@ -42,6 +43,13 @@
28 #include "util.h"
29 #include "utmp-wtmp.h"
30
31+#if defined _PATH_UTMP && !defined _PATH_UTMPX
32+# define _PATH_UTMPX _PATH_UTMP
33+#endif
34+#if defined _PATH_WTMP && !defined _PATH_WTMPX
35+# define _PATH_WTMPX _PATH_WTMP
36+#endif
37+
38 int utmp_get_runlevel(int *runlevel, int *previous) {
39 struct utmpx *found, lookup = { .ut_type = RUN_LVL };
40 int r;
41--
422.13.0
43
diff --git a/meta/recipes-core/systemd/systemd/0027-remove-nobody-user-group-checking.patch b/meta/recipes-core/systemd/systemd/0027-remove-nobody-user-group-checking.patch
deleted file mode 100644
index 42f59b0829..0000000000
--- a/meta/recipes-core/systemd/systemd/0027-remove-nobody-user-group-checking.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1From 5354eb767d1eba2ec41eb273f6b657f4a630ca8a Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 9 Jan 2018 14:45:46 +0800
4Subject: [PATCH 27/31] 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 f6515e97c..1b947adac 100644
15--- a/meson.build
16+++ b/meson.build
17@@ -700,43 +700,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- message('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- message('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- message('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- message('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 message('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.13.0
63
diff --git a/meta/recipes-core/systemd/systemd/0032-memfd.patch b/meta/recipes-core/systemd/systemd/0032-memfd.patch
deleted file mode 100644
index f7cfd60a3f..0000000000
--- a/meta/recipes-core/systemd/systemd/0032-memfd.patch
+++ /dev/null
@@ -1,272 +0,0 @@
1missing_syscall: when adding syscall replacements, use different names (
2
3#8229)
4
5In meson.build we check that functions are available using:
6 meson.get_compiler('c').has_function('foo')
7which checks the following:
8- if __stub_foo or __stub___foo are defined, return false
9- if foo is declared (a pointer to the function can be taken), return true
10- otherwise check for __builtin_memfd_create
11
12_stub is documented by glibc as
13 It defines a symbol '__stub_FUNCTION' for each function
14 in the C library which is a stub, meaning it will fail
15 every time called, usually setting errno to ENOSYS.
16
17So if __stub is defined, we know we don't want to use the glibc version, but
18this doesn't tell us if the name itself is defined or not. If it _is_ defined,
19and we define our replacement as an inline static function, we get an error:
20
21In file included from ../src/basic/missing.h:1358:0,
22 from ../src/basic/util.h:47,
23 from ../src/basic/calendarspec.h:29,
24 from ../src/basic/calendarspec.c:34:
25../src/basic/missing_syscall.h:65:19: error: static declaration of 'memfd_create' follows non-static declaration
26 static inline int memfd_create(const char *name, unsigned int flags) {
27 ^~~~~~~~~~~~
28.../usr/include/bits/mman-shared.h:46:5: note: previous declaration of 'memfd_create' was here
29 int memfd_create (const char *__name, unsigned int __flags) __THROW;
30 ^~~~~~~~~~~~
31
32To avoid this problem, call our inline functions different than glibc,
33and use a #define to map the official name to our replacement.
34
35Fixes #8099.
36
37v2:
38- use "missing_" as the prefix instead of "_"
39
40v3:
41- rebase and update for statx()
42
43 Unfortunately "statx" is also present in "struct statx", so the define
44 causes issues. Work around this by using a typedef.
45
46I checked that systemd compiles with current glibc
47(glibc-devel-2.26-24.fc27.x86_64) if HAVE_MEMFD_CREATE, HAVE_GETTID,
48HAVE_PIVOT_ROOT, HAVE_SETNS, HAVE_RENAMEAT2, HAVE_KCMP, HAVE_KEYCTL,
49HAVE_COPY_FILE_RANGE, HAVE_BPF, HAVE_STATX are forced to 0.
50
51Setting HAVE_NAME_TO_HANDLE_AT to 0 causes an issue, but it's not because of
52the define, but because of struct file_handle.
53
54
55backport https://github.com/systemd/systemd/commit/5187dd2c403caf92d09f3491e41f1ceb3f10491f
56
57Signed-off-by: Khem Raj <raj.khem@gmail.com>
58Upstream-Status: Backport [https://github.com/systemd/systemd/issues/8099]
59Index: git/src/basic/missing_syscall.h
60===================================================================
61--- git.orig/src/basic/missing_syscall.h
62+++ git/src/basic/missing_syscall.h
63@@ -26,9 +26,11 @@
64 #include <sys/types.h>
65
66 #if !HAVE_PIVOT_ROOT
67-static inline int pivot_root(const char *new_root, const char *put_old) {
68+static inline int missing_pivot_root(const char *new_root, const char *put_old) {
69 return syscall(SYS_pivot_root, new_root, put_old);
70 }
71+
72+# define pivot_root missing_pivot_root
73 #endif
74
75 #if !HAVE_CANONICALIZE_FILE_NAME
76@@ -68,7 +70,7 @@ static inline char *canonicalize_file_na
77 # endif
78 # endif
79
80-static inline int memfd_create(const char *name, unsigned int flags) {
81+static inline int missing_memfd_create(const char *name, unsigned int flags) {
82 # ifdef __NR_memfd_create
83 return syscall(__NR_memfd_create, name, flags);
84 # else
85@@ -76,6 +78,8 @@ static inline int memfd_create(const cha
86 return -1;
87 # endif
88 }
89+
90+# define memfd_create missing_memfd_create
91 #endif
92
93 /* ======================================================================= */
94@@ -115,7 +119,7 @@ static inline int memfd_create(const cha
95 # endif
96 # endif
97
98-static inline int getrandom(void *buffer, size_t count, unsigned flags) {
99+static inline int missing_getrandom(void *buffer, size_t count, unsigned flags) {
100 # ifdef __NR_getrandom
101 return syscall(__NR_getrandom, buffer, count, flags);
102 # else
103@@ -123,14 +127,18 @@ static inline int getrandom(void *buffer
104 return -1;
105 # endif
106 }
107+
108+# define getrandom missing_getrandom
109 #endif
110
111 /* ======================================================================= */
112
113 #if !HAVE_GETTID
114-static inline pid_t gettid(void) {
115+static inline pid_t missing_gettid(void) {
116 return (pid_t) syscall(SYS_gettid);
117 }
118+
119+# define gettid missing_gettid
120 #endif
121
122 /* ======================================================================= */
123@@ -158,7 +166,7 @@ struct file_handle {
124 unsigned char f_handle[0];
125 };
126
127-static inline int name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {
128+static inline int missing_name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {
129 # ifdef __NR_name_to_handle_at
130 return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
131 # else
132@@ -166,6 +174,8 @@ static inline int name_to_handle_at(int
133 return -1;
134 # endif
135 }
136+
137+# define name_to_handle_at missing_name_to_handle_at
138 #endif
139
140 /* ======================================================================= */
141@@ -183,7 +193,7 @@ static inline int name_to_handle_at(int
142 # endif
143 # endif
144
145-static inline int setns(int fd, int nstype) {
146+static inline int missing_setns(int fd, int nstype) {
147 # ifdef __NR_setns
148 return syscall(__NR_setns, fd, nstype);
149 # else
150@@ -191,6 +201,8 @@ static inline int setns(int fd, int nsty
151 return -1;
152 # endif
153 }
154+
155+# define setns missing_setns
156 #endif
157
158 /* ======================================================================= */
159@@ -236,7 +248,7 @@ static inline pid_t raw_getpid(void) {
160 # endif
161 # endif
162
163-static inline int renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
164+static inline int missing_renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
165 # ifdef __NR_renameat2
166 return syscall(__NR_renameat2, oldfd, oldname, newfd, newname, flags);
167 # else
168@@ -244,12 +256,14 @@ static inline int renameat2(int oldfd, c
169 return -1;
170 # endif
171 }
172+
173+# define renameat2 missing_renameat2
174 #endif
175
176 /* ======================================================================= */
177
178 #if !HAVE_KCMP
179-static inline int kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
180+static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
181 # ifdef __NR_kcmp
182 return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2);
183 # else
184@@ -257,36 +271,44 @@ static inline int kcmp(pid_t pid1, pid_t
185 return -1;
186 # endif
187 }
188+
189+# define kcmp missing_kcmp
190 #endif
191
192 /* ======================================================================= */
193
194 #if !HAVE_KEYCTL
195-static inline long keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4,unsigned long arg5) {
196+static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4,unsigned long arg5) {
197 # ifdef __NR_keyctl
198 return syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5);
199 # else
200 errno = ENOSYS;
201 return -1;
202 # endif
203+
204+# define keyctl missing_keyctl
205 }
206
207-static inline key_serial_t add_key(const char *type, const char *description, const void *payload, size_t plen, key_serial_t ringid) {
208+static inline key_serial_t missing_add_key(const char *type, const char *description, const void *payload, size_t plen, key_serial_t ringid) {
209 # ifdef __NR_add_key
210 return syscall(__NR_add_key, type, description, payload, plen, ringid);
211 # else
212 errno = ENOSYS;
213 return -1;
214 # endif
215+
216+# define add_key missing_add_key
217 }
218
219-static inline key_serial_t request_key(const char *type, const char *description, const char * callout_info, key_serial_t destringid) {
220+static inline key_serial_t missing_request_key(const char *type, const char *description, const char * callout_info, key_serial_t destringid) {
221 # ifdef __NR_request_key
222 return syscall(__NR_request_key, type, description, callout_info, destringid);
223 # else
224 errno = ENOSYS;
225 return -1;
226 # endif
227+
228+# define request_key missing_request_key
229 }
230 #endif
231
232@@ -313,10 +335,10 @@ static inline key_serial_t request_key(c
233 # endif
234 # endif
235
236-static inline ssize_t copy_file_range(int fd_in, loff_t *off_in,
237- int fd_out, loff_t *off_out,
238- size_t len,
239- unsigned int flags) {
240+static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in,
241+ int fd_out, loff_t *off_out,
242+ size_t len,
243+ unsigned int flags) {
244 # ifdef __NR_copy_file_range
245 return syscall(__NR_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags);
246 # else
247@@ -324,6 +346,8 @@ static inline ssize_t copy_file_range(in
248 return -1;
249 # endif
250 }
251+
252+# define copy_file_range missing_copy_file_range
253 #endif
254
255 /* ======================================================================= */
256@@ -351,7 +375,7 @@ static inline ssize_t copy_file_range(in
257
258 union bpf_attr;
259
260-static inline int bpf(int cmd, union bpf_attr *attr, size_t size) {
261+static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) {
262 #ifdef __NR_bpf
263 return (int) syscall(__NR_bpf, cmd, attr, size);
264 #else
265@@ -360,6 +384,7 @@ static inline int bpf(int cmd, union bpf
266 #endif
267 }
268
269+# define bpf missing_bpf
270 #endif
271
272 /* ======================================================================= */
diff --git a/meta/recipes-core/systemd/systemd/0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch b/meta/recipes-core/systemd/systemd/0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch
deleted file mode 100644
index 59647b22f8..0000000000
--- a/meta/recipes-core/systemd/systemd/0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch
+++ /dev/null
@@ -1,203 +0,0 @@
1From 848e863acc51ecfb0f3955c498874588201d9130 Mon Sep 17 00:00:00 2001
2From: Franck Bui <fbui@suse.com>
3Date: Thu, 15 Mar 2018 06:23:46 +0100
4Subject: [PATCH] basic/macros: rename noreturn into _noreturn_ (#8456)
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9"noreturn" is reserved and can be used in other header files we include:
10
11 [ 16s] In file included from /usr/include/gcrypt.h:30:0,
12 [ 16s] from ../src/journal/journal-file.h:26,
13 [ 16s] from ../src/journal/journal-vacuum.c:31:
14 [ 16s] /usr/include/gpg-error.h:1544:46: error: expected ‘,’ or ‘;’ before ‘)’ token
15 [ 16s] void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2);
16
17Here we include grcrypt.h (which in turns include gpg-error.h) *after* we
18"noreturn" was defined in macro.h.
19---
20 src/basic/log.c | 4 ++--
21 src/basic/log.h | 4 ++--
22 src/basic/macro.h | 19 +++++++++----------
23 src/basic/process-util.c | 2 +-
24 src/basic/process-util.h | 2 +-
25 src/core/main.c | 4 ++--
26 src/journal/test-journal-interleaving.c | 2 +-
27 src/shared/pager.c | 2 +-
28 src/udev/collect/collect.c | 2 +-
29 9 files changed, 20 insertions(+), 21 deletions(-)
30
31Upstream-Status: Backport [https://github.com/systemd/systemd/pull/8456]
32
33diff --git a/src/basic/log.c b/src/basic/log.c
34index 7a7f2cbec..16a2431c5 100644
35--- a/src/basic/log.c
36+++ b/src/basic/log.c
37@@ -814,7 +814,7 @@ static void log_assert(
38 log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
39 }
40
41-noreturn void log_assert_failed_realm(
42+_noreturn_ void log_assert_failed_realm(
43 LogRealm realm,
44 const char *text,
45 const char *file,
46@@ -826,7 +826,7 @@ noreturn void log_assert_failed_realm(
47 abort();
48 }
49
50-noreturn void log_assert_failed_unreachable_realm(
51+_noreturn_ void log_assert_failed_unreachable_realm(
52 LogRealm realm,
53 const char *text,
54 const char *file,
55diff --git a/src/basic/log.h b/src/basic/log.h
56index efcf0f1bf..314be128a 100644
57--- a/src/basic/log.h
58+++ b/src/basic/log.h
59@@ -186,7 +186,7 @@ int log_dump_internal(
60 char *buffer);
61
62 /* Logging for various assertions */
63-noreturn void log_assert_failed_realm(
64+_noreturn_ void log_assert_failed_realm(
65 LogRealm realm,
66 const char *text,
67 const char *file,
68@@ -195,7 +195,7 @@ noreturn void log_assert_failed_realm(
69 #define log_assert_failed(text, ...) \
70 log_assert_failed_realm(LOG_REALM, (text), __VA_ARGS__)
71
72-noreturn void log_assert_failed_unreachable_realm(
73+_noreturn_ void log_assert_failed_unreachable_realm(
74 LogRealm realm,
75 const char *text,
76 const char *file,
77diff --git a/src/basic/macro.h b/src/basic/macro.h
78index 95be63a20..8911edfc4 100644
79--- a/src/basic/macro.h
80+++ b/src/basic/macro.h
81@@ -53,6 +53,15 @@
82 #else
83 #define _fallthrough_
84 #endif
85+/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
86+ * compiler versions */
87+#ifndef _noreturn_
88+#if __STDC_VERSION__ >= 201112L
89+#define _noreturn_ _Noreturn
90+#else
91+#define _noreturn_ __attribute__((noreturn))
92+#endif
93+#endif
94
95 /* Temporarily disable some warnings */
96 #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
97@@ -414,16 +423,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
98 #endif
99 #endif
100
101-/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
102- * compiler versions */
103-#ifndef noreturn
104-#if __STDC_VERSION__ >= 201112L
105-#define noreturn _Noreturn
106-#else
107-#define noreturn __attribute__((noreturn))
108-#endif
109-#endif
110-
111 #define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
112 static inline void func##p(type *p) { \
113 if (*p) \
114diff --git a/src/basic/process-util.c b/src/basic/process-util.c
115index aa9846db5..e6120af5b 100644
116--- a/src/basic/process-util.c
117+++ b/src/basic/process-util.c
118@@ -987,7 +987,7 @@ bool is_main_thread(void) {
119 return cached > 0;
120 }
121
122-noreturn void freeze(void) {
123+_noreturn_ void freeze(void) {
124
125 log_close();
126
127diff --git a/src/basic/process-util.h b/src/basic/process-util.h
128index 93029e36e..5170adec7 100644
129--- a/src/basic/process-util.h
130+++ b/src/basic/process-util.h
131@@ -91,7 +91,7 @@ int pid_from_same_root_fs(pid_t pid);
132
133 bool is_main_thread(void);
134
135-noreturn void freeze(void);
136+_noreturn_ void freeze(void);
137
138 bool oom_score_adjust_is_valid(int oa);
139
140diff --git a/src/core/main.c b/src/core/main.c
141index 076846a41..4b2d14923 100644
142--- a/src/core/main.c
143+++ b/src/core/main.c
144@@ -141,7 +141,7 @@ static uint64_t arg_default_tasks_max = UINT64_MAX;
145 static sd_id128_t arg_machine_id = {};
146 static EmergencyAction arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE;
147
148-noreturn static void freeze_or_reboot(void) {
149+_noreturn_ static void freeze_or_reboot(void) {
150
151 if (arg_crash_reboot) {
152 log_notice("Rebooting in 10s...");
153@@ -156,7 +156,7 @@ noreturn static void freeze_or_reboot(void) {
154 freeze();
155 }
156
157-noreturn static void crash(int sig) {
158+_noreturn_ static void crash(int sig) {
159 struct sigaction sa;
160 pid_t pid;
161
162diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c
163index 5a88b2774..d87bdbdd3 100644
164--- a/src/journal/test-journal-interleaving.c
165+++ b/src/journal/test-journal-interleaving.c
166@@ -37,7 +37,7 @@
167
168 static bool arg_keep = false;
169
170-noreturn static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
171+_noreturn_ static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
172 log_internal(LOG_CRIT, error, file, line, func,
173 "'%s' failed at %s:%u (%s): %m", text, file, line, func);
174 abort();
175diff --git a/src/shared/pager.c b/src/shared/pager.c
176index 75db3c985..681af9c40 100644
177--- a/src/shared/pager.c
178+++ b/src/shared/pager.c
179@@ -47,7 +47,7 @@ static int stored_stderr = -1;
180 static bool stdout_redirected = false;
181 static bool stderr_redirected = false;
182
183-noreturn static void pager_fallback(void) {
184+_noreturn_ static void pager_fallback(void) {
185 int r;
186
187 r = copy_bytes(STDIN_FILENO, STDOUT_FILENO, (uint64_t) -1, 0);
188diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c
189index 2821640e9..c8fa47b3d 100644
190--- a/src/udev/collect/collect.c
191+++ b/src/udev/collect/collect.c
192@@ -58,7 +58,7 @@ static inline struct _mate *node_to_mate(struct udev_list_node *node)
193 return container_of(node, struct _mate, node);
194 }
195
196-noreturn static void sig_alrm(int signo)
197+_noreturn_ static void sig_alrm(int signo)
198 {
199 exit(4);
200 }
201--
2022.17.0
203
diff --git a/meta/recipes-core/systemd/systemd/0034-Fix-format-truncation-compile-failure-by-typecasting.patch b/meta/recipes-core/systemd/systemd/0034-Fix-format-truncation-compile-failure-by-typecasting.patch
deleted file mode 100644
index e56061f41b..0000000000
--- a/meta/recipes-core/systemd/systemd/0034-Fix-format-truncation-compile-failure-by-typecasting.patch
+++ /dev/null
@@ -1,173 +0,0 @@
1From c2b3ebe112ebfd9f9e82fb1531ee225c3152ca83 Mon Sep 17 00:00:00 2001
2From: Patrick Uiterwijk <patrick@puiterwijk.org>
3Date: Thu, 22 Feb 2018 19:41:30 +0100
4Subject: [PATCH] Fix format-truncation compile failure by typecasting USB IDs
5 (#8250)
6
7This patch adds safe_atoux16 for parsing an unsigned hexadecimal 16bit int, and
8uses that for parsing USB device and vendor IDs.
9
10This fixes a compile error with gcc-8 because while we know that USB IDs are 2 bytes,
11the compiler does not know that.
12
13../src/udev/udev-builtin-hwdb.c:80:38: error: '%04X' directive output may be
14truncated writing between 4 and 8 bytes into a region of size between 2 and 6
15[-Werror=format-truncation=]
16
17Upstream-Status: Backport [https://github.com/systemd/systemd/commit/5547c12503a683290eaed47954ffcfb2d1bc03cd]
18
19Signed-off-by: Adam Williamson <awilliam@redhat.com>
20Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
21---
22 src/basic/parse-util.c | 24 ++++++++++++++++++++++
23 src/basic/parse-util.h | 2 ++
24 src/test/test-parse-util.c | 39 ++++++++++++++++++++++++++++++++++++
25 src/udev/udev-builtin-hwdb.c | 13 ++++++------
26 4 files changed, 71 insertions(+), 7 deletions(-)
27
28diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
29index 97533721d..ff3fc298a 100644
30--- a/src/basic/parse-util.c
31+++ b/src/basic/parse-util.c
32@@ -532,6 +532,30 @@ int safe_atoi16(const char *s, int16_t *ret) {
33 return 0;
34 }
35
36+int safe_atoux16(const char *s, uint16_t *ret) {
37+ char *x = NULL;
38+ unsigned long l;
39+
40+ assert(s);
41+ assert(ret);
42+
43+ s += strspn(s, WHITESPACE);
44+
45+ errno = 0;
46+ l = strtoul(s, &x, 16);
47+ if (errno > 0)
48+ return -errno;
49+ if (!x || x == s || *x != 0)
50+ return -EINVAL;
51+ if (s[0] == '-')
52+ return -ERANGE;
53+ if ((unsigned long) (uint16_t) l != l)
54+ return -ERANGE;
55+
56+ *ret = (uint16_t) l;
57+ return 0;
58+}
59+
60 int safe_atod(const char *s, double *ret_d) {
61 _cleanup_(freelocalep) locale_t loc = (locale_t) 0;
62 char *x = NULL;
63diff --git a/src/basic/parse-util.h b/src/basic/parse-util.h
64index 1eda1d7f9..727422056 100644
65--- a/src/basic/parse-util.h
66+++ b/src/basic/parse-util.h
67@@ -54,6 +54,8 @@ int safe_atou8(const char *s, uint8_t *ret);
68 int safe_atou16(const char *s, uint16_t *ret);
69 int safe_atoi16(const char *s, int16_t *ret);
70
71+int safe_atoux16(const char *s, uint16_t *ret);
72+
73 static inline int safe_atou32(const char *s, uint32_t *ret_u) {
74 assert_cc(sizeof(uint32_t) == sizeof(unsigned));
75 return safe_atou(s, (unsigned*) ret_u);
76diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c
77index 937500213..a99cea5a1 100644
78--- a/src/test/test-parse-util.c
79+++ b/src/test/test-parse-util.c
80@@ -468,6 +468,44 @@ static void test_safe_atoi16(void) {
81 assert_se(r == -EINVAL);
82 }
83
84+static void test_safe_atoux16(void) {
85+ int r;
86+ uint16_t l;
87+
88+ r = safe_atoux16("1234", &l);
89+ assert_se(r == 0);
90+ assert_se(l == 0x1234);
91+
92+ r = safe_atoux16("abcd", &l);
93+ assert_se(r == 0);
94+ assert_se(l == 0xabcd);
95+
96+ r = safe_atoux16(" 1234", &l);
97+ assert_se(r == 0);
98+ assert_se(l == 0x1234);
99+
100+ r = safe_atoux16("12345", &l);
101+ assert_se(r == -ERANGE);
102+
103+ r = safe_atoux16("-1", &l);
104+ assert_se(r == -ERANGE);
105+
106+ r = safe_atoux16(" -1", &l);
107+ assert_se(r == -ERANGE);
108+
109+ r = safe_atoux16("junk", &l);
110+ assert_se(r == -EINVAL);
111+
112+ r = safe_atoux16("123x", &l);
113+ assert_se(r == -EINVAL);
114+
115+ r = safe_atoux16("12.3", &l);
116+ assert_se(r == -EINVAL);
117+
118+ r = safe_atoux16("", &l);
119+ assert_se(r == -EINVAL);
120+}
121+
122 static void test_safe_atou64(void) {
123 int r;
124 uint64_t l;
125@@ -745,6 +783,7 @@ int main(int argc, char *argv[]) {
126 test_safe_atolli();
127 test_safe_atou16();
128 test_safe_atoi16();
129+ test_safe_atoux16();
130 test_safe_atou64();
131 test_safe_atoi64();
132 test_safe_atod();
133diff --git a/src/udev/udev-builtin-hwdb.c b/src/udev/udev-builtin-hwdb.c
134index ca7f7c230..dbfe02429 100644
135--- a/src/udev/udev-builtin-hwdb.c
136+++ b/src/udev/udev-builtin-hwdb.c
137@@ -27,6 +27,7 @@
138
139 #include "alloc-util.h"
140 #include "hwdb-util.h"
141+#include "parse-util.h"
142 #include "string-util.h"
143 #include "udev-util.h"
144 #include "udev.h"
145@@ -63,7 +64,7 @@ int udev_builtin_hwdb_lookup(struct udev_device *dev,
146
147 static const char *modalias_usb(struct udev_device *dev, char *s, size_t size) {
148 const char *v, *p;
149- int vn, pn;
150+ uint16_t vn, pn;
151
152 v = udev_device_get_sysattr_value(dev, "idVendor");
153 if (!v)
154@@ -71,12 +72,10 @@ static const char *modalias_usb(struct udev_device *dev, char *s, size_t size) {
155 p = udev_device_get_sysattr_value(dev, "idProduct");
156 if (!p)
157 return NULL;
158- vn = strtol(v, NULL, 16);
159- if (vn <= 0)
160- return NULL;
161- pn = strtol(p, NULL, 16);
162- if (pn <= 0)
163- return NULL;
164+ if (safe_atoux16(v, &vn) < 0)
165+ return NULL;
166+ if (safe_atoux16(p, &pn) < 0)
167+ return NULL;
168 snprintf(s, size, "usb:v%04Xp%04X*", vn, pn);
169 return s;
170 }
171--
1722.17.0
173
diff --git a/meta/recipes-core/systemd/systemd/0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch b/meta/recipes-core/systemd/systemd/0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch
deleted file mode 100644
index fcc7c500ab..0000000000
--- a/meta/recipes-core/systemd/systemd/0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From f9fd4546c25a15629544bc4642a74d7909cc0840 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Fri, 1 Jun 2018 15:22:28 +0000
4Subject: [PATCH] time-util: fix build with gcc8 -Werror=format-truncation=
5
6* it fails with gcc8 when -O1 or -Os is used (and -ftree-vrp which is added by -O2 and higher isn't used)
7
8../git/src/basic/time-util.c: In function 'format_timespan':
9../git/src/basic/time-util.c:508:46: error: '%0*llu' directive output between 1 and 2147483647 bytes may cause result to exceed 'INT_MAX' [-Werror=format-truncation=]
10 "%s"USEC_FMT".%0*"PRI_USEC"%s",
11 ^~~~
12../git/src/basic/time-util.c:508:60: note: format string is defined here
13 "%s"USEC_FMT".%0*"PRI_USEC"%s",
14../git/src/basic/time-util.c:508:46: note: directive argument in the range [0, 18446744073709551614]
15 "%s"USEC_FMT".%0*"PRI_USEC"%s",
16 ^~~~
17../git/src/basic/time-util.c:507:37: note: 'snprintf' output 4 or more bytes (assuming 2147483651) into a destination of size 4294967295
18 k = snprintf(p, l,
19 ^~~~~~~~~~~~~~
20 "%s"USEC_FMT".%0*"PRI_USEC"%s",
21 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 p > buf ? " " : "",
23 ~~~~~~~~~~~~~~~~~~~
24 a,
25 ~~
26 j,
27 ~~
28 b,
29 ~~
30 table[i].suffix);
31 ~~~~~~~~~~~~~~~~
32cc1: some warnings being treated as errors
33
34Upstream-Status: Submitted https://github.com/systemd/systemd/pull/9156
35
36Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
37---
38 src/basic/time-util.c | 2 +-
39 1 file changed, 1 insertion(+), 1 deletion(-)
40
41diff --git a/src/basic/time-util.c b/src/basic/time-util.c
42index 0601d4fa9..db5a9cd78 100644
43--- a/src/basic/time-util.c
44+++ b/src/basic/time-util.c
45@@ -484,7 +484,7 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
46 /* Let's see if we should shows this in dot notation */
47 if (t < USEC_PER_MINUTE && b > 0) {
48 usec_t cc;
49- int j;
50+ signed char j;
51
52 j = 0;
53 for (cc = table[i].usec; cc > 1; cc /= 10)
diff --git a/meta/recipes-core/systemd/systemd/libmount.patch b/meta/recipes-core/systemd/systemd/libmount.patch
deleted file mode 100644
index b59d5b7d70..0000000000
--- a/meta/recipes-core/systemd/systemd/libmount.patch
+++ /dev/null
@@ -1,75 +0,0 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From 227b8a762fea1458547be2cdf0e6e4aac0079730 Mon Sep 17 00:00:00 2001
5From: Michael Olbrich <m.olbrich@pengutronix.de>
6Date: Mon, 26 Mar 2018 17:34:53 +0200
7Subject: [PATCH] core: don't include libmount.h in a header file (#8580)
8
9linux/fs.h sys/mount.h, libmount.h and missing.h all include MS_*
10definitions.
11
12To avoid problems, only one of linux/fs.h, sys/mount.h and libmount.h
13should be included. And missing.h must be included last.
14
15Without this, building systemd may fail with:
16
17In file included from [...]/libmount/libmount.h:31:0,
18 from ../systemd-238/src/core/manager.h:23,
19 from ../systemd-238/src/core/emergency-action.h:37,
20 from ../systemd-238/src/core/unit.h:34,
21 from ../systemd-238/src/core/dbus-timer.h:25,
22 from ../systemd-238/src/core/timer.c:26:
23[...]/sys/mount.h:57:2: error: expected identifier before numeric constant
24---
25 src/core/dbus-execute.c | 1 +
26 src/core/manager.h | 3 ++-
27 src/core/mount.c | 2 ++
28 3 files changed, 5 insertions(+), 1 deletion(-)
29
30diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
31index 7344623ebf6..c342093bca4 100644
32--- a/src/core/dbus-execute.c
33+++ b/src/core/dbus-execute.c
34@@ -18,6 +18,7 @@
35 along with systemd; If not, see <http://www.gnu.org/licenses/>.
36 ***/
37
38+#include <sys/mount.h>
39 #include <sys/prctl.h>
40 #include <stdio_ext.h>
41
42diff --git a/src/core/manager.h b/src/core/manager.h
43index 28c5da225b1..e09e0cdf5e9 100644
44--- a/src/core/manager.h
45+++ b/src/core/manager.h
46@@ -20,7 +20,6 @@
47 along with systemd; If not, see <http://www.gnu.org/licenses/>.
48 ***/
49
50-#include <libmount.h>
51 #include <stdbool.h>
52 #include <stdio.h>
53
54@@ -34,6 +33,8 @@
55 #include "list.h"
56 #include "ratelimit.h"
57
58+struct libmnt_monitor;
59+
60 /* Enforce upper limit how many names we allow */
61 #define MANAGER_MAX_NAMES 131072 /* 128K */
62
63diff --git a/src/core/mount.c b/src/core/mount.c
64index 0e755da5c02..0154ebda5d6 100644
65--- a/src/core/mount.c
66+++ b/src/core/mount.c
67@@ -23,6 +23,8 @@
68 #include <stdio.h>
69 #include <sys/epoll.h>
70
71+#include <libmount.h>
72+
73 #include "sd-messages.h"
74
75 #include "alloc-util.h"
diff --git a/meta/recipes-core/systemd/systemd_237.bb b/meta/recipes-core/systemd/systemd_239.bb
index 3efca33e73..7822548993 100644
--- a/meta/recipes-core/systemd/systemd_237.bb
+++ b/meta/recipes-core/systemd/systemd_239.bb
@@ -4,7 +4,7 @@ PROVIDES = "udev"
4 4
5PE = "1" 5PE = "1"
6 6
7DEPENDS = "kmod intltool-native gperf-native acl readline libcap libcgroup util-linux" 7DEPENDS = "intltool-native gperf-native libcap util-linux"
8 8
9SECTION = "base/shell" 9SECTION = "base/shell"
10 10
@@ -17,47 +17,43 @@ REQUIRED_DISTRO_FEATURES = "systemd"
17SRC_URI += "file://touchscreen.rules \ 17SRC_URI += "file://touchscreen.rules \
18 file://00-create-volatile.conf \ 18 file://00-create-volatile.conf \
19 file://init \ 19 file://init \
20 file://0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \ 20 file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
21 file://0001-Use-getenv-when-secure-versions-are-not-available.patch \ 21 file://0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
22 file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ 22 file://0003-implment-systemd-sysv-install-for-OE.patch \
23 file://0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \ 23 file://0004-rules-whitelist-hd-devices.patch \
24 file://0004-implment-systemd-sysv-install-for-OE.patch \ 24 file://0005-Make-root-s-home-directory-configurable.patch \
25 file://0005-rules-whitelist-hd-devices.patch \ 25 file://0006-remove-nobody-user-group-checking.patch \
26 file://0006-Make-root-s-home-directory-configurable.patch \ 26 file://0007-rules-watch-metadata-changes-in-ide-devices.patch \
27 file://0007-Revert-rules-remove-firmware-loading-rules.patch \ 27 file://0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch \
28 file://0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch \ 28 file://0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch \
29 file://0009-remove-duplicate-include-uchar.h.patch \ 29 file://0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch \
30 file://0010-check-for-uchar.h-in-meson.build.patch \
31 file://0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
32 file://0012-rules-watch-metadata-changes-in-ide-devices.patch \
33 file://0013-add-fallback-parse_printf_format-implementation.patch \
34 file://0014-src-basic-missing.h-check-for-missing-strndupa.patch \
35 file://0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
36 file://0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch \
37 file://0017-Include-netinet-if_ether.h.patch \
38 file://0018-check-for-missing-canonicalize_file_name.patch \
39 file://0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch \
40 file://0020-test-hexdecoct.c-Include-missing.h-for-strndupa.patch \
41 file://0021-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
42 file://0022-don-t-use-glibc-specific-qsort_r.patch \
43 file://0023-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
44 file://0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \
45 file://0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch \
46 file://0026-Use-uintmax_t-for-handling-rlim_t.patch \
47 file://0027-remove-nobody-user-group-checking.patch \
48 file://0028-add-missing-FTW_-macros-for-musl.patch \
49 file://0029-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch \
50 file://0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
51 file://0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch \
52 file://0032-memfd.patch \
53 file://0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch \
54 file://libmount.patch \
55 file://0034-Fix-format-truncation-compile-failure-by-typecasting.patch \
56 file://0035-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
57 file://0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch \
58 " 30 "
59SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch" 31SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
60 32
33# patches made for musl are only applied on TCLIBC is musl
34SRC_URI += "${SRC_URI_MUSL}"
35SRC_URI_MUSL = "file://0001-Use-getenv-when-secure-versions-are-not-available.patch \
36 file://0002-don-t-use-glibc-specific-qsort_r.patch \
37 file://0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \
38 file://0004-add-fallback-parse_printf_format-implementation.patch \
39 file://0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch \
40 file://0006-src-basic-missing.h-check-for-missing-strndupa.patch \
41 file://0007-Include-netinet-if_ether.h.patch \
42 file://0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
43 file://0009-add-missing-FTW_-macros-for-musl.patch \
44 file://0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
45 file://0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch \
46 file://0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
47 file://0013-Use-uintmax_t-for-handling-rlim_t.patch \
48 file://0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch \
49 file://0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch \
50 file://0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
51 file://0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
52 file://0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
53 file://0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
54 file://0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
55 "
56
61# Workaround undefined reference to `__stack_chk_fail_local' on qemux86 and qemuppc for musl 57# Workaround undefined reference to `__stack_chk_fail_local' on qemux86 and qemuppc for musl
62SRC_URI_append_libc-musl_qemux86 = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch" 58SRC_URI_append_libc-musl_qemux86 = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
63SRC_URI_append_libc-musl_qemuppc = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch" 59SRC_URI_append_libc-musl_qemuppc = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
@@ -72,12 +68,15 @@ PACKAGECONFIG ??= " \
72 ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge', d)} \ 68 ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge', d)} \
73 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \ 69 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
74 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \ 70 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
71 acl \
75 backlight \ 72 backlight \
76 binfmt \ 73 binfmt \
77 firstboot \ 74 firstboot \
75 gshadow \
78 hibernate \ 76 hibernate \
79 hostnamed \ 77 hostnamed \
80 ima \ 78 ima \
79 kmod \
81 localed \ 80 localed \
82 logind \ 81 logind \
83 machined \ 82 machined \
@@ -98,6 +97,7 @@ PACKAGECONFIG ??= " \
98" 97"
99 98
100PACKAGECONFIG_remove_libc-musl = " \ 99PACKAGECONFIG_remove_libc-musl = " \
100 gshadow \
101 localed \ 101 localed \
102 myhostname \ 102 myhostname \
103 nss \ 103 nss \
@@ -113,6 +113,7 @@ PACKAGECONFIG_remove_libc-musl = " \
113# systemd-serialgetty.bb - not enabled by default. 113# systemd-serialgetty.bb - not enabled by default.
114PACKAGECONFIG[serial-getty-generator] = "" 114PACKAGECONFIG[serial-getty-generator] = ""
115 115
116PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl"
116PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit" 117PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
117PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false" 118PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
118PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false" 119PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
@@ -125,6 +126,7 @@ PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
125PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false" 126PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
126# Sign the journal for anti-tampering 127# Sign the journal for anti-tampering
127PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt" 128PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
129PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
128PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false" 130PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
129PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false" 131PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
130PACKAGECONFIG[ima] = "-Dima=true,-Dima=false" 132PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
@@ -133,6 +135,7 @@ PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
133# Update NAT firewall rules 135# Update NAT firewall rules
134PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables" 136PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
135PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl" 137PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
138PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
136PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false" 139PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false"
137PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn" 140PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
138PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false" 141PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
@@ -146,6 +149,7 @@ PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
146PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false" 149PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
147PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}" 150PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
148PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false" 151PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
152PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
149PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode" 153PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode"
150PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false" 154PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
151PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false" 155PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
@@ -181,11 +185,10 @@ EXTRA_OEMESON += "-Dlink-udev-shared=false"
181 185
182EXTRA_OEMESON += "-Dnobody-user=nobody \ 186EXTRA_OEMESON += "-Dnobody-user=nobody \
183 -Dnobody-group=nobody \ 187 -Dnobody-group=nobody \
184 -Droothomedir=${ROOTHOME} \ 188 -Droothomedir=${ROOT_HOME} \
185 -Drootlibdir=${rootlibdir} \ 189 -Drootlibdir=${rootlibdir} \
186 -Drootprefix=${rootprefix} \ 190 -Drootprefix=${rootprefix} \
187 -Dsysvrcnd-path=${sysconfdir} \ 191 -Dsysvrcnd-path=${sysconfdir} \
188 -Dfirmware-path=${nonarch_base_libdir}/firmware \
189 " 192 "
190 193
191# Hardcode target binary paths to avoid using paths from sysroot 194# Hardcode target binary paths to avoid using paths from sysroot
@@ -377,6 +380,7 @@ FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.c
377 ${libdir}/libnss_mymachines.so.2 \ 380 ${libdir}/libnss_mymachines.so.2 \
378 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \ 381 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
379 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \ 382 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
383 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
380 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \ 384 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
381 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \ 385 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
382 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \ 386 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
@@ -432,6 +436,14 @@ CONFFILES_${PN} = "${sysconfdir}/machine-id \
432 ${sysconfdir}/systemd/user.conf" 436 ${sysconfdir}/systemd/user.conf"
433 437
434FILES_${PN} = " ${base_bindir}/* \ 438FILES_${PN} = " ${base_bindir}/* \
439 ${base_sbindir}/shutdown \
440 ${base_sbindir}/halt \
441 ${base_sbindir}/poweroff \
442 ${base_sbindir}/runlevel \
443 ${base_sbindir}/telinit \
444 ${base_sbindir}/resolvconf \
445 ${base_sbindir}/reboot \
446 ${base_sbindir}/init \
435 ${datadir}/dbus-1/services \ 447 ${datadir}/dbus-1/services \
436 ${datadir}/dbus-1/system-services \ 448 ${datadir}/dbus-1/system-services \
437 ${datadir}/polkit-1 \ 449 ${datadir}/polkit-1 \
@@ -456,6 +468,7 @@ FILES_${PN} = " ${base_bindir}/* \
456 ${bindir}/coredumpctl \ 468 ${bindir}/coredumpctl \
457 ${bindir}/localectl \ 469 ${bindir}/localectl \
458 ${bindir}/hostnamectl \ 470 ${bindir}/hostnamectl \
471 ${bindir}/resolvectl \
459 ${bindir}/timedatectl \ 472 ${bindir}/timedatectl \
460 ${bindir}/bootctl \ 473 ${bindir}/bootctl \
461 ${bindir}/kernel-install \ 474 ${bindir}/kernel-install \
@@ -478,6 +491,8 @@ FILES_${PN} = " ${base_bindir}/* \
478 ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \ 491 ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
479 ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \ 492 ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
480 ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \ 493 ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
494 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
495 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
481 " 496 "
482 497
483FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" 498FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
@@ -536,34 +551,7 @@ python __anonymous() {
536 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") 551 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
537} 552}
538 553
539# TODO: 554ALTERNATIVE_${PN} = "resolv-conf"
540# u-a for runlevel and telinit
541
542ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel resolv-conf"
543
544ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
545ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
546ALTERNATIVE_PRIORITY[init] ?= "300"
547
548ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
549ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
550ALTERNATIVE_PRIORITY[halt] ?= "300"
551
552ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
553ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
554ALTERNATIVE_PRIORITY[reboot] ?= "300"
555
556ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
557ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
558ALTERNATIVE_PRIORITY[shutdown] ?= "300"
559
560ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
561ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
562ALTERNATIVE_PRIORITY[poweroff] ?= "300"
563
564ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
565ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
566ALTERNATIVE_PRIORITY[runlevel] ?= "300"
567 555
568ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd" 556ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
569ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf" 557ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"