]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
12 days agoupdate TODO 41543/head
Lennart Poettering [Tue, 10 Feb 2026 11:39:02 +0000 (12:39 +0100)] 
update TODO

12 days agoci: add integration test for new bootctl functionality
Lennart Poettering [Fri, 17 Apr 2026 13:01:00 +0000 (15:01 +0200)] 
ci: add integration test for new bootctl functionality

12 days agobootctl: make sure "unlink" properly tracks "extra" files
Lennart Poettering [Fri, 20 Mar 2026 16:33:07 +0000 (17:33 +0100)] 
bootctl: make sure "unlink" properly tracks "extra" files

12 days agobootspec: generalize "addon" logic for all kinds of extra sidecars
Lennart Poettering [Tue, 10 Feb 2026 14:13:02 +0000 (15:13 +0100)] 
bootspec: generalize "addon" logic for all kinds of extra sidecars

Let's pick up all kinds of sidecars and show them, not just addons

This also fixes some issues regarding "root" directory handling.
In one context we'd resolve a directory claiming it was a "root", but it
wasn't.

Implements: https://github.com/uapi-group/specifications/pull/212

12 days agobootctl: add "link" command
Lennart Poettering [Mon, 9 Feb 2026 22:51:42 +0000 (23:51 +0100)] 
bootctl: add "link" command

12 days agobootctl: rework/modernize "unlink" and add Varlink API for it
Lennart Poettering [Fri, 10 Apr 2026 12:48:25 +0000 (14:48 +0200)] 
bootctl: rework/modernize "unlink" and add Varlink API for it

Among other things this changes tracking of the location of resources
during GC from using the BootEntrySource enum rather than a path, since
we have that and it is more efficient and easier to grok.

12 days agobootctl: add helpers that format a type1 menu entry filename from a commit nr
Lennart Poettering [Wed, 15 Apr 2026 14:09:48 +0000 (16:09 +0200)] 
bootctl: add helpers that format a type1 menu entry filename from a commit nr

12 days agobootspec: add bootspec_extract_osrelease() helper
Lennart Poettering [Fri, 20 Mar 2026 09:21:11 +0000 (10:21 +0100)] 
bootspec: add bootspec_extract_osrelease() helper

12 days agobootspec: make pe_find_uki_sections() non-static
Lennart Poettering [Fri, 13 Mar 2026 21:52:18 +0000 (22:52 +0100)] 
bootspec: make pe_find_uki_sections() non-static

12 days agobootspec: add boot_config_selected_entry() helper
Lennart Poettering [Wed, 15 Apr 2026 14:19:55 +0000 (16:19 +0200)] 
bootspec: add boot_config_selected_entry() helper

12 days agomkosi: update debian commit reference to 1302f123d9ab65bbaff5d95935eabfd659456550
Luca Boccassi [Thu, 30 Apr 2026 17:19:49 +0000 (18:19 +0100)] 
mkosi: update debian commit reference to 1302f123d9ab65bbaff5d95935eabfd659456550

1302f123d9 Restrict wildcard for new files
a6d0098d10 Install new files for upstream build
ce07fd7616 d/t/boot-and-services: use coreutils tunable in apparmor test (LP: #2125614)

12 days agoreport: report user and system CPU time per cgroup
Yaping Li [Wed, 29 Apr 2026 22:17:22 +0000 (15:17 -0700)] 
report: report user and system CPU time per cgroup

Extend io.systemd.CGroup.CpuUsage from a single per-unit nanosecond
counter to three rows distinguished by a "type" field of "total",
"user", or "system". The values come from cpu.stat's usage_usec,
user_usec and system_usec keys, read in a single keyed-attribute
fetch and cached on each CGroupInfo so each scrape only opens
cpu.stat once per cgroup.

12 days agofundamental: drop now-unused macro
Zbigniew Jędrzejewski-Szmek [Thu, 30 Apr 2026 07:31:46 +0000 (09:31 +0200)] 
fundamental: drop now-unused macro

Followup for 9d2f5b4611a47b9e5a31296cea70c2d8c6c86bbb.

13 days agooptions: get rid of "on_error" parameter to FOREACH_OPTION
Lennart Poettering [Thu, 30 Apr 2026 06:52:35 +0000 (08:52 +0200)] 
options: get rid of "on_error" parameter to FOREACH_OPTION

I am really not a fan of full code lines passed to macros as parameters.
Let's get rid of the 3rd parameter of FOREACH_OPTION() hence:

1. Let's return errors just as a regular value (though a negative one),
   that can be handled via a OPTION_ERROR case statement for the switch.
   This normalizes handling of the error, just like any other event
   returned by the option parser.

2. In order to avoid exploding the amount of boilerplate in each use
   (that just propagates the error on OPTION_ERROR), let's then
   introduce an explicit FOREACH_OPTION_OR_RETURN(), that returns from
   the calling function on its own (and makes that clear in the name).

Together this cleans up, normalizes the logic and shortens the code.

13 days agosd-json: limit the number of env variables to something reasonable
Frantisek Sumsal [Wed, 29 Apr 2026 14:50:57 +0000 (16:50 +0200)] 
sd-json: limit the number of env variables to something reasonable

Let's start with 1024, as that should be plenty for all sane use cases.

13 days agodns-question: limit the number of questions per query
Frantisek Sumsal [Wed, 29 Apr 2026 17:18:17 +0000 (19:18 +0200)] 
dns-question: limit the number of questions per query

Let's cap the number of question each query can have to something
reasonable - 128 questions per query should be more than enough for any
real-world scenario.

13 days agofundamental/cleanup: add CLEANUP_ELEMENTS() and DEFINE_POINTER_ARRAY_CLEAR_FUNC()
Daan De Meyer [Mon, 27 Apr 2026 18:03:51 +0000 (18:03 +0000)] 
fundamental/cleanup: add CLEANUP_ELEMENTS() and DEFINE_POINTER_ARRAY_CLEAR_FUNC()

DEFINE_POINTER_ARRAY_CLEAR_FUNC() generates a helper of the form
helper_array_clear(T *array, size_t n) that drops each element but does
not free the array itself, parallel to DEFINE_POINTER_ARRAY_FREE_FUNC()
for cases where the array has automatic storage duration.

CLEANUP_ELEMENTS() pairs with these helpers to provide a _cleanup_-like
attribute for fixed-size arrays: the bound is taken from ELEMENTSOF(),
and the helper is invoked across the elements at scope exit. Compared to
CLEANUP_ARRAY(), the storage is neither freed nor zeroed.

Migrate various logic across the tree over to the new macros.

sd-device: use DEFINE_POINTER_ARRAY_CLEAR_FUNC() for sd_device_unref_array_clear()

Replace the local device_unref_many() helper with the macro-generated
equivalent.

format-table: switch help-table arrays to CLEANUP_ELEMENTS()

Generate table_unref_array_clear() via DEFINE_POINTER_ARRAY_CLEAR_FUNC()
and convert the help-table arrays in bootctl, cryptenroll, nspawn,
repart and vmspawn to CLEANUP_ELEMENTS(). The arrays no longer need a
trailing NULL slot, so the size matches ELEMENTSOF() of the groups
array.

firewall-util: switch netlink message arrays to CLEANUP_ELEMENTS()

Generate sd_netlink_message_unref_array_clear() via
DEFINE_POINTER_ARRAY_CLEAR_FUNC() in place of the NULL-terminated
sd_netlink_message_unref_many(), and convert the two stack arrays of
sd_netlink_message pointers to CLEANUP_ELEMENTS().

13 days agoImprove error logging for fstat failure
Dan Anderson [Thu, 30 Apr 2026 02:53:10 +0000 (22:53 -0400)] 
Improve error logging for fstat failure

Small hygiene fix.  r must be >= 0 as per the prior statement (otherwise we would have returned).  This is really only going to be r == 0, which means return r; is return 0;  I'm updating this to use log_debug_errno

13 days agorepart: hide read-only block devices from candidates
Lennart Poettering [Wed, 29 Apr 2026 16:47:48 +0000 (18:47 +0200)] 
repart: hide read-only block devices from candidates

If they are read-only they are no candidates, since we cannot write to
them.

13 days agobinfmt-util: handle ELOOP/EACCES from automount in read-only bind mounts
Samuel Dainard [Tue, 28 Apr 2026 15:57:26 +0000 (15:57 +0000)] 
binfmt-util: handle ELOOP/EACCES from automount in read-only bind mounts

When /proc is bind-mounted read-only (common in mock/Koji buildroots,
containers, and other sandboxed environments), opening
/proc/sys/fs/binfmt_misc returns ELOOP if it is an automount point
that cannot be triggered in the read-only context.

Currently binfmt_mounted_and_writable() only handles ENOENT, so ELOOP
propagates as an error. This causes test-binfmt-util to fail with
SIGABRT and disable_binfmt() to log a spurious warning at shutdown.

Treat ELOOP and EACCES the same as ENOENT: binfmt_misc is not usably
available, return false.

Note: PR #37006 (merged April 2025) addressed ELOOP in the xstatfsat()
path, but the open() call in binfmt_mounted_and_writable() remained
unhandled.

Fixes #38070

13 days agoman: add section about systemd-boot Type#1 sidecars
Luca Boccassi [Wed, 29 Apr 2026 14:36:32 +0000 (15:36 +0100)] 
man: add section about systemd-boot Type#1 sidecars

Follow-up for 6b1324fb867d89147585ee20160dbe8f37beefc8

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
13 days agoblockdev-list: fix per-element leak in block_device_array_free() (#41869)
Christian Brauner [Wed, 29 Apr 2026 16:28:16 +0000 (18:28 +0200)] 
blockdev-list: fix per-element leak in block_device_array_free() (#41869)

FOREACH_ARRAY declares 'i' as the iterator but the body passed 'd' (the
array base) to block_device_done(). Since mfree() leaves the field NULL
after the first call, element 0 is freed repeatedly while elements
1..N-1 leak their node, symlinks strv, model, vendor and subsystem.

The bug predates the sanitizer-instrumented callers. PR #41776's new
systemd-storage-block daemon runs blockdev_list() under ASan/LSan in
TEST-87-AUX-UTILS-VM and exposes it (15 allocs / 804 bytes leaked per
ListVolumes request). The fix also benefits repart and blockdev_list's
internal CLEANUP_ARRAY cleanup.

Follow-up for 9f6b2745eaa15be80568fde2a44d0a10ed6eb2a1

13 days agoConvert remaining udev progs to option macros (#41856)
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 15:23:18 +0000 (17:23 +0200)] 
Convert remaining udev progs to option macros (#41856)

13 days agofollow-up for recently merged PRs (#41870)
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 14:41:35 +0000 (16:41 +0200)] 
follow-up for recently merged PRs (#41870)

Just small stuff.

13 days agosd-json,user-record: store the strv size when extending it
Frantisek Sumsal [Wed, 29 Apr 2026 11:48:49 +0000 (13:48 +0200)] 
sd-json,user-record: store the strv size when extending it

So strv_push_with_size() doesn't have to recalculate the size every
time.

13 days agoupdate TODO 41870/head
Lennart Poettering [Wed, 29 Apr 2026 14:05:36 +0000 (16:05 +0200)] 
update TODO

This is mostly stuff discussed in #41776.

13 days agosd-boot: minor tweaks as follow-up for #41863
Lennart Poettering [Wed, 29 Apr 2026 13:52:29 +0000 (15:52 +0200)] 
sd-boot: minor tweaks as follow-up for #41863

This addresses some trivial points made by @keszybz in the PR review.

13 days agovolume: add an "io.systemd.StorageProvider" IPC API that is supposed to be used by...
Lennart Poettering [Wed, 29 Apr 2026 13:51:52 +0000 (15:51 +0200)] 
volume: add an "io.systemd.StorageProvider" IPC API that is supposed to be used by vmspawn/nspawn/pid1 to provide storage volumes in a generic fashion (#41776)

BindPath= in unit files, and --bind= in nspawn/vmspawn doesn't really
cut it to connect arbitrary storage infra to it. Let's do something
about it, and implement a simple, light-weight API for acquiring an fd
to a storage volume. Benefits:

1. the interface can be implemented by anyone, connecting anything to
vmspawn/nspawn/service management
2. very lose coupling: just bind a socket into a well-known dir, done
3. mounting can happen on-demand

13 days agoudevadm: convert verb dispatch to VERB macros 41856/head
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 12:52:26 +0000 (14:52 +0200)] 
udevadm: convert verb dispatch to VERB macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
13 days agoudev-builtin-hwdb: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 11:24:40 +0000 (13:24 +0200)] 
udev-builtin-hwdb: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
13 days agoshared/options: add new helper option_parser_get_arg
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 10:20:58 +0000 (12:20 +0200)] 
shared/options: add new helper option_parser_get_arg

option_parser_next_arg() is renamed to option_parser_peek_next_arg()
to match option_parser_consume_next_arg().

A new helper is added option_parser_get_arg(…, n). It is a common pattern
to only need a single arg, and getting an array and extracting a single
item from it is too verbose.

13 days agosd-boot related work from #41543 (add "extra" stanza to bls type 1) (#41863)
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 13:25:38 +0000 (15:25 +0200)] 
sd-boot related work from #41543 (add "extra" stanza to bls type 1) (#41863)

This implements the "extra" stanza for type 1 entries in systemd-boot,
see:

https://github.com/uapi-group/specifications/commit/bde167a46c866c44e1240120695f70f0bf70aadc

It comes with a really thorough test suite matching our currently level
of testing of systemd-boot (read: there is none, I ask you to trust me,
Claude, and your review on this one)...

Split out of #41543

13 days agoSmall cleanups in sd-varlink and sd-json (#41861)
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 13:03:00 +0000 (15:03 +0200)] 
Small cleanups in sd-varlink and sd-json (#41861)

13 days agosd-bus: store the strv size when extending it (#41864)
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 13:01:12 +0000 (15:01 +0200)] 
sd-bus: store the strv size when extending it (#41864)

So strv_push_with_size() doesn't have to recalculate the size every
time.

2 weeks agoudev-builtin-blkid: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 11:24:36 +0000 (13:24 +0200)] 
udev-builtin-blkid: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-info: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:40:54 +0000 (11:40 +0200)] 
udevadm-info: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-trigger: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:36:00 +0000 (11:36 +0200)] 
udevadm-trigger: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-wait: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:34:15 +0000 (11:34 +0200)] 
udevadm-wait: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-control: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:33:16 +0000 (11:33 +0200)] 
udevadm-control: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-lock: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:31:51 +0000 (11:31 +0200)] 
udevadm-lock: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-settle: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:28:35 +0000 (11:28 +0200)] 
udevadm-settle: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-monitor: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:22:32 +0000 (11:22 +0200)] 
udevadm-monitor: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-test: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:17:14 +0000 (11:17 +0200)] 
udevadm-test: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-verify: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:16:04 +0000 (11:16 +0200)] 
udevadm-verify: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-test-builtin: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:01:28 +0000 (11:01 +0200)] 
udevadm-test-builtin: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudevadm-hwdb: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:00:00 +0000 (11:00 +0200)] 
udevadm-hwdb: convert to OPTION macros

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudev: convert udev-config.c to OPTION macros
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 08:48:04 +0000 (10:48 +0200)] 
udev: convert udev-config.c to OPTION macros

--timeout-signal is now documented (fixup for
e209926778267cbd3e09ed8137bf45b7f370aed0).

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoudev: fix stale optarg use
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 18:28:00 +0000 (20:28 +0200)] 
udev: fix stale optarg use

Fixup for 8623980980d3798f26f23aa56c1491cfd6ceb7b2. This didn't
cause any problems until the conversion away from getopt_long().

2 weeks agoshared/options: add OPTION_COMMON_RESOLVE_NAMES
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 10:02:25 +0000 (12:02 +0200)] 
shared/options: add OPTION_COMMON_RESOLVE_NAMES

2 weeks agoudevadm-cat: convert to OPTION macros
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 07:30:54 +0000 (09:30 +0200)] 
udevadm-cat: convert to OPTION macros

2 weeks agoudevadm: convert option parsing to the new option parser
Zbigniew Jędrzejewski-Szmek [Sun, 26 Apr 2026 10:51:36 +0000 (12:51 +0200)] 
udevadm: convert option parsing to the new option parser

Verb dispatch is left untouched for now.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 weeks agoshared/options: add option_parser_get_help_table_ns() helper
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 10:01:30 +0000 (12:01 +0200)] 
shared/options: add option_parser_get_help_table_ns() helper

It'll be used in the next commit.

2 weeks agoman: add a brief note about type 1 extra lines 41863/head
Lennart Poettering [Wed, 29 Apr 2026 11:35:41 +0000 (13:35 +0200)] 
man: add a brief note about type 1 extra lines

2 weeks agoboot: downgrade log level for an error we ignore
Lennart Poettering [Wed, 29 Apr 2026 10:39:26 +0000 (12:39 +0200)] 
boot: downgrade log level for an error we ignore

2 weeks agoboot: load extra files for UKIs into memory and register as initrds
Lennart Poettering [Wed, 25 Mar 2026 17:15:38 +0000 (18:15 +0100)] 
boot: load extra files for UKIs into memory and register as initrds

This generates on-the-fly cpio initrds from 'extra' resources declared
in Type #1 entries and installs them via the Linux initrd protocol so
that they get passed to the Linux kernel.

Replaces: #39286

2 weeks agoboot: parse 'extra' type 1 stanza too
Lennart Poettering [Fri, 20 Mar 2026 16:46:15 +0000 (17:46 +0100)] 
boot: parse 'extra' type 1 stanza too

This loads the new 'extra' stanza, but doesn't actually do anything with
it yet. That's added in a later commit.

Replaces: #39286

Implements: https://github.com/uapi-group/specifications/pull/212

2 weeks agocpio: move TPM PCR info into CpioTarget
Lennart Poettering [Wed, 29 Apr 2026 10:01:59 +0000 (12:01 +0200)] 
cpio: move TPM PCR info into CpioTarget

The PR to measure into is closely associated with where we place a
resource in the initrd cpios. Hence, let's also track it in CpioTarget,
thus simplifying our function parameter lists that way.

No change in behaviour.

2 weeks agocore: limit the number of units that can be requested over ListUnitsByNames 41864/head
Frantisek Sumsal [Wed, 29 Apr 2026 10:02:32 +0000 (12:02 +0200)] 
core: limit the number of units that can be requested over ListUnitsByNames

2 weeks agosd-bus: store the strv size when extending it
Frantisek Sumsal [Wed, 29 Apr 2026 09:50:01 +0000 (11:50 +0200)] 
sd-bus: store the strv size when extending it

So strv_push_with_size() doesn't have to recalculate the size every
time.

2 weeks agoTODO: track StorageProvider follow-ups, sketch a NetworkProvider sibling 41776/head
Lennart Poettering [Thu, 23 Apr 2026 10:16:24 +0000 (12:16 +0200)] 
TODO: track StorageProvider follow-ups, sketch a NetworkProvider sibling

Records the still-missing StorageProvider integrations (nspawn,
vmspawn, service-manager BindVolume=) and replaces the now-obsolete
generic "storage API via varlink" entry with a NetworkProvider
proposal modelled on it.

2 weeks agotest: add integration test for storagectl and storage providers
Lennart Poettering [Wed, 29 Apr 2026 00:25:07 +0000 (02:25 +0200)] 
test: add integration test for storagectl and storage providers

VM-only test that exercises both shipped providers through storagectl:
verifies the well-known sockets exist, lists providers/volumes/
templates, creates and acquires volumes from each template
(sparse-file, allocated-file, directory, subvolume), attaches a loop
device to cover the block provider, and exercises the mount.storage
helper.

2 weeks agostorage: add 'storagectl' command-line tool
Lennart Poettering [Wed, 22 Apr 2026 21:44:04 +0000 (23:44 +0200)] 
storage: add 'storagectl' command-line tool

CLI for inspecting and using storage providers. Scans
/run/systemd/io.systemd.StorageProvider/ (or the user-mode equivalent)
for AF_UNIX sockets and talks to each one over Varlink. Verbs:
"volumes" lists volumes across all providers, "templates" lists
supported creation templates, "providers" lists the endpoints
themselves.

Also installed as a mount.storage helper, so
'mount -t storage PROVIDER:VOLUME /mnt' (or 'mount -t storage.<fstype>'
to put a fresh filesystem on a block volume) acquires the volume and
mounts it. Ships with bash/zsh completions and a man page.

2 weeks agostorage: add systemd-storage-fs@.service provider
Lennart Poettering [Thu, 23 Apr 2026 07:00:46 +0000 (09:00 +0200)] 
storage: add systemd-storage-fs@.service provider

Second StorageProvider implementation, exposing regular files and
directories from a backing filesystem. In system mode the backing
directory is /var/lib/storage/, in user mode $XDG_STATE_HOME/storage/;
entries with a .volume suffix are exposed, with the inode type
determining whether the volume is reported as reg, dir or (via
symlinked/bind-mounted device node) blk.

Unlike the block provider, this one supports creating volumes
on-demand from a small set of built-in templates: sparse-file,
allocated-file, directory and subvolume.

2 weeks agostorage: add systemd-storage-block@.service provider
Lennart Poettering [Thu, 23 Apr 2026 07:00:06 +0000 (09:00 +0200)] 
storage: add systemd-storage-block@.service provider

First implementation of io.systemd.StorageProvider, exposing all block
devices known to udev (disks, partitions, dm nodes, …) as volumes of
type "blk". Names are picked from stable /dev/mapper and /dev/disk/by-*
symlinks; content-derived identifiers (by-uuid, by-label, …) are
intentionally avoided for security. Volume creation is not supported by
this backend.

Socket-activated via /run/systemd/io.systemd.StorageProvider/block.
Also adds shared storage-util.[ch] (VolumeType / CreateMode helpers)
that subsequent providers reuse.

2 weeks agoshared: add io.systemd.StorageProvider Varlink interface
Lennart Poettering [Thu, 23 Apr 2026 06:59:20 +0000 (08:59 +0200)] 
shared: add io.systemd.StorageProvider Varlink interface

Generic Varlink API for services that hand out file descriptors to
storage volumes. Three methods: Acquire() returns an fd for a named
volume (optionally creating it from a template), ListVolumes()
enumerates available volumes, ListTemplates() enumerates supported
creation templates. Volume types follow kernel inode-type naming:
blk (block device), reg (regular file), dir (directory).

Intent is that multiple providers can sit behind AF_UNIX sockets in a
well-known directory and be consumed uniformly by nspawn, vmspawn,
the service manager (BindVolume=) and similar tools.

2 weeks agolibsystemd: Clean up meson.build
Daan De Meyer [Tue, 28 Apr 2026 17:47:14 +0000 (19:47 +0200)] 
libsystemd: Clean up meson.build

Merge the two blocks adding tests, since there seems to be
no obvious reason to have two separate blocks, as they both
contain tests from the same libraries.

2 weeks agosd-json: stop printing debug messages about extension fields 41861/head
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 09:20:06 +0000 (11:20 +0200)] 
sd-json: stop printing debug messages about extension fields

The intent was good, but we now print two or three of those messages
for each report metrics received on the wire. If the json object is
extensible, then it's all good and we don't need to inundate the user
with this trivial information. (And the message also sounds like
something is wrong or unexpected, when it totally isn't.)

...
(string):1:73: Unrecognized object field 'object', assuming extension.
(string):1:89: Unrecognized object field 'value', assuming extension.
json-stream: Received message: {"parameters":{"name":"io.systemd.Network.CarrierState","object":"virbr0","value":"degraded-carrier"},"continues":true}
(string):1:66: Unrecognized object field 'object', assuming extension.
(string):1:83: Unrecognized object field 'value', assuming extension.
json-stream: Received message: {"parameters":{"name":"io.systemd.Network.CarrierState","object":"lo","value":"carrier"},"continues":true}
(string):1:66: Unrecognized object field 'object', assuming extension.
(string):1:79: Unrecognized object field 'value', assuming extension.
json-stream: Received message: {"parameters":{"name":"io.systemd.Network.CarrierState","object":"wlp0s20f3","value":"carrier"},"continues":true}
(string):1:66: Unrecognized object field 'object', assuming extension.
(string):1:86: Unrecognized object field 'value', assuming extension.
...

2 weeks agosd-varlink: reduce size of varlink structs
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 09:00:00 +0000 (11:00 +0200)] 
sd-varlink: reduce size of varlink structs

struct sd_varlink:
- /* size: 448, cachelines: 7, members: 21 */
+ /* size: 432, cachelines: 7, members: 21 */

struct sd_varlink_server:
- /* size: 160, cachelines: 3, members: 21 */
+ /* size: 152, cachelines: 3, members: 21 */

2 weeks agosd-varlink: drop pointless bitfield
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2026 08:54:43 +0000 (10:54 +0200)] 
sd-varlink: drop pointless bitfield

As is often the case, in this case because of alignment, we are actually
not saving any space. With the bitfield we are using one bit of the 8 bytes
allocated, and without the bitfield we are using 8 bits of that.

But we're paying a price in generated code, at every access site to the
field:

$ diff <(objdump -S build/libsystemd.so.old) <(objdump -S build/libsystemd.so.new)
...
       v->protocol_upgrade = false;
-   fa2d2: 48 8b 45 a8           mov    -0x58(%rbp),%rax
-   fa2d6: 0f b6 90 90 01 00 00  movzbl 0x190(%rax),%edx
-   fa2dd: 83 e2 fe              and    $0xfffffffe,%edx
-   fa2e0: 88 90 90 01 00 00     mov    %dl,0x190(%rax)
+   fa2a9: 48 8b 45 a8           mov    -0x58(%rbp),%rax
+   fa2ad: c6 80 90 01 00 00 00  movb   $0x0,0x190(%rax)

2 weeks agomkosi: Install liburing
Daan De Meyer [Mon, 27 Apr 2026 21:46:37 +0000 (23:46 +0200)] 
mkosi: Install liburing

Make sure liburing is installed so it's available for
experimentation in sd-event integration.

2 weeks agocore: add io.systemd.Unit.StartTransient() to the varlink API (#41583)
Michael Vogt [Wed, 29 Apr 2026 06:20:56 +0000 (08:20 +0200)] 
core: add io.systemd.Unit.StartTransient() to the varlink API (#41583)

This commit adds a simple version of io.systemd.Unit.StartTransient
for varlink. It is similar to the dbus version, but there is a key
difference:
1. Instead of building the unit from key/value properties it
takes a structured json object "UnitContext" with a "Service" field
inside.
   It is also only implementing a minimal set of what can be done with a
   service.
2. No aux units (for now)
3. When called with --more the varlink socket can notify about
   state changes depending on the notify{Job,Unit}Changes parameter

This aligns to the json objects/format from
https://github.com/systemd/systemd/pull/39391
and to show how the format can be shared it adds a new
(minimal) `ServiceContext` that is now part of
`io.systemd.Unit.List()`.

2 weeks agoci: Reduce noise from claude-review workflow
Daan De Meyer [Tue, 28 Apr 2026 07:26:12 +0000 (09:26 +0200)] 
ci: Reduce noise from claude-review workflow

2 weeks agoAdd "namespaces" to option macros, convert systemd-run+run0 (#41844)
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 17:38:04 +0000 (19:38 +0200)] 
Add "namespaces" to option macros, convert systemd-run+run0 (#41844)

2 weeks agoupdate TODO
Lennart Poettering [Tue, 28 Apr 2026 10:04:20 +0000 (12:04 +0200)] 
update TODO

2 weeks agoshared/options: add an assert loop to verify ordering 41844/head
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 06:45:03 +0000 (08:45 +0200)] 
shared/options: add an assert loop to verify ordering

If things are misordered, we need to catch this. Use assert_se to make
the check also in custom builds that otherwise disable assertions.

2 weeks agorun: use a "named namespace" also for the main option parser
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 06:11:40 +0000 (08:11 +0200)] 
run: use a "named namespace" also for the main option parser

It seems that clang reorders the entries in the options array that
originate from different functions, but not within a function. Using
"named namespaces" exclusively should sidestep the issue.

(A bigger hammer would be to sort the array. We *can* do this, since the
options have the increasing .id field. But that'd require duplicating
the memory or making it writable. Let's avoid this until we know for
sure that it's needed.)

2 weeks agorun: convert run0 option parser to macros
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 22:30:08 +0000 (00:30 +0200)] 
run: convert run0 option parser to macros

This exercises the new option namespace code.

--help output is generally the same, except for the formatting changes
related to use of the new output helpers and the common option macros.

--same-root-dir is now documented (followup for
  475729b80532dfbbce98705dade6570ce5cc29f0).

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agorun: convert parse_argv() to OPTION macros
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 22:04:50 +0000 (00:04 +0200)] 
run: convert parse_argv() to OPTION macros

--system is now documented (fixup for 66b1e746055b9c56fd72c0451a4cfb2b06cf3f20).
--capsule is now documented (fixup for 759b3c082d463a488235592df45cbebefbe1ad5c).

--help output is generally the same, except for the formatting changes
related to use of the new output helpers and common option macros.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agorun: reorder switch cases to match help() output order
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 21:58:24 +0000 (23:58 +0200)] 
run: reorder switch cases to match help() output order

Both parse_argv() and parse_argv_sudo_mode() handled options in an
order that no longer matched the help text. Reorder the case statements
so the source order mirrors what the user sees in --help.

In parse_argv_sudo_mode(), drop the case 'i' → ARG_VIA_SHELL fall-through
so the cases can be sequenced independently; 'i' now sets arg_via_shell
directly.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2 weeks agoshared/options: introduce "namespaces" for options
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 20:56:50 +0000 (22:56 +0200)] 
shared/options: introduce "namespaces" for options

This allows multiple option parsers to be defined in a single
compilation unit. We put the OPTION_NAMESPACE("name") to split
up the options. The basic implementation is similar to groups,
except that groups only matter for help display, while namespaces
matter for both help display and actual option parsing. When parsing,
we locate the appropriate range between the beginning of options
and the next namespace marker or between two namespace markers and
only look at that range.

2 weeks agoloop-util: don't reuse partition fd when partscan needed
Clayton Craft [Tue, 28 Apr 2026 02:38:26 +0000 (19:38 -0700)] 
loop-util: don't reuse partition fd when partscan needed

Some devices (e.g. android phones running pmOS) cannot have their OEM
partition table altered without breaking the firmware, so the distros's
partitions live inside a nested GPT carved into one of the OEM
partitions. Exposing these subpartitions requires wrapping the outer
partition in a loop device with partscan enabled, since the kernel does
not go into nested partition tables.

systemd already detects this case in udev-builtin-blkid
(ID_PART_GPT_AUTO_ROOT_DISK_NEEDS_LOOP) and acts on with
systemd-loop@.service, but this fails towards the end.
loop_device_make_internal has an optimization where if the input is
already a block device with a matching sector size, it skips creating
a loop and just hands back the original fd. That's fine for whole disks
but wrong for partitions, which don't support partscan, so this causes
dissect_image to fail with EPROTONOSUPPORT.

This patch changes the behavior to only take the shortcut when the input
is a whole disk, or when partscan was not requested.

Co-Authored-By: Clayton Craft <clayton@craftyguy.net>
2 weeks agoshared/options: fix --help indentation for long options
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2026 09:12:43 +0000 (11:12 +0200)] 
shared/options: fix --help indentation for long options

In 4339197f5d4f712bc900d8e09c892015d48b19bb the helper to format -o/--opt=
was split out, but the indentation was for --long-options was messed up.
We'd print:
Options:
  -h --help             Show this help
  --version             Show package version
  --no-ask-password     Do not prompt for password
  ...
But we want
  -h --help             Show this help
     --version          Show package version
     --no-ask-password  Do not prompt for password
  ...

The prefix argument was arguably ugly, even if it allowed one alloc to be
avoided. Let's get rid of it and let the handler prefix the string as
appropriate. This makes other callers nicer too.

Fixup for 4339197f5d4f712bc900d8e09c892015d48b19bb.

2 weeks agocore: ensure all types from execute.h start with Exec
Lennart Poettering [Tue, 28 Apr 2026 10:05:28 +0000 (12:05 +0200)] 
core: ensure all types from execute.h start with Exec

Until very recently all types defined by execute.h started with "Exec"
in the name. I think that was useful, since it made clear that the types
are associated with the ExecContext infrastructure. Let's hence restore
this.

(If we every move these types out of execute.h we should drop the "Exec"
prefix again. But today is not that day.)

No real code changes, just dumb renaming.

2 weeks agomeson: rerun 'update-man-rules'
Lennart Poettering [Tue, 28 Apr 2026 10:03:45 +0000 (12:03 +0200)] 
meson: rerun 'update-man-rules'

2 weeks agoA couple of sanitizer-related tweaks (#41808)
Luca Boccassi [Tue, 28 Apr 2026 11:04:45 +0000 (12:04 +0100)] 
A couple of sanitizer-related tweaks (#41808)

The sanitizer job was FUBAR on Fedora Rawhide (and RHEL 10 to some
extent) due to several changes:
- latest LLVM (v22) introduced a change that occasionally generates a
false-positive warning when running with sanitizers
  - several tools had to be "ASan-wrapped" because:
- util-linux started linking against libsystemd which propagated to
other tools depending on its shared libraries (like libmount)
- libssh started depending on libfido2, which depends on libudev; this
then translated to an interesting depedency chain where tpm2 utils got a
dependency on libudev through libcurl -> libssh -> libfido2
- polkit added MemoryMax= to its service file, which is incompatible
with ASan-runs (at least with the current limits)

See the commits for more detailed descriptions.

Also, one note: the santizer job is currently still FUBAR on Fedora
Rawhide (or, more specifically, the TEST-50-DISSECT and TEST-58-REPART),
because mkfs.erofs also gained a dependency on libudev (through libcurl,
see above), but the wrapping currently doesn't work as it also depends
on libqpl which is linked with libtsan (which is incompatible with other
sanitizers). This is currently tracked in
https://bugzilla.redhat.com/show_bug.cgi?id=2461146

2 weeks agopo: Translated using Weblate (German)
Dark Cronyx [Tue, 28 Apr 2026 08:59:17 +0000 (08:59 +0000)] 
po: Translated using Weblate (German)

Currently translated at 100.0% (266 of 266 strings)

Co-authored-by: Dark Cronyx <darkcronyx@protonmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/de/
Translation: systemd/main

2 weeks agofork-notify: Use callback instead of argv NULL code path with return (#41813)
Daan De Meyer [Tue, 28 Apr 2026 08:15:31 +0000 (10:15 +0200)] 
fork-notify: Use callback instead of argv NULL code path with return (#41813)

2 weeks agocore: transition job to JOB_FINISHED on uninstall 41583/head
Michael Vogt [Mon, 27 Apr 2026 11:12:30 +0000 (13:12 +0200)] 
core: transition job to JOB_FINISHED on uninstall

When a job reaches the job_uninstall() stage we used to set the
state to JOB_WAITING. However now that we have a JOB_FINISHED state [1]
we should use that instead. This is more accurate so when
varlink_job_send_removed_signal() is called the job is in the expected
state and that is what the user will see.

Note that this does not change the D-Bus API because there
bus_job_send_removed_signal() doesn't send the state, it only sends
the result.

[1] https://github.com/systemd/systemd/pull/41811

2 weeks agoudev: don't assert on worker cap after killing a broken idle worker 41758/head
Daan De Meyer [Tue, 21 Apr 2026 08:44:44 +0000 (08:44 +0000)] 
udev: don't assert on worker cap after killing a broken idle worker

manager_can_process_event() considers an event processable if either
there is room below children_max to spawn, or an idle worker exists.
When only the latter holds, event_run() picks the idle worker and
tries device_monitor_send(). If that send fails, event_run() SIGKILLs
the worker, marks it WORKER_KILLED and continues the loop. With no
other idle worker available, it falls through to worker_spawn(),
guarded by:

    assert(hashmap_size(manager->workers) < manager->config.children_max);

The just-killed worker is still in manager->workers until its SIGCHLD
is reaped by on_worker_exit(), so at the cap this assertion trips and
udevd aborts:

    Assertion 'hashmap_size(manager->workers) < manager->config.children_max'
    failed at src/udev/udev-manager.c:635, function event_run(). Aborting.

Instead of asserting, bail out when we are already at the worker
limit. The event remains in EVENT_QUEUED; once the killed worker's
SIGCHLD arrives and frees it from the hashmap, on_post() re-runs
event_queue_start() and the event is retried.

2 weeks agooptions: add a proper state machine field
Lennart Poettering [Fri, 24 Apr 2026 08:33:46 +0000 (10:33 +0200)] 
options: add a proper state machine field

Let's track the state of the option parser in an explicit 'state' field.

Benefits:

1. We can make sure that a parser that got into a failure state will
   be invalidated for good (i.e. further operations are guaranteed to
   fail too).

2. As a side effect this cleans up the option_parse() return parameter
   handling: we'll now always initialize ret_option/ret_arg when
   returning >= 0, as per coding style.

2 weeks agooptions: tighten validation of argc/argv
Lennart Poettering [Fri, 24 Apr 2026 08:37:48 +0000 (10:37 +0200)] 
options: tighten validation of argc/argv

If argc/argv do no match a lot of our assumptions are invalid, hence
let's check this explicitly once, instead of ignoring the issue.

2 weeks agooptions: drop redundant enum value declaration
Lennart Poettering [Fri, 24 Apr 2026 08:32:52 +0000 (10:32 +0200)] 
options: drop redundant enum value declaration

2 weeks agotree-wide: change option_parse() to return option and arg via internal state (#41833)
Zbigniew Jędrzejewski-Szmek [Mon, 27 Apr 2026 17:42:52 +0000 (19:42 +0200)] 
tree-wide: change option_parse() to return option and arg via internal state (#41833)

2 weeks agomachine-register: don't unref borrowed varlink reply 41813/head
Kai Lüke [Fri, 24 Apr 2026 16:49:09 +0000 (01:49 +0900)] 
machine-register: don't unref borrowed varlink reply

ASAN showed a use-after-free error for systemd-vmspawn's
machine_register call because the reply got accessed and freed again
through _cleanup. The same problem exists in two
verb_machine_control_one/unregister_machine.
Fix these call sites to not set up _cleanup.

2 weeks agonsresource: fix buffer overrun reported by ASAN
Kai Lüke [Fri, 24 Apr 2026 16:42:36 +0000 (01:42 +0900)] 
nsresource: fix buffer overrun reported by ASAN

This came up when running systemd-vmspawn with ASAN to fix another bug
and thus I had to fix this overrun here first: The dispatch tables were
missing the terminator, add it.

2 weeks agofork-notify: Use callback instead of argv NULL code path with return
Kai Lüke [Fri, 24 Apr 2026 15:18:56 +0000 (00:18 +0900)] 
fork-notify: Use callback instead of argv NULL code path with return

In 012d87c1fc/cc8f398202 it was made possible for fork_notify() to
return in the child but at that point all FDs were closed and the
_cleanup path from the return causes assertion failures due to invalid
FDs in notify_event_source/event, leading to a vmspawn failing to start
with a SIGABRT logged in coredump.
Instead of TAKE_PTR on a bunch of things which is fragile, rather avoid
the return and instead add an explicit callback handler and guarantee
to exit directly after it. A userdata argument is also added but not
used yet I think it's quite normal to have for a callback.

2 weeks agovmspawn-varlink: treat QMP disconnect as success for Terminate
Christian Brauner [Mon, 27 Apr 2026 10:34:27 +0000 (12:34 +0200)] 
vmspawn-varlink: treat QMP disconnect as success for Terminate

QMP "quit" tells QEMU to exit, which races the reply with the socket
EOF: sometimes the disconnect lands in qmp_client_fail_pending() with
-ECONNRESET before the reply has been parsed. The shared completion
callback then translates that into io.systemd.MachineInstance.NotConnected,
turning the desired outcome into a varlink error.

This is exactly what TEST-87-AUX-UTILS-VM exposes during its repeated
start/pause/resume/terminate stress loop: a successful Pause/Describe
followed milliseconds later by a Terminate that fails with NotConnected
when the disconnect path wins the race.

Give Terminate its own completion callback that treats disconnect-class
errors as success, since QEMU shutting down is the whole point of "quit".
The other simple commands (Pause, Resume, PowerOff, Reboot) keep the
existing semantics: they expect QMP to remain alive, so NotConnected is
the correct reply for them.

Link: https://github.com/systemd/systemd/actions/runs/24986080288/job/73159585425?pr=41835
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2 weeks agotest: add varlink io.systemd.Unit.StartTransient() test
Michael Vogt [Tue, 14 Apr 2026 15:04:31 +0000 (17:04 +0200)] 
test: add varlink io.systemd.Unit.StartTransient() test

This commit adds a bunch of integration tests for the new varlink
based io.systemd.Unit.StartTransient().

2 weeks agocore: add io.systemd.Unit.StartTransient() to the varlink API
Michael Vogt [Tue, 14 Apr 2026 15:04:15 +0000 (17:04 +0200)] 
core: add io.systemd.Unit.StartTransient() to the varlink API

This commit adds a simple version of io.systemd.Unit.StartTransient
for varlink. It is similar to the dbus version, but there is a key
difference:
1. Instead of building the unit from key/value properties it
   takes a json object in the "service" parameter. It is also
   only implementing a minimal set of what can be done with a
   service (for now)
2. No aux units (for now)
3. When called with --more the varlink socket can notify about
   unit job and state changes controlled via a bool on the
   varlink call inputs: notify{Job,Unit}Changes

We use the new io.systemd.Job interface when outputing the
io.systemd.Unit.StartTransient result as it makes the output
nice and mirrors the input.

Note that the property names follow the D-Bus naming to make a
future "systemctl show" transition from D-Bus -> varlink easier.

Because UnitContext is now also used for the inputs we need
to make a bunch of fields `SD_VARLINK_NULLABLE` so that the
input is even accepted. This does not affect the output, it
is still fully populated, just the schema. The ID of UnitContext
is still required.

Thanks to ikruglov and Lennart for their excellent feedback on
this.

2 weeks agocore: extract manager_setup_transient_unit() helper
Michael Vogt [Tue, 14 Apr 2026 14:24:07 +0000 (16:24 +0200)] 
core: extract manager_setup_transient_unit() helper

Extract the transient unit setup logic from transient_unit_from_message()
in dbus-manager.c into a shared helper.

This prepares for reuse by the varlink StartTransient implementation.