systemd: upgrade to 261.1 and be compatible with rhel8
v5 cover systemd: upgrade to 261.1 and be compatible with rhel8
From: Daniel Turull <[email protected]>
systemd increases the dependency on the host kernel, which breaks builds with rhel 8
This series add native patches in the systemd tools to make it work.
v2:
- re-add tag verification in SRC_URI
v3:
- rebase on top of Ross Burton meson patches. if not needed keep v2
- re-tested
See https://patchwork.yoctoproject.org/project/oe-core/patch/[email protected]/
v4:
- still on top of Meson patches from Ross
- merge systemd-systemctl-native and systemd-hwdb-native into
systemd-tools-native and update references
(this will cause meta-oe postgresql to fail). I'm planning to send
a patch to it once we merge this one.
v5:
- on top of master-next and ross systemd patches
systemd: no need to use qemu for hwdb update
systemd-tools-native: add systemd-hwdb
- update to 261.1 instead of 261
- simplify patches based on Ross work
Tested on rhel8.10 with testsuite systemd on qemux86-64
Daniel Turull (2):
systemd: upgrade to 261.1
systemd-tools-native: fix systemctl/hwdb --root on RHEL 8 hosts
..._259.5.bb => systemd-boot-native_261.1.bb} | 0
...md-boot_259.5.bb => systemd-boot_261.1.bb} | 0
...259.5.bb => systemd-tools-native_261.1.bb} | 3 +
meta/recipes-core/systemd/systemd.inc | 8 +-
...meson-use-libfido2_cflags-dependency.patch | 54 ------
.../0003-Do-not-create-var-log-README.patch | 10 +-
...il-fix-PCR-bank-guessing-without-EFI.patch | 62 -------
...-detailed-debug-logging-to-fdset_new.patch | 97 -----------
...issing-STATX_MNT_ID-on-older-kernels.patch | 160 ++++++++++++++++++
.../{systemd_259.5.bb => systemd_261.1.bb} | 12 +-
10 files changed, 174 insertions(+), 232 deletions(-)
rename meta/recipes-core/systemd/{systemd-boot-native_259.5.bb => systemd-boot-native_261.1.bb} (100%)
rename meta/recipes-core/systemd/{systemd-boot_259.5.bb => systemd-boot_261.1.bb} (100%)
rename meta/recipes-core/systemd/{systemd-tools-native_259.5.bb => systemd-tools-native_261.1.bb} (89%)
delete mode 100644 meta/recipes-core/systemd/systemd/0001-meson-use-libfido2_cflags-dependency.patch
delete mode 100644 meta/recipes-core/systemd/systemd/0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch
delete mode 100644 meta/recipes-core/systemd/systemd/0018-shared-fdset-add-detailed-debug-logging-to-fdset_new.patch
create mode 100644 meta/recipes-core/systemd/systemd/Handle-missing-STATX_MNT_ID-on-older-kernels.patch
rename meta/recipes-core/systemd/{systemd_259.5.bb => systemd_261.1.bb} (99%)PATCH v5 1/2 systemd: upgrade to 261.1
From: Daniel Turull <[email protected]>
Changes: https://github.com/systemd/systemd/compare/v259.5...v261.1
https://github.com/systemd/systemd/blob/main/NEWS
- Drop backported patches no longer needed (libfido2_cflags, tpm2-util PCR bank, fdset_new debug)
- Remove sysvinit-path/sysvrcnd-path meson options and systemd-sysv-install skeleton (removed upstream in 260)
- Add explicit meson disables for auto-detected features in systemd-systemctl-native to prevent host sysroot contamination
- Refresh 0003-Do-not-create-var-log-README.patch
Tested on qemu target with testsuite systemd.
Summary of changes in systemd from NEWS file:
* Drop legacy SysV init support: rc-local, sysv-generator, sysv-install removed; services must ship native systemd unit files going forward.
* Deprecate non-system users/groups in udev and systemd-networkd configs; usage still works but emits warnings and is scheduled for removal.
* Raise dependency baselines:
- cryptsetup, elfutils, libblkid, libseccomp, glibc, libxcrypt, OpenSSL, Python all require newer versions.
- Linux baseline moved from 5.4 to 5.10, recommended 5.14, with 6.6 needed for full functionality; compatibility code for older kernels dropped.
- musl minimum bumped from 1.2.5 to 1.2.6 when building with -Dlibc=musl.
* Rework dynamic linking: shift optional dependencies to dlopen() for libgnutls, libmicrohttpd, libcurl, libcrypto, libssl, libfdisk, libcryptsetup. libsystemd no longer guarantees a link to libm, so consumers relying on transitive libm must link it explicitly.
* sd-varlink API: temporary enum extension in 260-rc1 changed numeric values, reverted in -rc2. Binaries built against -rc1 headers must be rebuilt to avoid ABI mismatches.
* systemd-logind D-Bus CanPowerOff/CanReboot/CanSuspend/... gain new return values for inhibitors: "inhibited", "inhibitor-blocked", "challenge-inhibitor-blocked". Consumers assuming only "yes"/"no" need adjustment.
* Rename systemd-nspawn --user= to --uid=. The -u short option still works. Old forms --user NAME/--user=NAME remain accepted but are deprecated and emit a warning; bare --user now toggles user manager scope instead of taking an argument.
* Varlink io.systemd.Unit: several configuration fields switched from free-form strings to enums (ExecInputType, ExecOutputType, ProtectHome, CGroupController, CollectMode, EmergencyAction, JobMode). Wire format now uses underscores instead of dashes/plus (e.g. "tty-force" -> "tty_force", "kmsg+console" -> "kmsg_console").
* Announced removal of experimental systemd-sysupdated D-Bus API in favor of direct Varlink IPC to systemd-sysupdate; updatectl will be reworked accordingly.
* TPM / CC measurement changes:
- systemd-stub now measures more artifacts into hardware CC registers (e.g. TDX RTMRs) in addition to TPM, altering expected CC values for devicetree, initrd, ucode addons, UKI profile.
- New verity TPM NvPCR added; various components measure dm-verity images into it.
- New ConditionSecurity=measured-os, and improved SMBIOS measurements in systemd-boot/systemd-stub.
- New systemd-pcrosseparator.service adds a PCR separator measurement affecting PCRs 0-7,9,12-14 to isolate firmware vs OS measurements.
* Boot and UKI tooling:
- systemd-stub introduces a "boot secret" passed via initrd for TPM fallback key material in non-TPM environments.
- Keyboard layout and serial console are auto-propagated from UEFI to Linux; LoaderKeyboardLayout EFI variable used as fallback mapping.
- Unified handling of UKI sidecars and "extra" Type #1 stanzas for confext/sysext/credentials.
- systemd-boot avoids auto-boot into non-default UKI profiles and adds better fallback handling and new bootctl verbs/options.
* New IMDS subsystem:
- hwdb gains 40-imds.hwdb to detect major public clouds and describe access to local IMDS endpoints.
- systemd-imdsd provides Varlink IPC for IMDS access; systemd-imds imports IMDS data into credentials with measurements.
- Optional network lockdown for IMDS via -Dimds-network=, with a "locked" default recommended for secure setups.
* New metrics / report framework:
- systemd-report defines a Varlink-based metrics aggregation API under /run/systemd/report/.
- Initial endpoints from systemd-networkd and the service manager in 260; extended in 261 to system-wide and per-service/cgroup metrics, with Varlink and HTTP upload support.
* New mstack feature:
- ".mstack/" directory layout defines overlayfs + bind mount stacks for services/containers.
- RootMStack= unit setting and systemd-nspawn --mstack= support invoking services and containers from self-describing mstack images.
- importctl pull-oci stores OCI images as mstack images.
* Manager and resource-control enhancements:
- New per-unit settings: RootMStack=, PrivateUsers=managed, MemoryTHP=, CPUSetPartition=, RestrictFileSystemAccess= (BPF LSM), CPUPressureWatch=/CPUPressureThresholdSec=, IOPressureWatch=/IOPressureThresholdSec=.
- New global knobs: DefaultMemoryZSwapWriteback=, EventLoopRateLimitIntervalSec=/EventLoopRateLimitBurst=, MinimumUptimeSec= (default 15s to avoid tight boot loops).
- fd-store persistence improvements: LUO/Kexec handover support in PID1, FileDescriptorStorePreserve=on-success and user/manager plumbing to keep memfds and other state across session restarts and kexec.
* Varlink and IPC surface growth:
- New Varlink methods for shutdown (PowerOff, Reboot, SoftReboot, Halt, Kexec) on io.systemd.Manager and io.systemd.Shutdown.
- io.systemd.Unit.StartTransient(), io.systemd.Manager.ListUnitsByNames(), io.systemd.Job interface for job inspection/cancellation.
- systemd-networkd Varlink updates: Reload(), Link.Describe(), Reconfigure(), Renew(), ForceRenew(), Up()/Down() and reporting of interface bit rates.
- journalctl gains a Varlink GetEntries() interface.
- New sd-varlink APIs for sentinel handling and protocol upgrade, plus wildcard type SD_VARLINK_ANY and per-UID connection limit reduction.
* Scheduling and rollout knobs:
- CPUSchedulingPolicy=ext for SCHED_EXT.
- ConditionFraction= for percentage-based staged rollouts keyed by machine ID and tag.
- ConditionMachineTag= and new Tags= in /etc/machine-info for fleet-wide targeting via hostnamed.
* Filesystem, tmpfiles, sysusers:
- tmpfiles.d/root.conf sets / to mode 0555 in certain setups.
- systemd-tmpfiles gains --inline and new k/K directives for capabilities.
- New initrd services systemd-sysext-sysroot.service and systemd-confext-sysroot.service to merge extensions from initrd, plus a kernel kill switch to fully disable sysext/confext.
* Networking and resolved:
- DHCP relay refactoring with sd-dhcp-relay backend; [DHCPServer] options deprecated in favor of [Network]/[DHCPRelay] + networkd.conf settings.
- systemd-networkd adds MultiPathRoute= improvements, ModemManager "simple connect" integration, new offload controls in .link files, new DHCPv4 server options, and various Varlink/JSON interface updates.
- systemd-resolved adds JSON static RR drop-ins, per-interface cache size tunables, improved DNSSEC handling for insecure answers, better stale cache retention, and reload of /etc/hosts on SIGHUP/Reload().
- resolvectl now talks via Varlink; nss-resolve gains interface scoping via $SYSTEMD_NSS_RESOLVE_INTERFACE.
* Logging, coredumps, cryptsetup:
- coredumpctl info gains JSON output; crashing thread TID/name and new COREDUMP_CODE field recorded.
- systemd-cryptsetup/libcryptsetup moved behind dlopen(); new fixate-volume-key= support for binding crypttab entries to volume keys; systemd-cryptenroll now defaults to RSA-OAEP+SHA-256 for sealed keys.
- systemd-creds improves TPM2 PCR handling to avoid errors on non-TPM systems.
* OOM and reliability:
- systemd-oomd gains OOM rulesets and "prekill hook" integration via Varlink sockets.
- systemd-oomd and PID1 adopt pidfds in more places.
- systemd-run gets --output= to control verbose mode logging.
* Misc:
- RootImageOptions=/ExtensionImages=/MountImages= parsing changed so last definition per partition wins, aligning with other option semantics.
- systemd-sysext/confext refresh now suppresses unnecessary umount/mount by default, with --always-refresh= to force a refresh.
- [email protected] now has [Install] section and must be explicitly enabled.
- runlevel[0-6].target can be restored when building with -Dcompat-sysv-interfaces=yes, but SysV scripts themselves are gone.
AI-Generated: Claude-opus-4.6
---
..._259.5.bb => systemd-boot-native_261.1.bb} | 0
...md-boot_259.5.bb => systemd-boot_261.1.bb} | 0
...259.5.bb => systemd-tools-native_261.1.bb} | 0
meta/recipes-core/systemd/systemd.inc | 8 +-
...meson-use-libfido2_cflags-dependency.patch | 54 -----------
.../0003-Do-not-create-var-log-README.patch | 10 +-
...il-fix-PCR-bank-guessing-without-EFI.patch | 62 ------------
...-detailed-debug-logging-to-fdset_new.patch | 97 -------------------
.../{systemd_259.5.bb => systemd_261.1.bb} | 12 +--
9 files changed, 11 insertions(+), 232 deletions(-)
rename meta/recipes-core/systemd/{systemd-boot-native_259.5.bb => systemd-boot-native_261.1.bb} (100%)
rename meta/recipes-core/systemd/{systemd-boot_259.5.bb => systemd-boot_261.1.bb} (100%)
rename meta/recipes-core/systemd/{systemd-tools-native_259.5.bb => systemd-tools-native_261.1.bb} (100%)
delete mode 100644 meta/recipes-core/systemd/systemd/0001-meson-use-libfido2_cflags-dependency.patch
delete mode 100644 meta/recipes-core/systemd/systemd/0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch
delete mode 100644 meta/recipes-core/systemd/systemd/0018-shared-fdset-add-detailed-debug-logging-to-fdset_new.patch
rename meta/recipes-core/systemd/{systemd_259.5.bb => systemd_261.1.bb} (99%)meta/recipes-core/systemd/systemd-boot-native_261.1.bb renamed from meta/recipes-core/systemd/systemd-boot-native_259.5.bb +0 -0
meta/recipes-core/systemd/systemd-boot_261.1.bb renamed from meta/recipes-core/systemd/systemd-boot_259.5.bb +0 -0
meta/recipes-core/systemd/systemd-tools-native_261.1.bb renamed from meta/recipes-core/systemd/systemd-tools-native_259.5.bb +0 -0
meta/recipes-core/systemd/systemd.inc +2 -6
@@ -15,14 +15,10 @@ LICENSE:libsystemd = "LGPL-2.1-or-later" LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=c09786363500a9acc29b147e6e72d2c6 \ file://LICENSE.LGPL2.1;md5=be0aaf4a380f73f7e00b420a007368f2" -SRCREV = "b3d8fc43e9cb531d958c17ef2cd93b374bc14e8a" -SRCBRANCH = "v259-stable" +SRCREV = "eff9446d505d62c075bed37d606860b38cfe51fb" +SRCBRANCH = "v261-stable" SRC_URI = "git://github.com/systemd/systemd.git;protocol=https;branch=${SRCBRANCH};tag=v${PV}" CVE_PRODUCT = "systemd" CVE_STATUS[CVE-2019-3815] = "not-applicable-platform: only applied to RHEL" -CVE_STATUS[CVE-2026-40223] = "fixed-version: fixed in 259.2" -CVE_STATUS[CVE-2026-40224] = "fixed-version: fixed in 259.3" -CVE_STATUS[CVE-2026-40225] = "fixed-version: fixed in 259.5" -CVE_STATUS[CVE-2026-40226] = "fixed-version: fixed in 259.4"
meta/recipes-core/systemd/systemd/0001-meson-use-libfido2_cflags-dependency.patch deleted +0 -54
54 lines not on this page · raw message
meta/recipes-core/systemd/systemd/0003-Do-not-create-var-log-README.patch +3 -7
@@ -1,7 +1,7 @@ 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 03/16] Do not create /var/log/README +Subject: [PATCH] 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,19 +15,15 @@ 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 cdef21fa9b..03798c953e 100644 +index cdef21fa9b..7890abcdef 100644 --- a/tmpfiles.d/legacy.conf.in +++ b/tmpfiles.d/legacy.conf.in -@@ -13,9 +13,6 @@ +@@ -13,6 +13,3 @@ d /run/lock 0755 root root - L /var/lock - - - - ../run/lock -{% if CREATE_LOG_DIRS %} -L$ /var/log/README - - - - ../..{{DOC_DIR}}/README.logs -{% endif %} - - {% if HAVE_SYSV_COMPAT %} - # /run/lock/subsys is used for serializing SysV service execution, and -- 2.34.1 -
meta/recipes-core/systemd/systemd/0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch deleted +0 -62
62 lines not on this page · raw message
meta/recipes-core/systemd/systemd/0018-shared-fdset-add-detailed-debug-logging-to-fdset_new.patch deleted +0 -97
97 lines not on this page · raw message
meta/recipes-core/systemd/systemd_261.1.bb renamed from meta/recipes-core/systemd/systemd_259.5.bb +6 -6
@@ -36,9 +36,6 @@ SRC_URI += " \ file://systemd-pager.sh \ file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ file://0003-Do-not-create-var-log-README.patch \ - file://0001-meson-use-libfido2_cflags-dependency.patch \ - file://0018-shared-fdset-add-detailed-debug-logging-to-fdset_new.patch \ - file://0004-tpm2-util-fix-PCR-bank-guessing-without-EFI.patch \ file://0005-boot-downgrade-EFI_MEMORY_ATTRIBUTE_PROTOCOL-warning.patch \ "
@@ -231,9 +228,6 @@ EXTRA_OEMESON += "-Dnobody-user=nobody \ -Ddbus=disabled \ -Dtests=false \ -Dlibc=${TCLIBC} \ - -Drc-local='' \ - -Dsysvinit-path='' \ - -Dsysvrcnd-path='' \ " # Hardcode target binary paths to avoid using paths from sysroot or worse
@@ -587,6 +581,8 @@ FILES:${PN}-extra-utils = "\ ${bindir}/systemd-cgtop \ ${bindir}/systemd-stdio-bridge \ ${base_sbindir}/mount.ddi \ + ${base_sbindir}/mount.mstack \ + ${base_sbindir}/mount.storage \ ${systemd_system_unitdir}/initrd.target.wants/systemd-pcrphase-initrd.path \ ${systemd_system_unitdir}/sysinit.target.wants/systemd-pcrphase.path \ ${systemd_system_unitdir}/sysinit.target.wants/systemd-pcrphase-sysinit.path \
@@ -683,6 +679,7 @@ FILES:${PN} = " ${base_bindir}/* \ ${datadir}/polkit-1 \ ${datadir}/${BPN} \ ${datadir}/factory \ + ${datadir}/user-tmpfiles.d \ ${sysconfdir}/credstore/ \ ${sysconfdir}/credstore.encrypted/ \ ${sysconfdir}/dbus-1/ \
@@ -692,6 +689,7 @@ FILES:${PN} = " ${base_bindir}/* \ ${sysconfdir}/sysctl.d/ \ ${sysconfdir}/systemd/ \ ${sysconfdir}/tmpfiles.d/ \ + ${sysconfdir}/user-tmpfiles.d/ \ ${sysconfdir}/xdg/ \ ${sysconfdir}/init.d/README \ ${sysconfdir}/resolv-conf.systemd \
@@ -803,11 +801,13 @@ FILES:udev += "${base_sbindir}/udevd \ ${nonarch_libdir}/udev/rules.d/60-persistent-storage.rules \ ${nonarch_libdir}/udev/rules.d/60-persistent-storage-mtd.rules \ ${nonarch_libdir}/udev/rules.d/60-persistent-storage-tape.rules \ + ${nonarch_libdir}/udev/rules.d/60-tpm2-id.rules \ ${nonarch_libdir}/udev/rules.d/60-persistent-v4l.rules \ ${nonarch_libdir}/udev/rules.d/60-sensor.rules \ ${nonarch_libdir}/udev/rules.d/60-serial.rules \ ${nonarch_libdir}/udev/rules.d/61-autosuspend-manual.rules \ ${nonarch_libdir}/udev/rules.d/64-btrfs.rules \ + ${nonarch_libdir}/udev/rules.d/65-integration.rules \ ${nonarch_libdir}/udev/rules.d/70-camera.rules \ ${nonarch_libdir}/udev/rules.d/70-joystick.rules \ ${nonarch_libdir}/udev/rules.d/70-memory.rules \
PATCH v5 2/2 systemd-tools-native: fix systemctl/hwdb --root on RHEL 8 hosts
In reply to [email protected]From: Daniel Turull <[email protected]>
The native systemctl and systemd-hwdb tools run offline against the target rootfs (--root $D) during do_rootfs. On build hosts with a kernel older than 5.8 (e.g. RHEL 8, kernel 4.18) statx() does not support STATX_MNT_ID, so path resolution fails with -EUNATCH. This breaks the offline "systemctl --root" enable/preset invoked by the postinst of any package shipping a systemd service, e.g.:
Failed to preset all units: Protocol driver not attached.
which in turn fails do_rootfs:
ERROR: Postinstall scriptlets of ['busybox-syslog', 'systemd-networkd'] have failed. [...] Deferring to first boot via 'exit 1' is no longer supported.
- Add Handle-missing-STATX_MNT_ID-on-older-kernels.patch, which reads mnt_id from /proc/self/fdinfo (available since kernel 3.15) as a fallback when statx() lacks STATX_MNT_ID, restoring the behaviour removed upstream after systemd 259
- Apply it only to systemd-tools-native, where /proc/self/fdinfo is guaranteed available; the target systemd recipe is untouched
Tested on rhel8.10, qemux86-64 with systemd testsuite.
RESULTS:
RESULTS - ping.PingTest.test_ping: PASSED (0.00s)
RESULTS - ssh.SSHTest.test_ssh: PASSED (0.48s)
RESULTS - systemd.SystemdBasicTests.test_systemd_basic: PASSED (0.48s)
RESULTS - systemd.SystemdBasicTests.test_systemd_failed: PASSED (0.95s)
RESULTS - systemd.SystemdBasicTests.test_systemd_list: PASSED (0.66s)
RESULTS - systemd.SystemdJournalTests.test_systemd_boot_time: PASSED (0.68s) RESULTS - systemd.SystemdJournalTests.test_systemd_journal: PASSED (0.68s)
RESULTS - systemd.SystemdServiceTests.test_systemd_coredump_minidebuginfo: SKIPPED (0.00s) RESULTS - systemd.SystemdServiceTests.test_systemd_disable_enable: SKIPPED (0.00s) RESULTS - systemd.SystemdServiceTests.test_systemd_disable_enable_ro: SKIPPED (0.00s) RESULTS - systemd.SystemdServiceTests.test_systemd_status: SKIPPED (0.00s)
RESULTS - systemd.SystemdServiceTests.test_systemd_stop_start: SKIPPED (0.00s) SUMMARY:
core-image-minimal () - Ran 12 tests in 3.923s
core-image-minimal - OK - All required tests passed (successes=7, skipped=5, failures=0, errors=0)
--- .../systemd/systemd-tools-native_261.1.bb | 3 + ...issing-STATX_MNT_ID-on-older-kernels.patch | 160 ++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd/Handle-missing-STATX_MNT_ID-on-older-kernels.patch
meta/recipes-core/systemd/systemd-tools-native_261.1.bb +3 -0
@@ -6,6 +6,9 @@ SUMMARY = "native tools from systemd" SRC_URI += "file://0001-hwdb-strip-the-root-from-filenames-when-generating-h.patch" +# TODO: Remove STATX_MNT_ID patch once minimum supported build host kernel is >= 5.8 (RHEL 8 EOL: 2029) +SRC_URI += "file://Handle-missing-STATX_MNT_ID-on-older-kernels.patch" + # We don't actually need jinja to generate code, but it's checked for at configure time DEPENDS = "gperf-native python3-jinja2-native"
meta/recipes-core/systemd/systemd/Handle-missing-STATX_MNT_ID-on-older-kernels.patch new file +160 -0
160 lines not on this page · raw message