Skip to contentSkip to conversation

base-passwd: add clock group

PATCH Superseded [email protected] 1 participant 3 messages Oct 31, 2025 exec and binfmt

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/3 base-passwd: add clock group

From: Chen Qi <[email protected]>

New systemd version (v258) introduces a new group, clock, to "enable applications like linuxptp to open clocks without root privileges".[1]

This results in warning at do_rootfs time:
WARNING: Group clock has never been defined

Add group clock with gid 81 to fix this issue. The wheel group's gid is 80, so 81 is chosen.

Note that Debian rejects this patch because they're using sysusers to handle such groups, including 'clock', 'kvm', 'sgx', etc. We're not relying on sysusers, so we have to add a patch here.

[1] https://github.com/systemd/systemd/commit/af96ccfc24bc4803078a46b4ef2cdeb5decdfbcd

---
 .../base-passwd/0001-Add-clock-group.patch    | 34 +++++++++++++++++++
 .../base-passwd/base-passwd_3.6.7.bb          |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-core/base-passwd/base-passwd/0001-Add-clock-group.patch
meta/recipes-core/base-passwd/base-passwd/0001-Add-clock-group.patch new file +34 -0
new file mode 100644
index 0000000000..af871949fa
@@ -0,0 +1,34 @@
+From 4b3a8f347179d7e2a1062eeed13a6474deb28728 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Thu, 16 Oct 2025 08:48:49 +0800
+Subject: [PATCH] Add clock group
+
+The clock group is needed to "to enable applications like linuxptp
+to open clocks without root privileges". See the link below:
+https://github.com/systemd/systemd/commit/af96ccfc24bc4803078a46b4ef2cdeb5decdfbcd
+
+Note that this group is needed as long as people use udev from
+systemd because 50-udev-default.rules needs it. See the above
+commit.
+
+Upstream-Status: Denied [https://salsa.debian.org/debian/base-passwd/-/merge_requests/17]
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ group.master | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/group.master b/group.master
+index e54fd1d..6f84539 100644
+--- a/group.master
++++ b/group.master
+@@ -39,5 +39,6 @@ staff:*:50:
+ games:*:60:
+ shutdown:*:70:
+ wheel:*:80:
++clock:*:81:
+ users:*:100:
+ nogroup:*:65534:
+-- 
+2.34.1
+
meta/recipes-core/base-passwd/base-passwd_3.6.7.bb +1 -0
index 177927d674..e4e0890293 100644
@@ -13,6 +13,7 @@ SRC_URI = "https://launchpad.net/debian/+archive/primary/+files/${BPN}_${PV}.tar
            file://0005-Add-kvm-group.patch \
            file://0007-Add-wheel-group.patch \
            file://0001-base-passwd-Add-the-sgx-group.patch \
+           file://0001-Add-clock-group.patch \
            "
 
 SRC_URI[sha256sum] = "cf869870fed7862b57bfa9e99cd5cd6f365e2349705a1b65af7fc182629bd1ab"
Signature · 1 line
2.34.1
#1 lore raw

PATCH v6 2/3 systemd: upgrade from 257.8 to 258.1

From: Chen Qi <[email protected]>

v258 Release Changes:
https://github.com/systemd/systemd/releases/tag/v258

v258.1 Contains a critical fix for our link-udev-shared PACKAGECONFIG.
https://github.com/systemd/systemd/commit/49b701531486536f69dcd2ef2cfc10d468847481
(meson: fix link-udev-shared option)

License-Update: update address of FSF.
See https://github.com/systemd/systemd/commit/d4802151b0be56d79dc171880fa3df0ed6f5f8fa

The 'runlevel', 'initctl', 'telinit' related contents are removed because they are offically removed in v258.

Disable tests explicitly. This is because we're not installing any tests. There's no point building them out. And this puts extra burden on making things compile for musl.

gcrypt and gnutls PACKAGECONFIGs are removed as "OpenSSL is now the only supported cryptography backend for systemd-resolved and systemd-importd."

systemd-systemctl-native changes:
sysvinit compat actions are removed. This includes removing unncessary patches and adding EXTRA_OEMESON. The systemctl-native should only focus on the systemd units as it was. The removed two extra patches look like a workaround to make do_rootfs pass. But the correct behavior is that systemctl-native should not invoke systemd-sysv-install and only focus on systemd units.

musl changes:
1. This version has big changes in musl patches. The goal is to help maintenance. I want patches to be more easily applied to new versions. The count of files modified by musl specific patches decreased from 113 (v257) to 34 (v258).
2. All patches are re-evaluated.
This version of systemd introduces big changes in header files and other places. So the previous musl patches are re-evaluated one by one. Those that are dropped are considered not needed. A few new ones are added. There are some notable ones. 0012-do-not-disable-buffer-in-writing-files.patch is dropped because there is not runtime error. 0016-Fix-the-segfault-for-glob-related-codes-and-define-d.patch is added because this version of systemd uses strv_free to free gl_pathv instead of relying on globfree provided by libc.

---
 ..._257.8.bb => systemd-boot-native_258.1.bb} |   0
 ...md-boot_257.8.bb => systemd-boot_258.1.bb} |   0
 ...8.bb => systemd-systemctl-native_258.1.bb} |   4 +-
 meta/recipes-core/systemd/systemd.inc         |   8 +-
 ...tall-dependency-links-at-install-tim.patch |  10 +-
 ...ll-systemd-sysv-install-without-path.patch |  37 --
 ...implment-systemd-sysv-install-for-OE.patch |  13 +-
 ...> 0003-Do-not-create-var-log-README.patch} |   9 +-
 ...3-missing_type.h-add-comparison_fn_t.patch |  61 --
 ...ntroduce-header-file-and-add-__THROW.patch |  61 ++
 ...-parse_printf_format-implementation.patch} |  79 +--
 ...OB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch | 156 ------
 ...info-related-contents-glibc-specific.patch | 117 ++++
 ...006-add-missing-FTW_-macros-for-musl.patch |  44 --
 ...07-Use-uintmax_t-for-handling-rlim_t.patch | 106 ----
 ...override-sys-prctl.h-to-avoid-redefi.patch |  43 ++
 ...patible-basename-for-non-glibc-syste.patch |  34 --
 ...ompliant-strerror_r-from-GNU-specif.patch} |  20 +-
 ...uffering-when-writing-to-oom_score_a.patch |  41 --
 ...til-Make-STRERROR-portable-for-musl.patch} |  17 +-
 ...-util.h-define-RLIM_FMT-to-fit-musl-.patch |  40 ++
 ...definition-of-prctl_mm_map-structure.patch |  32 --
 ...ride-malloc.h-define-dummy-malloc_tr.patch |  41 ++
 ...-not-disable-buffer-in-writing-files.patch | 530 ------------------
 ...tion.c-avoid-using-glibc-ConditionVe.patch |  47 ++
 .../0013-Handle-__cpu_mask-usage.patch        |  60 --
 ...c-avoid-boot-time-segfault-for-musl.patch} |   8 +-
 ...014-Handle-missing-gshadow-for-musl.patch} |  77 +--
 .../0015-Avoid-sequence-point-error.patch     |  35 ++
 ...l.h-Define-MIPS-ABI-defines-for-musl.patch |  42 --
 ...-for-glob-related-codes-and-define-d.patch | 409 ++++++++++++++
 ...ass-correct-parameters-to-getdents64.patch |  37 --
 .../0017-Adjust-for-musl-headers.patch        | 526 -----------------
 ...ays-include-netinet-if_ether.h-first.patch |  40 ++
 ...trerror-is-assumed-to-be-GNU-specifi.patch |  52 --
 ...ake-malloc_trim-conditional-on-glibc.patch |  39 --
 ...hared-Do-not-use-malloc_info-on-musl.patch |  57 --
 ...22-avoid-missing-LOCK_EX-declaration.patch |  56 --
 ...gnal.h-to-avoid-the-undeclared-error.patch |  27 -
 ...references-using-stdin-as-a-struct-m.patch |  48 --
 ...clusion-order-to-avoid-redeclaration.patch | 288 ----------
 .../{systemd_257.8.bb => systemd_258.1.bb}    |  67 +--
 42 files changed, 969 insertions(+), 2449 deletions(-)
 rename meta/recipes-core/systemd/{systemd-boot-native_257.8.bb => systemd-boot-native_258.1.bb} (100%)
 rename meta/recipes-core/systemd/{systemd-boot_257.8.bb => systemd-boot_258.1.bb} (100%)
 rename meta/recipes-core/systemd/{systemd-systemctl-native_257.8.bb => systemd-systemctl-native_258.1.bb} (87%)
 delete mode 100644 meta/recipes-core/systemd/systemd/0001-systemctl-Call-systemd-sysv-install-without-path.patch
 rename meta/recipes-core/systemd/systemd/{0001-Do-not-create-var-log-README.patch => 0003-Do-not-create-var-log-README.patch} (84%)
 delete mode 100644 meta/recipes-core/systemd/systemd/0003-missing_type.h-add-comparison_fn_t.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0004-musl.h-introduce-header-file-and-add-__THROW.patch
 rename meta/recipes-core/systemd/systemd/{0004-add-fallback-parse_printf_format-implementation.patch => 0005-add-fallback-parse_printf_format-implementation.patch} (88%)
 delete mode 100644 meta/recipes-core/systemd/systemd/0005-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0006-Make-mallinfo-related-contents-glibc-specific.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0006-add-missing-FTW_-macros-for-musl.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0007-Use-uintmax_t-for-handling-rlim_t.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0007-add-src-include-override-sys-prctl.h-to-avoid-redefi.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch
 rename meta/recipes-core/systemd/systemd/{0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch => 0008-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch} (77%)
 delete mode 100644 meta/recipes-core/systemd/systemd/0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
 rename meta/recipes-core/systemd/systemd/{0019-errno-util-Make-STRERROR-portable-for-musl.patch => 0009-errno-util-Make-STRERROR-portable-for-musl.patch} (72%)
 create mode 100644 meta/recipes-core/systemd/systemd/0010-src-basic-format-util.h-define-RLIM_FMT-to-fit-musl-.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0011-avoid-redefinition-of-prctl_mm_map-structure.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0011-src-include-override-malloc.h-define-dummy-malloc_tr.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0012-do-not-disable-buffer-in-writing-files.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0012-src-shared-condition.c-avoid-using-glibc-ConditionVe.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0013-Handle-__cpu_mask-usage.patch
 rename meta/recipes-core/systemd/systemd/{0026-build-path.c-avoid-boot-time-segfault-for-musl.patch => 0013-build-path.c-avoid-boot-time-segfault-for-musl.patch} (77%)
 rename meta/recipes-core/systemd/systemd/{0014-Handle-missing-gshadow.patch => 0014-Handle-missing-gshadow-for-musl.patch} (71%)
 create mode 100644 meta/recipes-core/systemd/systemd/0015-Avoid-sequence-point-error.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0016-Fix-the-segfault-for-glob-related-codes-and-define-d.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0017-Adjust-for-musl-headers.patch
 create mode 100644 meta/recipes-core/systemd/systemd/0017-Always-include-netinet-if_ether.h-first.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0021-shared-Do-not-use-malloc_info-on-musl.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0022-avoid-missing-LOCK_EX-declaration.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0023-include-signal.h-to-avoid-the-undeclared-error.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0024-undef-stdin-for-references-using-stdin-as-a-struct-m.patch
 delete mode 100644 meta/recipes-core/systemd/systemd/0025-adjust-header-inclusion-order-to-avoid-redeclaration.patch
 rename meta/recipes-core/systemd/{systemd_257.8.bb => systemd_258.1.bb} (92%)
meta/recipes-core/systemd/systemd-boot-native_258.1.bb renamed from meta/recipes-core/systemd/systemd-boot-native_257.8.bb +0 -0
similarity index 100%
rename from meta/recipes-core/systemd/systemd-boot-native_257.8.bb
rename to meta/recipes-core/systemd/systemd-boot-native_258.1.bb
meta/recipes-core/systemd/systemd-boot_258.1.bb renamed from meta/recipes-core/systemd/systemd-boot_257.8.bb +0 -0
similarity index 100%
rename from meta/recipes-core/systemd/systemd-boot_257.8.bb
rename to meta/recipes-core/systemd/systemd-boot_258.1.bb
meta/recipes-core/systemd/systemd-systemctl-native_258.1.bb renamed from meta/recipes-core/systemd/systemd-systemctl-native_257.8.bb +1 -3
similarity index 87%
rename from meta/recipes-core/systemd/systemd-systemctl-native_257.8.bb
rename to meta/recipes-core/systemd/systemd-systemctl-native_258.1.bb
index a37c9035ed..3d01d60e9c 100644
@@ -6,14 +6,12 @@ require systemd.inc
 
 DEPENDS = "gperf-native libcap-native util-linux-native python3-jinja2-native"
 
-SRC_URI += "file://0001-systemctl-Call-systemd-sysv-install-without-path.patch"
-SRC_URI += "file://0002-implment-systemd-sysv-install-for-OE.patch"
-
 inherit pkgconfig meson native
 
 MESON_TARGET = "systemctl:executable"
 MESON_INSTALL_TAGS = "systemctl"
 EXTRA_OEMESON += "-Dlink-systemctl-shared=false"
+EXTRA_OEMESON += "-Dsysvinit-path= -Dsysvrcnd-path="
 
 # Systemctl is supposed to operate on target, but the target sysroot is not
 # determined at run-time, but rather set during configure
meta/recipes-core/systemd/systemd.inc +4 -4
index 761660f2c8..daf37060d7 100644
@@ -12,11 +12,11 @@ work as a drop-in replacement for sysvinit."
 
 LICENSE = "GPL-2.0-only & LGPL-2.1-or-later"
 LICENSE:libsystemd = "LGPL-2.1-or-later"
-LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
-                    file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
+LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=c09786363500a9acc29b147e6e72d2c6 \
+                    file://LICENSE.LGPL2.1;md5=be0aaf4a380f73f7e00b420a007368f2"
 
-SRCREV = "5e38d199a623563698ab4a69acbbe3afa9135198"
-SRCBRANCH = "v257-stable"
+SRCREV = "67a1069b7269cc23c3d04a2fb0cf110abe7abf31"
+SRCBRANCH = "v258-stable"
 SRC_URI = "git://github.com/systemd/systemd.git;protocol=https;branch=${SRCBRANCH};tag=v${PV}"
 
 CVE_PRODUCT = "systemd"
meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch +5 -5
index 5101f9227e..8061ff1000 100644
@@ -1,7 +1,7 @@
-From e5fd143f215f072404c544f694cb026a4231503e Mon Sep 17 00:00:00 2001
+From b1ab58d3b4a8164e5978409706d6769f5cfde404 Mon Sep 17 00:00:00 2001
 From: Chen Qi <[email protected]>
 Date: Thu, 21 Feb 2019 16:23:24 +0800
-Subject: [PATCH 01/26] binfmt: Don't install dependency links at install time
+Subject: [PATCH 01/16] 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
@@ -25,10 +25,10 @@ Signed-off-by: Scott Murray <[email protected]>
  3 files changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/units/meson.build b/units/meson.build
-index 96f4852741..0a3a4fee67 100644
+index 4f47a3b2bd..237870025b 100644
 --- a/units/meson.build
 +++ b/units/meson.build
-@@ -156,7 +156,6 @@ units = [
+@@ -154,7 +154,6 @@ units = [
          {
            'file' : 'proc-sys-fs-binfmt_misc.automount',
            'conditions' : ['ENABLE_BINFMT'],
@@ -36,7 +36,7 @@ index 96f4852741..0a3a4fee67 100644
          },
          {
            'file' : 'proc-sys-fs-binfmt_misc.mount',
-@@ -258,7 +257,6 @@ units = [
+@@ -263,7 +262,6 @@ units = [
          {
            'file' : 'systemd-binfmt.service.in',
            'conditions' : ['ENABLE_BINFMT'],
meta/recipes-core/systemd/systemd/0001-systemctl-Call-systemd-sysv-install-without-path.patch deleted +0 -37
deleted file mode 100644
index bf08dbe9b0..0000000000
@@ -1,37 +0,0 @@
-From 34c8551a8b16bf235a1ebe8d9cb1a3474a7c975e Mon Sep 17 00:00:00 2001
-From: Peter Kjellerstedt <[email protected]>
-Date: Fri, 22 Aug 2025 18:07:28 +0200
-Subject: [PATCH] systemctl: Call systemd-sysv-install without path
-
-Expect to find systemd-sysv-install in $PATH instead of hardcoding the
-path to it, as the latter does not work when running systemctl from a
-recipe sysroot.
-
-Signed-off-by: Peter Kjellerstedt <[email protected]>
-Upstream-Status: Inappropriate [OE specific]
----
- src/systemctl/systemctl-sysv-compat.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/systemctl/systemctl-sysv-compat.c b/src/systemctl/systemctl-sysv-compat.c
-index cb9c43e3dc..e44ef9f64e 100644
---- a/src/systemctl/systemctl-sysv-compat.c
-+++ b/src/systemctl/systemctl-sysv-compat.c
-@@ -140,7 +140,7 @@ int enable_sysv_units(const char *verb, char **args) {
-         while (args[f]) {
- 
-                 const char *argv[] = {
--                        LIBEXECDIR "/systemd-sysv-install",
-+                        "systemd-sysv-install",
-                         NULL, /* --root= */
-                         NULL, /* verb */
-                         NULL, /* service */
-@@ -218,7 +218,7 @@ int enable_sysv_units(const char *verb, char **args) {
-                         return j;
-                 if (j == 0) {
-                         /* Child */
--                        execv(argv[0], (char**) argv);
-+                        execvp(argv[0], (char**) argv);
-                         log_error_errno(errno, "Failed to execute %s: %m", argv[0]);
-                         _exit(EXIT_FAILURE);
-                 }
meta/recipes-core/systemd/systemd/0002-implment-systemd-sysv-install-for-OE.patch +8 -5
index 98d050ceae..7529abe668 100644
@@ -1,7 +1,7 @@
-From 4a5602ede9881fd8e578a3c8bc40dd5df7c4d802 Mon Sep 17 00:00:00 2001
+From 08ab9f1eaa86ca2c6a0bb45219a0153495708acb Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
 Date: Sat, 5 Sep 2015 06:31:47 +0000
-Subject: [PATCH] implement systemd-sysv-install for OE
+Subject: [PATCH 02/16] implment systemd-sysv-install for OE
 
 Use update-rc.d for enabling/disabling and status command
 to check the status of the sysv service
@@ -14,7 +14,7 @@ Signed-off-by: Khem Raj <[email protected]>
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON
-index cb58d8243b..eff3f5f579 100755
+index cb58d8243b..000bdf6165 100755
 --- a/src/systemctl/systemd-sysv-install.SKELETON
 +++ b/src/systemctl/systemd-sysv-install.SKELETON
 @@ -34,17 +34,17 @@ case "$1" in
@@ -22,13 +22,13 @@ index cb58d8243b..eff3f5f579 100755
          # call the command to enable SysV init script $NAME here
          # (consider optional $ROOT)
 -        echo "IMPLEMENT ME: enabling SysV init.d script $NAME"
-+        update-rc.d ${ROOT:+-r $ROOT} -f $NAME defaults
++        update-rc.d -f $NAME defaults
          ;;
      disable)
          # call the command to disable SysV init script $NAME here
          # (consider optional $ROOT)
 -        echo "IMPLEMENT ME: disabling SysV init.d script $NAME"
-+        update-rc.d ${ROOT:+-r $ROOT} -f $NAME remove
++        update-rc.d -f $NAME remove
          ;;
      is-enabled)
          # exit with 0 if $NAME is enabled, non-zero if it is disabled
@@ -38,3 +38,6 @@ index cb58d8243b..eff3f5f579 100755
          ;;
      *)
          usage ;;
+-- 
+2.34.1
+
meta/recipes-core/systemd/systemd/0003-Do-not-create-var-log-README.patch renamed from meta/recipes-core/systemd/systemd/0001-Do-not-create-var-log-README.patch +6 -3
similarity index 84%
rename from meta/recipes-core/systemd/systemd/0001-Do-not-create-var-log-README.patch
rename to meta/recipes-core/systemd/systemd/0003-Do-not-create-var-log-README.patch
index 850e356b2f..1d3c4f83c0 100644
@@ -1,7 +1,7 @@
-From 425ad51e727058b48dd4580fd6afe7e51e96a28a Mon Sep 17 00:00:00 2001
+From a7f6a296707642d05463aec22ea3dfce7d06c989 Mon Sep 17 00:00:00 2001
 From: Peter Kjellerstedt <[email protected]>
 Date: Tue, 21 Jan 2025 05:02:00 +0100
-Subject: [PATCH] Do not create /var/log/README
+Subject: [PATCH 03/16] Do not create /var/log/README
 
 /var/log/README is a link to /usr/share/doc/systemd/README.logs. The
 latter is packaged in systemd-doc and likely not installed, which leaves
@@ -15,7 +15,7 @@ Signed-off-by: Peter Kjellerstedt <[email protected]>
  1 file changed, 3 deletions(-)
 
 diff --git a/tmpfiles.d/legacy.conf.in b/tmpfiles.d/legacy.conf.in
-index b475500e58..650c91a8da 100644
+index cdef21fa9b..03798c953e 100644
 --- a/tmpfiles.d/legacy.conf.in
 +++ b/tmpfiles.d/legacy.conf.in
 @@ -13,9 +13,6 @@
@@ -28,3 +28,6 @@ index b475500e58..650c91a8da 100644
  
  {% if HAVE_SYSV_COMPAT %}
  # /run/lock/subsys is used for serializing SysV service execution, and
+-- 
+2.34.1
+
meta/recipes-core/systemd/systemd/0003-missing_type.h-add-comparison_fn_t.patch deleted +0 -61

61 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0004-musl.h-introduce-header-file-and-add-__THROW.patch new file +61 -0

61 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0005-add-fallback-parse_printf_format-implementation.patch renamed from meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch +28 -51

138 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0005-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch deleted +0 -156

156 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0006-Make-mallinfo-related-contents-glibc-specific.patch new file +117 -0

117 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0006-add-missing-FTW_-macros-for-musl.patch deleted +0 -44

44 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0007-Use-uintmax_t-for-handling-rlim_t.patch deleted +0 -106

106 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0007-add-src-include-override-sys-prctl.h-to-avoid-redefi.patch new file +43 -0

43 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch deleted +0 -34
deleted file mode 100644
index 22e2ceadcc..0000000000
@@ -1,34 +0,0 @@
-From f4cd939c7cc1ce0a59bab2693768f2c95d9ced00 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sun, 27 May 2018 08:36:44 -0700
-Subject: [PATCH 08/26] 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
-
-Upstream-Status: Inappropriate [musl specific]
-
-Signed-off-by: Khem Raj <[email protected]>
----
- src/basic/string-util.h | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/basic/string-util.h b/src/basic/string-util.h
-index cc6aa183c0..0b035125cd 100644
---- a/src/basic/string-util.h
-+++ b/src/basic/string-util.h
-@@ -27,6 +27,10 @@
- #define URI_UNRESERVED      ALPHANUMERICAL "-._~"       /* [RFC3986] */
- #define URI_VALID           URI_RESERVED URI_UNRESERVED /* [RFC3986] */
- 
-+#if !defined(__GLIBC__)
-+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
-+#endif
-+
- static inline char* strstr_ptr(const char *haystack, const char *needle) {
-         if (!haystack || !needle)
-                 return NULL;
--- 
-2.34.1
-
meta/recipes-core/systemd/systemd/0008-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch renamed from meta/recipes-core/systemd/systemd/0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch +10 -10
similarity index 77%
rename from meta/recipes-core/systemd/systemd/0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
rename to meta/recipes-core/systemd/systemd/0008-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
index 0dfb77890e..73819375c8 100644
@@ -1,10 +1,10 @@
-From b7f6c245b4ae72999f23eecc2bbb6d6fb8db667c Mon Sep 17 00:00:00 2001
+From bbe0096367618026fe5ebb81c266fd50084f113a Mon Sep 17 00:00:00 2001
 From: Chen Qi <[email protected]>
 Date: Tue, 10 Jul 2018 15:40:17 +0800
-Subject: [PATCH 10/26] distinguish XSI-compliant strerror_r from GNU-specifi
+Subject: [PATCH 08/16] distinguish XSI-compliant strerror_r from GNU-specific
  strerror_r
 
-XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+XSI-compliant strerror_r and GNU-specific strerror_r are different.
 
        int strerror_r(int errnum, char *buf, size_t buflen);
                    /* XSI-compliant */
@@ -24,10 +24,10 @@ Signed-off-by: Chen Qi <[email protected]>
  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 58c24d25c0..69a0d09d42 100644
+index bc0164c1b4..e69ffe4f75 100644
 --- a/src/libsystemd/sd-bus/bus-error.c
 +++ b/src/libsystemd/sd-bus/bus-error.c
-@@ -405,7 +405,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+@@ -400,7 +400,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
                          return;
  
                  errno = 0;
@@ -40,25 +40,25 @@ index 58c24d25c0..69a0d09d42 100644
                  if (errno == ERANGE || strlen(x) >= k - 1) {
                          free(m);
                          k *= 2;
-@@ -590,8 +595,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
+@@ -585,8 +590,12 @@ const char* _bus_error_message(const sd_bus_error *e, int error, char buf[static
  
          if (e && e->message)
                  return e->message;
 -
 +#ifndef __GLIBC__
-+        strerror_r(abs(error), buf, ERRNO_BUF_LEN);
++        strerror_r(ABS(error), buf, ERRNO_BUF_LEN);
 +        return buf;
 +#else
-         return strerror_r(abs(error), buf, ERRNO_BUF_LEN);
+         return strerror_r(ABS(error), buf, ERRNO_BUF_LEN);
 +#endif
  }
  
  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 75e8e08add..41e5c7c2b8 100644
+index e838e7e0d7..28b6e014c0 100644
 --- a/src/libsystemd/sd-journal/journal-send.c
 +++ b/src/libsystemd/sd-journal/journal-send.c
-@@ -361,7 +361,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+@@ -338,7 +338,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
                  char* j;
  
                  errno = 0;
meta/recipes-core/systemd/systemd/0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch deleted +0 -41

41 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0009-errno-util-Make-STRERROR-portable-for-musl.patch renamed from meta/recipes-core/systemd/systemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch +10 -7
similarity index 72%
rename from meta/recipes-core/systemd/systemd/0019-errno-util-Make-STRERROR-portable-for-musl.patch
rename to meta/recipes-core/systemd/systemd/0009-errno-util-Make-STRERROR-portable-for-musl.patch
index 56083cc7b3..4a9a05147a 100644
@@ -1,7 +1,7 @@
-From 28fa1d5f56c6ddee9e336e6f2051c55e9f2f98b4 Mon Sep 17 00:00:00 2001
+From 7ce68a17deeda43c31a5de5956bad4c92481f1ca Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
 Date: Mon, 23 Jan 2023 23:39:46 -0800
-Subject: [PATCH 19/26] errno-util: Make STRERROR portable for musl
+Subject: [PATCH 09/16] 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
@@ -10,27 +10,30 @@ non-glibc hosts
 Upstream-Status: Inappropriate [musl specific]
 
 Signed-off-by: Khem Raj <[email protected]>
+
+Rebased for v258
+Signed-off-by: Chen Qi <[email protected]>
 ---
  src/basic/errno-util.h | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
 
 diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h
-index 48b76e4bf7..6e7653e2d9 100644
+index 5fe337cfb1..dee34167cb 100644
 --- a/src/basic/errno-util.h
 +++ b/src/basic/errno-util.h
-@@ -15,8 +15,16 @@
+@@ -13,8 +13,16 @@
   * https://stackoverflow.com/questions/34880638/compound-literal-lifetime-and-if-blocks
   *
   * Note that we use the GNU variant of strerror_r() here. */
--#define STRERROR(errnum) strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
+-#define STRERROR(errnum) strerror_r(ABS(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN)
 +static inline const char * STRERROR(int errnum);
  
 +static inline const char * STRERROR(int errnum) {
 +#ifdef __GLIBC__
-+        return strerror_r(abs(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
++        return strerror_r(ABS(errnum), (char[ERRNO_BUF_LEN]){}, ERRNO_BUF_LEN);
 +#else
 +        static __thread char buf[ERRNO_BUF_LEN];
-+        return strerror_r(abs(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
++        return strerror_r(ABS(errnum), buf, ERRNO_BUF_LEN) ? "unknown error" : buf;
 +#endif
 +}
  /* A helper to print an error message or message for functions that return 0 on EOF.
meta/recipes-core/systemd/systemd/0010-src-basic-format-util.h-define-RLIM_FMT-to-fit-musl-.patch new file +40 -0
new file mode 100644
index 0000000000..d6281b015b
@@ -0,0 +1,40 @@
+From adf7bd6cf6305f5454cfb1ad4f1755880e831f7e Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Mon, 29 Sep 2025 14:41:52 +0800
+Subject: [PATCH 10/16] src/basic/format-util.h: define RLIM_FMT to fit musl's
+ rlim_t definition
+
+musl always defines rlim_t to be "unsigned long long".
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ src/basic/format-util.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/basic/format-util.h b/src/basic/format-util.h
+index e42f788ce6..9275f9615d 100644
+--- a/src/basic/format-util.h
++++ b/src/basic/format-util.h
+@@ -39,6 +39,7 @@ assert_cc(sizeof(gid_t) == sizeof(uint32_t));
+ #  error Unknown timex member size
+ #endif
+ 
++#ifdef __GLIBC__
+ #if SIZEOF_RLIM_T == 8
+ #  define RLIM_FMT "%" PRIu64
+ #elif SIZEOF_RLIM_T == 4
+@@ -46,6 +47,9 @@ assert_cc(sizeof(gid_t) == sizeof(uint32_t));
+ #else
+ #  error Unknown rlim_t size
+ #endif
++#else
++#define RLIM_FMT "%llu"
++#endif
+ 
+ #if SIZEOF_DEV_T == 8
+ #  define DEV_FMT "%" PRIu64
+-- 
+2.34.1
+
meta/recipes-core/systemd/systemd/0011-avoid-redefinition-of-prctl_mm_map-structure.patch deleted +0 -32
deleted file mode 100644
index 16d741cf87..0000000000
@@ -1,32 +0,0 @@
-From 43b0269e850a2fbcb6ca615258aa8f8a9b4f6a9d Mon Sep 17 00:00:00 2001
-From: Chen Qi <[email protected]>
-Date: Mon, 25 Feb 2019 15:44:54 +0800
-Subject: [PATCH 11/26] avoid redefinition of prctl_mm_map structure
-
-Fix the following compile failure:
-error: redefinition of 'struct prctl_mm_map'
-
-Upstream-Status: Inappropriate [musl specific]
-
-Signed-off-by: Chen Qi <[email protected]>
----
- src/basic/missing_prctl.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/basic/missing_prctl.h b/src/basic/missing_prctl.h
-index 2c9f9f6c50..65a984b564 100644
---- a/src/basic/missing_prctl.h
-+++ b/src/basic/missing_prctl.h
-@@ -1,7 +1,9 @@
- /* SPDX-License-Identifier: LGPL-2.1-or-later */
- #pragma once
- 
-+#ifdef __GLIBC__
- #include <linux/prctl.h>
-+#endif
- 
- #include "macro.h"
- 
--- 
-2.34.1
-
meta/recipes-core/systemd/systemd/0011-src-include-override-malloc.h-define-dummy-malloc_tr.patch new file +41 -0

41 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0012-do-not-disable-buffer-in-writing-files.patch deleted +0 -530

530 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0012-src-shared-condition.c-avoid-using-glibc-ConditionVe.patch new file +47 -0

47 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0013-Handle-__cpu_mask-usage.patch deleted +0 -60

60 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0013-build-path.c-avoid-boot-time-segfault-for-musl.patch renamed from meta/recipes-core/systemd/systemd/0026-build-path.c-avoid-boot-time-segfault-for-musl.patch +4 -4
similarity index 77%
rename from meta/recipes-core/systemd/systemd/0026-build-path.c-avoid-boot-time-segfault-for-musl.patch
rename to meta/recipes-core/systemd/systemd/0013-build-path.c-avoid-boot-time-segfault-for-musl.patch
index a7549ee151..e4d2c198f9 100644
@@ -1,7 +1,7 @@
-From f2a7cf1d2a2bc2516a180809efd85c828cd9c7f4 Mon Sep 17 00:00:00 2001
+From a4b921b8d408e0f1c9d035a3ec93c3da3fe42352 Mon Sep 17 00:00:00 2001
 From: Chen Qi <[email protected]>
 Date: Wed, 3 Jul 2024 07:18:42 -0700
-Subject: [PATCH 26/26] build-path.c: avoid boot time segfault for musl
+Subject: [PATCH 13/16] build-path.c: avoid boot time segfault for musl
 
 This function, at runtime, should return -ENOEXEC. For musl, it
 somehow segfaults. I think it's related to getauxval, but it's
@@ -15,10 +15,10 @@ Signed-off-by: Chen Qi <[email protected]>
  1 file changed, 1 insertion(+)
 
 diff --git a/src/basic/build-path.c b/src/basic/build-path.c
-index b5972658df..4ef551034e 100644
+index 577ff72bce..3a7876798c 100644
 --- a/src/basic/build-path.c
 +++ b/src/basic/build-path.c
-@@ -151,6 +151,7 @@ int get_build_exec_dir(char **ret) {
+@@ -152,6 +152,7 @@ int get_build_exec_dir(char **ret) {
           */
  
          static int runpath_cached = -ERRNO_MAX-1;
meta/recipes-core/systemd/systemd/0014-Handle-missing-gshadow-for-musl.patch renamed from meta/recipes-core/systemd/systemd/0014-Handle-missing-gshadow.patch +40 -37

162 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0015-Avoid-sequence-point-error.patch new file +35 -0
new file mode 100644
index 0000000000..c3401068cb
@@ -0,0 +1,35 @@
+From 5dbeaee2085d3edcf20983fce4208eb174e46422 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Thu, 9 Oct 2025 15:19:09 +0800
+Subject: [PATCH 15/16] Avoid sequence-point error
+
+See https://www.openwall.com/lists/musl/2025/09/30/4
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ src/shared/cpu-set-util.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/shared/cpu-set-util.c b/src/shared/cpu-set-util.c
+index 7a155c12d4..a9c57fc31c 100644
+--- a/src/shared/cpu-set-util.c
++++ b/src/shared/cpu-set-util.c
+@@ -97,9 +97,11 @@ char* cpu_set_to_mask_string(const CPUSet *c) {
+         for (size_t i = c->allocated * 8; i > 0; ) {
+                 uint32_t m = 0;
+ 
+-                for (int j = (i % 32 ?: 32) - 1; j >= 0; j--)
+-                        if (CPU_ISSET_S(--i, c->allocated, c->set))
++                for (int j = (i % 32 ?: 32) - 1; j >= 0; j--) {
++                        --i;
++                        if (CPU_ISSET_S(i, c->allocated, c->set))
+                                 SET_BIT(m, j);
++                }
+ 
+                 if (!found_nonzero) {
+                         if (m == 0)
+-- 
+2.34.1
+
meta/recipes-core/systemd/systemd/0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch deleted +0 -42

42 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0016-Fix-the-segfault-for-glob-related-codes-and-define-d.patch new file +409 -0

409 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch deleted +0 -37
deleted file mode 100644
index b802106155..0000000000
@@ -1,37 +0,0 @@
-From 9079b158779a9c395c24f882f72a1c734795045d Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Fri, 21 Jan 2022 15:15:11 -0800
-Subject: [PATCH 16/26] 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]
-                n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
-                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
-        n = getdents64(fd, &buffer, sizeof(buffer));
-                           ^~~~~~~
-
-Upstream-Status: Inappropriate [musl specific]
-Signed-off-by: Khem Raj <[email protected]>
-Signed-off-by: Jiaqing Zhao <[email protected]>
----
- src/basic/recurse-dir.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
-index 378fd92b06..5b567b457d 100644
---- a/src/basic/recurse-dir.c
-+++ b/src/basic/recurse-dir.c
-@@ -56,7 +56,7 @@ int readdir_all(int dir_fd,
-                 bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
-                 assert(bs > de->buffer_size);
- 
--                n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
-+                n = getdents64(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
-                 if (n < 0)
-                         return -errno;
-                 if (n == 0)
--- 
-2.34.1
-
meta/recipes-core/systemd/systemd/0017-Adjust-for-musl-headers.patch deleted +0 -526

487 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0017-Always-include-netinet-if_ether.h-first.patch new file +40 -0
new file mode 100644
index 0000000000..1cd9622540

Lines of this file are not shown. View the raw message.

meta/recipes-core/systemd/systemd/0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch deleted +0 -52

52 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch deleted +0 -39
deleted file mode 100644
index 16df44cd86..0000000000

Lines of this file are not shown. View the raw message.

meta/recipes-core/systemd/systemd/0021-shared-Do-not-use-malloc_info-on-musl.patch deleted +0 -57

57 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0022-avoid-missing-LOCK_EX-declaration.patch deleted +0 -56

56 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0023-include-signal.h-to-avoid-the-undeclared-error.patch deleted +0 -27
deleted file mode 100644
index c8bcd9e355..0000000000

Lines of this file are not shown. View the raw message.

meta/recipes-core/systemd/systemd/0024-undef-stdin-for-references-using-stdin-as-a-struct-m.patch deleted +0 -48

48 lines not on this page · raw message

meta/recipes-core/systemd/systemd/0025-adjust-header-inclusion-order-to-avoid-redeclaration.patch deleted +0 -288

288 lines not on this page · raw message

meta/recipes-core/systemd/systemd_258.1.bb renamed from meta/recipes-core/systemd/systemd_257.8.bb +20 -47

67 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.34.1

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH v6 3/3 xserver-nodm-init: avoid race condition related to udev

In reply to [email protected]

From: Chen Qi <[email protected]>

With systemd upgraded to 258+, there's a race condition error found on qemuarm:

failed to find screen to remove

This error is likely to be introduced by the following systemd commit:
https://github.com/systemd/systemd/commit/0ba9d06963ecb848e71951ed5e9f6f6f03b80b06

However, I think the commit cannot be reverted, not only because there are a bunch of changes based on this one, but also because the change look like a reasonable one.

Before xserver is able to handle such issue inside its codes, this service need wait for udev to settle things before it starts. This can avoid the above race condition error.

Fixes [YOCTO #16045]

---
 .../x11-common/xserver-nodm-init/xserver-nodm.service.in        | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service.in +2 -0
index 87dc4f8fcd..43aaa84c0f 100644
@@ -1,5 +1,7 @@
 [Unit]
 Description=Xserver startup without a display manager
+After=systemd-udev-settle.service
+Wants=systemd-udev-settle.service
 
 [Service]
 EnvironmentFile=/etc/default/xserver-nodm
Signature · 1 line
2.34.1