diff --git a/.oebuild/manifest.yaml b/.oebuild/manifest.yaml index ea4058df61f5bd9ffbc30baef72343ae97296601..a74d3a52bdb847d373100bf8a843e07f8b611b99 100644 --- a/.oebuild/manifest.yaml +++ b/.oebuild/manifest.yaml @@ -1512,9 +1512,9 @@ manifest_list: syslinux: remote_url: https://gitee.com/src-openeuler/syslinux.git version: 7f2318a9d7e85935b6c3146c67d31140734b724e - systemd: - remote_url: https://gitee.com/src-openeuler/systemd.git - version: 5b7479879d98638372c8f537c18c13f0079d7b20 + # systemd: + # remote_url: https://gitee.com/src-openeuler/systemd.git + # version: 2b20884ae6d7df65398e5fb1fccc4b4e9bc7d27f systemtap: remote_url: https://gitee.com/src-openeuler/systemtap.git version: 60ee7da866d0c3a3fb1fa9e2255681a5ba7107ca diff --git a/meta-openeuler/conf/distro/include/default-versions.inc b/meta-openeuler/conf/distro/include/default-versions.inc new file mode 100644 index 0000000000000000000000000000000000000000..a82b5d44bbf27f39460d0d63423d7fddc9a4b569 --- /dev/null +++ b/meta-openeuler/conf/distro/include/default-versions.inc @@ -0,0 +1,2 @@ +# systemd +PREFERRED_VERSION_systemd = "255%" diff --git a/meta-openeuler/recipes-core/systemd/files/fix-glibc-2.36-redefinition-error.patch b/meta-openeuler/recipes-core/systemd/files/fix-glibc-2.36-redefinition-error.patch deleted file mode 100644 index 9d04f047ffcfd088ee3148128c25e4c5dc5bab4a..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/systemd/files/fix-glibc-2.36-redefinition-error.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff -uprN a/meson.build b/meson.build ---- a/meson.build 2023-03-17 02:12:01.119365345 +0000 -+++ b/meson.build 2023-03-17 02:10:34.756309801 +0000 -@@ -448,7 +448,6 @@ decl_headers = ''' - #include - #include - #include --#include - ''' - - foreach decl : ['char16_t', -@@ -460,6 +459,17 @@ foreach decl : ['char16_t', - # We get -1 if the size cannot be determined - have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0 - -+ if decl == 'struct mount_attr' -+ if have -+ want_linux_fs_h = false -+ else -+ have = cc.sizeof(decl, -+ prefix : decl_headers + '#include ', -+ args : '-D_GNU_SOURCE') > 0 -+ want_linux_fs_h = have -+ endif -+ endif -+ - if decl == 'struct statx' - if have - want_linux_stat_h = false -@@ -475,6 +485,7 @@ foreach decl : ['char16_t', - endforeach - - conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h) -+conf.set10('WANT_LINUX_FS_H', want_linux_fs_h) - - foreach ident : ['secure_getenv', '__secure_getenv'] - conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident)) -diff -uprN a/src/core/namespace.c b/src/core/namespace.c ---- a/src/core/namespace.c 2023-03-17 02:11:54.819431730 +0000 -+++ b/src/core/namespace.c 2023-03-17 02:10:34.772309619 +0000 -@@ -6,7 +6,9 @@ - #include - #include - #include -+#if WANT_LINUX_FS_H - #include -+#endif - - #include "alloc-util.h" - #include "base-filesystem.h" -diff -uprN a/src/shared/mount-util.c b/src/shared/mount-util.c ---- a/src/shared/mount-util.c 2023-03-17 02:11:59.291384569 +0000 -+++ b/src/shared/mount-util.c 2023-03-17 02:10:34.808309208 +0000 -@@ -7,7 +7,9 @@ - #include - #include - #include -+#if WANT_LINUX_FS_H - #include -+#endif - - #include "alloc-util.h" - #include "dissect-image.h" diff --git a/meta-openeuler/recipes-core/systemd/files/systemd-depmod.service b/meta-openeuler/recipes-core/systemd/files/systemd-depmod.service index 8addd0692bbac4eeedd428997818eb650e2214be..dd37df74100cd52412c50f0866127a01fdeef9f7 100644 --- a/meta-openeuler/recipes-core/systemd/files/systemd-depmod.service +++ b/meta-openeuler/recipes-core/systemd/files/systemd-depmod.service @@ -14,9 +14,9 @@ ConditionKernelCommandLine=|rd.modules-load ConditionFileIsExecutable=/sbin/depmod ConditionFileNotEmpty=!/lib/modules/%v/modules.dep + [Service] Type=oneshot RemainAfterExit=yes ExecStart=/sbin/depmod -a -TimeoutSec=90s - +TimeoutSec=90s \ No newline at end of file diff --git a/meta-openeuler/recipes-core/systemd/systemd-boot_%.bbappend b/meta-openeuler/recipes-core/systemd/systemd-boot_%.bbappend index bf710834712f9d7825fad9d1f250691511a1a43f..2de855b49256248ed3cf45ddd37aae8b3c0bac20 100644 --- a/meta-openeuler/recipes-core/systemd/systemd-boot_%.bbappend +++ b/meta-openeuler/recipes-core/systemd/systemd-boot_%.bbappend @@ -1,7 +1,7 @@ # main bb: openembedded-core/meta/recipes-core/systemd/systemd-boot_253.7.bb # version in openEuler -PV = "253" +PV = "255" S = "${WORKDIR}/systemd-${PV}" OPENEULER_REPO_NAME = "systemd" diff --git a/meta-openeuler/recipes-core/systemd/systemd-boot_253.7.bb b/meta-openeuler/recipes-core/systemd/systemd-boot_255.4.bb similarity index 68% rename from meta-openeuler/recipes-core/systemd/systemd-boot_253.7.bb rename to meta-openeuler/recipes-core/systemd/systemd-boot_255.4.bb index b67706b7316d78bf2fc0d2a554fcf97a9d2782da..050594506727b34af25d33110afccaf316571cf9 100644 --- a/meta-openeuler/recipes-core/systemd/systemd-boot_253.7.bb +++ b/meta-openeuler/recipes-core/systemd/systemd-boot_255.4.bb @@ -3,31 +3,31 @@ FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemd:" require conf/image-uefi.conf -DEPENDS = "intltool-native libcap util-linux gnu-efi gperf-native python3-jinja2-native" +DEPENDS = "intltool-native libcap util-linux gperf-native python3-jinja2-native python3-pyelftools-native" inherit meson pkgconfig gettext inherit deploy LDFLAGS:prepend = "${@ " ".join(d.getVar('LD').split()[1:])} " -do_write_config[vardeps] += "CC OBJCOPY" +EFI_LD = "bfd" +LDFLAGS:append = " -fuse-ld=${EFI_LD}" + +do_write_config[vardeps] += "EFI_LD" do_write_config:append() { cat >${WORKDIR}/meson-${PN}.cross < Date: Mon, 25 Feb 2019 13:55:12 +0800 -Subject: [PATCH] missing_type.h: add comparison_fn_t +Subject: [PATCH 01/22] missing_type.h: add comparison_fn_t Make it work with musl where comparison_fn_t and is not provided. @@ -33,7 +33,7 @@ index f6233090a9..6c0456349d 100644 +typedef int (*comparison_fn_t)(const void *, const void *); +#endif diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h -index f0bf246aa3..33669c7a75 100644 +index 9c818bd747..ef10c8be2c 100644 --- a/src/basic/sort-util.h +++ b/src/basic/sort-util.h @@ -4,6 +4,7 @@ @@ -45,7 +45,7 @@ index f0bf246aa3..33669c7a75 100644 /* This is the same as glibc's internal __compar_d_fn_t type. glibc exports a public comparison_fn_t, for the * external type __compar_fn_t, but doesn't do anything similar for __compar_d_fn_t. Let's hence do that diff --git a/src/libsystemd/sd-journal/catalog.c b/src/libsystemd/sd-journal/catalog.c -index 7527abf636..f33383e57f 100644 +index ae91534198..7f67eea38b 100644 --- a/src/libsystemd/sd-journal/catalog.c +++ b/src/libsystemd/sd-journal/catalog.c @@ -28,6 +28,7 @@ @@ -57,5 +57,4 @@ index 7527abf636..f33383e57f 100644 const char * const catalog_file_dirs[] = { "/usr/local/lib/systemd/catalog/", -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0010-add-fallback-parse_printf_format-implementation.patch b/meta-openeuler/recipes-core/systemd/systemd/0002-add-fallback-parse_printf_format-implementation.patch similarity index 93% rename from meta-openeuler/recipes-core/systemd/systemd/0010-add-fallback-parse_printf_format-implementation.patch rename to meta-openeuler/recipes-core/systemd/systemd/0002-add-fallback-parse_printf_format-implementation.patch index 2090d81dc39acc071479220845d513fe99e519af..02fc7907d82f3c5127e290b04ec3aef29cd5b5f2 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0010-add-fallback-parse_printf_format-implementation.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0002-add-fallback-parse_printf_format-implementation.patch @@ -1,7 +1,7 @@ -From 383e85e15f16a46aac925aa439b8b60f58b40aa6 Mon Sep 17 00:00:00 2001 +From 872b72739e62123867ce6c4f82aa37de24cc3f75 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Sat, 22 May 2021 20:26:24 +0200 -Subject: [PATCH] add fallback parse_printf_format implementation +Subject: [PATCH 02/22] add fallback parse_printf_format implementation Upstream-Status: Inappropriate [musl specific] @@ -21,9 +21,11 @@ Signed-off-by: Scott Murray create mode 100644 src/basic/parse-printf-format.c create mode 100644 src/basic/parse-printf-format.h +diff --git a/meson.build b/meson.build +index 7419e2b0b0..01fd3ffc19 100644 --- a/meson.build +++ b/meson.build -@@ -755,6 +755,7 @@ endif +@@ -725,6 +725,7 @@ endif foreach header : ['crypt.h', 'linux/memfd.h', 'linux/vm_sockets.h', @@ -31,9 +33,11 @@ Signed-off-by: Scott Murray 'sys/auxv.h', 'threads.h', 'valgrind/memcheck.h', +diff --git a/src/basic/meson.build b/src/basic/meson.build +index d7450d8b44..c3e3daf4bd 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build -@@ -173,6 +173,11 @@ endforeach +@@ -183,6 +183,11 @@ endforeach basic_sources += generated_gperf_headers @@ -45,6 +49,9 @@ Signed-off-by: Scott Murray ############################################################ arch_list = [ +diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c +new file mode 100644 +index 0000000000..49437e5445 --- /dev/null +++ b/src/basic/parse-printf-format.c @@ -0,0 +1,273 @@ @@ -321,6 +328,9 @@ Signed-off-by: Scott Murray + + return last; +} +diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h +new file mode 100644 +index 0000000000..47be7522d7 --- /dev/null +++ b/src/basic/parse-printf-format.h @@ -0,0 +1,57 @@ @@ -381,6 +391,8 @@ Signed-off-by: Scott Murray +size_t parse_printf_format(const char *fmt, size_t n, int *types); + +#endif /* HAVE_PRINTF_H */ +diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h +index 4e93ac90c9..f9deb6f662 100644 --- a/src/basic/stdio-util.h +++ b/src/basic/stdio-util.h @@ -1,12 +1,12 @@ @@ -397,6 +409,8 @@ Signed-off-by: Scott Murray _printf_(3, 4) static inline char *snprintf_ok(char *buf, size_t len, const char *format, ...) { +diff --git a/src/libsystemd/sd-journal/journal-send.c b/src/libsystemd/sd-journal/journal-send.c +index be23b2fe75..69a2eb6404 100644 --- a/src/libsystemd/sd-journal/journal-send.c +++ b/src/libsystemd/sd-journal/journal-send.c @@ -2,7 +2,6 @@ @@ -407,7 +421,7 @@ Signed-off-by: Scott Murray #include #include #include -@@ -25,6 +24,7 @@ +@@ -28,6 +27,7 @@ #include "stdio-util.h" #include "string-util.h" #include "tmpfile-util.h" @@ -415,3 +429,5 @@ Signed-off-by: Scott Murray #define SNDBUF_SIZE (8*1024*1024) +-- +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch b/meta-openeuler/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch index 43611e65fbc1273557d27eb92e29b1aadd1a4b63..5e3b087df32d34d749cbbd6a2a5190979274310c 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch @@ -1,8 +1,8 @@ -From ca7d9a8d9c81702af9c599bb79706f12b1a465cf Mon Sep 17 00:00:00 2001 +From 29a58009a172e369ad7166e16dab2f4945c6b0d2 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Thu, 21 Feb 2019 16:23:24 +0800 -Subject: [PATCH] binfmt: Don't install dependency links at install time for - the binfmt services +Subject: [PATCH 1/2] binfmt: Don't install dependency links at install time + for the binfmt services use [Install] blocks so that they get created when the service is enabled like a traditional service. @@ -19,40 +19,36 @@ Signed-off-by: Chen Qi [rebased for systemd 243] Signed-off-by: Scott Murray --- - units/meson.build | 6 ++---- + units/meson.build | 2 -- units/proc-sys-fs-binfmt_misc.automount | 3 +++ units/systemd-binfmt.service.in | 4 ++++ - 3 files changed, 9 insertions(+), 4 deletions(-) + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/units/meson.build b/units/meson.build -index c7939a10f8..219570ab19 100644 +index e7bfb7f838..1d5ec4b178 100644 --- a/units/meson.build +++ b/units/meson.build -@@ -62,8 +62,7 @@ units = [ - ['poweroff.target', '', - (with_runlevels ? 'runlevel0.target' : '')], - ['printer.target', ''], -- ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT', -- 'sysinit.target.wants/'], -+ ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT'], - ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'], - ['reboot.target', '', - 'ctrl-alt-del.target' + (with_runlevels ? ' runlevel6.target' : '')], -@@ -185,8 +184,7 @@ in_units = [ - ['rescue.service', ''], - ['serial-getty@.service', ''], - ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'], -- ['systemd-binfmt.service', 'ENABLE_BINFMT', -- 'sysinit.target.wants/'], -+ ['systemd-binfmt.service', 'ENABLE_BINFMT'], - ['systemd-bless-boot.service', 'HAVE_GNU_EFI HAVE_BLKID'], - ['systemd-boot-check-no-failures.service', ''], - ['systemd-coredump@.service', 'ENABLE_COREDUMP'], +@@ -154,7 +154,6 @@ units = [ + { + 'file' : 'proc-sys-fs-binfmt_misc.automount', + 'conditions' : ['ENABLE_BINFMT'], +- 'symlinks' : ['sysinit.target.wants/'], + }, + { + 'file' : 'proc-sys-fs-binfmt_misc.mount', +@@ -251,7 +250,6 @@ units = [ + { + 'file' : 'systemd-binfmt.service.in', + 'conditions' : ['ENABLE_BINFMT'], +- 'symlinks' : ['sysinit.target.wants/'], + }, + { + 'file' : 'systemd-bless-boot.service.in', diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount -index 6b1bbdc91e..5ec5b8670a 100644 +index 5d212015a5..6c2900ca77 100644 --- a/units/proc-sys-fs-binfmt_misc.automount +++ b/units/proc-sys-fs-binfmt_misc.automount -@@ -19,3 +19,6 @@ ConditionPathIsReadWrite=/proc/sys/ +@@ -22,3 +22,6 @@ Before=shutdown.target [Automount] Where=/proc/sys/fs/binfmt_misc @@ -60,7 +56,7 @@ index 6b1bbdc91e..5ec5b8670a 100644 +[Install] +WantedBy=sysinit.target diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in -index b04412e037..63f116e4fa 100644 +index 6861c76674..531e9fbd90 100644 --- a/units/systemd-binfmt.service.in +++ b/units/systemd-binfmt.service.in @@ -14,6 +14,7 @@ Documentation=https://docs.kernel.org/admin-guide/binfmt-misc.html @@ -72,12 +68,11 @@ index b04412e037..63f116e4fa 100644 After=proc-sys-fs-binfmt_misc.mount After=local-fs.target @@ -31,3 +32,6 @@ RemainAfterExit=yes - ExecStart={{ROOTLIBEXECDIR}}/systemd-binfmt - ExecStop={{ROOTLIBEXECDIR}}/systemd-binfmt --unregister + ExecStart={{LIBEXECDIR}}/systemd-binfmt + ExecStop={{LIBEXECDIR}}/systemd-binfmt --unregister TimeoutSec=90s + +[Install] +WantedBy=sysinit.target -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-strndupa.patch b/meta-openeuler/recipes-core/systemd/systemd/0003-src-basic-missing.h-check-for-missing-strndupa.patch similarity index 85% rename from meta-openeuler/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-strndupa.patch rename to meta-openeuler/recipes-core/systemd/systemd/0003-src-basic-missing.h-check-for-missing-strndupa.patch index bd5f6a6190cb5a8eb3a3585ff0f343588948bdda..d1f6db003797fb7ac823dc6904ac7c9f50ac7981 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-strndupa.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0003-src-basic-missing.h-check-for-missing-strndupa.patch @@ -1,7 +1,7 @@ -From ee5c8b494a3269edd154a0b799a03b39dba2ceb0 Mon Sep 17 00:00:00 2001 +From 87f1d38f40c5fe9cadf2b2de442473e4e5605788 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Mon, 25 Feb 2019 14:18:21 +0800 -Subject: [PATCH] src/basic/missing.h: check for missing strndupa +Subject: [PATCH 03/22] src/basic/missing.h: check for missing strndupa include missing.h for definition of strndupa @@ -17,6 +17,9 @@ Signed-off-by: Alex Kiernan [rebased for systemd 244] [Rebased for v247] Signed-off-by: Luca Boccassi +[Rebased for v254] +Signed-off-by: Chen Qi +[Rebased for v255.1] --- meson.build | 1 + src/backlight/backlight.c | 1 + @@ -65,16 +68,17 @@ Signed-off-by: Luca Boccassi src/shared/pager.c | 1 + src/socket-proxy/socket-proxyd.c | 1 + src/test/test-hexdecoct.c | 1 + + src/udev/udev-builtin-net_id.c | 1 + src/udev/udev-builtin-path_id.c | 1 + src/udev/udev-event.c | 1 + src/udev/udev-rules.c | 1 + - 50 files changed, 61 insertions(+) + 51 files changed, 62 insertions(+) diff --git a/meson.build b/meson.build -index fb96143c37..739b2f7f72 100644 +index 01fd3ffc19..61a872b753 100644 --- a/meson.build +++ b/meson.build -@@ -574,6 +574,7 @@ foreach ident : ['secure_getenv', '__secure_getenv'] +@@ -567,6 +567,7 @@ foreach ident : ['secure_getenv', '__secure_getenv'] endforeach foreach ident : [ @@ -83,10 +87,10 @@ index fb96143c37..739b2f7f72 100644 ['gettid', '''#include #include '''], diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c -index e66477f328..2613d1e3f9 100644 +index 5ac9f904a9..99d5122dd7 100644 --- a/src/backlight/backlight.c +++ b/src/backlight/backlight.c -@@ -19,6 +19,7 @@ +@@ -20,6 +20,7 @@ #include "string-util.h" #include "strv.h" #include "terminal-util.h" @@ -95,19 +99,19 @@ index e66477f328..2613d1e3f9 100644 #define PCI_CLASS_GRAPHICS_CARD 0x30000 diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c -index feda596939..11b4375ed5 100644 +index 18b16ecc0e..d2be79622f 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c -@@ -37,6 +37,7 @@ +@@ -38,6 +38,7 @@ #include "unit-name.h" #include "user-util.h" #include "xattr-util.h" +#include "missing_stdlib.h" - static int cg_enumerate_items(const char *controller, const char *path, FILE **_f, const char *item) { + static int cg_enumerate_items(const char *controller, const char *path, FILE **ret, const char *item) { _cleanup_free_ char *fs = NULL; diff --git a/src/basic/env-util.c b/src/basic/env-util.c -index 55ac11a512..7ccb1d7887 100644 +index d3bf73385f..16b17358ca 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -19,6 +19,7 @@ @@ -119,17 +123,17 @@ index 55ac11a512..7ccb1d7887 100644 /* We follow bash for the character set. Different shells have different rules. */ #define VALID_BASH_ENV_NAME_CHARS \ diff --git a/src/basic/log.c b/src/basic/log.c -index fc5793139e..515218fca8 100644 +index 1470611a75..9924ec2b9a 100644 --- a/src/basic/log.c +++ b/src/basic/log.c -@@ -39,6 +39,7 @@ +@@ -40,6 +40,7 @@ #include "terminal-util.h" #include "time-util.h" #include "utf8.h" +#include "missing_stdlib.h" #define SNDBUF_SIZE (8*1024*1024) - #define IOVEC_MAX 128U + #define IOVEC_MAX 256U diff --git a/src/basic/missing_stdlib.h b/src/basic/missing_stdlib.h index 8c76f93eb2..9068bfb4f0 100644 --- a/src/basic/missing_stdlib.h @@ -151,10 +155,10 @@ index 8c76f93eb2..9068bfb4f0 100644 + }) +#endif diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c -index 7ad19ee33b..cc1d5e1e5b 100644 +index c770e5ed32..1fd8816cd0 100644 --- a/src/basic/mkdir.c +++ b/src/basic/mkdir.c -@@ -15,6 +15,7 @@ +@@ -16,6 +16,7 @@ #include "stat-util.h" #include "stdio-util.h" #include "user-util.h" @@ -163,10 +167,10 @@ index 7ad19ee33b..cc1d5e1e5b 100644 int mkdirat_safe_internal( int dir_fd, diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c -index bc74fbef8f..cdb609bb84 100644 +index bf67f7e01a..409f8d8a73 100644 --- a/src/basic/mountpoint-util.c +++ b/src/basic/mountpoint-util.c -@@ -13,6 +13,7 @@ +@@ -18,6 +18,7 @@ #include "missing_stat.h" #include "missing_syscall.h" #include "mkdir.h" @@ -175,7 +179,7 @@ index bc74fbef8f..cdb609bb84 100644 #include "nulstr-util.h" #include "parse-util.h" diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c -index 3445d31307..d82b4415d9 100644 +index 0430e33e40..f3728de026 100644 --- a/src/basic/parse-util.c +++ b/src/basic/parse-util.c @@ -18,6 +18,7 @@ @@ -187,7 +191,7 @@ index 3445d31307..d82b4415d9 100644 int parse_boolean(const char *v) { if (!v) diff --git a/src/basic/path-lookup.c b/src/basic/path-lookup.c -index c99e9d8786..71a917a0b0 100644 +index 4e3d59fc56..726e240df0 100644 --- a/src/basic/path-lookup.c +++ b/src/basic/path-lookup.c @@ -16,6 +16,7 @@ @@ -211,19 +215,19 @@ index cab9d0eaea..5f6ca258e9 100644 static int parse_parts_value_whole(const char *p, const char *symbol) { const char *pc, *n; diff --git a/src/basic/proc-cmdline.c b/src/basic/proc-cmdline.c -index eea70d8606..ae3abd8402 100644 +index 522d8de1f4..7c129dc0fc 100644 --- a/src/basic/proc-cmdline.c +++ b/src/basic/proc-cmdline.c -@@ -15,6 +15,7 @@ - #include "special.h" +@@ -16,6 +16,7 @@ #include "string-util.h" + #include "strv.h" #include "virt.h" +#include "missing_stdlib.h" - int proc_cmdline(char **ret) { - const char *e; + int proc_cmdline_filter_pid1_args(char **argv, char ***ret) { + enum { diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c -index bcba5a5208..64a95dd866 100644 +index d7cfcd9105..6cb0ddf575 100644 --- a/src/basic/procfs-util.c +++ b/src/basic/procfs-util.c @@ -12,6 +12,7 @@ @@ -235,10 +239,10 @@ index bcba5a5208..64a95dd866 100644 int procfs_get_pid_max(uint64_t *ret) { _cleanup_free_ char *value = NULL; diff --git a/src/basic/time-util.c b/src/basic/time-util.c -index b700f364ef..48a26bcec9 100644 +index f9014dc560..1d7840a5b5 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c -@@ -26,6 +26,7 @@ +@@ -27,6 +27,7 @@ #include "string-util.h" #include "strv.h" #include "time-util.h" @@ -247,7 +251,7 @@ index b700f364ef..48a26bcec9 100644 static clockid_t map_clock_id(clockid_t c) { diff --git a/src/boot/bless-boot.c b/src/boot/bless-boot.c -index 59f02b761a..7496646350 100644 +index 0c0b4f23c7..68fe5ca509 100644 --- a/src/boot/bless-boot.c +++ b/src/boot/bless-boot.c @@ -22,6 +22,7 @@ @@ -259,22 +263,22 @@ index 59f02b761a..7496646350 100644 static char **arg_path = NULL; diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c -index b5484eda78..54ed62c790 100644 +index 4237e694c0..05f9d9d9a9 100644 --- a/src/core/dbus-cgroup.c +++ b/src/core/dbus-cgroup.c -@@ -21,6 +21,7 @@ +@@ -25,6 +25,7 @@ #include "parse-util.h" #include "path-util.h" #include "percent-util.h" +#include "missing_stdlib.h" #include "socket-util.h" - BUS_DEFINE_PROPERTY_GET(bus_property_get_tasks_max, "t", TasksMax, tasks_max_resolve); + BUS_DEFINE_PROPERTY_GET(bus_property_get_tasks_max, "t", CGroupTasksMax, cgroup_tasks_max_resolve); diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c -index f514b8fd12..4febd0d496 100644 +index 4daa1cefd3..2c77901471 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c -@@ -45,6 +45,7 @@ +@@ -42,6 +42,7 @@ #include "unit-printf.h" #include "user-util.h" #include "utf8.h" @@ -283,7 +287,7 @@ index f514b8fd12..4febd0d496 100644 BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_exec_output, exec_output, ExecOutput); static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_exec_input, exec_input, ExecInput); diff --git a/src/core/dbus-util.c b/src/core/dbus-util.c -index edfa0eb69a..6fd2ec9062 100644 +index d680a64268..e59f48103e 100644 --- a/src/core/dbus-util.c +++ b/src/core/dbus-util.c @@ -9,6 +9,7 @@ @@ -295,34 +299,34 @@ index edfa0eb69a..6fd2ec9062 100644 int bus_property_get_triggered_unit( sd_bus *bus, diff --git a/src/core/execute.c b/src/core/execute.c -index 853e87450f..8ef76de9ab 100644 +index ef0bf88687..bd3da0c401 100644 --- a/src/core/execute.c +++ b/src/core/execute.c -@@ -105,6 +105,7 @@ +@@ -72,6 +72,7 @@ #include "unit-serialize.h" #include "user-util.h" #include "utmp-wtmp.h" +#include "missing_stdlib.h" - #define IDLE_TIMEOUT_USEC (5*USEC_PER_SEC) - #define IDLE_TIMEOUT2_USEC (1*USEC_PER_SEC) + static bool is_terminal_input(ExecInput i) { + return IN_SET(i, diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c -index e843743777..e149807492 100644 +index b8e3f7aadd..8ce8ca68d8 100644 --- a/src/core/kmod-setup.c +++ b/src/core/kmod-setup.c -@@ -12,6 +12,7 @@ - #include "recurse-dir.h" +@@ -13,6 +13,7 @@ #include "string-util.h" + #include "strv.h" #include "virt.h" +#include "missing_stdlib.h" #if HAVE_KMOD #include "module-util.h" diff --git a/src/core/service.c b/src/core/service.c -index 9ad3c3d995..b112d64919 100644 +index b9eb40c555..268fe7573b 100644 --- a/src/core/service.c +++ b/src/core/service.c -@@ -42,6 +42,7 @@ +@@ -45,6 +45,7 @@ #include "unit-name.h" #include "unit.h" #include "utf8.h" @@ -331,7 +335,7 @@ index 9ad3c3d995..b112d64919 100644 #define service_spawn(...) service_spawn_internal(__func__, __VA_ARGS__) diff --git a/src/coredump/coredump-vacuum.c b/src/coredump/coredump-vacuum.c -index c6e201ecf2..ab034475e2 100644 +index 7e0c98cb7d..978a7f5874 100644 --- a/src/coredump/coredump-vacuum.c +++ b/src/coredump/coredump-vacuum.c @@ -17,6 +17,7 @@ @@ -343,10 +347,10 @@ index c6e201ecf2..ab034475e2 100644 #define DEFAULT_MAX_USE_LOWER (uint64_t) (1ULL*1024ULL*1024ULL) /* 1 MiB */ #define DEFAULT_MAX_USE_UPPER (uint64_t) (4ULL*1024ULL*1024ULL*1024ULL) /* 4 GiB */ diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c -index efc553b698..acea922311 100644 +index 016f3baa7f..b1def81313 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c -@@ -33,6 +33,7 @@ +@@ -37,6 +37,7 @@ #include "unit-name.h" #include "virt.h" #include "volatile-util.h" @@ -355,10 +359,10 @@ index efc553b698..acea922311 100644 typedef enum MountPointFlags { MOUNT_NOAUTO = 1 << 0, diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c -index 7df264fb53..9463a0e9fb 100644 +index da0f20d3ce..f22ce41908 100644 --- a/src/journal-remote/journal-remote-main.c +++ b/src/journal-remote/journal-remote-main.c -@@ -25,6 +25,7 @@ +@@ -27,6 +27,7 @@ #include "stat-util.h" #include "string-table.h" #include "strv.h" @@ -367,10 +371,10 @@ index 7df264fb53..9463a0e9fb 100644 #define PRIV_KEY_FILE CERTIFICATE_ROOT "/private/journal-remote.pem" #define CERT_FILE CERTIFICATE_ROOT "/certs/journal-remote.pem" diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c -index da0fac548e..c1c043e0e0 100644 +index 7f3dcd56a4..41b7cbaaf1 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c -@@ -72,6 +72,7 @@ +@@ -77,6 +77,7 @@ #include "unit-name.h" #include "user-util.h" #include "varlink.h" @@ -379,7 +383,7 @@ index da0fac548e..c1c043e0e0 100644 #define DEFAULT_FSS_INTERVAL_USEC (15*USEC_PER_MINUTE) #define PROCESS_INOTIFY_INTERVAL 1024 /* Every 1,024 messages processed */ diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c -index 9719f97c02..75decd9834 100644 +index ff0228081f..9066fcb133 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -19,6 +19,7 @@ @@ -391,7 +395,7 @@ index 9719f97c02..75decd9834 100644 static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored); static int message_parse_fields(sd_bus_message *m); diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c -index 2ad7a9993d..bba72f99f4 100644 +index c25c40ff37..57a5da704f 100644 --- a/src/libsystemd/sd-bus/bus-objects.c +++ b/src/libsystemd/sd-bus/bus-objects.c @@ -11,6 +11,7 @@ @@ -403,10 +407,10 @@ index 2ad7a9993d..bba72f99f4 100644 static int node_vtable_get_userdata( sd_bus *bus, diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c -index 64037e4fe0..9b9ce0aaa9 100644 +index 3c59d0d615..746922d46f 100644 --- a/src/libsystemd/sd-bus/bus-socket.c +++ b/src/libsystemd/sd-bus/bus-socket.c -@@ -27,6 +27,7 @@ +@@ -29,6 +29,7 @@ #include "string-util.h" #include "user-util.h" #include "utf8.h" @@ -415,10 +419,10 @@ index 64037e4fe0..9b9ce0aaa9 100644 #define SNDBUF_SIZE (8*1024*1024) diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c -index f6a5e4aa06..b36faa79a3 100644 +index 4a0259f8bb..aaa90d2223 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c -@@ -44,6 +44,7 @@ +@@ -46,6 +46,7 @@ #include "string-util.h" #include "strv.h" #include "user-util.h" @@ -427,46 +431,46 @@ index f6a5e4aa06..b36faa79a3 100644 #define log_debug_bus_message(m) \ do { \ diff --git a/src/libsystemd/sd-bus/test-bus-benchmark.c b/src/libsystemd/sd-bus/test-bus-benchmark.c -index 1eb6edd329..d434a3c178 100644 +index d988588de0..458df8df9a 100644 --- a/src/libsystemd/sd-bus/test-bus-benchmark.c +++ b/src/libsystemd/sd-bus/test-bus-benchmark.c -@@ -13,6 +13,7 @@ - #include "missing_resource.h" +@@ -14,6 +14,7 @@ #include "string-util.h" + #include "tests.h" #include "time-util.h" +#include "missing_stdlib.h" #define MAX_SIZE (2*1024*1024) diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c -index 9947947ef2..8dc6f93159 100644 +index 6b9ff0a4ed..4a5027ad0f 100644 --- a/src/libsystemd/sd-journal/sd-journal.c +++ b/src/libsystemd/sd-journal/sd-journal.c -@@ -41,6 +41,7 @@ - #include "string-util.h" +@@ -44,6 +44,7 @@ #include "strv.h" #include "syslog-util.h" + #include "uid-alloc-range.h" +#include "missing_stdlib.h" #define JOURNAL_FILES_RECHECK_USEC (2 * USEC_PER_SEC) diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c -index ba2fca32c6..e1f9caa13b 100644 +index b8da266e27..4bb8dd9496 100644 --- a/src/login/pam_systemd.c +++ b/src/login/pam_systemd.c -@@ -32,6 +32,7 @@ - #include "locale-util.h" +@@ -35,6 +35,7 @@ #include "login-util.h" #include "macro.h" + #include "missing_syscall.h" +#include "missing_stdlib.h" #include "pam-util.h" #include "parse-util.h" #include "path-util.h" diff --git a/src/network/generator/network-generator.c b/src/network/generator/network-generator.c -index 1090934bfc..69a77f66e2 100644 +index 48527a2c73..9777fe0561 100644 --- a/src/network/generator/network-generator.c +++ b/src/network/generator/network-generator.c -@@ -13,6 +13,7 @@ +@@ -14,6 +14,7 @@ #include "string-table.h" #include "string-util.h" #include "strv.h" @@ -475,7 +479,7 @@ index 1090934bfc..69a77f66e2 100644 /* # .network diff --git a/src/nspawn/nspawn-settings.c b/src/nspawn/nspawn-settings.c -index 05bde1c756..aa29587868 100644 +index 161b1c1c70..ba1c459f78 100644 --- a/src/nspawn/nspawn-settings.c +++ b/src/nspawn/nspawn-settings.c @@ -16,6 +16,7 @@ @@ -499,10 +503,10 @@ index c64e79bdff..eda26b0b9a 100644 static void setup_logging_once(void) { static pthread_once_t once = PTHREAD_ONCE_INIT; diff --git a/src/portable/portable.c b/src/portable/portable.c -index 7811833fac..c6414da91c 100644 +index d4b448a627..bb26623565 100644 --- a/src/portable/portable.c +++ b/src/portable/portable.c -@@ -39,6 +39,7 @@ +@@ -40,6 +40,7 @@ #include "strv.h" #include "tmpfile-util.h" #include "user-util.h" @@ -511,7 +515,7 @@ index 7811833fac..c6414da91c 100644 /* Markers used in the first line of our 20-portable.conf unit file drop-in to determine, that a) the unit file was * dropped there by the portable service logic and b) for which image it was dropped there. */ diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c -index 2638e985fb..82c903fd66 100644 +index afa537f160..32ccee4ae5 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -48,6 +48,7 @@ @@ -523,7 +527,7 @@ index 2638e985fb..82c903fd66 100644 static int arg_family = AF_UNSPEC; static int arg_ifindex = 0; diff --git a/src/shared/bus-get-properties.c b/src/shared/bus-get-properties.c -index 8b4f66b22e..5926e4c61b 100644 +index 53e5d6b99f..851ecd5644 100644 --- a/src/shared/bus-get-properties.c +++ b/src/shared/bus-get-properties.c @@ -4,6 +4,7 @@ @@ -547,7 +551,7 @@ index 8b462b5627..183ce1c18e 100644 struct CGroupInfo { char *cgroup_path; diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c -index 1e95e36678..640ee031d5 100644 +index 4ee9706847..30c8084847 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -50,6 +50,7 @@ @@ -559,10 +563,10 @@ index 1e95e36678..640ee031d5 100644 int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) { assert(message); diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c -index d09ec5148d..f38a8f7cc1 100644 +index 4123152d93..74f148c8b4 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c -@@ -21,6 +21,7 @@ +@@ -24,6 +24,7 @@ #include "path-util.h" #include "socket-util.h" #include "stdio-util.h" @@ -571,7 +575,7 @@ index d09ec5148d..f38a8f7cc1 100644 static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) { sd_event *e = ASSERT_PTR(userdata); diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c -index 620b156563..5ee5b09186 100644 +index b41c9b06ca..e69050a507 100644 --- a/src/shared/dns-domain.c +++ b/src/shared/dns-domain.c @@ -18,6 +18,7 @@ @@ -583,19 +587,19 @@ index 620b156563..5ee5b09186 100644 int dns_label_unescape(const char **name, char *dest, size_t sz, DNSLabelFlags flags) { const char *n; diff --git a/src/shared/journal-importer.c b/src/shared/journal-importer.c -index d9eabec886..534c6cf7e3 100644 +index 83e9834bbf..74eaae6f5e 100644 --- a/src/shared/journal-importer.c +++ b/src/shared/journal-importer.c -@@ -15,6 +15,7 @@ - #include "parse-util.h" +@@ -16,6 +16,7 @@ #include "string-util.h" + #include "strv.h" #include "unaligned.h" +#include "missing_stdlib.h" enum { IMPORTER_STATE_LINE = 0, /* waiting to read, or reading line */ diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c -index b72e516c8d..6e832b74c3 100644 +index a5d04003bd..10392c132d 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -41,6 +41,7 @@ @@ -607,7 +611,7 @@ index b72e516c8d..6e832b74c3 100644 /* up to three lines (each up to 100 characters) or 300 characters, whichever is less */ #define PRINT_LINE_THRESHOLD 3 diff --git a/src/shared/pager.c b/src/shared/pager.c -index 6ed35a3ca9..99d9d36140 100644 +index 19deefab56..6b6d0af1a0 100644 --- a/src/shared/pager.c +++ b/src/shared/pager.c @@ -25,6 +25,7 @@ @@ -619,10 +623,10 @@ index 6ed35a3ca9..99d9d36140 100644 static pid_t pager_pid = 0; diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c -index 821049e667..08a5bdae3d 100644 +index 287fd6c181..8f8d5493da 100644 --- a/src/socket-proxy/socket-proxyd.c +++ b/src/socket-proxy/socket-proxyd.c -@@ -26,6 +26,7 @@ +@@ -27,6 +27,7 @@ #include "set.h" #include "socket-util.h" #include "string-util.h" @@ -631,7 +635,7 @@ index 821049e667..08a5bdae3d 100644 #define BUFFER_SIZE (256 * 1024) diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c -index 9d71db6ae1..a9938c1e6e 100644 +index f884008660..987e180697 100644 --- a/src/test/test-hexdecoct.c +++ b/src/test/test-hexdecoct.c @@ -7,6 +7,7 @@ @@ -642,11 +646,23 @@ index 9d71db6ae1..a9938c1e6e 100644 #include "tests.h" TEST(hexchar) { +diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c +index 91b40088f4..f528a46b8e 100644 +--- a/src/udev/udev-builtin-net_id.c ++++ b/src/udev/udev-builtin-net_id.c +@@ -39,6 +39,7 @@ + #include "strv.h" + #include "strxcpyx.h" + #include "udev-builtin.h" ++#include "missing_stdlib.h" + + #define ONBOARD_14BIT_INDEX_MAX ((1U << 14) - 1) + #define ONBOARD_16BIT_INDEX_MAX ((1U << 16) - 1) diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c -index 8e4d57ee72..6b4555b4d5 100644 +index 467c9a6ad3..f74dae60af 100644 --- a/src/udev/udev-builtin-path_id.c +++ b/src/udev/udev-builtin-path_id.c -@@ -22,6 +22,7 @@ +@@ -24,6 +24,7 @@ #include "sysexits.h" #include "udev-builtin.h" #include "udev-util.h" @@ -655,29 +671,28 @@ index 8e4d57ee72..6b4555b4d5 100644 _printf_(2,3) static void path_prepend(char **path, const char *fmt, ...) { diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c -index ec4ad30824..bc40303a46 100644 +index ed22c8b679..19ebe20237 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c -@@ -34,6 +34,7 @@ +@@ -16,6 +16,7 @@ #include "udev-util.h" #include "udev-watch.h" #include "user-util.h" +#include "missing_stdlib.h" - typedef struct Spawn { - sd_device *device; + UdevEvent *udev_event_new(sd_device *dev, usec_t exec_delay_usec, sd_netlink *rtnl, int log_level) { + UdevEvent *event; diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c -index 5bd09a64d1..0ce79f815c 100644 +index 5f12002394..febe345b4c 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c -@@ -34,6 +34,7 @@ +@@ -41,6 +41,7 @@ #include "udev-util.h" #include "user-util.h" #include "virt.h" +#include "missing_stdlib.h" - #define RULES_DIRS (const char* const*) CONF_PATHS_STRV("udev/rules.d") + #define RULES_DIRS ((const char* const*) CONF_PATHS_STRV("udev/rules.d")) -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch b/meta-openeuler/recipes-core/systemd/systemd/0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch deleted file mode 100644 index aa1f3c2e8201aa1a44b401845e71a099681d7660..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/systemd/systemd/0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch +++ /dev/null @@ -1,73 +0,0 @@ -From f75f03ef6bc3554068e456bed227f333d5cb8c34 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 29 Sep 2020 18:01:41 -0700 -Subject: [PATCH] Move sysusers.d/sysctl.d/binfmt.d/modules-load.d to /usr - -These directories are moved to /lib since systemd v246, commit -4a56315a990b ("path: use ROOTPREFIX properly"), but in oe-core/yocto, -the old /usr/lib is still being used. - -Upstream-Status: Inappropriate (OE-specific) -Signed-off-by: Khem Raj -Signed-off-by: Jiaqing Zhao ---- - src/core/systemd.pc.in | 8 ++++---- - src/libsystemd/sd-path/sd-path.c | 8 ++++---- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in -index 693433b34b..8368a3ff02 100644 ---- a/src/core/systemd.pc.in -+++ b/src/core/systemd.pc.in -@@ -67,16 +67,16 @@ tmpfilesdir=${tmpfiles_dir} - - user_tmpfiles_dir=${prefix}/share/user-tmpfiles.d - --sysusers_dir=${rootprefix}/lib/sysusers.d -+sysusers_dir=${prefix}/lib/sysusers.d - sysusersdir=${sysusers_dir} - --sysctl_dir=${rootprefix}/lib/sysctl.d -+sysctl_dir=${prefix}/lib/sysctl.d - sysctldir=${sysctl_dir} - --binfmt_dir=${rootprefix}/lib/binfmt.d -+binfmt_dir=${prefix}/lib/binfmt.d - binfmtdir=${binfmt_dir} - --modules_load_dir=${rootprefix}/lib/modules-load.d -+modules_load_dir=${prefix}/lib/modules-load.d - modulesloaddir=${modules_load_dir} - - catalog_dir=${prefix}/lib/systemd/catalog -diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c -index 1af3a36d1d..def502b717 100644 ---- a/src/libsystemd/sd-path/sd-path.c -+++ b/src/libsystemd/sd-path/sd-path.c -@@ -362,19 +362,19 @@ static int get_path(uint64_t type, char **buffer, const char **ret) { - return 0; - - case SD_PATH_SYSUSERS: -- *ret = ROOTPREFIX_NOSLASH "/lib/sysusers.d"; -+ *ret = "/usr/lib/sysusers.d"; - return 0; - - case SD_PATH_SYSCTL: -- *ret = ROOTPREFIX_NOSLASH "/lib/sysctl.d"; -+ *ret = "/usr/lib/sysctl.d"; - return 0; - - case SD_PATH_BINFMT: -- *ret = ROOTPREFIX_NOSLASH "/lib/binfmt.d"; -+ *ret = "/usr/lib/binfmt.d"; - return 0; - - case SD_PATH_MODULES_LOAD: -- *ret = ROOTPREFIX_NOSLASH "/lib/modules-load.d"; -+ *ret = "/usr/lib/modules-load.d"; - return 0; - - case SD_PATH_CATALOG: --- -2.39.2 - diff --git a/meta-openeuler/recipes-core/systemd/systemd/0012-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch b/meta-openeuler/recipes-core/systemd/systemd/0004-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch similarity index 90% rename from meta-openeuler/recipes-core/systemd/systemd/0012-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch rename to meta-openeuler/recipes-core/systemd/systemd/0004-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch index b86cc42589dc0a5249566cd152bd13893e933fcb..a98716a1a0b6db1a4e5af14e53852648d3b95a99 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0012-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0004-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch @@ -1,7 +1,8 @@ -From 747ff78ecda6afe01c7eab4d7c27aea6af810c86 Mon Sep 17 00:00:00 2001 +From 5325ab5813617f35f03806ec420829dde7104387 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Mon, 25 Feb 2019 14:56:21 +0800 -Subject: [PATCH] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not defined +Subject: [PATCH 04/22] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not + defined If the standard library doesn't provide brace expansion users just won't get it. @@ -23,7 +24,7 @@ Signed-off-by: Scott Murray 3 files changed, 38 insertions(+) diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c -index fd60a6eda2..c73edc41ea 100644 +index 802ca8c655..23818a67c6 100644 --- a/src/basic/glob-util.c +++ b/src/basic/glob-util.c @@ -12,6 +12,12 @@ @@ -114,7 +115,7 @@ index 9b3e73cce0..3790ba3be5 100644 (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c -index 458aed7054..2cf24b38c0 100644 +index 230ec09b97..2cc5f391d7 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -73,6 +73,12 @@ @@ -130,9 +131,9 @@ index 458aed7054..2cf24b38c0 100644 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates * them in the file system. This is intended to be used to create * properly owned directories beneath /tmp, /var/tmp, /run, which are -@@ -2194,7 +2200,9 @@ finish: +@@ -2434,7 +2440,9 @@ finish: - static int glob_item(Item *i, action_t action) { + static int glob_item(Context *c, Item *i, action_t action) { _cleanup_globfree_ glob_t g = { +#ifdef GLOB_ALTDIRFUNC .gl_opendir = (void *(*)(const char *)) opendir_nomod, @@ -140,9 +141,9 @@ index 458aed7054..2cf24b38c0 100644 }; int r = 0, k; -@@ -2214,7 +2222,9 @@ static int glob_item(Item *i, action_t action) { +@@ -2461,7 +2469,9 @@ static int glob_item_recursively( + fdaction_t action) { - static int glob_item_recursively(Item *i, fdaction_t action) { _cleanup_globfree_ glob_t g = { +#ifdef GLOB_ALTDIRFUNC .gl_opendir = (void *(*)(const char *)) opendir_nomod, @@ -151,5 +152,4 @@ index 458aed7054..2cf24b38c0 100644 int r = 0, k; -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0013-add-missing-FTW_-macros-for-musl.patch b/meta-openeuler/recipes-core/systemd/systemd/0005-add-missing-FTW_-macros-for-musl.patch similarity index 84% rename from meta-openeuler/recipes-core/systemd/systemd/0013-add-missing-FTW_-macros-for-musl.patch rename to meta-openeuler/recipes-core/systemd/systemd/0005-add-missing-FTW_-macros-for-musl.patch index d6aaadc006f5802b0a97f95e1326cea0473336bb..73bba29cdbb889e274104e6b9d2ec47d38f9103c 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0013-add-missing-FTW_-macros-for-musl.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0005-add-missing-FTW_-macros-for-musl.patch @@ -1,7 +1,7 @@ -From efd7b41cf270c7b07ee3b9aec0fedd8e52dd422f Mon Sep 17 00:00:00 2001 +From dad7f897c0de654fa5592fda3e90f874639849f9 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Mon, 25 Feb 2019 15:00:06 +0800 -Subject: [PATCH] add missing FTW_ macros for musl +Subject: [PATCH 05/22] add missing FTW_ macros for musl This is to avoid build failures like below for musl. @@ -28,10 +28,10 @@ index 6c0456349d..73a5b90e3c 100644 +#define FTW_CONTINUE 0 +#endif diff --git a/src/test/test-recurse-dir.c b/src/test/test-recurse-dir.c -index 2c2120b136..bc60a178a2 100644 +index 8684d064ec..70fc2b5376 100644 --- a/src/test/test-recurse-dir.c +++ b/src/test/test-recurse-dir.c -@@ -6,6 +6,7 @@ +@@ -8,6 +8,7 @@ #include "recurse-dir.h" #include "strv.h" #include "tests.h" @@ -40,5 +40,4 @@ index 2c2120b136..bc60a178a2 100644 static char **list_nftw = NULL; -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0014-Use-uintmax_t-for-handling-rlim_t.patch b/meta-openeuler/recipes-core/systemd/systemd/0006-Use-uintmax_t-for-handling-rlim_t.patch similarity index 91% rename from meta-openeuler/recipes-core/systemd/systemd/0014-Use-uintmax_t-for-handling-rlim_t.patch rename to meta-openeuler/recipes-core/systemd/systemd/0006-Use-uintmax_t-for-handling-rlim_t.patch index f586d3ff5273613ecafc008a804f128f2e680e82..5bf2547ff84d5a05fc68d068d396c1eef9d7d69d 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0014-Use-uintmax_t-for-handling-rlim_t.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0006-Use-uintmax_t-for-handling-rlim_t.patch @@ -1,7 +1,7 @@ -From 60f7d2c62bc3718023df93c01688d3ee1625d64d Mon Sep 17 00:00:00 2001 +From 96e975a2412a20e5f80bd3ab144057d275eb8597 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Mon, 25 Feb 2019 15:12:41 +0800 -Subject: [PATCH] Use uintmax_t for handling rlim_t +Subject: [PATCH 06/22] Use uintmax_t for handling rlim_t PRIu{32,64} is not right format to represent rlim_t type therefore use %ju and typecast the rlim_t variables to @@ -46,7 +46,7 @@ index 8719df3e29..9becc96066 100644 #if SIZEOF_DEV_T == 8 # define DEV_FMT "%" PRIu64 diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c -index 33dfde9d6c..e018fd81fd 100644 +index c1f0b2b974..61c5412582 100644 --- a/src/basic/rlimit-util.c +++ b/src/basic/rlimit-util.c @@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) { @@ -76,9 +76,9 @@ index 33dfde9d6c..e018fd81fd 100644 if (r < 0) return -ENOMEM; -@@ -403,7 +403,7 @@ int rlimit_nofile_safe(void) { - - rl.rlim_cur = FD_SETSIZE; +@@ -422,7 +422,7 @@ int rlimit_nofile_safe(void) { + rl.rlim_max = MIN(rl.rlim_max, (rlim_t) read_nr_open()); + rl.rlim_cur = MIN((rlim_t) FD_SETSIZE, rl.rlim_max); if (setrlimit(RLIMIT_NOFILE, &rl) < 0) - return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", rl.rlim_cur); + return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", (uintmax_t)rl.rlim_cur); @@ -86,10 +86,10 @@ index 33dfde9d6c..e018fd81fd 100644 return 1; } diff --git a/src/core/execute.c b/src/core/execute.c -index 8ef76de9ab..ea1c203e43 100644 +index bd3da0c401..df1870fd2f 100644 --- a/src/core/execute.c +++ b/src/core/execute.c -@@ -6034,9 +6034,9 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) { +@@ -1045,9 +1045,9 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) { for (unsigned i = 0; i < RLIM_NLIMITS; i++) if (c->rlimit[i]) { fprintf(f, "%sLimit%s: " RLIM_FMT "\n", @@ -102,5 +102,4 @@ index 8ef76de9ab..ea1c203e43 100644 if (c->ioprio_set) { -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0016-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch b/meta-openeuler/recipes-core/systemd/systemd/0007-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch similarity index 84% rename from meta-openeuler/recipes-core/systemd/systemd/0016-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch rename to meta-openeuler/recipes-core/systemd/systemd/0007-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch index 2f84d3d6c2536401f46f250b0ddb29451cafbf7e..119200702f844e8d3156d55287acc64bd7b438d6 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0016-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0007-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch @@ -1,7 +1,7 @@ -From 26b02348e39fe72b73dd61bba8a0cefb0352717d Mon Sep 17 00:00:00 2001 +From 4842cff4f1329f0b5034b529d56f8ad1f234ac4c Mon Sep 17 00:00:00 2001 From: Andre McCurdy Date: Tue, 10 Oct 2017 14:33:30 -0700 -Subject: [PATCH] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat() +Subject: [PATCH 07/22] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat() Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right thing to do and it's not portable (not supported by musl). See: @@ -31,10 +31,10 @@ Signed-off-by: Andre McCurdy 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h -index 932d003f19..33215dbf5f 100644 +index 1023ab73ca..c78ff6f27f 100644 --- a/src/basic/fs-util.h +++ b/src/basic/fs-util.h -@@ -50,8 +50,27 @@ int futimens_opath(int fd, const struct timespec ts[2]); +@@ -49,8 +49,27 @@ int futimens_opath(int fd, const struct timespec ts[2]); int fd_warn_permissions(const char *path, int fd); int stat_warn_permissions(const char *path, const struct stat *st); @@ -64,19 +64,19 @@ index 932d003f19..33215dbf5f 100644 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode); diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c -index be6dd1654a..2726dc946a 100644 +index 569ef466c3..7ae921a113 100644 --- a/src/shared/base-filesystem.c +++ b/src/shared/base-filesystem.c -@@ -131,7 +131,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { - return log_error_errno(errno, "Failed to open root file system: %m"); +@@ -145,7 +145,7 @@ int base_filesystem_create_fd(int fd, const char *root, uid_t uid, gid_t gid) { + /* The "root" parameter is decoration only – it's only used as part of log messages */ for (size_t i = 0; i < ELEMENTSOF(table); i++) { - if (faccessat(fd, table[i].dir, F_OK, AT_SYMLINK_NOFOLLOW) >= 0) + if (faccessat(fd, table[i].dir, F_OK, 0) >= 0) continue; - if (table[i].target) { -@@ -139,7 +139,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { + if (table[i].target) { /* Create as symlink? */ +@@ -153,7 +153,7 @@ int base_filesystem_create_fd(int fd, const char *root, uid_t uid, gid_t gid) { /* check if one of the targets exists */ NULSTR_FOREACH(s, table[i].target) { @@ -85,7 +85,7 @@ index be6dd1654a..2726dc946a 100644 continue; /* check if a specific file exists at the target path */ -@@ -150,7 +150,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { +@@ -164,7 +164,7 @@ int base_filesystem_create_fd(int fd, const char *root, uid_t uid, gid_t gid) { if (!p) return log_oom(); @@ -95,5 +95,4 @@ index be6dd1654a..2726dc946a 100644 } -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0017-Define-glibc-compatible-basename-for-non-glibc-syste.patch b/meta-openeuler/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch similarity index 37% rename from meta-openeuler/recipes-core/systemd/systemd/0017-Define-glibc-compatible-basename-for-non-glibc-syste.patch rename to meta-openeuler/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch index 7d74cfcc24501406f13aa271f141782c2da68410..5af934b6870be0ee471c1bca6423e97c94621a8a 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0017-Define-glibc-compatible-basename-for-non-glibc-syste.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch @@ -1,7 +1,8 @@ -From fdc7fb940bb41020271b9db41d5608004efdbde5 Mon Sep 17 00:00:00 2001 +From bab07e779ff23d5593bb118efaaa31b60a6dce87 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 27 May 2018 08:36:44 -0700 -Subject: [PATCH] Define glibc compatible basename() for non-glibc systems +Subject: [PATCH 08/22] Define glibc compatible basename() for non-glibc + systems Fixes builds with musl, even though systemd is adamant about using non-posix basename implementation, we have a way out @@ -10,25 +11,23 @@ Upstream-Status: Inappropriate [musl specific] Signed-off-by: Khem Raj --- - src/machine/machine-dbus.c | 5 +++++ - 1 file changed, 5 insertions(+) + src/basic/string-util.h | 4 ++++ + 1 file changed, 4 insertions(+) -diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c -index 45bc056326..aee51d5da5 100644 ---- a/src/machine/machine-dbus.c -+++ b/src/machine/machine-dbus.c -@@ -4,6 +4,11 @@ - #include - #include +diff --git a/src/basic/string-util.h b/src/basic/string-util.h +index b6d8be3083..0a29036c4c 100644 +--- a/src/basic/string-util.h ++++ b/src/basic/string-util.h +@@ -26,6 +26,10 @@ + #define URI_UNRESERVED ALPHANUMERICAL "-._~" /* [RFC3986] */ + #define URI_VALID URI_RESERVED URI_UNRESERVED /* [RFC3986] */ +#if !defined(__GLIBC__) -+#include +#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src) +#endif + - #include "alloc-util.h" - #include "bus-common-errors.h" - #include "bus-get-properties.h" + static inline char* strstr_ptr(const char *haystack, const char *needle) { + if (!haystack || !needle) + return NULL; -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0008-implment-systemd-sysv-install-for-OE.patch b/meta-openeuler/recipes-core/systemd/systemd/0008-implment-systemd-sysv-install-for-OE.patch index acff18dc4346c95a6f4e1c812bf1bff6246d7966..de2f190a5e88b81ac70c926cc37a5f8e5c756128 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0008-implment-systemd-sysv-install-for-OE.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0008-implment-systemd-sysv-install-for-OE.patch @@ -40,4 +40,3 @@ index cb58d8243b..000bdf6165 100755 usage ;; -- 2.39.2 - diff --git a/meta-openeuler/recipes-core/systemd/systemd/0018-Do-not-disable-buffering-when-writing-to-oom_score_a.patch b/meta-openeuler/recipes-core/systemd/systemd/0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch similarity index 82% rename from meta-openeuler/recipes-core/systemd/systemd/0018-Do-not-disable-buffering-when-writing-to-oom_score_a.patch rename to meta-openeuler/recipes-core/systemd/systemd/0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch index 401a9a9546c54423f8c1fefc8f537e6ab33aa3ae..aab2f71e4426f5e25423d74415a1531c588c174c 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0018-Do-not-disable-buffering-when-writing-to-oom_score_a.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch @@ -1,7 +1,7 @@ -From 32fd0dc67b6df531f0769dbb099dbe8f30c28514 Mon Sep 17 00:00:00 2001 +From 25093c5017725b8577c444dfea0f42ad85b43522 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Wed, 4 Jul 2018 15:00:44 +0800 -Subject: [PATCH] Do not disable buffering when writing to oom_score_adj +Subject: [PATCH 09/22] Do not disable buffering when writing to oom_score_adj On musl, disabling buffering when writing to oom_score_adj will cause the following error. @@ -24,10 +24,10 @@ Signed-off-by: Scott Murray 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/process-util.c b/src/basic/process-util.c -index 0747c14c1c..8d0c5aae92 100644 +index 201c5596ae..ea51595b6c 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c -@@ -1405,7 +1405,7 @@ int set_oom_score_adjust(int value) { +@@ -1716,7 +1716,7 @@ int set_oom_score_adjust(int value) { xsprintf(t, "%i", value); return write_string_file("/proc/self/oom_score_adj", t, @@ -37,5 +37,4 @@ index 0747c14c1c..8d0c5aae92 100644 int get_oom_score_adjust(int *ret) { -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0019-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch b/meta-openeuler/recipes-core/systemd/systemd/0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch similarity index 89% rename from meta-openeuler/recipes-core/systemd/systemd/0019-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch rename to meta-openeuler/recipes-core/systemd/systemd/0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch index 48b8eda0a5e4f624da7f498ebf05223e185fae60..41d737cb971561f659f056d097ba4fefb515e507 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0019-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch @@ -1,7 +1,7 @@ -From ed46afcbc6bc1f6277a0a54c3db8cf1b056bca1e Mon Sep 17 00:00:00 2001 +From 2adbe9773cd65c48eec9df96868d4a738927c8d9 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Tue, 10 Jul 2018 15:40:17 +0800 -Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi +Subject: [PATCH 10/22] distinguish XSI-compliant strerror_r from GNU-specifi strerror_r XSI-compliant strerror_r and GNU-specifi strerror_r are different. @@ -24,7 +24,7 @@ Signed-off-by: Chen Qi 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c -index 413e2dd43f..805e5da0c0 100644 +index 77b2e1a0fd..fdba0e0142 100644 --- a/src/libsystemd/sd-bus/bus-error.c +++ b/src/libsystemd/sd-bus/bus-error.c @@ -408,7 +408,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) { @@ -55,10 +55,10 @@ index 413e2dd43f..805e5da0c0 100644 static bool map_ok(const sd_bus_error_map *map) { diff --git a/src/libsystemd/sd-journal/journal-send.c b/src/libsystemd/sd-journal/journal-send.c -index 136ebcb153..8a75ba4ecd 100644 +index 69a2eb6404..1561859650 100644 --- a/src/libsystemd/sd-journal/journal-send.c +++ b/src/libsystemd/sd-journal/journal-send.c -@@ -381,7 +381,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove +@@ -361,7 +361,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove char* j; errno = 0; @@ -72,5 +72,4 @@ index 136ebcb153..8a75ba4ecd 100644 char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1]; -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0020-avoid-redefinition-of-prctl_mm_map-structure.patch b/meta-openeuler/recipes-core/systemd/systemd/0011-avoid-redefinition-of-prctl_mm_map-structure.patch similarity index 79% rename from meta-openeuler/recipes-core/systemd/systemd/0020-avoid-redefinition-of-prctl_mm_map-structure.patch rename to meta-openeuler/recipes-core/systemd/systemd/0011-avoid-redefinition-of-prctl_mm_map-structure.patch index e5f017347c023b48122aed5819eadd2966faee55..bb0438ee05ca49f895051e08a41b67d07b3c84c6 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0020-avoid-redefinition-of-prctl_mm_map-structure.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0011-avoid-redefinition-of-prctl_mm_map-structure.patch @@ -1,7 +1,7 @@ -From 277b680d07a178b8278862b60417052d05c1376f Mon Sep 17 00:00:00 2001 +From 49c446cfb78cf74a909bed8c3798b77a5469866a Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Mon, 25 Feb 2019 15:44:54 +0800 -Subject: [PATCH] avoid redefinition of prctl_mm_map structure +Subject: [PATCH 11/22] avoid redefinition of prctl_mm_map structure Fix the following compile failure: error: redefinition of 'struct prctl_mm_map' @@ -14,7 +14,7 @@ Signed-off-by: Chen Qi 1 file changed, 2 insertions(+) diff --git a/src/basic/missing_prctl.h b/src/basic/missing_prctl.h -index ab851306ba..5547cad875 100644 +index 7d9e395c92..88c2d7dfac 100644 --- a/src/basic/missing_prctl.h +++ b/src/basic/missing_prctl.h @@ -1,7 +1,9 @@ @@ -28,5 +28,4 @@ index ab851306ba..5547cad875 100644 /* 58319057b7847667f0c9585b9de0e8932b0fdb08 (4.3) */ #ifndef PR_CAP_AMBIENT -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0021-do-not-disable-buffer-in-writing-files.patch b/meta-openeuler/recipes-core/systemd/systemd/0012-do-not-disable-buffer-in-writing-files.patch similarity index 56% rename from meta-openeuler/recipes-core/systemd/systemd/0021-do-not-disable-buffer-in-writing-files.patch rename to meta-openeuler/recipes-core/systemd/systemd/0012-do-not-disable-buffer-in-writing-files.patch index 46267a5ada95b34cb1a171057bf9b9189698526a..c3f798b54c855dfa5340bb3e54f8a7b83370c72c 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0021-do-not-disable-buffer-in-writing-files.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0012-do-not-disable-buffer-in-writing-files.patch @@ -1,7 +1,7 @@ -From aa6e5588e6d01c12e2f101d140cc710ab199df16 Mon Sep 17 00:00:00 2001 +From e4885a8e60f883d9217e26e1db3754c2906aca31 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Fri, 1 Mar 2019 15:22:15 +0800 -Subject: [PATCH] do not disable buffer in writing files +Subject: [PATCH 12/22] do not disable buffer in writing files Do not disable buffer in writing files, otherwise we get failure at boot for musl like below. @@ -18,34 +18,39 @@ Signed-off-by: Chen Qi Signed-off-by: Andrej Valek [rebased for systemd 243] Signed-off-by: Scott Murray +[rebased for systemd 254] +Signed-off-by: Chen Qi +[rebased for systemd 255.1] --- - src/basic/cgroup-util.c | 12 ++++++------ - src/basic/namespace-util.c | 4 ++-- - src/basic/procfs-util.c | 4 ++-- - src/basic/sysctl-util.c | 2 +- - src/binfmt/binfmt.c | 6 +++--- - src/core/cgroup.c | 2 +- - src/core/main.c | 2 +- - src/core/smack-setup.c | 8 ++++---- - src/hibernate-resume/hibernate-resume.c | 2 +- - src/home/homework.c | 2 +- - src/libsystemd/sd-device/sd-device.c | 2 +- - src/nspawn/nspawn-cgroup.c | 2 +- - src/nspawn/nspawn.c | 6 +++--- - src/shared/binfmt-util.c | 2 +- - src/shared/cgroup-setup.c | 4 ++-- - src/shared/coredump-util.c | 2 +- - src/shared/smack-util.c | 2 +- - src/sleep/sleep.c | 8 ++++---- - src/udev/udev-rules.c | 1 - - src/vconsole/vconsole-setup.c | 2 +- - 20 files changed, 37 insertions(+), 38 deletions(-) + src/basic/cgroup-util.c | 12 ++++++------ + src/basic/namespace-util.c | 4 ++-- + src/basic/procfs-util.c | 4 ++-- + src/basic/sysctl-util.c | 2 +- + src/binfmt/binfmt.c | 6 +++--- + src/core/cgroup.c | 2 +- + src/core/main.c | 2 +- + src/core/smack-setup.c | 8 ++++---- + src/home/homework.c | 2 +- + src/libsystemd/sd-device/sd-device.c | 2 +- + src/nspawn/nspawn-cgroup.c | 2 +- + src/nspawn/nspawn.c | 6 +++--- + src/shared/binfmt-util.c | 2 +- + src/shared/cgroup-setup.c | 4 ++-- + src/shared/coredump-util.c | 4 ++-- + src/shared/hibernate-util.c | 4 ++-- + src/shared/smack-util.c | 2 +- + src/shared/watchdog.c | 2 +- + src/sleep/sleep.c | 4 ++-- + src/storagetm/storagetm.c | 24 ++++++++++++------------ + src/udev/udev-rules.c | 1 - + src/vconsole/vconsole-setup.c | 2 +- + 22 files changed, 50 insertions(+), 51 deletions(-) diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c -index 11b4375ed5..7d81a6007f 100644 +index d2be79622f..e65fecb68d 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c -@@ -399,7 +399,7 @@ int cg_kill_kernel_sigkill(const char *controller, const char *path) { +@@ -417,7 +417,7 @@ int cg_kill_kernel_sigkill(const char *path) { if (r < 0) return r; @@ -54,7 +59,7 @@ index 11b4375ed5..7d81a6007f 100644 if (r < 0) return r; -@@ -805,7 +805,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { +@@ -843,7 +843,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { sc = strstrip(contents); if (isempty(sc)) { @@ -63,7 +68,7 @@ index 11b4375ed5..7d81a6007f 100644 if (r < 0) return r; } else if (!path_equal(sc, agent)) -@@ -823,7 +823,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { +@@ -861,7 +861,7 @@ int cg_install_release_agent(const char *controller, const char *agent) { sc = strstrip(contents); if (streq(sc, "0")) { @@ -72,7 +77,7 @@ index 11b4375ed5..7d81a6007f 100644 if (r < 0) return r; -@@ -850,7 +850,7 @@ int cg_uninstall_release_agent(const char *controller) { +@@ -888,7 +888,7 @@ int cg_uninstall_release_agent(const char *controller) { if (r < 0) return r; @@ -81,7 +86,7 @@ index 11b4375ed5..7d81a6007f 100644 if (r < 0) return r; -@@ -860,7 +860,7 @@ int cg_uninstall_release_agent(const char *controller) { +@@ -898,7 +898,7 @@ int cg_uninstall_release_agent(const char *controller) { if (r < 0) return r; @@ -90,7 +95,7 @@ index 11b4375ed5..7d81a6007f 100644 if (r < 0) return r; -@@ -1752,7 +1752,7 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri +@@ -1814,7 +1814,7 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri if (r < 0) return r; @@ -100,10 +105,10 @@ index 11b4375ed5..7d81a6007f 100644 int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) { diff --git a/src/basic/namespace-util.c b/src/basic/namespace-util.c -index f5c0e04cec..272b920022 100644 +index 2101f617ad..63817bae17 100644 --- a/src/basic/namespace-util.c +++ b/src/basic/namespace-util.c -@@ -220,12 +220,12 @@ int userns_acquire(const char *uid_map, const char *gid_map) { +@@ -227,12 +227,12 @@ int userns_acquire(const char *uid_map, const char *gid_map) { freeze(); xsprintf(path, "/proc/" PID_FMT "/uid_map", pid); @@ -119,7 +124,7 @@ index f5c0e04cec..272b920022 100644 return log_error_errno(r, "Failed to write GID map: %m"); diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c -index 64a95dd866..12cd16db1c 100644 +index 6cb0ddf575..247cf9e1d1 100644 --- a/src/basic/procfs-util.c +++ b/src/basic/procfs-util.c @@ -64,13 +64,13 @@ int procfs_tasks_set_limit(uint64_t limit) { @@ -152,7 +157,7 @@ index b66a6622ae..8d1c93008a 100644 int sysctl_writef(const char *property, const char *format, ...) { diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c -index e1ddf97914..df6e156f19 100644 +index d21f3f79ff..258607cc7e 100644 --- a/src/binfmt/binfmt.c +++ b/src/binfmt/binfmt.c @@ -30,7 +30,7 @@ static bool arg_unregister = false; @@ -173,7 +178,7 @@ index e1ddf97914..df6e156f19 100644 if (r < 0) return log_error_errno(r, "%s:%u: Failed to add binary format '%s': %m", filename, line, rulename); -@@ -244,7 +244,7 @@ static int run(int argc, char *argv[]) { +@@ -248,7 +248,7 @@ static int run(int argc, char *argv[]) { return r; /* Flush out all rules */ @@ -183,10 +188,10 @@ index e1ddf97914..df6e156f19 100644 log_warning_errno(r, "Failed to flush binfmt_misc rules, ignoring: %m"); else diff --git a/src/core/cgroup.c b/src/core/cgroup.c -index 4cac3f6a89..bebe2cd120 100644 +index 61ac4df1a6..ea18970196 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c -@@ -4267,7 +4267,7 @@ int unit_cgroup_freezer_action(Unit *u, FreezerAction action) { +@@ -4578,7 +4578,7 @@ int unit_cgroup_freezer_action(Unit *u, FreezerAction action) { u->freezer_state = FREEZER_THAWING; } @@ -196,10 +201,10 @@ index 4cac3f6a89..bebe2cd120 100644 return r; diff --git a/src/core/main.c b/src/core/main.c -index c0b8126d96..fe676320ba 100644 +index 3f71cc0947..0e5aec3e9e 100644 --- a/src/core/main.c +++ b/src/core/main.c -@@ -1716,7 +1716,7 @@ static void initialize_core_pattern(bool skip_setup) { +@@ -1678,7 +1678,7 @@ static void initialize_core_pattern(bool skip_setup) { if (getpid_cached() != 1) return; @@ -209,10 +214,10 @@ index c0b8126d96..fe676320ba 100644 log_warning_errno(r, "Failed to write '%s' to /proc/sys/kernel/core_pattern, ignoring: %m", arg_early_core_pattern); diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c -index bcaa237c8d..4032bde19e 100644 +index 7ea902b6f9..1aef2988d0 100644 --- a/src/core/smack-setup.c +++ b/src/core/smack-setup.c -@@ -319,17 +319,17 @@ int mac_smack_setup(bool *loaded_policy) { +@@ -321,17 +321,17 @@ int mac_smack_setup(bool *loaded_policy) { } #if HAVE_SMACK_RUN_LABEL @@ -234,21 +239,8 @@ index bcaa237c8d..4032bde19e 100644 if (r < 0) log_warning_errno(r, "Failed to set SMACK netlabel rule \"127.0.0.1 -CIPSO\": %m"); #endif -diff --git a/src/hibernate-resume/hibernate-resume.c b/src/hibernate-resume/hibernate-resume.c -index 9a9df5d22f..75ddec881a 100644 ---- a/src/hibernate-resume/hibernate-resume.c -+++ b/src/hibernate-resume/hibernate-resume.c -@@ -40,7 +40,7 @@ int main(int argc, char *argv[]) { - return EXIT_FAILURE; - } - -- r = write_string_file("/sys/power/resume", FORMAT_DEVNUM(st.st_rdev), WRITE_STRING_FILE_DISABLE_BUFFER); -+ r = write_string_file("/sys/power/resume", FORMAT_DEVNUM(st.st_rdev), 0); - if (r < 0) { - log_error_errno(r, "Failed to write '" DEVNUM_FORMAT_STR "' to /sys/power/resume: %m", DEVNUM_FORMAT_VAL(st.st_rdev)); - return EXIT_FAILURE; diff --git a/src/home/homework.c b/src/home/homework.c -index 28907386a4..f9e45349a7 100644 +index 066483e342..5f92dd7064 100644 --- a/src/home/homework.c +++ b/src/home/homework.c @@ -278,7 +278,7 @@ static void drop_caches_now(void) { @@ -261,10 +253,10 @@ index 28907386a4..f9e45349a7 100644 log_warning_errno(r, "Failed to drop caches, ignoring: %m"); else diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c -index 8c65ee3469..153edab081 100644 +index 2fbc619a34..09d9591e37 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c -@@ -2481,7 +2481,7 @@ _public_ int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, +@@ -2516,7 +2516,7 @@ _public_ int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, if (!value) return -ENOMEM; @@ -274,10 +266,10 @@ index 8c65ee3469..153edab081 100644 /* On failure, clear cache entry, as we do not know how it fails. */ device_remove_cached_sysattr_value(device, sysattr); diff --git a/src/nspawn/nspawn-cgroup.c b/src/nspawn/nspawn-cgroup.c -index 0deb4ebb30..bae8eead9e 100644 +index a5002437c6..b12e6cd9c9 100644 --- a/src/nspawn/nspawn-cgroup.c +++ b/src/nspawn/nspawn-cgroup.c -@@ -122,7 +122,7 @@ int sync_cgroup(pid_t pid, CGroupUnified unified_requested, uid_t uid_shift) { +@@ -124,7 +124,7 @@ int sync_cgroup(pid_t pid, CGroupUnified unified_requested, uid_t uid_shift) { fn = strjoina(tree, cgroup, "/cgroup.procs"); sprintf(pid_string, PID_FMT, pid); @@ -287,10 +279,10 @@ index 0deb4ebb30..bae8eead9e 100644 log_error_errno(r, "Failed to move process: %m"); goto finish; diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c -index 36d336dfc8..8c5c69596b 100644 +index 6ab604d3dc..bbec6b686c 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c -@@ -2771,7 +2771,7 @@ static int reset_audit_loginuid(void) { +@@ -2688,7 +2688,7 @@ static int reset_audit_loginuid(void) { if (streq(p, "4294967295")) return 0; @@ -299,7 +291,7 @@ index 36d336dfc8..8c5c69596b 100644 if (r < 0) { log_error_errno(r, "Failed to reset audit login UID. This probably means that your kernel is too\n" -@@ -4211,7 +4211,7 @@ static int setup_uid_map( +@@ -4141,7 +4141,7 @@ static int setup_uid_map( return log_oom(); xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid); @@ -308,7 +300,7 @@ index 36d336dfc8..8c5c69596b 100644 if (r < 0) return log_error_errno(r, "Failed to write UID map: %m"); -@@ -4221,7 +4221,7 @@ static int setup_uid_map( +@@ -4151,7 +4151,7 @@ static int setup_uid_map( return log_oom(); xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid); @@ -331,19 +323,19 @@ index a26175474b..1413a9c72c 100644 return log_warning_errno(r, "Failed to unregister binfmt_misc entries: %m"); diff --git a/src/shared/cgroup-setup.c b/src/shared/cgroup-setup.c -index 2ea83f05d3..8626bb184c 100644 +index 934a16eaf3..c921ced861 100644 --- a/src/shared/cgroup-setup.c +++ b/src/shared/cgroup-setup.c -@@ -350,7 +350,7 @@ int cg_attach(const char *controller, const char *path, pid_t pid) { +@@ -351,7 +351,7 @@ int cg_attach(const char *controller, const char *path, pid_t pid) { xsprintf(c, PID_FMT "\n", pid); - r = write_string_file(fs, c, WRITE_STRING_FILE_DISABLE_BUFFER); + r = write_string_file(fs, c, 0); - if (r == -EOPNOTSUPP && cg_is_threaded(controller, path) > 0) + if (r == -EOPNOTSUPP && cg_is_threaded(path) > 0) /* When the threaded mode is used, we cannot read/write the file. Let's return recognizable error. */ return -EUCLEAN; -@@ -887,7 +887,7 @@ int cg_enable_everywhere( +@@ -966,7 +966,7 @@ int cg_enable_everywhere( return log_debug_errno(errno, "Failed to open cgroup.subtree_control file of %s: %m", p); } @@ -353,11 +345,11 @@ index 2ea83f05d3..8626bb184c 100644 log_debug_errno(r, "Failed to %s controller %s for %s (%s): %m", FLAGS_SET(mask, bit) ? "enable" : "disable", n, p, fs); diff --git a/src/shared/coredump-util.c b/src/shared/coredump-util.c -index 3d2f179049..c1b6c170ac 100644 +index 805503f366..01a7ccb291 100644 --- a/src/shared/coredump-util.c +++ b/src/shared/coredump-util.c -@@ -71,7 +71,7 @@ int set_coredump_filter(uint64_t value) { - sprintf(t, "0x%"PRIx64, value); +@@ -163,7 +163,7 @@ int set_coredump_filter(uint64_t value) { + xsprintf(t, "0x%"PRIx64, value); return write_string_file("/proc/self/coredump_filter", t, - WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER); @@ -365,11 +357,42 @@ index 3d2f179049..c1b6c170ac 100644 } /* Turn off core dumps but only if we're running outside of a container. */ +@@ -173,7 +173,7 @@ void disable_coredumps(void) { + if (detect_container() > 0) + return; + +- r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0); + if (r < 0) + log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m"); + } +diff --git a/src/shared/hibernate-util.c b/src/shared/hibernate-util.c +index 3eb13d48f6..d09b901be1 100644 +--- a/src/shared/hibernate-util.c ++++ b/src/shared/hibernate-util.c +@@ -481,7 +481,7 @@ int write_resume_config(dev_t devno, uint64_t offset, const char *device) { + + /* We write the offset first since it's safer. Note that this file is only available in 4.17+, so + * fail gracefully if it doesn't exist and we're only overwriting it with 0. */ +- r = write_string_file("/sys/power/resume_offset", offset_str, WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file("/sys/power/resume_offset", offset_str, 0); + if (r == -ENOENT) { + if (offset != 0) + return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), +@@ -497,7 +497,7 @@ int write_resume_config(dev_t devno, uint64_t offset, const char *device) { + log_debug("Wrote resume_offset=%s for device '%s' to /sys/power/resume_offset.", + offset_str, device); + +- r = write_string_file("/sys/power/resume", devno_str, WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file("/sys/power/resume", devno_str, 0); + if (r < 0) + return log_error_errno(r, + "Failed to write device '%s' (%s) to /sys/power/resume: %m", diff --git a/src/shared/smack-util.c b/src/shared/smack-util.c -index b3b5c905ad..bbfa1973fd 100644 +index 1f88e724d0..feb18b320a 100644 --- a/src/shared/smack-util.c +++ b/src/shared/smack-util.c -@@ -115,7 +115,7 @@ int mac_smack_apply_pid(pid_t pid, const char *label) { +@@ -113,7 +113,7 @@ int mac_smack_apply_pid(pid_t pid, const char *label) { return 0; p = procfs_file_alloca(pid, "attr/current"); @@ -378,52 +401,143 @@ index b3b5c905ad..bbfa1973fd 100644 if (r < 0) return r; -diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c -index 765dd4974f..cd6afb001b 100644 ---- a/src/sleep/sleep.c -+++ b/src/sleep/sleep.c -@@ -50,7 +50,7 @@ static int write_hibernate_location_info(const HibernateLocation *hibernate_loca - assert(hibernate_location->swap); +diff --git a/src/shared/watchdog.c b/src/shared/watchdog.c +index 4c1a968718..6faf6806a5 100644 +--- a/src/shared/watchdog.c ++++ b/src/shared/watchdog.c +@@ -93,7 +93,7 @@ static int set_pretimeout_governor(const char *governor) { - xsprintf(resume_str, "%u:%u", major(hibernate_location->devno), minor(hibernate_location->devno)); -- r = write_string_file("/sys/power/resume", resume_str, WRITE_STRING_FILE_DISABLE_BUFFER); -+ r = write_string_file("/sys/power/resume", resume_str, 0); + r = write_string_file(sys_fn, + governor, +- WRITE_STRING_FILE_DISABLE_BUFFER | WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE); ++ WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE); if (r < 0) - return log_debug_errno(r, "Failed to write partition device to /sys/power/resume for '%s': '%s': %m", - hibernate_location->swap->device, resume_str); -@@ -77,7 +77,7 @@ static int write_hibernate_location_info(const HibernateLocation *hibernate_loca - } + return log_error_errno(r, "Failed to set pretimeout_governor to '%s': %m", governor); - xsprintf(offset_str, "%" PRIu64, hibernate_location->offset); -- r = write_string_file("/sys/power/resume_offset", offset_str, WRITE_STRING_FILE_DISABLE_BUFFER); -+ r = write_string_file("/sys/power/resume_offset", offset_str, 0); - if (r < 0) - return log_debug_errno(r, "Failed to write swap file offset to /sys/power/resume_offset for '%s': '%s': %m", - hibernate_location->swap->device, offset_str); -@@ -93,7 +93,7 @@ static int write_mode(char **modes) { +diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c +index 21af3e9e52..6d4b84b5d5 100644 +--- a/src/sleep/sleep.c ++++ b/src/sleep/sleep.c +@@ -137,7 +137,7 @@ static int write_state(int fd, char * const *states) { + if (k < 0) + return RET_GATHER(r, k); + +- k = write_string_stream(f, *state, WRITE_STRING_FILE_DISABLE_BUFFER); ++ k = write_string_stream(f, *state, 0); + if (k >= 0) { + log_debug("Using sleep state '%s'.", *state); + return 0; +@@ -155,7 +155,7 @@ static int write_mode(char * const *modes) { STRV_FOREACH(mode, modes) { int k; - k = write_string_file("/sys/power/disk", *mode, WRITE_STRING_FILE_DISABLE_BUFFER); + k = write_string_file("/sys/power/disk", *mode, 0); - if (k >= 0) + if (k >= 0) { + log_debug("Using sleep disk mode '%s'.", *mode); return 0; +diff --git a/src/storagetm/storagetm.c b/src/storagetm/storagetm.c +index ae63baaf79..82eeca479a 100644 +--- a/src/storagetm/storagetm.c ++++ b/src/storagetm/storagetm.c +@@ -186,7 +186,7 @@ static int nvme_subsystem_unlink(NvmeSubsystem *s) { + if (!enable_fn) + return log_oom(); + +- r = write_string_file_at(namespaces_fd, enable_fn, "0", WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(namespaces_fd, enable_fn, "0", 0); + if (r < 0) + log_warning_errno(r, "Failed to disable namespace '%s' of NVME subsystem '%s', ignoring: %m", e->d_name, s->name); + +@@ -254,7 +254,7 @@ static int nvme_subsystem_write_metadata(int subsystem_fd, sd_device *device) { + _cleanup_free_ char *truncated = strndup(w, 40); /* kernel refuses more than 40 chars (as per nvme spec) */ + + /* The default string stored in 'attr_model' is "Linux" btw. */ +- r = write_string_file_at(subsystem_fd, "attr_model", truncated, WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(subsystem_fd, "attr_model", truncated, 0); + if (r < 0) + log_warning_errno(r, "Failed to set model of subsystem to '%s', ignoring: %m", w); + } +@@ -268,7 +268,7 @@ static int nvme_subsystem_write_metadata(int subsystem_fd, sd_device *device) { + return log_oom(); -@@ -114,7 +114,7 @@ static int write_state(FILE **f, char **states) { - STRV_FOREACH(state, states) { - int k; + /* The default string stored in 'attr_firmware' is `uname -r` btw, but truncated to 8 chars. */ +- r = write_string_file_at(subsystem_fd, "attr_firmware", truncated, WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(subsystem_fd, "attr_firmware", truncated, 0); + if (r < 0) + log_warning_errno(r, "Failed to set model of subsystem to '%s', ignoring: %m", truncated); + } +@@ -295,7 +295,7 @@ static int nvme_subsystem_write_metadata(int subsystem_fd, sd_device *device) { + if (!truncated) + return log_oom(); + +- r = write_string_file_at(subsystem_fd, "attr_serial", truncated, WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(subsystem_fd, "attr_serial", truncated, 0); + if (r < 0) + log_warning_errno(r, "Failed to set serial of subsystem to '%s', ignoring: %m", truncated); + } +@@ -345,7 +345,7 @@ static int nvme_namespace_write_metadata(int namespace_fd, sd_device *device, co + id = id128_digest(j, l); + } + +- r = write_string_file_at(namespace_fd, "device_uuid", SD_ID128_TO_UUID_STRING(id), WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(namespace_fd, "device_uuid", SD_ID128_TO_UUID_STRING(id), 0); + if (r < 0) + log_warning_errno(r, "Failed to set uuid of namespace to '%s', ignoring: %m", SD_ID128_TO_UUID_STRING(id)); + +@@ -408,7 +408,7 @@ static int nvme_subsystem_add(const char *node, int consumed_fd, sd_device *devi + if (subsystem_fd < 0) + return log_error_errno(subsystem_fd, "Failed to create NVME subsystem '%s': %m", j); + +- r = write_string_file_at(subsystem_fd, "attr_allow_any_host", "1", WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(subsystem_fd, "attr_allow_any_host", "1", 0); + if (r < 0) + return log_error_errno(r, "Failed to set 'attr_allow_any_host' flag: %m"); + +@@ -423,11 +423,11 @@ static int nvme_subsystem_add(const char *node, int consumed_fd, sd_device *devi + + /* We use /proc/$PID/fd/$FD rather than /proc/self/fd/$FD, because this string is visible to others + * via configfs, and by including the PID it's clear to who the stuff belongs. */ +- r = write_string_file_at(namespace_fd, "device_path", FORMAT_PROC_PID_FD_PATH(0, fd), WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(namespace_fd, "device_path", FORMAT_PROC_PID_FD_PATH(0, fd), 0); + if (r < 0) + return log_error_errno(r, "Failed to write 'device_path' attribute: %m"); + +- r = write_string_file_at(namespace_fd, "enable", "1", WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(namespace_fd, "enable", "1", 0); + if (r < 0) + return log_error_errno(r, "Failed to write 'enable' attribute: %m"); + +@@ -557,19 +557,19 @@ static int nvme_port_add_portnr( + return 0; + } + +- r = write_string_file_at(port_fd, "addr_adrfam", af_to_ipv4_ipv6(ip_family), WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(port_fd, "addr_adrfam", af_to_ipv4_ipv6(ip_family), 0); + if (r < 0) + return log_error_errno(r, "Failed to set address family on NVME port %" PRIu16 ": %m", portnr); + +- r = write_string_file_at(port_fd, "addr_trtype", "tcp", WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(port_fd, "addr_trtype", "tcp", 0); + if (r < 0) + return log_error_errno(r, "Failed to set transport type on NVME port %" PRIu16 ": %m", portnr); + +- r = write_string_file_at(port_fd, "addr_trsvcid", fname, WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(port_fd, "addr_trsvcid", fname, 0); + if (r < 0) + return log_error_errno(r, "Failed to set IP port on NVME port %" PRIu16 ": %m", portnr); + +- r = write_string_file_at(port_fd, "addr_traddr", ip_family == AF_INET6 ? "::" : "0.0.0.0", WRITE_STRING_FILE_DISABLE_BUFFER); ++ r = write_string_file_at(port_fd, "addr_traddr", ip_family == AF_INET6 ? "::" : "0.0.0.0", 0); + if (r < 0) + return log_error_errno(r, "Failed to set IP address on NVME port %" PRIu16 ": %m", portnr); -- k = write_string_stream(*f, *state, WRITE_STRING_FILE_DISABLE_BUFFER); -+ k = write_string_stream(*f, *state, 0); - if (k >= 0) - return 0; - log_debug_errno(k, "Failed to write '%s' to /sys/power/state: %m", *state); diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c -index 0ce79f815c..28aab475d0 100644 +index febe345b4c..a90b610ba1 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c -@@ -2357,7 +2357,6 @@ static int udev_rule_apply_token_to_event( - log_rule_debug(dev, rules, "ATTR '%s' writing '%s'", buf, value); +@@ -2711,7 +2711,6 @@ static int udev_rule_apply_token_to_event( + log_event_debug(dev, token, "ATTR '%s' writing '%s'", buf, value); r = write_string_file(buf, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | - WRITE_STRING_FILE_DISABLE_BUFFER | @@ -431,10 +545,10 @@ index 0ce79f815c..28aab475d0 100644 WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE); if (r < 0) diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c -index 7d3e9db73f..2d4a0c4c9d 100644 +index 4d82c65f0a..3a3d861b83 100644 --- a/src/vconsole/vconsole-setup.c +++ b/src/vconsole/vconsole-setup.c -@@ -108,7 +108,7 @@ static int toggle_utf8_vc(const char *name, int fd, bool utf8) { +@@ -261,7 +261,7 @@ static int toggle_utf8_vc(const char *name, int fd, bool utf8) { static int toggle_utf8_sysfs(bool utf8) { int r; @@ -444,5 +558,4 @@ index 7d3e9db73f..2d4a0c4c9d 100644 return log_warning_errno(r, "Failed to %s sysfs UTF-8 flag: %m", enable_disable(utf8)); -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0022-Handle-__cpu_mask-usage.patch b/meta-openeuler/recipes-core/systemd/systemd/0013-Handle-__cpu_mask-usage.patch similarity index 89% rename from meta-openeuler/recipes-core/systemd/systemd/0022-Handle-__cpu_mask-usage.patch rename to meta-openeuler/recipes-core/systemd/systemd/0013-Handle-__cpu_mask-usage.patch index 61545f577860fe1513ea99a203528decd2de9f44..73e60cadf3d4b943171aa7a098b800705728bcd5 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0022-Handle-__cpu_mask-usage.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0013-Handle-__cpu_mask-usage.patch @@ -1,7 +1,7 @@ -From a50ec65dbe660421052656dda7499c925005f486 Mon Sep 17 00:00:00 2001 +From 2f90f8463423cfbb7e83fcef42f1071018c3b56e Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Fri, 13 Sep 2019 19:26:27 -0400 -Subject: [PATCH] Handle __cpu_mask usage +Subject: [PATCH 13/22] Handle __cpu_mask usage Fixes errors: @@ -37,7 +37,7 @@ index 3c63a58826..4c2d4347fc 100644 typedef struct CPUSet { cpu_set_t *set; diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c -index 6cf92bffde..937d26ca55 100644 +index ea0c58770e..b65c0bd370 100644 --- a/src/test/test-sizeof.c +++ b/src/test/test-sizeof.c @@ -1,6 +1,5 @@ @@ -46,8 +46,8 @@ index 6cf92bffde..937d26ca55 100644 -#include #include #include - #include -@@ -10,6 +9,7 @@ + #include +@@ -12,6 +11,7 @@ #include #include "time-util.h" @@ -56,5 +56,4 @@ index 6cf92bffde..937d26ca55 100644 /* Print information about various types. Useful when diagnosing * gcc diagnostics on an unfamiliar architecture. */ -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0023-Handle-missing-gshadow.patch b/meta-openeuler/recipes-core/systemd/systemd/0014-Handle-missing-gshadow.patch similarity index 83% rename from meta-openeuler/recipes-core/systemd/systemd/0023-Handle-missing-gshadow.patch rename to meta-openeuler/recipes-core/systemd/systemd/0014-Handle-missing-gshadow.patch index 7da8798ebc306fb6002b4f4a7002bca6410621d2..cca8b61c29c1bc533c2e69f57e41d808b0746cd3 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0023-Handle-missing-gshadow.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0014-Handle-missing-gshadow.patch @@ -1,7 +1,7 @@ -From ebf0f69d8614b8d86a971b97ff0d847d1e5d47c9 Mon Sep 17 00:00:00 2001 +From b7c827bb44edbb6251c9fcdb80aa03982c0e7bf3 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Tue, 10 Mar 2020 11:05:20 +0000 -Subject: [PATCH] Handle missing gshadow +Subject: [PATCH 14/22] Handle missing gshadow gshadow usage is now present in the userdb code. Mask all uses of it to allow compilation on musl @@ -17,10 +17,10 @@ Signed-off-by: Luca Boccassi 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/shared/user-record-nss.c b/src/shared/user-record-nss.c -index 88b8fc2f8f..a819d41bac 100644 +index 414a49331b..1a4e1b628c 100644 --- a/src/shared/user-record-nss.c +++ b/src/shared/user-record-nss.c -@@ -331,8 +331,10 @@ int nss_group_to_group_record( +@@ -329,8 +329,10 @@ int nss_group_to_group_record( if (isempty(grp->gr_name)) return -EINVAL; @@ -31,7 +31,7 @@ index 88b8fc2f8f..a819d41bac 100644 g = group_record_new(); if (!g) -@@ -348,6 +350,7 @@ int nss_group_to_group_record( +@@ -346,6 +348,7 @@ int nss_group_to_group_record( g->gid = grp->gr_gid; @@ -39,7 +39,7 @@ index 88b8fc2f8f..a819d41bac 100644 if (sgrp) { if (looks_like_hashed_password(utf8_only(sgrp->sg_passwd))) { g->hashed_password = strv_new(sgrp->sg_passwd); -@@ -363,6 +366,7 @@ int nss_group_to_group_record( +@@ -361,6 +364,7 @@ int nss_group_to_group_record( if (r < 0) return r; } @@ -47,7 +47,7 @@ index 88b8fc2f8f..a819d41bac 100644 r = json_build(&g->json, JSON_BUILD_OBJECT( JSON_BUILD_PAIR("groupName", JSON_BUILD_STRING(g->group_name)), -@@ -388,6 +392,7 @@ int nss_sgrp_for_group(const struct group *grp, struct sgrp *ret_sgrp, char **re +@@ -387,6 +391,7 @@ int nss_sgrp_for_group(const struct group *grp, struct sgrp *ret_sgrp, char **re assert(ret_sgrp); assert(ret_buffer); @@ -55,7 +55,7 @@ index 88b8fc2f8f..a819d41bac 100644 for (;;) { _cleanup_free_ char *buf = NULL; struct sgrp sgrp, *result; -@@ -416,6 +421,9 @@ int nss_sgrp_for_group(const struct group *grp, struct sgrp *ret_sgrp, char **re +@@ -415,6 +420,9 @@ int nss_sgrp_for_group(const struct group *grp, struct sgrp *ret_sgrp, char **re buflen *= 2; buf = mfree(buf); } @@ -65,7 +65,7 @@ index 88b8fc2f8f..a819d41bac 100644 } int nss_group_record_by_name( -@@ -427,7 +435,9 @@ int nss_group_record_by_name( +@@ -426,7 +434,9 @@ int nss_group_record_by_name( struct group grp, *result; bool incomplete = false; size_t buflen = 4096; @@ -75,7 +75,7 @@ index 88b8fc2f8f..a819d41bac 100644 int r; assert(name); -@@ -457,6 +467,7 @@ int nss_group_record_by_name( +@@ -455,6 +465,7 @@ int nss_group_record_by_name( buf = mfree(buf); } @@ -83,7 +83,7 @@ index 88b8fc2f8f..a819d41bac 100644 if (with_shadow) { r = nss_sgrp_for_group(result, &sgrp, &sbuf); if (r < 0) { -@@ -468,6 +479,9 @@ int nss_group_record_by_name( +@@ -466,6 +477,9 @@ int nss_group_record_by_name( incomplete = true; r = nss_group_to_group_record(result, sresult, ret); @@ -93,7 +93,7 @@ index 88b8fc2f8f..a819d41bac 100644 if (r < 0) return r; -@@ -484,7 +498,9 @@ int nss_group_record_by_gid( +@@ -483,7 +497,9 @@ int nss_group_record_by_gid( struct group grp, *result; bool incomplete = false; size_t buflen = 4096; @@ -102,8 +102,8 @@ index 88b8fc2f8f..a819d41bac 100644 +#endif int r; - assert(ret); -@@ -512,6 +528,7 @@ int nss_group_record_by_gid( + for (;;) { +@@ -509,6 +525,7 @@ int nss_group_record_by_gid( buf = mfree(buf); } @@ -111,7 +111,7 @@ index 88b8fc2f8f..a819d41bac 100644 if (with_shadow) { r = nss_sgrp_for_group(result, &sgrp, &sbuf); if (r < 0) { -@@ -523,6 +540,9 @@ int nss_group_record_by_gid( +@@ -520,6 +537,9 @@ int nss_group_record_by_gid( incomplete = true; r = nss_group_to_group_record(result, sresult, ret); @@ -138,10 +138,10 @@ index 22ab04d6ee..4e52e7a911 100644 #include diff --git a/src/shared/userdb.c b/src/shared/userdb.c -index a77eff4407..955e361d3a 100644 +index f60d48ace4..e878199a28 100644 --- a/src/shared/userdb.c +++ b/src/shared/userdb.c -@@ -1044,13 +1044,15 @@ int groupdb_iterator_get(UserDBIterator *iterator, GroupRecord **ret) { +@@ -1038,13 +1038,15 @@ int groupdb_iterator_get(UserDBIterator *iterator, GroupRecord **ret) { if (gr) { _cleanup_free_ char *buffer = NULL; bool incomplete = false; @@ -158,7 +158,7 @@ index a77eff4407..955e361d3a 100644 if (!FLAGS_SET(iterator->flags, USERDB_SUPPRESS_SHADOW)) { r = nss_sgrp_for_group(gr, &sgrp, &buffer); if (r < 0) { -@@ -1063,6 +1065,9 @@ int groupdb_iterator_get(UserDBIterator *iterator, GroupRecord **ret) { +@@ -1057,6 +1059,9 @@ int groupdb_iterator_get(UserDBIterator *iterator, GroupRecord **ret) { } r = nss_group_to_group_record(gr, r >= 0 ? &sgrp : NULL, ret); @@ -169,5 +169,4 @@ index a77eff4407..955e361d3a 100644 return r; -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0024-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch b/meta-openeuler/recipes-core/systemd/systemd/0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch similarity index 83% rename from meta-openeuler/recipes-core/systemd/systemd/0024-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch rename to meta-openeuler/recipes-core/systemd/systemd/0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch index 15ff6eb4f8a7732c1ab5c919141cf7f10d3424b6..d16dda6f230d2a6d7a5c1cff1de75bf245d9f21d 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0024-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch @@ -1,7 +1,7 @@ -From a2f56a2a6cdd5137bb1e680aa9f6c40540107166 Mon Sep 17 00:00:00 2001 +From 3dc9d9d410bcce54fddfd94f43f7f77f3aa8e281 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 12 Apr 2021 23:44:53 -0700 -Subject: [PATCH] missing_syscall.h: Define MIPS ABI defines for musl +Subject: [PATCH 15/22] missing_syscall.h: Define MIPS ABI defines for musl musl does not define _MIPS_SIM_ABI32, _MIPS_SIM_NABI32, _MIPS_SIM_ABI64 unlike glibc where these are provided by libc headers, therefore define @@ -16,7 +16,7 @@ Signed-off-by: Khem Raj 2 files changed, 7 insertions(+) diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h -index 98cd037962..ea6a76c2e2 100644 +index d795efd8f2..d6729d3c1d 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -20,6 +20,12 @@ @@ -33,10 +33,10 @@ index 98cd037962..ea6a76c2e2 100644 #include "missing_keyctl.h" #include "missing_stat.h" diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c -index 2726dc946a..484f63e0b4 100644 +index 7ae921a113..0ef9d1fd39 100644 --- a/src/shared/base-filesystem.c +++ b/src/shared/base-filesystem.c -@@ -19,6 +19,7 @@ +@@ -20,6 +20,7 @@ #include "string-util.h" #include "umask-util.h" #include "user-util.h" @@ -45,5 +45,4 @@ index 2726dc946a..484f63e0b4 100644 typedef struct BaseFilesystem { const char *dir; /* directory or symlink to create */ -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0015-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch b/meta-openeuler/recipes-core/systemd/systemd/0015-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch deleted file mode 100644 index afc80b9511afaecb27f1db65eb63203ad673dc37..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/systemd/systemd/0015-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 96088895149746dd2ee8e8c2e4b97972ccf44696 Mon Sep 17 00:00:00 2001 -From: Chen Qi -Date: Wed, 28 Feb 2018 21:25:22 -0800 -Subject: [PATCH] test-sizeof.c: Disable tests for missing typedefs in musl - -Upstream-Status: Inappropriate [musl specific] - -Signed-off-by: Khem Raj -Signed-off-by: Chen Qi ---- - src/test/test-sizeof.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c -index 55bd81e22f..6cf92bffde 100644 ---- a/src/test/test-sizeof.c -+++ b/src/test/test-sizeof.c -@@ -55,8 +55,10 @@ int main(void) { - info(unsigned); - info(unsigned long); - info(unsigned long long); -+#ifdef __GLIBC__ - info(__syscall_ulong_t); - info(__syscall_slong_t); -+#endif - info(intmax_t); - info(uintmax_t); - -@@ -76,7 +78,9 @@ int main(void) { - info(ssize_t); - info(time_t); - info(usec_t); -+#ifdef __GLIBC__ - info(__time_t); -+#endif - info(pid_t); - info(uid_t); - info(gid_t); --- -2.39.2 - diff --git a/meta-openeuler/recipes-core/systemd/systemd/0005-pass-correct-parameters-to-getdents64.patch b/meta-openeuler/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch similarity index 92% rename from meta-openeuler/recipes-core/systemd/systemd/0005-pass-correct-parameters-to-getdents64.patch rename to meta-openeuler/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch index c634d8ec3d0e1e3c06b958824a2eaa3744837824..43673ed01c753740d138e90d941824d2d3534209 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0005-pass-correct-parameters-to-getdents64.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch @@ -1,7 +1,7 @@ -From 17766c64ecc7dedf09ed2d361690fc4eda77bf42 Mon Sep 17 00:00:00 2001 +From 0994b59dba9f248ad31cb7087046dc00b72cb4ea Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 21 Jan 2022 15:15:11 -0800 -Subject: [PATCH] pass correct parameters to getdents64 +Subject: [PATCH 16/22] pass correct parameters to getdents64 Fixes ../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types] @@ -33,5 +33,4 @@ index 5e98b7a5d8..aef065047b 100644 return -errno; if (n == 0) -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0001-Adjust-for-musl-headers.patch b/meta-openeuler/recipes-core/systemd/systemd/0017-Adjust-for-musl-headers.patch similarity index 89% rename from meta-openeuler/recipes-core/systemd/systemd/0001-Adjust-for-musl-headers.patch rename to meta-openeuler/recipes-core/systemd/systemd/0017-Adjust-for-musl-headers.patch index 5e9646c569927fe9b0b5907f68c7dcec332c1f62..8ee51a145bc2a9ad637de85b44b865f0992b45f5 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0001-Adjust-for-musl-headers.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0017-Adjust-for-musl-headers.patch @@ -1,11 +1,14 @@ -From e5f067cb3dc845dd865e450f4e64077b28feb4c0 Mon Sep 17 00:00:00 2001 +From 3c094d443ca30f19114392fd8ef274af6eabc12d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 21 Jan 2022 22:19:37 -0800 -Subject: [PATCH] Adjust for musl headers +Subject: [PATCH 17/22] Adjust for musl headers Upstream-Status: Inappropriate [musl specific] Signed-off-by: Khem Raj + +[Rebased for v255.1] +Signed-off-by: Chen Qi --- src/libsystemd-network/sd-dhcp6-client.c | 2 +- src/network/netdev/bareudp.c | 2 +- @@ -33,7 +36,7 @@ Signed-off-by: Khem Raj src/network/netdev/xfrm.c | 2 +- src/network/networkd-bridge-mdb.c | 4 ++-- src/network/networkd-dhcp-common.c | 3 ++- - src/network/networkd-dhcp-prefix-delegation.c | 4 ++-- + src/network/networkd-dhcp-prefix-delegation.c | 3 ++- src/network/networkd-dhcp-server.c | 2 +- src/network/networkd-dhcp4.c | 2 +- src/network/networkd-ipv6ll.c | 2 +- @@ -41,13 +44,14 @@ Signed-off-by: Khem Raj src/network/networkd-ndisc.c | 2 +- src/network/networkd-route.c | 8 ++++---- src/network/networkd-setlink.c | 2 +- + src/network/networkd-sysctl.c | 2 +- src/shared/linux/ethtool.h | 3 ++- src/shared/netif-util.c | 2 +- src/udev/udev-builtin-net_id.c | 2 +- - 37 files changed, 44 insertions(+), 42 deletions(-) + 38 files changed, 45 insertions(+), 42 deletions(-) diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c -index 57dd91f81f..2b7f4fa3a7 100644 +index c20367dfc9..b8d4cd8c2a 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -5,7 +5,7 @@ @@ -60,7 +64,7 @@ index 57dd91f81f..2b7f4fa3a7 100644 #include "sd-dhcp6-client.h" diff --git a/src/network/netdev/bareudp.c b/src/network/netdev/bareudp.c -index 24d3afb877..f6241b41ee 100644 +index 1df886573b..c8b6714726 100644 --- a/src/network/netdev/bareudp.c +++ b/src/network/netdev/bareudp.c @@ -2,7 +2,7 @@ @@ -73,7 +77,7 @@ index 24d3afb877..f6241b41ee 100644 #include "bareudp.h" #include "netlink-util.h" diff --git a/src/network/netdev/batadv.c b/src/network/netdev/batadv.c -index 7e97619657..50fcffcfdf 100644 +index 26da0231d4..2e8002af8c 100644 --- a/src/network/netdev/batadv.c +++ b/src/network/netdev/batadv.c @@ -3,7 +3,7 @@ @@ -86,7 +90,7 @@ index 7e97619657..50fcffcfdf 100644 #include "batadv.h" #include "fileio.h" diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c -index 601bff0a9c..dfed8d9e54 100644 +index 4d75a0d6bf..985b3197e0 100644 --- a/src/network/netdev/bond.c +++ b/src/network/netdev/bond.c @@ -1,7 +1,7 @@ @@ -99,7 +103,7 @@ index 601bff0a9c..dfed8d9e54 100644 #include "alloc-util.h" #include "bond.h" diff --git a/src/network/netdev/bridge.c b/src/network/netdev/bridge.c -index b65c3b49fc..6875b4fbdb 100644 +index 3e394edadf..f12f667687 100644 --- a/src/network/netdev/bridge.c +++ b/src/network/netdev/bridge.c @@ -2,7 +2,7 @@ @@ -124,7 +128,7 @@ index 00df1d2787..77b506b422 100644 #include "dummy.h" diff --git a/src/network/netdev/geneve.c b/src/network/netdev/geneve.c -index 777a32d75c..73bfa2b5c1 100644 +index bc655ec7ff..a77e8e17e4 100644 --- a/src/network/netdev/geneve.c +++ b/src/network/netdev/geneve.c @@ -2,7 +2,7 @@ @@ -150,7 +154,7 @@ index d7ff44cb9e..e037629ae4 100644 #include "ifb.h" diff --git a/src/network/netdev/ipoib.c b/src/network/netdev/ipoib.c -index 5dd9286d57..4036d66dad 100644 +index d5fe299b7b..c9c8002eac 100644 --- a/src/network/netdev/ipoib.c +++ b/src/network/netdev/ipoib.c @@ -1,6 +1,6 @@ @@ -162,7 +166,7 @@ index 5dd9286d57..4036d66dad 100644 #include "ipoib.h" diff --git a/src/network/netdev/ipvlan.c b/src/network/netdev/ipvlan.c -index 058eadebd7..c470ebb6d7 100644 +index 05d5d010f6..d440f49537 100644 --- a/src/network/netdev/ipvlan.c +++ b/src/network/netdev/ipvlan.c @@ -2,7 +2,7 @@ @@ -175,7 +179,7 @@ index 058eadebd7..c470ebb6d7 100644 #include "conf-parser.h" #include "ipvlan.h" diff --git a/src/network/netdev/macsec.c b/src/network/netdev/macsec.c -index 0da3dd4bd2..eb20f04469 100644 +index 17d6acefb6..679d0984f9 100644 --- a/src/network/netdev/macsec.c +++ b/src/network/netdev/macsec.c @@ -1,7 +1,7 @@ @@ -188,7 +192,7 @@ index 0da3dd4bd2..eb20f04469 100644 #include #include diff --git a/src/network/netdev/macvlan.c b/src/network/netdev/macvlan.c -index 1114bb0cb1..6c79a219a4 100644 +index 203807e3a5..8ab09a387e 100644 --- a/src/network/netdev/macvlan.c +++ b/src/network/netdev/macvlan.c @@ -2,7 +2,7 @@ @@ -201,7 +205,7 @@ index 1114bb0cb1..6c79a219a4 100644 #include "conf-parser.h" #include "macvlan.h" diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c -index 038a27c118..67155f0db7 100644 +index 57127a861a..7f787d0b9f 100644 --- a/src/network/netdev/netdev.c +++ b/src/network/netdev/netdev.c @@ -2,7 +2,7 @@ @@ -238,7 +242,7 @@ index ff372092e6..eef66811f4 100644 #include "nlmon.h" diff --git a/src/network/netdev/tunnel.c b/src/network/netdev/tunnel.c -index 2addfeecaa..954987f26d 100644 +index db84e7cf6e..93d5642962 100644 --- a/src/network/netdev/tunnel.c +++ b/src/network/netdev/tunnel.c @@ -2,7 +2,7 @@ @@ -263,7 +267,7 @@ index 380547ee1e..137c1adf8a 100644 #include "vcan.h" diff --git a/src/network/netdev/veth.c b/src/network/netdev/veth.c -index fb00e6667f..f52d9ee89a 100644 +index e0f5b4ebb1..8a424ed03d 100644 --- a/src/network/netdev/veth.c +++ b/src/network/netdev/veth.c @@ -3,7 +3,7 @@ @@ -276,7 +280,7 @@ index fb00e6667f..f52d9ee89a 100644 #include "netlink-util.h" diff --git a/src/network/netdev/vlan.c b/src/network/netdev/vlan.c -index a3d961dac3..386b567a42 100644 +index 2390206993..efec630e30 100644 --- a/src/network/netdev/vlan.c +++ b/src/network/netdev/vlan.c @@ -2,7 +2,7 @@ @@ -289,7 +293,7 @@ index a3d961dac3..386b567a42 100644 #include "parse-util.h" diff --git a/src/network/netdev/vrf.c b/src/network/netdev/vrf.c -index 05ef3ff13d..825fc4a398 100644 +index b75ec2bcc6..6aeeea640b 100644 --- a/src/network/netdev/vrf.c +++ b/src/network/netdev/vrf.c @@ -2,7 +2,7 @@ @@ -302,7 +306,7 @@ index 05ef3ff13d..825fc4a398 100644 #include "vrf.h" diff --git a/src/network/netdev/vxcan.c b/src/network/netdev/vxcan.c -index 83269b0707..39c6dbe29c 100644 +index c0343f45b6..f9e718f40b 100644 --- a/src/network/netdev/vxcan.c +++ b/src/network/netdev/vxcan.c @@ -1,7 +1,7 @@ @@ -315,7 +319,7 @@ index 83269b0707..39c6dbe29c 100644 #include "vxcan.h" diff --git a/src/network/netdev/vxlan.c b/src/network/netdev/vxlan.c -index 589161938a..0ec9625b7a 100644 +index b11fdbbd0d..a971a917f0 100644 --- a/src/network/netdev/vxlan.c +++ b/src/network/netdev/vxlan.c @@ -2,7 +2,7 @@ @@ -328,7 +332,7 @@ index 589161938a..0ec9625b7a 100644 #include "conf-parser.h" #include "alloc-util.h" diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c -index 51e7e02990..fc36c0623a 100644 +index 4c7d837c41..6df6dfb816 100644 --- a/src/network/netdev/wireguard.c +++ b/src/network/netdev/wireguard.c @@ -6,7 +6,7 @@ @@ -341,7 +345,7 @@ index 51e7e02990..fc36c0623a 100644 #include "sd-resolve.h" diff --git a/src/network/netdev/xfrm.c b/src/network/netdev/xfrm.c -index a961d8fef2..6c1815b257 100644 +index 905bfc0bdf..39e34dbb3b 100644 --- a/src/network/netdev/xfrm.c +++ b/src/network/netdev/xfrm.c @@ -1,6 +1,6 @@ @@ -374,7 +378,7 @@ index bd1a9745dc..949d3da029 100644 #define STATIC_BRIDGE_MDB_ENTRIES_PER_NETWORK_MAX 1024U diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c -index ca9a825e7b..8735e261ad 100644 +index 080b15387c..efe8283957 100644 --- a/src/network/networkd-dhcp-common.c +++ b/src/network/networkd-dhcp-common.c @@ -1,7 +1,8 @@ @@ -388,18 +392,17 @@ index ca9a825e7b..8735e261ad 100644 #include "bus-error.h" #include "bus-locator.h" diff --git a/src/network/networkd-dhcp-prefix-delegation.c b/src/network/networkd-dhcp-prefix-delegation.c -index 66c5e979d9..581b6b8c29 100644 +index af2fe9efcd..511565700f 100644 --- a/src/network/networkd-dhcp-prefix-delegation.c +++ b/src/network/networkd-dhcp-prefix-delegation.c -@@ -1,7 +1,5 @@ +@@ -1,6 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include -- - #include "sd-dhcp6-client.h" + #include "dhcp6-lease-internal.h" #include "hashmap.h" -@@ -21,6 +19,8 @@ +@@ -20,6 +19,8 @@ #include "strv.h" #include "tunnel.h" @@ -409,7 +412,7 @@ index 66c5e979d9..581b6b8c29 100644 assert(link); diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c -index 620fbbddc7..c8af20fb34 100644 +index 607fe0053c..9ce4005874 100644 --- a/src/network/networkd-dhcp-server.c +++ b/src/network/networkd-dhcp-server.c @@ -1,7 +1,7 @@ @@ -422,7 +425,7 @@ index 620fbbddc7..c8af20fb34 100644 #include "sd-dhcp-server.h" diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c -index d4b4942173..3d78da5609 100644 +index efbae6d868..1ea2151d50 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -3,7 +3,7 @@ @@ -448,7 +451,7 @@ index 32229a3fc7..662a345d6e 100644 #include "in-addr-util.h" #include "networkd-address.h" diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c -index 019bef0590..657fc41ae6 100644 +index ee5f0f2c0a..ea5269a2de 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -3,7 +3,7 @@ @@ -461,7 +464,7 @@ index 019bef0590..657fc41ae6 100644 #include #include diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c -index 99a07e16fc..e51cd81d96 100644 +index ab9eeb13a5..dd96fe7483 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -6,7 +6,7 @@ @@ -474,7 +477,7 @@ index 99a07e16fc..e51cd81d96 100644 #include "sd-ndisc.h" diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c -index 5214a8ad2c..9dd758daae 100644 +index 7218d799fc..30d5574eae 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1,9 +1,5 @@ @@ -499,7 +502,7 @@ index 5214a8ad2c..9dd758daae 100644 _cleanup_(route_freep) Route *route = NULL; diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c -index 541c4b8a72..06ebda8f0f 100644 +index 2298f9ea3a..7d5f87de53 100644 --- a/src/network/networkd-setlink.c +++ b/src/network/networkd-setlink.c @@ -2,7 +2,7 @@ @@ -511,8 +514,21 @@ index 541c4b8a72..06ebda8f0f 100644 #include #include "missing_network.h" +diff --git a/src/network/networkd-sysctl.c b/src/network/networkd-sysctl.c +index 2b226b2e2a..f12a474e2f 100644 +--- a/src/network/networkd-sysctl.c ++++ b/src/network/networkd-sysctl.c +@@ -2,7 +2,7 @@ + + #include + #include +-#include ++//#include + + #include "missing_network.h" + #include "networkd-link.h" diff --git a/src/shared/linux/ethtool.h b/src/shared/linux/ethtool.h -index 1458de3627..d5c2d2e0ac 100644 +index 3d1da515c0..3fca9a4faf 100644 --- a/src/shared/linux/ethtool.h +++ b/src/shared/linux/ethtool.h @@ -16,7 +16,8 @@ @@ -539,7 +555,7 @@ index f56c5646c1..5af28ff119 100644 #include "arphrd-util.h" #include "device-util.h" diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c -index a48d5dedf8..31a8bc1b3c 100644 +index f528a46b8e..830318cda5 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -18,7 +18,7 @@ @@ -552,5 +568,4 @@ index a48d5dedf8..31a8bc1b3c 100644 #include -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0006-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch b/meta-openeuler/recipes-core/systemd/systemd/0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch similarity index 89% rename from meta-openeuler/recipes-core/systemd/systemd/0006-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch rename to meta-openeuler/recipes-core/systemd/systemd/0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch index 96322e5a562bbf8a810f4e84b1197d0e94489426..4eeb045aa198eae8abf8ba6a94e6269e4ae3415b 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0006-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch @@ -1,8 +1,8 @@ -From fa598869cca684c001f3dc23ce2198f5a6169e2a Mon Sep 17 00:00:00 2001 +From be02bd0876a061728661535a709d313e39fe1ac3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 8 Nov 2022 13:31:34 -0800 -Subject: [PATCH] test-bus-error: strerror() is assumed to be GNU specific - version mark it so +Subject: [PATCH 18/22] test-bus-error: strerror() is assumed to be GNU + specific version mark it so Upstream-Status: Inappropriate [Upstream systemd only supports glibc] @@ -27,7 +27,7 @@ index a55f3f9856..4123bf3da0 100644 assert_se(sd_bus_error_get_errno(&error) == EBUSY); assert_se(sd_bus_error_is_set(&error)); diff --git a/src/test/test-errno-util.c b/src/test/test-errno-util.c -index d3d022c33f..74e95c804d 100644 +index 376d532281..967cfd4d67 100644 --- a/src/test/test-errno-util.c +++ b/src/test/test-errno-util.c @@ -4,7 +4,7 @@ @@ -48,5 +48,4 @@ index d3d022c33f..74e95c804d 100644 TEST(PROTECT_ERRNO) { errno = 12; -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0003-errno-util-Make-STRERROR-portable-for-musl.patch b/meta-openeuler/recipes-core/systemd/systemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch similarity index 87% rename from meta-openeuler/recipes-core/systemd/systemd/0003-errno-util-Make-STRERROR-portable-for-musl.patch rename to meta-openeuler/recipes-core/systemd/systemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch index e9e69cb6489bf7b3ce80e82e53256bc1633e5757..ea2eed5a17a154cd666a18951b28444a3a345b82 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/0003-errno-util-Make-STRERROR-portable-for-musl.patch +++ b/meta-openeuler/recipes-core/systemd/systemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch @@ -1,7 +1,7 @@ -From f629a76e0fba300a9d511614160fee38dd4a5e57 Mon Sep 17 00:00:00 2001 +From 46d80840bfe37e67d4f18c37a77751ea1fe63a07 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 23 Jan 2023 23:39:46 -0800 -Subject: [PATCH] errno-util: Make STRERROR portable for musl +Subject: [PATCH 19/22] errno-util: Make STRERROR portable for musl Sadly, systemd has decided to use yet another GNU extention in a macro lets make this such that we can use XSI compliant strerror_r() for @@ -15,10 +15,10 @@ Signed-off-by: Khem Raj 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h -index 091f99c590..eb5c1f9961 100644 +index 27804e6382..274c1c6ef1 100644 --- a/src/basic/errno-util.h +++ b/src/basic/errno-util.h -@@ -14,8 +14,16 @@ +@@ -15,8 +15,16 @@ * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks * * Note that we use the GNU variant of strerror_r() here. */ @@ -38,5 +38,4 @@ index 091f99c590..eb5c1f9961 100644 * Note that we can't use ({ … }) to define a temporary variable, so errnum is * evaluated twice. */ -- -2.39.2 - +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch b/meta-openeuler/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch new file mode 100644 index 0000000000000000000000000000000000000000..7063c439ab751d7c13602f3d1d9395900ffc6fbe --- /dev/null +++ b/meta-openeuler/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch @@ -0,0 +1,38 @@ +From 9eb4867b4e2dbdb2484ae854022aff97e2f0feb3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 2 Aug 2023 12:06:27 -0700 +Subject: [PATCH 20/22] sd-event: Make malloc_trim() conditional on glibc + +musl does not have this API + +Upstream-Status: Inappropriate [musl-specific] +Signed-off-by: Khem Raj +--- + src/libsystemd/sd-event/sd-event.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c +index 288798a0dc..6419a7f216 100644 +--- a/src/libsystemd/sd-event/sd-event.c ++++ b/src/libsystemd/sd-event/sd-event.c +@@ -1874,7 +1874,7 @@ _public_ int sd_event_add_exit( + } + + _public_ int sd_event_trim_memory(void) { +- int r; ++ int r = 0; + + /* A default implementation of a memory pressure callback. Simply releases our own allocation caches + * and glibc's. This is automatically used when people call sd_event_add_memory_pressure() with a +@@ -1888,7 +1888,9 @@ _public_ int sd_event_trim_memory(void) { + + usec_t before_timestamp = now(CLOCK_MONOTONIC); + hashmap_trim_pools(); ++#ifdef __GLIBC__ + r = malloc_trim(0); ++#endif + usec_t after_timestamp = now(CLOCK_MONOTONIC); + + if (r > 0) +-- +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0021-shared-Do-not-use-malloc_info-on-musl.patch b/meta-openeuler/recipes-core/systemd/systemd/0021-shared-Do-not-use-malloc_info-on-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..d3e0e1cd356455d5103913f16d192226123ecadb --- /dev/null +++ b/meta-openeuler/recipes-core/systemd/systemd/0021-shared-Do-not-use-malloc_info-on-musl.patch @@ -0,0 +1,56 @@ +From 502597b9ddd6b145541b23fadca0b1d3ca9f6367 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 2 Aug 2023 12:20:40 -0700 +Subject: [PATCH 21/22] shared: Do not use malloc_info on musl + +Upstream-Status: Inappropriate [musl-specific] +Signed-off-by: Khem Raj +--- + src/shared/bus-util.c | 5 +++-- + src/shared/common-signal.c | 4 ++-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c +index 74f148c8b4..2d862a123d 100644 +--- a/src/shared/bus-util.c ++++ b/src/shared/bus-util.c +@@ -611,15 +611,16 @@ static int method_dump_memory_state_by_fd(sd_bus_message *message, void *userdat + _cleanup_close_ int fd = -EBADF; + size_t dump_size; + FILE *f; +- int r; ++ int r = 0; + + assert(message); + + f = memstream_init(&m); + if (!f) + return -ENOMEM; +- ++#ifdef __GLIBC__ + r = RET_NERRNO(malloc_info(/* options= */ 0, f)); ++#endif + if (r < 0) + return r; + +diff --git a/src/shared/common-signal.c b/src/shared/common-signal.c +index 8e70e365dd..9e782caec9 100644 +--- a/src/shared/common-signal.c ++++ b/src/shared/common-signal.c +@@ -65,12 +65,12 @@ int sigrtmin18_handler(sd_event_source *s, const struct signalfd_siginfo *si, vo + log_oom(); + break; + } +- ++#ifdef __GLIBC__ + if (malloc_info(0, f) < 0) { + log_error_errno(errno, "Failed to invoke malloc_info(): %m"); + break; + } +- ++#endif + (void) memstream_dump(LOG_INFO, &m); + break; + } +-- +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0022-avoid-missing-LOCK_EX-declaration.patch b/meta-openeuler/recipes-core/systemd/systemd/0022-avoid-missing-LOCK_EX-declaration.patch new file mode 100644 index 0000000000000000000000000000000000000000..869ab0f74d59ec1d593d6541b8d10d481d4367b7 --- /dev/null +++ b/meta-openeuler/recipes-core/systemd/systemd/0022-avoid-missing-LOCK_EX-declaration.patch @@ -0,0 +1,42 @@ +From fd52f1764647e03a35e8f0ed0ef952049073ccbd Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Tue, 2 Jan 2024 11:03:27 +0800 +Subject: [PATCH 22/22] avoid missing LOCK_EX declaration + +This only happens on MUSL. Include sys/file.h to avoid compilation +error about missing LOCK_EX declaration. + +Upstream-Status: Inappropriate [musl specific] + +Signed-off-by: Chen Qi +--- + src/core/exec-invoke.c | 1 + + src/shared/dev-setup.h | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c +index 70d963e269..7084811439 100644 +--- a/src/core/exec-invoke.c ++++ b/src/core/exec-invoke.c +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + #if HAVE_PAM + #include +diff --git a/src/shared/dev-setup.h b/src/shared/dev-setup.h +index 5339bc4e5e..0697495f23 100644 +--- a/src/shared/dev-setup.h ++++ b/src/shared/dev-setup.h +@@ -2,6 +2,7 @@ + #pragma once + + #include ++#include + + int lock_dev_console(void); + +-- +2.34.1 diff --git a/meta-openeuler/recipes-core/systemd/systemd/0026-src-boot-efi-efi-string.c-define-wchar_t-from-__WCHA.patch b/meta-openeuler/recipes-core/systemd/systemd/0026-src-boot-efi-efi-string.c-define-wchar_t-from-__WCHA.patch deleted file mode 100644 index c7e2280c3b2aa0e6bf85f49210d84dd74fc4b37d..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/systemd/systemd/0026-src-boot-efi-efi-string.c-define-wchar_t-from-__WCHA.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 34072f456b4fe880fbb2f18760b64a1a6c1eebb8 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Mon, 6 Mar 2023 15:24:49 +0100 -Subject: [PATCH] src/boot/efi/efi-string.c: define wchar_t from __WCHAR_TYPE__ - -systemd-boot relies on wchar_t being 16 bit, and breaks at build time otherwise. - -To set wchar_t to 16 bit it is passing -fshort-wchar to gcc; this has the -desired effect on glibc (which sets wchar_t from __WCHAR_TYPE__) but not on -musl (which hardcodes it to 32 bit). - -This patch ensures wchar_t is set from the compiler flags on all systems; note -that systemd-boot is not actually using functions from musl or other libc, just their headers. - -Meanwhile upstream has refactored the code to not rely on libc headers at all; -however this will not be backported to v253 and we need a different fix. - -Upstream-Status: Inappropriate [fixed differently in trunk according to https://github.com/systemd/systemd/pull/26689] -Signed-off-by: Alexander Kanavin ---- - src/boot/efi/efi-string.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/boot/efi/efi-string.c b/src/boot/efi/efi-string.c -index 22923d60f6..5d09d4281f 100644 ---- a/src/boot/efi/efi-string.c -+++ b/src/boot/efi/efi-string.c -@@ -2,7 +2,13 @@ - - #include - #include -+ -+#if SD_BOOT -+typedef __WCHAR_TYPE__ wchar_t; -+#define __DEFINED_wchar_t -+#else - #include -+#endif - - #include "efi-string.h" - --- -2.39.2 - diff --git a/meta-openeuler/recipes-core/systemd/systemd/27253.patch b/meta-openeuler/recipes-core/systemd/systemd/27253.patch deleted file mode 100644 index 6c556fe80fdfe6b0f81220a47a8aa9a14d7ed29f..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/systemd/systemd/27253.patch +++ /dev/null @@ -1,313 +0,0 @@ -From 924937cbc0bf692bc6e5b3a0bd3c18347d9521e9 Mon Sep 17 00:00:00 2001 -From: Yu Watanabe -Date: Thu, 13 Apr 2023 16:40:36 +0900 -Subject: [PATCH 1/7] timesync: drop unnecessary initialization - -Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/27253] -Signed-off-by: Khem Raj ---- - src/timesync/timesyncd-manager.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/src/timesync/timesyncd-manager.c -+++ b/src/timesync/timesyncd-manager.c -@@ -410,7 +410,7 @@ static int manager_receive_response(sd_e - .msg_name = &server_addr, - .msg_namelen = sizeof(server_addr), - }; -- struct timespec *recv_time = NULL; -+ struct timespec *recv_time; - triple_timestamp dts; - ssize_t len; - double origin, receive, trans, dest, delay, offset, root_distance; -@@ -445,7 +445,7 @@ static int manager_receive_response(sd_e - return 0; - } - -- recv_time = CMSG_FIND_DATA(&msghdr, SOL_SOCKET, SCM_TIMESTAMPNS, struct timespec); -+ recv_time = CMSG_FIND_AND_COPY_DATA(&msghdr, SOL_SOCKET, SCM_TIMESTAMPNS, struct timespec); - if (!recv_time) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Packet timestamp missing."); - ---- a/src/basic/socket-util.h -+++ b/src/basic/socket-util.h -@@ -183,17 +183,22 @@ int flush_accept(int fd); - * riscv32. */ - #define CMSG_TYPED_DATA(cmsg, type) \ - ({ \ -- struct cmsghdr *_cmsg = cmsg; \ -- assert_cc(__alignof__(type) <= __alignof__(struct cmsghdr)); \ -+ struct cmsghdr *_cmsg = (cmsg); \ -+ assert_cc(alignof(type) <= alignof(struct cmsghdr)); \ - _cmsg ? CAST_ALIGN_PTR(type, CMSG_DATA(_cmsg)) : (type*) NULL; \ - }) - - struct cmsghdr* cmsg_find(struct msghdr *mh, int level, int type, socklen_t length); -+void* cmsg_find_and_copy_data(struct msghdr *mh, int level, int type, void *buf, size_t buf_len); - - /* Type-safe, dereferencing version of cmsg_find() */ - #define CMSG_FIND_DATA(mh, level, type, ctype) \ - CMSG_TYPED_DATA(cmsg_find(mh, level, type, CMSG_LEN(sizeof(ctype))), ctype) - -+/* Type-safe version of cmsg_find_and_copy_data() */ -+#define CMSG_FIND_AND_COPY_DATA(mh, level, type, ctype) \ -+ (ctype*) cmsg_find_and_copy_data(mh, level, type, &(ctype){}, sizeof(ctype)) -+ - /* Resolves to a type that can carry cmsghdr structures. Make sure things are properly aligned, i.e. the type - * itself is placed properly in memory and the size is also aligned to what's appropriate for "cmsghdr" - * structures. */ ---- a/src/boot/efi/pe.c -+++ b/src/boot/efi/pe.c -@@ -197,7 +197,7 @@ static uint32_t get_compatibility_entry_ - uint32_t entry_point; - } _packed_ LinuxPeCompat1; - -- while (size >= sizeof(LinuxPeCompat1) && addr % __alignof__(LinuxPeCompat1) == 0) { -+ while (size >= sizeof(LinuxPeCompat1) && addr % alignof(LinuxPeCompat1) == 0) { - LinuxPeCompat1 *compat = (LinuxPeCompat1 *) ((uint8_t *) dos + addr); - - if (compat->type == 0 || compat->size == 0 || compat->size > size) ---- a/src/fundamental/macro-fundamental.h -+++ b/src/fundamental/macro-fundamental.h -@@ -6,12 +6,13 @@ - #endif - - #include -+#include - #include - #include - #include - - #define _align_(x) __attribute__((__aligned__(x))) --#define _alignas_(x) __attribute__((__aligned__(__alignof__(x)))) -+#define _alignas_(x) __attribute__((__aligned__(alignof(x)))) - #define _alignptr_ __attribute__((__aligned__(sizeof(void *)))) - #define _cleanup_(x) __attribute__((__cleanup__(x))) - #define _const_ __attribute__((__const__)) -@@ -346,9 +347,9 @@ static inline size_t ALIGN_TO(size_t l, - #endif - - /* Checks if the specified pointer is aligned as appropriate for the specific type */ --#define IS_ALIGNED16(p) (((uintptr_t) p) % __alignof__(uint16_t) == 0) --#define IS_ALIGNED32(p) (((uintptr_t) p) % __alignof__(uint32_t) == 0) --#define IS_ALIGNED64(p) (((uintptr_t) p) % __alignof__(uint64_t) == 0) -+#define IS_ALIGNED16(p) (((uintptr_t) p) % alignof(uint16_t) == 0) -+#define IS_ALIGNED32(p) (((uintptr_t) p) % alignof(uint32_t) == 0) -+#define IS_ALIGNED64(p) (((uintptr_t) p) % alignof(uint64_t) == 0) - - /* Same as ALIGN_TO but callable in constant contexts. */ - #define CONST_ALIGN_TO(l, ali) \ -@@ -366,7 +367,7 @@ static inline size_t ALIGN_TO(size_t l, - #define CAST_ALIGN_PTR(t, p) \ - ({ \ - const void *_p = (p); \ -- assert(((uintptr_t) _p) % __alignof__(t) == 0); \ -+ assert(((uintptr_t) _p) % alignof(t) == 0); \ - (t *) _p; \ - }) - ---- a/src/network/networkd-nexthop.c -+++ b/src/network/networkd-nexthop.c -@@ -894,7 +894,7 @@ int manager_rtnl_process_nexthop(sd_netl - return 0; - } - -- assert((uintptr_t) group % __alignof__(struct nexthop_grp) == 0); -+ assert((uintptr_t) group % alignof(struct nexthop_grp) == 0); - - n_group = raw_group_size / sizeof(struct nexthop_grp); - for (size_t i = 0; i < n_group; i++) { ---- a/src/test/test-sizeof.c -+++ b/src/test/test-sizeof.c -@@ -17,16 +17,16 @@ - DISABLE_WARNING_TYPE_LIMITS; - - #define info_no_sign(t) \ -- printf("%s → %zu bits, %zu byte alignment\n", STRINGIFY(t), \ -+ printf("%s → %zu bits, %zu byte alignment\n", STRINGIFY(t), \ - sizeof(t)*CHAR_BIT, \ -- __alignof__(t)) -+ alignof(t)) - - #define info(t) \ -- printf("%s → %zu bits%s, %zu byte alignment\n", STRINGIFY(t), \ -+ printf("%s → %zu bits%s, %zu byte alignment\n", STRINGIFY(t), \ - sizeof(t)*CHAR_BIT, \ - strstr(STRINGIFY(t), "signed") ? "" : \ - (t)-1 < (t)0 ? ", signed" : ", unsigned", \ -- __alignof__(t)) -+ alignof(t)) - - enum Enum { - enum_value, -@@ -44,7 +44,7 @@ enum BigEnum2 { - int main(void) { - int (*function_pointer)(void); - -- info_no_sign(function_pointer); -+ info_no_sign(typeof(function_pointer)); - info_no_sign(void*); - info(char*); - ---- a/src/basic/socket-util.c -+++ b/src/basic/socket-util.c -@@ -1171,6 +1171,18 @@ struct cmsghdr* cmsg_find(struct msghdr - return NULL; - } - -+void* cmsg_find_and_copy_data(struct msghdr *mh, int level, int type, void *buf, size_t buf_len) { -+ struct cmsghdr *cmsg; -+ -+ assert(mh); -+ -+ cmsg = cmsg_find(mh, level, type, buf_len == SIZE_MAX ? (socklen_t) -1 : CMSG_LEN(buf_len)); -+ if (!cmsg) -+ return NULL; -+ -+ return memcpy_safe(buf, CMSG_DATA(cmsg), buf_len == SIZE_MAX ? cmsg->cmsg_len : buf_len); -+} -+ - int socket_ioctl_fd(void) { - int fd; - ---- a/src/journal/journald-server.c -+++ b/src/journal/journald-server.c -@@ -1385,7 +1385,7 @@ int server_process_datagram( - size_t label_len = 0, m; - Server *s = ASSERT_PTR(userdata); - struct ucred *ucred = NULL; -- struct timeval *tv = NULL; -+ struct timeval tv_buf, *tv = NULL; - struct cmsghdr *cmsg; - char *label = NULL; - struct iovec iovec; -@@ -1461,10 +1461,10 @@ int server_process_datagram( - label = CMSG_TYPED_DATA(cmsg, char); - label_len = cmsg->cmsg_len - CMSG_LEN(0); - } else if (cmsg->cmsg_level == SOL_SOCKET && -- cmsg->cmsg_type == SO_TIMESTAMP && -+ cmsg->cmsg_type == SCM_TIMESTAMP && - cmsg->cmsg_len == CMSG_LEN(sizeof(struct timeval))) { - assert(!tv); -- tv = CMSG_TYPED_DATA(cmsg, struct timeval); -+ tv = memcpy(&tv_buf, CMSG_DATA(cmsg), sizeof(struct timeval)); - } else if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_RIGHTS) { - assert(!fds); ---- a/src/libsystemd-network/icmp6-util.c -+++ b/src/libsystemd-network/icmp6-util.c -@@ -199,9 +199,11 @@ int icmp6_receive(int fd, void *buffer, - } - - if (cmsg->cmsg_level == SOL_SOCKET && -- cmsg->cmsg_type == SO_TIMESTAMP && -- cmsg->cmsg_len == CMSG_LEN(sizeof(struct timeval))) -- triple_timestamp_from_realtime(&t, timeval_load(CMSG_TYPED_DATA(cmsg, struct timeval))); -+ cmsg->cmsg_type == SCM_TIMESTAMP && -+ cmsg->cmsg_len == CMSG_LEN(sizeof(struct timeval))) { -+ struct timeval *tv = memcpy(&(struct timeval) {}, CMSG_DATA(cmsg), sizeof(struct timeval)); -+ triple_timestamp_from_realtime(&t, timeval_load(tv)); -+ } - } - - if (!triple_timestamp_is_set(&t)) ---- a/src/libsystemd-network/sd-dhcp6-client.c -+++ b/src/libsystemd-network/sd-dhcp6-client.c -@@ -1276,7 +1276,6 @@ static int client_receive_message( - .msg_control = &control, - .msg_controllen = sizeof(control), - }; -- struct cmsghdr *cmsg; - triple_timestamp t = {}; - _cleanup_free_ DHCP6Message *message = NULL; - struct in6_addr *server_address = NULL; -@@ -1320,12 +1319,9 @@ static int client_receive_message( - server_address = &sa.in6.sin6_addr; - } - -- CMSG_FOREACH(cmsg, &msg) { -- if (cmsg->cmsg_level == SOL_SOCKET && -- cmsg->cmsg_type == SO_TIMESTAMP && -- cmsg->cmsg_len == CMSG_LEN(sizeof(struct timeval))) -- triple_timestamp_from_realtime(&t, timeval_load(CMSG_TYPED_DATA(cmsg, struct timeval))); -- } -+ struct timeval *tv = CMSG_FIND_AND_COPY_DATA(&msg, SOL_SOCKET, SCM_TIMESTAMP, struct timeval); -+ if (tv) -+ triple_timestamp_from_realtime(&t, timeval_load(tv)); - - if (client->transaction_id != (message->transaction_id & htobe32(0x00ffffff))) - return 0; ---- a/src/libsystemd-network/sd-dhcp-server.c -+++ b/src/libsystemd-network/sd-dhcp-server.c -@@ -407,7 +407,7 @@ static int dhcp_server_send_udp(sd_dhcp_ - rather than binding the socket. This will be mostly useful - when we gain support for arbitrary number of server addresses - */ -- pktinfo = (struct in_pktinfo*) CMSG_DATA(cmsg); -+ pktinfo = CMSG_TYPED_DATA(cmsg, struct in_pktinfo); - assert(pktinfo); - - pktinfo->ipi_ifindex = server->ifindex; -@@ -1270,7 +1270,6 @@ static int server_receive_message(sd_eve - .msg_control = &control, - .msg_controllen = sizeof(control), - }; -- struct cmsghdr *cmsg; - ssize_t datagram_size, len; - int r; - -@@ -1306,19 +1305,10 @@ static int server_receive_message(sd_eve - if ((size_t) len < sizeof(DHCPMessage)) - return 0; - -- CMSG_FOREACH(cmsg, &msg) -- if (cmsg->cmsg_level == IPPROTO_IP && -- cmsg->cmsg_type == IP_PKTINFO && -- cmsg->cmsg_len == CMSG_LEN(sizeof(struct in_pktinfo))) { -- struct in_pktinfo *info = CMSG_TYPED_DATA(cmsg, struct in_pktinfo); -- -- /* TODO figure out if this can be done as a filter on -- * the socket, like for IPv6 */ -- if (server->ifindex != info->ipi_ifindex) -- return 0; -- -- break; -- } -+ /* TODO figure out if this can be done as a filter on the socket, like for IPv6 */ -+ struct in_pktinfo *info = CMSG_FIND_DATA(&msg, IPPROTO_IP, IP_PKTINFO, struct in_pktinfo); -+ if (info && info->ipi_ifindex != server->ifindex) -+ return 0; - - if (sd_dhcp_server_is_in_relay_mode(server)) { - r = dhcp_server_relay_message(server, message, len - sizeof(DHCPMessage), buflen); ---- a/src/libsystemd/sd-daemon/sd-daemon.c -+++ b/src/libsystemd/sd-daemon/sd-daemon.c -@@ -567,7 +567,7 @@ _public_ int sd_pid_notify_with_fds( - cmsg->cmsg_type = SCM_CREDENTIALS; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred)); - -- ucred = (struct ucred*) CMSG_DATA(cmsg); -+ ucred = CMSG_TYPED_DATA(cmsg, struct ucred); - ucred->pid = pid != 0 ? pid : getpid_cached(); - ucred->uid = getuid(); - ucred->gid = getgid(); ---- a/src/resolve/resolved-manager.c -+++ b/src/resolve/resolved-manager.c -@@ -984,7 +984,7 @@ static int manager_ipv4_send( - cmsg->cmsg_level = IPPROTO_IP; - cmsg->cmsg_type = IP_PKTINFO; - -- pi = (struct in_pktinfo*) CMSG_DATA(cmsg); -+ pi = CMSG_TYPED_DATA(cmsg, struct in_pktinfo); - pi->ipi_ifindex = ifindex; - - if (source) -@@ -1040,7 +1040,7 @@ static int manager_ipv6_send( - cmsg->cmsg_level = IPPROTO_IPV6; - cmsg->cmsg_type = IPV6_PKTINFO; - -- pi = (struct in6_pktinfo*) CMSG_DATA(cmsg); -+ pi = CMSG_TYPED_DATA(cmsg, struct in6_pktinfo); - pi->ipi6_ifindex = ifindex; - - if (source) diff --git a/meta-openeuler/recipes-core/systemd/systemd/27254.patch b/meta-openeuler/recipes-core/systemd/systemd/27254.patch deleted file mode 100644 index 3928088dc6aeb19b46606cbc12cb8dc0caadf69e..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/systemd/systemd/27254.patch +++ /dev/null @@ -1,345 +0,0 @@ -From 79dec6f5cc0b72d43dfb0469fa68b5cd023fbaf9 Mon Sep 17 00:00:00 2001 -From: Lennart Poettering -Date: Thu, 13 Apr 2023 10:21:31 +0200 -Subject: [PATCH 1/3] socket-util: tighten aignment check for CMSG_TYPED_DATA() - -Apparently CMSG_DATA() alignment is very much undefined. Which is quite -an ABI fuck-up, but we need to deal with this. CMSG_TYPED_DATA() already -checks alignment of the specified pointer. Let's also check matching -alignment of the underlying structures, which we already can do at -compile-time. - -See: #27241 - -(This does not fix #27241, but should catch such errors already at -compile-time instead of runtime) - -Upstream-Status: Backport [https://github.com/systemd/systemd/pull/27254] -Signed-off-by: Khem Raj ---- - src/basic/socket-util.h | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/src/basic/socket-util.h -+++ b/src/basic/socket-util.h -@@ -175,9 +175,16 @@ int flush_accept(int fd); - #define CMSG_FOREACH(cmsg, mh) \ - for ((cmsg) = CMSG_FIRSTHDR(mh); (cmsg); (cmsg) = CMSG_NXTHDR((mh), (cmsg))) - -+/* Returns the cmsghdr's data pointer, but safely cast to the specified type. Does two alignment checks: one -+ * at compile time, that the requested type has a smaller or same alignment as 'struct cmsghdr', and one -+ * during runtime, that the actual pointer matches the alignment too. This is supposed to catch cases such as -+ * 'struct timeval' is embedded into 'struct cmsghdr' on architectures where the alignment of the former is 8 -+ * bytes (because of a 64bit time_t), but of the latter is 4 bytes (because size_t is 32bit), such as -+ * riscv32. */ - #define CMSG_TYPED_DATA(cmsg, type) \ - ({ \ - struct cmsghdr *_cmsg = cmsg; \ -+ assert_cc(__alignof__(type) <= __alignof__(struct cmsghdr)); \ - _cmsg ? CAST_ALIGN_PTR(type, CMSG_DATA(_cmsg)) : (type*) NULL; \ - }) - ---- a/src/basic/socket-util.c -+++ b/src/basic/socket-util.c -@@ -1047,7 +1047,7 @@ ssize_t receive_one_fd_iov( - } - - if (found) -- *ret_fd = *(int*) CMSG_DATA(found); -+ *ret_fd = *CMSG_TYPED_DATA(found, int); - else - *ret_fd = -EBADF; - ---- a/src/core/manager.c -+++ b/src/core/manager.c -@@ -2503,7 +2503,7 @@ static int manager_dispatch_notify_fd(sd - if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { - - assert(!fd_array); -- fd_array = (int*) CMSG_DATA(cmsg); -+ fd_array = CMSG_TYPED_DATA(cmsg, int); - n_fds = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); - - } else if (cmsg->cmsg_level == SOL_SOCKET && -@@ -2511,7 +2511,7 @@ static int manager_dispatch_notify_fd(sd - cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred))) { - - assert(!ucred); -- ucred = (struct ucred*) CMSG_DATA(cmsg); -+ ucred = CMSG_TYPED_DATA(cmsg, struct ucred); - } - } - ---- a/src/coredump/coredump.c -+++ b/src/coredump/coredump.c -@@ -1163,7 +1163,7 @@ static int process_socket(int fd) { - } - - assert(input_fd < 0); -- input_fd = *(int*) CMSG_DATA(found); -+ input_fd = *CMSG_TYPED_DATA(found, int); - break; - } else - cmsg_close_all(&mh); ---- a/src/home/homed-manager.c -+++ b/src/home/homed-manager.c -@@ -1086,7 +1086,7 @@ static ssize_t read_datagram( - cmsg->cmsg_type == SCM_CREDENTIALS && - cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred))) { - assert(!sender); -- sender = (struct ucred*) CMSG_DATA(cmsg); -+ sender = CMSG_TYPED_DATA(cmsg, struct ucred); - } - - if (cmsg->cmsg_level == SOL_SOCKET && -@@ -1098,7 +1098,7 @@ static ssize_t read_datagram( - } - - assert(passed_fd < 0); -- passed_fd = *(int*) CMSG_DATA(cmsg); -+ passed_fd = *CMSG_TYPED_DATA(cmsg, int); - } - } - ---- a/src/journal/journald-server.c -+++ b/src/journal/journald-server.c -@@ -1454,21 +1454,21 @@ int server_process_datagram( - cmsg->cmsg_type == SCM_CREDENTIALS && - cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred))) { - assert(!ucred); -- ucred = (struct ucred*) CMSG_DATA(cmsg); -+ ucred = CMSG_TYPED_DATA(cmsg, struct ucred); - } else if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_SECURITY) { - assert(!label); -- label = (char*) CMSG_DATA(cmsg); -+ label = CMSG_TYPED_DATA(cmsg, char); - label_len = cmsg->cmsg_len - CMSG_LEN(0); - } else if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SO_TIMESTAMP && - cmsg->cmsg_len == CMSG_LEN(sizeof(struct timeval))) { - assert(!tv); -- tv = (struct timeval*) CMSG_DATA(cmsg); -+ tv = CMSG_TYPED_DATA(cmsg, struct timeval); - } else if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_RIGHTS) { - assert(!fds); -- fds = (int*) CMSG_DATA(cmsg); -+ fds = CMSG_TYPED_DATA(cmsg, int); - n_fds = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); - } - ---- a/src/libsystemd-network/icmp6-util.c -+++ b/src/libsystemd-network/icmp6-util.c -@@ -192,7 +192,7 @@ int icmp6_receive(int fd, void *buffer, - if (cmsg->cmsg_level == SOL_IPV6 && - cmsg->cmsg_type == IPV6_HOPLIMIT && - cmsg->cmsg_len == CMSG_LEN(sizeof(int))) { -- int hops = *(int*) CMSG_DATA(cmsg); -+ int hops = *CMSG_TYPED_DATA(cmsg, int); - - if (hops != 255) - return -EMULTIHOP; -@@ -201,7 +201,7 @@ int icmp6_receive(int fd, void *buffer, - if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SO_TIMESTAMP && - cmsg->cmsg_len == CMSG_LEN(sizeof(struct timeval))) -- triple_timestamp_from_realtime(&t, timeval_load((struct timeval*) CMSG_DATA(cmsg))); -+ triple_timestamp_from_realtime(&t, timeval_load(CMSG_TYPED_DATA(cmsg, struct timeval))); - } - - if (!triple_timestamp_is_set(&t)) ---- a/src/libsystemd-network/sd-dhcp-client.c -+++ b/src/libsystemd-network/sd-dhcp-client.c -@@ -1981,7 +1981,7 @@ static int client_receive_message_raw( - - cmsg = cmsg_find(&msg, SOL_PACKET, PACKET_AUXDATA, CMSG_LEN(sizeof(struct tpacket_auxdata))); - if (cmsg) { -- struct tpacket_auxdata *aux = (struct tpacket_auxdata*) CMSG_DATA(cmsg); -+ struct tpacket_auxdata *aux = CMSG_TYPED_DATA(cmsg, struct tpacket_auxdata); - checksum = !(aux->tp_status & TP_STATUS_CSUMNOTREADY); - } - ---- a/src/libsystemd-network/sd-dhcp-server.c -+++ b/src/libsystemd-network/sd-dhcp-server.c -@@ -1310,7 +1310,7 @@ static int server_receive_message(sd_eve - if (cmsg->cmsg_level == IPPROTO_IP && - cmsg->cmsg_type == IP_PKTINFO && - cmsg->cmsg_len == CMSG_LEN(sizeof(struct in_pktinfo))) { -- struct in_pktinfo *info = (struct in_pktinfo*)CMSG_DATA(cmsg); -+ struct in_pktinfo *info = CMSG_TYPED_DATA(cmsg, struct in_pktinfo); - - /* TODO figure out if this can be done as a filter on - * the socket, like for IPv6 */ ---- a/src/libsystemd/sd-bus/bus-socket.c -+++ b/src/libsystemd/sd-bus/bus-socket.c -@@ -604,7 +604,7 @@ static int bus_socket_read_auth(sd_bus * - * protocol? Somebody is playing games with - * us. Close them all, and fail */ - j = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); -- close_many((int*) CMSG_DATA(cmsg), j); -+ close_many(CMSG_TYPED_DATA(cmsg, int), j); - return -EIO; - } else - log_debug("Got unexpected auxiliary data with level=%d and type=%d", -@@ -1270,18 +1270,18 @@ int bus_socket_read_message(sd_bus *bus) - * isn't actually enabled? Close them, - * and fail */ - -- close_many((int*) CMSG_DATA(cmsg), n); -+ close_many(CMSG_TYPED_DATA(cmsg, int), n); - return -EIO; - } - - f = reallocarray(bus->fds, bus->n_fds + n, sizeof(int)); - if (!f) { -- close_many((int*) CMSG_DATA(cmsg), n); -+ close_many(CMSG_TYPED_DATA(cmsg, int), n); - return -ENOMEM; - } - - for (i = 0; i < n; i++) -- f[bus->n_fds++] = fd_move_above_stdio(((int*) CMSG_DATA(cmsg))[i]); -+ f[bus->n_fds++] = fd_move_above_stdio(CMSG_TYPED_DATA(cmsg, int)[i]); - bus->fds = f; - } else - log_debug("Got unexpected auxiliary data with level=%d and type=%d", ---- a/src/resolve/resolved-dns-stream.c -+++ b/src/resolve/resolved-dns-stream.c -@@ -147,7 +147,7 @@ static int dns_stream_identify(DnsStream - switch (cmsg->cmsg_type) { - - case IPV6_PKTINFO: { -- struct in6_pktinfo *i = (struct in6_pktinfo*) CMSG_DATA(cmsg); -+ struct in6_pktinfo *i = CMSG_TYPED_DATA(cmsg, struct in6_pktinfo); - - if (s->ifindex <= 0) - s->ifindex = i->ipi6_ifindex; -@@ -155,7 +155,7 @@ static int dns_stream_identify(DnsStream - } - - case IPV6_HOPLIMIT: -- s->ttl = *(int *) CMSG_DATA(cmsg); -+ s->ttl = *CMSG_TYPED_DATA(cmsg, int); - break; - } - -@@ -165,7 +165,7 @@ static int dns_stream_identify(DnsStream - switch (cmsg->cmsg_type) { - - case IP_PKTINFO: { -- struct in_pktinfo *i = (struct in_pktinfo*) CMSG_DATA(cmsg); -+ struct in_pktinfo *i = CMSG_TYPED_DATA(cmsg, struct in_pktinfo); - - if (s->ifindex <= 0) - s->ifindex = i->ipi_ifindex; -@@ -173,7 +173,7 @@ static int dns_stream_identify(DnsStream - } - - case IP_TTL: -- s->ttl = *(int *) CMSG_DATA(cmsg); -+ s->ttl = *CMSG_TYPED_DATA(cmsg, int); - break; - } - } ---- a/src/resolve/resolved-manager.c -+++ b/src/resolve/resolved-manager.c -@@ -801,7 +801,7 @@ int manager_recv(Manager *m, int fd, Dns - switch (cmsg->cmsg_type) { - - case IPV6_PKTINFO: { -- struct in6_pktinfo *i = (struct in6_pktinfo*) CMSG_DATA(cmsg); -+ struct in6_pktinfo *i = CMSG_TYPED_DATA(cmsg, struct in6_pktinfo); - - if (p->ifindex <= 0) - p->ifindex = i->ipi6_ifindex; -@@ -811,11 +811,11 @@ int manager_recv(Manager *m, int fd, Dns - } - - case IPV6_HOPLIMIT: -- p->ttl = *(int *) CMSG_DATA(cmsg); -+ p->ttl = *CMSG_TYPED_DATA(cmsg, int); - break; - - case IPV6_RECVFRAGSIZE: -- p->fragsize = *(int *) CMSG_DATA(cmsg); -+ p->fragsize = *CMSG_TYPED_DATA(cmsg, int); - break; - } - } else if (cmsg->cmsg_level == IPPROTO_IP) { -@@ -824,7 +824,7 @@ int manager_recv(Manager *m, int fd, Dns - switch (cmsg->cmsg_type) { - - case IP_PKTINFO: { -- struct in_pktinfo *i = (struct in_pktinfo*) CMSG_DATA(cmsg); -+ struct in_pktinfo *i = CMSG_TYPED_DATA(cmsg, struct in_pktinfo); - - if (p->ifindex <= 0) - p->ifindex = i->ipi_ifindex; -@@ -834,11 +834,11 @@ int manager_recv(Manager *m, int fd, Dns - } - - case IP_TTL: -- p->ttl = *(int *) CMSG_DATA(cmsg); -+ p->ttl = *CMSG_TYPED_DATA(cmsg, int); - break; - - case IP_RECVFRAGSIZE: -- p->fragsize = *(int *) CMSG_DATA(cmsg); -+ p->fragsize = *CMSG_TYPED_DATA(cmsg, int); - break; - } - } ---- a/src/libsystemd/sd-device/device-monitor.c -+++ b/src/libsystemd/sd-device/device-monitor.c -@@ -503,7 +503,6 @@ int device_monitor_receive_device(sd_dev - .msg_name = &snl, - .msg_namelen = sizeof(snl), - }; -- struct cmsghdr *cmsg; - struct ucred *cred; - size_t offset; - ssize_t n; -@@ -559,12 +558,11 @@ int device_monitor_receive_device(sd_dev - snl.nl.nl_pid); - } - -- cmsg = CMSG_FIRSTHDR(&smsg); -- if (!cmsg || cmsg->cmsg_type != SCM_CREDENTIALS) -+ cred = CMSG_FIND_DATA(&smsg, SOL_SOCKET, SCM_CREDENTIALS, struct ucred); -+ if (!cred) - return log_monitor_errno(m, SYNTHETIC_ERRNO(EAGAIN), - "No sender credentials received, ignoring message."); - -- cred = (struct ucred*) CMSG_DATA(cmsg); - if (!check_sender_uid(m, cred->uid)) - return log_monitor_errno(m, SYNTHETIC_ERRNO(EAGAIN), - "Sender uid="UID_FMT", message ignored.", cred->uid); ---- a/src/udev/udev-ctrl.c -+++ b/src/udev/udev-ctrl.c -@@ -161,7 +161,6 @@ static int udev_ctrl_connection_event_ha - .msg_control = &control, - .msg_controllen = sizeof(control), - }; -- struct cmsghdr *cmsg; - struct ucred *cred; - ssize_t size; - -@@ -185,15 +184,12 @@ static int udev_ctrl_connection_event_ha - - cmsg_close_all(&smsg); - -- cmsg = CMSG_FIRSTHDR(&smsg); -- -- if (!cmsg || cmsg->cmsg_type != SCM_CREDENTIALS) { -+ cred = CMSG_FIND_DATA(&smsg, SOL_SOCKET, SCM_CREDENTIALS, struct ucred); -+ if (!cred) { - log_error("No sender credentials received, ignoring message"); - return 0; - } - -- cred = (struct ucred *) CMSG_DATA(cmsg); -- - if (cred->uid != 0) { - log_error("Invalid sender uid "UID_FMT", ignoring message", cred->uid); - return 0; diff --git a/meta-openeuler/recipes-core/systemd/systemd/99-default.preset b/meta-openeuler/recipes-core/systemd/systemd/99-default.preset index 1f29b50597f0fd0557b15cb95bd670fc5f16c655..31954e13ef2a825462df2de27d32268e5c0d01c7 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/99-default.preset +++ b/meta-openeuler/recipes-core/systemd/systemd/99-default.preset @@ -1 +1 @@ -disable * +disable * \ No newline at end of file diff --git a/meta-openeuler/recipes-core/systemd/systemd/basic.conf.in b/meta-openeuler/recipes-core/systemd/systemd/basic.conf.in deleted file mode 100644 index fac288f7fa5892488794b4f8f4799a736ce5a5cd..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/systemd/systemd/basic.conf.in +++ /dev/null @@ -1,40 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -# The superuser -u root 0 "root" :ROOT_HOME: - -# The nobody user/group for NFS file systems -g {{NOBODY_GROUP_NAME}} 65534 - - -u {{NOBODY_USER_NAME }} 65534:65534 "Nobody" - - -# Administrator group: can *see* more than normal users -g adm {{ADM_GID }} - - - -# Administrator group: can *do* more than normal users -g wheel {{WHEEL_GID }} - - - -# Access to shared database of users on the system -g utmp {{UTMP_GID }} - - - -# Physical and virtual hardware access groups -g audio {{AUDIO_GID }} - - -g cdrom {{CDROM_GID }} - - -g dialout {{DIALOUT_GID}} - - -g disk {{DISK_GID }} - - -g input {{INPUT_GID }} - - -g kmem {{KMEM_GID }} - - -g kvm {{KVM_GID }} - - -g lp {{LP_GID }} - - -g render {{RENDER_GID }} - - -g sgx {{SGX_GID }} - - -g tape {{TAPE_GID }} - - -g tty {{TTY_GID }} - - -g video {{VIDEO_GID }} - - - -# Default group for normal users -g users {{USERS_GID }} - - diff --git a/meta-openeuler/recipes-core/systemd/systemd/init b/meta-openeuler/recipes-core/systemd/systemd/init index ea52be48209521aa1a49345c631c9afbb1616434..70dce3ab31be16ee23e80c7b6dfdc3ad6af6fd96 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/init +++ b/meta-openeuler/recipes-core/systemd/systemd/init @@ -101,4 +101,4 @@ case "$1" in echo "Usage: $0 {start|stop|status|restart}" exit 1 esac -exit 0 +exit 0 \ No newline at end of file diff --git a/meta-openeuler/recipes-core/systemd/systemd/org.freedesktop.hostname1_no_polkit.conf b/meta-openeuler/recipes-core/systemd/systemd/org.freedesktop.hostname1_no_polkit.conf index f4d0271cdb6a562fbc3782ee242b09ff5d1a1674..bd98ba2fc18fdfd46a39baac7b06f40f110e3869 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/org.freedesktop.hostname1_no_polkit.conf +++ b/meta-openeuler/recipes-core/systemd/systemd/org.freedesktop.hostname1_no_polkit.conf @@ -8,4 +8,4 @@ - + \ No newline at end of file diff --git a/meta-openeuler/recipes-core/systemd/systemd/systemd-pager.sh b/meta-openeuler/recipes-core/systemd/systemd/systemd-pager.sh index 86e3e0ab78176c209781fb41e3a6f09f4ed90cd7..4b791ef1a609ff27e522e4a59519639ab2a0227f 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/systemd-pager.sh +++ b/meta-openeuler/recipes-core/systemd/systemd/systemd-pager.sh @@ -4,4 +4,4 @@ # is not the GNU version. if ! less -V > /dev/null 2>&1 ; then export SYSTEMD_PAGER= -fi +fi \ No newline at end of file diff --git a/meta-openeuler/recipes-core/systemd/systemd/touchscreen.rules b/meta-openeuler/recipes-core/systemd/systemd/touchscreen.rules index d83fd1673dfd30d9190affa9cd0cd3397e433603..d0aaeb300300ac3b9266086981b04e429b7516c4 100644 --- a/meta-openeuler/recipes-core/systemd/systemd/touchscreen.rules +++ b/meta-openeuler/recipes-core/systemd/systemd/touchscreen.rules @@ -15,4 +15,4 @@ # Create a symlink to any touchscreen input device SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0" -SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0" +SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0" \ No newline at end of file diff --git a/meta-openeuler/recipes-core/systemd/systemd_%.bbappend b/meta-openeuler/recipes-core/systemd/systemd_%.bbappend index abae709bf8c249e612ad1517b232c84daac71e3a..72af77a21e46b12e01c9cf6aafdd6a1be9703d24 100644 --- a/meta-openeuler/recipes-core/systemd/systemd_%.bbappend +++ b/meta-openeuler/recipes-core/systemd/systemd_%.bbappend @@ -1,11 +1,13 @@ # main bbfile: openembedded-core/meta/recipes-core/systemd/systemd_253.7.bb #version in openEuler -PV = "253" +PV = "255" S = "${WORKDIR}/${BP}" require systemd-openeuler.inc +DISTRO_FEATURES:append = " usrmerge" + # depmodwrapper is not valid to do depmod in buildtime, add a service to do it in runtime as a workaround. # as modutils.sh is not run under systemd PACKAGE_BEFORE_PN:append = " ${PN}-depmod " @@ -14,13 +16,22 @@ FILES:${PN}-depmod = "${systemd_unitdir}/system/systemd-depmod.service" SYSTEMD_SERVICE:${PN}-depmod = "systemd-depmod.service" do_install:append () { install -m 0644 ${WORKDIR}/systemd-depmod.service ${D}${systemd_unitdir}/system/systemd-depmod.service - ln -sf ../systemd-depmod.service ${D}${systemd_unitdir}/system/sysinit.target.wants/systemd-depmod.service + mkdir -p ${D}${systemd_unitdir}/system/sysinit.target.wants/ + ln -sf .${systemd_unitdir}/system/systemd-depmod.service ${D}${systemd_unitdir}/system/sysinit.target.wants/systemd-depmod.service # the default DNS servers systemd resolved use cannot be accessed in China # so we need to change the default DNS servers to the ones that can be accessed in China # for example, we can use AliDNS servers sed -i 's/#DNS=/DNS=223.5.5.5/' ${D}${sysconfdir}/systemd/resolved.conf } +# do_install:append () { +# install -m 0644 ${B}/units/systemd-binfmt.service ${D}/${systemd_user_unitdir}/systemd-binfmt.service +# } + +FILES:${PN}-binfmt:append = " \ + /usr/lib/systemd/system/systemd-binfmt.service \ +" + # glib needs meson, meson needs python3-native # here use nativesdk's meson-native and python3-native DEPENDS:remove = "python3-native" diff --git a/meta-openeuler/recipes-core/systemd/systemd_253.7.bb b/meta-openeuler/recipes-core/systemd/systemd_255.4.bb similarity index 85% rename from meta-openeuler/recipes-core/systemd/systemd_253.7.bb rename to meta-openeuler/recipes-core/systemd/systemd_255.4.bb index 1fd4556afd0e7a9446485171f28ce53d89c19ba2..c0a8b2e4ee56fb623f5180a2b704f4a8f8aee73f 100644 --- a/meta-openeuler/recipes-core/systemd/systemd_253.7.bb +++ b/meta-openeuler/recipes-core/systemd/systemd_255.4.bb @@ -10,14 +10,17 @@ SECTION = "base/shell" inherit useradd pkgconfig meson perlnative update-rc.d update-alternatives qemu systemd gettext bash-completion manpages features_check +# unmerged-usr support is deprecated upstream, taints the system and will be +# removed in the near future. Fail the build if it is not enabled. +REQUIRED_DISTRO_FEATURES += "usrmerge" + # As this recipe builds udev, respect systemd being in DISTRO_FEATURES so # that we don't build both udev and systemd in world builds. -REQUIRED_DISTRO_FEATURES = "systemd" +REQUIRED_DISTRO_FEATURES += "systemd" SRC_URI += " \ file://touchscreen.rules \ file://00-create-volatile.conf \ - file://basic.conf.in \ ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \ ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://00-hostnamed-network-user.conf', '', d)} \ file://init \ @@ -25,34 +28,33 @@ SRC_URI += " \ file://systemd-pager.sh \ file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ file://0008-implment-systemd-sysv-install-for-OE.patch \ - file://0004-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \ - file://27254.patch \ - file://27253.patch \ " # patches needed by musl SRC_URI:append:libc-musl = " ${SRC_URI_MUSL}" SRC_URI_MUSL = "\ - file://0009-missing_type.h-add-comparison_fn_t.patch \ - file://0010-add-fallback-parse_printf_format-implementation.patch \ - file://0011-src-basic-missing.h-check-for-missing-strndupa.patch \ - file://0012-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \ - file://0013-add-missing-FTW_-macros-for-musl.patch \ - file://0014-Use-uintmax_t-for-handling-rlim_t.patch \ - file://0015-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \ - file://0016-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \ - file://0017-Define-glibc-compatible-basename-for-non-glibc-syste.patch \ - file://0018-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \ - file://0019-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \ - file://0020-avoid-redefinition-of-prctl_mm_map-structure.patch \ - file://0021-do-not-disable-buffer-in-writing-files.patch \ - file://0022-Handle-__cpu_mask-usage.patch \ - file://0023-Handle-missing-gshadow.patch \ - file://0024-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch \ - file://0005-pass-correct-parameters-to-getdents64.patch \ - file://0001-Adjust-for-musl-headers.patch \ - file://0006-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch \ - file://0003-errno-util-Make-STRERROR-portable-for-musl.patch \ + file://0001-missing_type.h-add-comparison_fn_t.patch \ + file://0002-add-fallback-parse_printf_format-implementation.patch \ + file://0003-src-basic-missing.h-check-for-missing-strndupa.patch \ + file://0004-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \ + file://0005-add-missing-FTW_-macros-for-musl.patch \ + file://0006-Use-uintmax_t-for-handling-rlim_t.patch \ + file://0007-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \ + file://0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch \ + file://0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \ + file://0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \ + file://0011-avoid-redefinition-of-prctl_mm_map-structure.patch \ + file://0012-do-not-disable-buffer-in-writing-files.patch \ + file://0013-Handle-__cpu_mask-usage.patch \ + file://0014-Handle-missing-gshadow.patch \ + file://0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch \ + file://0016-pass-correct-parameters-to-getdents64.patch \ + file://0017-Adjust-for-musl-headers.patch \ + file://0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch \ + file://0019-errno-util-Make-STRERROR-portable-for-musl.patch \ + file://0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch \ + file://0021-shared-Do-not-use-malloc_info-on-musl.patch \ + file://0022-avoid-missing-LOCK_EX-declaration.patch \ " PAM_PLUGINS = " \ @@ -63,12 +65,14 @@ PAM_PLUGINS = " \ " PACKAGECONFIG ??= " \ - ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam selinux smack usrmerge polkit seccomp', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam pni-names selinux smack usrmerge polkit seccomp', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'minidebuginfo', 'coredump elfutils', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', 'link-udev-shared', d)} \ backlight \ binfmt \ + cgroupv2 \ gshadow \ hibernate \ hostnamed \ @@ -132,6 +136,7 @@ PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2" PACKAGECONFIG[cgroupv2] = "-Ddefault-hierarchy=unified,-Ddefault-hierarchy=hybrid" PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false" PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup,,cryptsetup" +PACKAGECONFIG[cryptsetup-plugins] = "-Dlibcryptsetup-plugins=true,-Dlibcryptsetup-plugins=false,cryptsetup,,cryptsetup" PACKAGECONFIG[tpm2] = "-Dtpm2=true,-Dtpm2=false,tpm2-tss,tpm2-tss libtss2 libtss2-tcti-device" # If multiple compression libraries are enabled, the format to use for compression is chosen implicitly, # so if you want to compress with e.g. lz4 you cannot enable zstd, so you cannot read zstd-compressed journal files. @@ -140,9 +145,8 @@ PACKAGECONFIG[default-compression-lz4] = "-Dlz4=true -Ddefault-compression=lz4,, PACKAGECONFIG[default-compression-xz] = "-Dxz=true -Ddefault-compression=xz,,xz" PACKAGECONFIG[default-compression-zstd] = "-Dzstd=true -Ddefault-compression=zstd,,zstd" PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus" -PACKAGECONFIG[efi] = "-Defi=true,-Defi=false" -PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi" -PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils" +PACKAGECONFIG[efi] = "-Defi=true -Dbootloader=true,-Defi=false -Dbootloader=false,python3-pyelftools-native" +PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils,,libelf libdw" PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false" PACKAGECONFIG[repart] = "-Drepart=true,-Drepart=false" PACKAGECONFIG[homed] = "-Dhomed=true,-Dhomed=false" @@ -158,6 +162,7 @@ PACKAGECONFIG[ima] = "-Dima=true,-Dima=false" PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false,glib-2.0" # Update NAT firewall rules PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables" +PACKAGECONFIG[journal-color] = ",,,less" PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl" PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod" PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig" @@ -175,11 +180,13 @@ PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd" PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname" PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false" PACKAGECONFIG[no-dns-fallback] = "-Ddns-servers=" -PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false" +PACKAGECONFIG[no-ntp-fallback] = "-Dntp-servers=" +PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false,,libnss-systemd" PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false" PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false" PACKAGECONFIG[oomd] = "-Doomd=true,-Doomd=false" PACKAGECONFIG[openssl] = "-Dopenssl=true,-Dopenssl=false,openssl" +PACKAGECONFIG[p11kit] = "-Dp11kit=true,-Dp11kit=false,p11-kit" PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}" PACKAGECONFIG[pcre2] = "-Dpcre2=true,-Dpcre2=false,libpcre2" PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false" @@ -189,6 +196,7 @@ PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false" PACKAGECONFIG[polkit_hostnamed_fallback] = ",,,,dbus-broker,polkit" PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false" PACKAGECONFIG[pstore] = "-Dpstore=true,-Dpstore=false" +PACKAGECONFIG[pni-names] = ",,," PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode,,qrencode" PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false" PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false" @@ -200,7 +208,7 @@ PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false" PACKAGECONFIG[sysext] = "-Dsysext=true, -Dsysext=false" PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false" PACKAGECONFIG[sysvinit] = "-Dsysvinit-path=${sysconfdir}/init.d -Dsysvrcnd-path=${sysconfdir},-Dsysvinit-path= -Dsysvrcnd-path=,,systemd-compat-units update-rc.d" -# When enabled use reproducble build timestamp if set as time epoch, +# When enabled use reproducible build timestamp if set as time epoch, # or build time if not. When disabled, time epoch is unset. def build_epoch(d): epoch = d.getVar('SOURCE_DATE_EPOCH') or "-1" @@ -222,6 +230,8 @@ PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz" PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib" PACKAGECONFIG[zstd] = "-Dzstd=true,-Dzstd=false,zstd" +RESOLV_CONF ??= "" + # Helper variables to clarify locations. This mirrors the logic in systemd's # build system. rootprefix ?= "${root_prefix}" @@ -238,9 +248,13 @@ EXTRA_OEMESON += "-Dnobody-user=nobody \ -Dsystem-uid-max=999 \ -Dsystem-alloc-gid-min=101 \ -Dsystem-gid-max=999 \ + -Dcreate-log-dirs=false \ + ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', '-Ddefault-mdns=no -Ddefault-llmnr=no', '', d)} \ " -# Hardcode target binary paths to avoid using paths from sysroot +# Hardcode target binary paths to avoid using paths from sysroot or worse +# it pokes for these binaries on build host and encodes that distro assumption +# into target EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \ -Dkmod-path=${base_bindir}/kmod \ -Dmount-path=${base_bindir}/mount \ @@ -248,17 +262,23 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \ -Dquotaon-path=${sbindir}/quotaon \ -Dsulogin-path=${base_sbindir}/sulogin \ -Dnologin-path=${base_sbindir}/nologin \ - -Dumount-path=${base_bindir}/umount" + -Dumount-path=${base_bindir}/umount \ + -Dloadkeys-path=${bindir}/loadkeys \ + -Dsetfont-path=${bindir}/setfont" # The 60 seconds is watchdog's default vaule. WATCHDOG_TIMEOUT ??= "60" -do_configure:prepend() { - sed s@:ROOT_HOME:@${ROOT_HOME}@g ${WORKDIR}/basic.conf.in > ${S}/sysusers.d/basic.conf.in -} - do_install() { meson_do_install + # Change the root user's home directory in /lib/sysusers.d/basic.conf. + # This is done merely for backward compatibility with previous systemd recipes. + # systemd hardcodes root user's HOME to be "/root". Changing to use other values + # may have unexpected runtime behaviors. + if [ "${ROOT_HOME}" != "/root" ]; then + bbwarn "Using ${ROOT_HOME} as root user's home directory is not fully supported by systemd" + sed -i -e 's#/root#${ROOT_HOME}#g' ${D}${exec_prefix}/lib/sysusers.d/basic.conf + fi install -d ${D}/${base_sbindir} if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then # Provided by a separate recipe @@ -270,12 +290,12 @@ do_install() { [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd install -d ${D}${sysconfdir}/udev/rules.d/ - install -d ${D}${sysconfdir}/tmpfiles.d + install -d ${D}${nonarch_libdir}/tmpfiles.d for rule in $(find ${WORKDIR} -maxdepth 1 -type f -name "*.rules"); do install -m 0644 $rule ${D}${sysconfdir}/udev/rules.d/ done - install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ + install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${nonarch_libdir}/tmpfiles.d/ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then install -d ${D}${sysconfdir}/init.d @@ -288,7 +308,7 @@ do_install() { # /var/log is typically a symbolic link to inside /var/volatile, # which is expected to be empty. rm -rf ${D}${localstatedir}/log - else + elif [ -e ${D}${localstatedir}/log/journal ]; then chown root:systemd-journal ${D}${localstatedir}/log/journal # journal-remote creates this at start @@ -329,8 +349,9 @@ do_install() { echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd else - sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf%g" ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf - ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd + resolv_conf="${@bb.utils.contains('RESOLV_CONF', 'stub-resolv', 'run/systemd/resolve/stub-resolv.conf', 'run/systemd/resolve/resolv.conf', d)}" + sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../${resolv_conf}%g" ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf + ln -s ../${resolv_conf} ${D}${sysconfdir}/resolv-conf.systemd fi if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'false', 'true', d)}; then rm ${D}${exec_prefix}/lib/tmpfiles.d/x11.conf @@ -368,6 +389,15 @@ do_install() { sed -i -e 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \ ${D}/${sysconfdir}/systemd/system.conf fi + + if ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d)}; then + if ! grep -q '^NamePolicy=.*mac' ${D}${rootlibexecdir}/systemd/network/99-default.link; then + sed -i '/^NamePolicy=/s/$/ mac/' ${D}${rootlibexecdir}/systemd/network/99-default.link + fi + if ! grep -q 'AlternativeNamesPolicy=.*mac' ${D}${rootlibexecdir}/systemd/network/99-default.link; then + sed -i '/AlternativeNamesPolicy=/s/$/ mac/' ${D}${rootlibexecdir}/systemd/network/99-default.link + fi + fi } python populate_packages:prepend (){ @@ -377,22 +407,24 @@ python populate_packages:prepend (){ PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*" PACKAGE_BEFORE_PN = "\ - ${PN}-gui \ - ${PN}-vconsole-setup \ - ${PN}-initramfs \ ${PN}-analyze \ - ${PN}-kernel-install \ - ${PN}-rpm-macros \ ${PN}-binfmt \ - ${PN}-zsh-completion \ ${PN}-container \ + ${PN}-crypt \ + ${PN}-extra-utils \ + ${PN}-gui \ + ${PN}-initramfs \ ${PN}-journal-gatewayd \ ${PN}-journal-upload \ ${PN}-journal-remote \ - ${PN}-extra-utils \ + ${PN}-kernel-install \ + ${PN}-rpm-macros \ ${PN}-udev-rules \ + ${PN}-vconsole-setup \ + ${PN}-zsh-completion \ libsystemd-shared \ udev \ + udev-bash-completion \ udev-hwdb \ " @@ -417,7 +449,7 @@ SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfm " SYSTEMD_SERVICE:${PN}-binfmt = "systemd-binfmt.service" -USERADD_PACKAGES = "${PN} ${PN}-extra-utils \ +USERADD_PACKAGES = "${PN} \ udev \ ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \ ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \ @@ -432,13 +464,17 @@ USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--syste USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /sbin/nologin systemd-resolve;', '', d)}" USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /sbin/nologin systemd-timesync;', '', d)}" USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'oomd', '--system -d / -M --shell /sbin/nologin systemd-oom;', '', d)}" -USERADD_PARAM:${PN}-extra-utils = "--system -d / -M --shell /sbin/nologin systemd-bus-proxy" USERADD_PARAM:${PN}-journal-gatewayd = "--system -d / -M --shell /sbin/nologin systemd-journal-gateway" USERADD_PARAM:${PN}-journal-remote = "--system -d / -M --shell /sbin/nologin systemd-journal-remote" USERADD_PARAM:${PN}-journal-upload = "--system -d / -M --shell /sbin/nologin systemd-journal-upload" FILES:${PN}-analyze = "${bindir}/systemd-analyze" +FILES:${PN}-crypt = "${bindir}/systemd-cryptenroll \ + ${libdir}/cryptsetup \ + " +RRECOMMENDS:${PN} += "${PN}-crypt" + FILES:${PN}-initramfs = "/init" RDEPENDS:${PN}-initramfs = "${PN}" @@ -465,7 +501,7 @@ FILES:${PN}-binfmt = "${sysconfdir}/binfmt.d/ \ ${systemd_system_unitdir}/systemd-binfmt.service" RRECOMMENDS:${PN}-binfmt = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', 'kernel-module-binfmt-misc', '', d)}" -RRECOMMENDS:${PN}-vconsole-setup = "${@bb.utils.contains('PACKAGECONFIG', 'vconsole', 'kbd kbd-consolefonts kbd-keymaps', '', d)}" +RDEPENDS:${PN}-vconsole-setup = "${@bb.utils.contains('PACKAGECONFIG', 'vconsole', 'kbd kbd-consolefonts kbd-keymaps', '', d)}" FILES:${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \ @@ -516,7 +552,6 @@ FILES:${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.c ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \ ${exec_prefix}/lib/tmpfiles.d/README \ ${systemd_system_unitdir}/systemd-nspawn@.service \ - ${libdir}/libnss_mymachines.so.2 \ ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \ ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \ ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \ @@ -525,6 +560,8 @@ FILES:${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.c ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \ " +RDEPENDS:${PN}-container = "${@bb.utils.contains('PACKAGECONFIG', 'nss-mymachines', 'libnss-mymachines', '', d)}" + # "machinectl import-tar" uses "tar --numeric-owner", not supported by busybox. RRECOMMENDS:${PN}-container += "\ ${PN}-journal-gatewayd \ @@ -545,13 +582,13 @@ FILES:${PN}-extra-utils = "\ ${bindir}/systemd-run \ ${bindir}/systemd-cat \ ${bindir}/systemd-creds \ - ${bindir}/systemd-cryptenroll \ ${bindir}/systemd-delta \ ${bindir}/systemd-cgls \ ${bindir}/systemd-cgtop \ ${bindir}/systemd-stdio-bridge \ ${base_bindir}/systemd-ask-password \ ${base_bindir}/systemd-tty-ask-password-agent \ + ${base_sbindir}/mount.ddi \ ${systemd_system_unitdir}/initrd.target.wants/systemd-pcrphase-initrd.path \ ${systemd_system_unitdir}/systemd-ask-password-console.path \ ${systemd_system_unitdir}/systemd-ask-password-console.service \ @@ -565,9 +602,6 @@ FILES:${PN}-extra-utils = "\ ${rootlibexecdir}/systemd/systemd-resolve-host \ ${rootlibexecdir}/systemd/systemd-ac-power \ ${rootlibexecdir}/systemd/systemd-activate \ - ${rootlibexecdir}/systemd/systemd-bus-proxyd \ - ${systemd_system_unitdir}/systemd-bus-proxyd.service \ - ${systemd_system_unitdir}/systemd-bus-proxyd.socket \ ${rootlibexecdir}/systemd/systemd-measure \ ${rootlibexecdir}/systemd/systemd-pcrphase \ ${rootlibexecdir}/systemd/systemd-socket-proxyd \ @@ -622,6 +656,8 @@ FILES:${PN} = " ${base_bindir}/* \ ${datadir}/polkit-1 \ ${datadir}/${BPN} \ ${datadir}/factory \ + ${sysconfdir}/credstore/ \ + ${sysconfdir}/credstore.encrypted/ \ ${sysconfdir}/dbus-1/ \ ${sysconfdir}/modules-load.d/ \ ${sysconfdir}/pam.d/ \ @@ -650,12 +686,14 @@ FILES:${PN} = " ${base_bindir}/* \ ${bindir}/bootctl \ ${bindir}/oomctl \ ${bindir}/userdbctl \ + ${exec_prefix}/lib/credstore \ ${exec_prefix}/lib/tmpfiles.d/*.conf \ ${exec_prefix}/lib/systemd \ ${exec_prefix}/lib/modules-load.d \ ${exec_prefix}/lib/sysctl.d \ ${exec_prefix}/lib/sysusers.d \ ${exec_prefix}/lib/environment.d \ + ${exec_prefix}/lib/pcrlock.d \ ${localstatedir} \ ${rootlibexecdir}/modprobe.d/systemd.conf \ ${rootlibexecdir}/modprobe.d/README \ @@ -675,7 +713,7 @@ FILES:${PN} = " ${base_bindir}/* \ FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" -RDEPENDS:${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck" +RDEPENDS:${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck util-linux-swaponoff" RDEPENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}" RDEPENDS:${PN} += "volatile-binds" @@ -685,6 +723,7 @@ RRECOMMENDS:${PN} += "systemd-extra-utils \ kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 kernel-module-sch-fq-codel \ os-release \ systemd-conf \ + ${@bb.utils.contains('PACKAGECONFIG', 'logind', 'pam-plugin-umask', '', d)} \ " INSANE_SKIP:${PN} += "dev-so libdir" @@ -696,6 +735,7 @@ FILES:libsystemd-shared = "${rootlibdir}/systemd/libsystemd-shared*.so" RPROVIDES:udev = "hotplug" +RDEPENDS:udev-bash-completion += "bash-completion" RDEPENDS:udev-hwdb += "udev" FILES:udev += "${base_sbindir}/udevd \ @@ -708,6 +748,7 @@ FILES:udev += "${base_sbindir}/udevd \ ${rootlibexecdir}/udev/dmi_memory_id \ ${rootlibexecdir}/udev/fido_id \ ${rootlibexecdir}/udev/findkeyboards \ + ${rootlibexecdir}/udev/iocost \ ${rootlibexecdir}/udev/keyboard-force-release.sh \ ${rootlibexecdir}/udev/keymap \ ${rootlibexecdir}/udev/mtd_probe \ @@ -719,6 +760,7 @@ FILES:udev += "${base_sbindir}/udevd \ ${rootlibexecdir}/udev/rules.d/60-autosuspend-chromiumos.rules \ ${rootlibexecdir}/udev/rules.d/60-block.rules \ ${rootlibexecdir}/udev/rules.d/60-cdrom_id.rules \ + ${rootlibexecdir}/udev/rules.d/60-dmi-id.rules \ ${rootlibexecdir}/udev/rules.d/60-drm.rules \ ${rootlibexecdir}/udev/rules.d/60-evdev.rules \ ${rootlibexecdir}/udev/rules.d/60-fido-id.rules \ @@ -727,6 +769,7 @@ FILES:udev += "${base_sbindir}/udevd \ ${rootlibexecdir}/udev/rules.d/60-persistent-alsa.rules \ ${rootlibexecdir}/udev/rules.d/60-persistent-input.rules \ ${rootlibexecdir}/udev/rules.d/60-persistent-storage.rules \ + ${rootlibexecdir}/udev/rules.d/60-persistent-storage-mtd.rules \ ${rootlibexecdir}/udev/rules.d/60-persistent-storage-tape.rules \ ${rootlibexecdir}/udev/rules.d/60-persistent-v4l.rules \ ${rootlibexecdir}/udev/rules.d/60-sensor.rules \ @@ -746,6 +789,7 @@ FILES:udev += "${base_sbindir}/udevd \ ${rootlibexecdir}/udev/rules.d/80-net-setup-link.rules \ ${rootlibexecdir}/udev/rules.d/81-net-dhcp.rules \ ${rootlibexecdir}/udev/rules.d/90-vconsole.rules \ + ${rootlibexecdir}/udev/rules.d/90-iocost.rules \ ${rootlibexecdir}/udev/rules.d/README \ ${sysconfdir}/udev \ ${sysconfdir}/init.d/systemd-udevd \ @@ -754,10 +798,10 @@ FILES:udev += "${base_sbindir}/udevd \ ${base_bindir}/systemd-hwdb \ ${base_bindir}/udevadm \ ${base_sbindir}/udevadm \ - ${datadir}/bash-completion/completions/udevadm \ ${systemd_system_unitdir}/systemd-hwdb-update.service \ " +FILES:udev-bash-completion = "${datadir}/bash-completion/completions/udevadm" FILES:udev-hwdb = "${rootlibexecdir}/udev/hwdb.d \ " @@ -771,6 +815,9 @@ python __anonymous() { if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") + if bb.utils.contains('DISTRO_FEATURES', 'systemd-resolved', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'nss-resolve resolved', True, False, d): + bb.error("DISTRO_FEATURES[systemd-resolved] requires PACKAGECONFIG[nss-resolve, resolved]") + if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d): bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]") @@ -811,15 +858,31 @@ ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" ALTERNATIVE_PRIORITY[runlevel] ?= "300" pkg_postinst:${PN}:libc-glibc () { - sed -e '/^hosts:/s/\s*\//' \ - -e 's/\(^hosts:.*\)\(\\)\(.*\)\(\\)\(.*\)/\1\2 myhostname \3\4\5/' \ - -i $D${sysconfdir}/nsswitch.conf + if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then + sed -e '/^hosts:/s/\s*\//' \ + -e 's/\(^hosts:.*\)\(\\)\(.*\)\(\\)\(.*\)/\1\2 myhostname \3\4\5/' \ + -i $D${sysconfdir}/nsswitch.conf + fi + if ${@bb.utils.contains('PACKAGECONFIG', 'nss', 'true', 'false', d)}; then + sed -e 's#\(^passwd:.*\)#\1 systemd#' \ + -e 's#\(^group:.*\)#\1 systemd#' \ + -e 's#\(^shadow:.*\)#\1 systemd#' \ + -i $D${sysconfdir}/nsswitch.conf + fi } pkg_prerm:${PN}:libc-glibc () { - sed -e '/^hosts:/s/\s*\//' \ - -e '/^hosts:/s/\s*myhostname//' \ - -i $D${sysconfdir}/nsswitch.conf + if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then + sed -e '/^hosts:/s/\s*\//' \ + -e '/^hosts:/s/\s*myhostname//' \ + -i $D${sysconfdir}/nsswitch.conf + fi + if ${@bb.utils.contains('PACKAGECONFIG', 'nss', 'true', 'false', d)}; then + sed -e '/^passwd:/s#\s*systemd##' \ + -e '/^group:/s#\s*systemd##' \ + -e '/^shadow:/s#\s*systemd##' \ + -i $D${sysconfdir}/nsswitch.conf + fi } PACKAGE_WRITE_DEPS += "qemu-native" @@ -833,4 +896,4 @@ pkg_postinst:udev-hwdb () { pkg_prerm:udev-hwdb () { rm -f $D${sysconfdir}/udev/hwdb.bin -} +} \ No newline at end of file