]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
10 days agovarious: use DEFINE_ARRAY_FREE_FUNC 41559/head
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 21:04:47 +0000 (23:04 +0200)] 
various: use DEFINE_ARRAY_FREE_FUNC

10 days agosysupdate: use DEFINE_POINTER_ARRAY_FREE_FUNC, rename func
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 21:04:19 +0000 (23:04 +0200)] 
sysupdate: use DEFINE_POINTER_ARRAY_FREE_FUNC, rename func

10 days agoshared/tar-util: use DEFINE_ARRAY_FREE_FUNC, rename funcs
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 21:03:47 +0000 (23:03 +0200)] 
shared/tar-util: use DEFINE_ARRAY_FREE_FUNC, rename funcs

10 days agosd-journal: use NormalCasing for struct
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 20:56:07 +0000 (22:56 +0200)] 
sd-journal: use NormalCasing for struct

10 days agonsresourced: use DEFINE_ARRAY_FREE_FUNC, make func static and rename
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 20:49:41 +0000 (22:49 +0200)] 
nsresourced: use DEFINE_ARRAY_FREE_FUNC, make func static and rename

10 days agolibsystemd-network: use DEFINE_POINTER_ARRAY_FREE_FUNC, rename cleanup function
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 20:40:21 +0000 (22:40 +0200)] 
libsystemd-network: use DEFINE_POINTER_ARRAY_FREE_FUNC, rename cleanup function

10 days agolibsystemd-network: use DEFINE_ARRAY_FREE_FUNC, rename cleanup func
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 20:34:34 +0000 (22:34 +0200)] 
libsystemd-network: use DEFINE_ARRAY_FREE_FUNC, rename cleanup func

10 days agostub: use DEFINE_ARRAY_FREE_FUNC
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 16:30:37 +0000 (18:30 +0200)] 
stub: use DEFINE_ARRAY_FREE_FUNC

10 days agoAdd DEFINE_ARRAY_FREE_FUNC and mount_image_free_array
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 16:27:34 +0000 (18:27 +0200)] 
Add DEFINE_ARRAY_FREE_FUNC and mount_image_free_array

This is similar to DEFINE_POINTER_ARRAY_FREE_FUNC, but one
pointer chase less. The name of the outer and inner functions are
specified separately. The inner function does not free, so it'll
be generally something like 'foo_done', but the outer function
does free, so it can be called 'foo_array_free'.

10 days agoAdd DEFINE_POINTER_ARRAY_FREE_FUNC and conf_file_free_array
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 15:56:09 +0000 (17:56 +0200)] 
Add DEFINE_POINTER_ARRAY_FREE_FUNC and conf_file_free_array

As mentioned in the grandfather commit, I want to use the _many
suffix for freeing of the contents of an array, so the functions
to free the array to get the suffix _array.

10 days agofirewall-util: use DEFINE_ARRAY_DONE_FUNC for netlink message cleanup
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 15:37:41 +0000 (17:37 +0200)] 
firewall-util: use DEFINE_ARRAY_DONE_FUNC for netlink message cleanup

Replace the open-coded netlink_message_unref_many() function and its
DEFINE_TRIVIAL_CLEANUP_FUNC wrapper with DEFINE_ARRAY_DONE_FUNC.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
10 days agoAdd DEFINE_ARRAY_DONE_FUNC
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 15:17:32 +0000 (17:17 +0200)] 
Add DEFINE_ARRAY_DONE_FUNC

This is a helper macro that defines a function to drop elements of an
array but not the array itself. I used the "_many" suffix because it
most closely matches what happens here: we are calling the cleanup
function a bunch of times.

11 days agonspawn,vmspawn: fixups for recent changes
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 14:41:06 +0000 (16:41 +0200)] 
nspawn,vmspawn: fixups for recent changes

Nits found in post-merge review for
bf5bc9a7b26191ff4254836bd909cbb92eafe480 and
4c778c51c07db3eb0e07dd875f10eb85f086f096.

11 days agocoredumpctll: avoid unnecessary heap copy and decompression for field existence check...
Luca Boccassi [Wed, 8 Apr 2026 20:34:47 +0000 (21:34 +0100)] 
coredumpctll: avoid unnecessary heap copy and decompression for field existence checks (#41520)

`print_list()` and `print_info()` used `RETRIEVE()` to `strndup()` the
entire
`COREDUMP` field into a heap-allocated string, only to check whether it
exists.
With `sd_journal_set_data_threshold(j, 0)` in `print_info()`, this
copies the
full coredump binary (potentially hundreds of MB) to heap just to print
"Storage: journal".

This PR:

1. Makes `sd_journal_get_data()` output parameters optional
(`NULL`-safe), so
   callers can do pure existence checks without receiving the data.
2. Short-circuits `maybe_decompress_payload()` after
`decompress_startswith()`
   succeeds when neither output pointer is requested, skipping full blob
   decompression for compressed journal entries.
3. Switches coredumpctl to pass `NULL, NULL` for the existence checks
instead
   of heap-copying via `RETRIEVE()`.

11 days agosd-varlink: check flags against the correct field
Frantisek Sumsal [Wed, 8 Apr 2026 14:30:54 +0000 (16:30 +0200)] 
sd-varlink: check flags against the correct field

Otherwise even a method without SD_VARLINK_SUPPORTS_MORE/REQUIRES_MORE
can emit "continues" replies without our IDL validation catching it.

11 days agoclangd: Strip GCC-only flags and silence unknown-attributes
Daan De Meyer [Wed, 8 Apr 2026 17:35:10 +0000 (17:35 +0000)] 
clangd: Strip GCC-only flags and silence unknown-attributes

Several GCC-only options in our compile_commands.json
(-fwide-exec-charset=UCS2, used by EFI boot code for UTF-16 string
literals, and -maccumulate-outgoing-args) cause clangd to emit
driver-level "unknown argument" errors. These can't be silenced through
Diagnostics.Suppress, so remove them via CompileFlags.Remove before
clang ever sees them.

Also suppress the -Wunknown-attributes warning that fires on every use
of _no_reorder_, since meson unconditionally expands it to the GCC-only
__no_reorder__ attribute when configured with GCC.

11 days agonetworkd-wwan: drop unreachable unknown-bearer fallback path
noxiouz [Tue, 7 Apr 2026 13:47:33 +0000 (14:47 +0100)] 
networkd-wwan: drop unreachable unknown-bearer fallback path

bearer_get_by_path() only succeeds when both modem and bearer are found.
On failure, trying bearer_new_and_initialize(modem, path) was
unreachable and relied on a modem value that is not returned on that
path.

Treat unknown bearers as no-op and rely on modem_map_bearers() for
association during initialization.

Co-developed-by: Codex (GPT-5) <noreply@openai.com>
11 days agocoredumpctl: use NULL outputs for COREDUMP existence checks 41520/head
noxiouz [Tue, 7 Apr 2026 15:30:04 +0000 (16:30 +0100)] 
coredumpctl: use NULL outputs for COREDUMP existence checks

print_list() and print_info() used RETRIEVE() to strndup() the entire
COREDUMP field into a heap-allocated string, only to check whether it
exists.  With sd_journal_set_data_threshold(j, 0) in print_info(),
this copies the full coredump binary (potentially hundreds of MB) to
heap just to print "Storage: journal".

Now that sd_journal_get_data() accepts NULL output pointers, use a
direct NULL/NULL existence check instead.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
11 days agosd-journal: skip full decompression when caller only checks field existence
noxiouz [Tue, 7 Apr 2026 15:29:56 +0000 (16:29 +0100)] 
sd-journal: skip full decompression when caller only checks field existence

When both ret_data and ret_size are NULL after decompress_startswith()
has confirmed the field matches, skip the decompress_blob() call.
This avoids decompressing potentially large payloads (e.g. inline
coredumps) just to discard the result.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
11 days agosd-journal: make sd_journal_get_data() output params optional
noxiouz [Tue, 7 Apr 2026 15:29:51 +0000 (16:29 +0100)] 
sd-journal: make sd_journal_get_data() output params optional

Allow callers to pass NULL for ret_data and/or ret_size when they only
need to check whether a field exists.  Initialize provided output
pointers to safe defaults and update the manual page accordingly.

Propagate the NULL-ness through to journal_file_data_payload() so that
downstream helpers can optimize for the existence-check case.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
12 days agotmpfiles: skip redundant label writes to avoid unnecessary timestamp changes
Nandakumar Raghavan [Tue, 7 Apr 2026 06:33:41 +0000 (06:33 +0000)] 
tmpfiles: skip redundant label writes to avoid unnecessary timestamp changes

When systemd-tmpfiles processes a 'z' (relabel) entry, fd_set_perms()
unconditionally calls label_fix_full() even when mode, owner, and group
already match. This causes setfilecon_raw() (SELinux) or xsetxattr() (SMACK)
to write the security label even if it is already correct, which on some
kernels updates the file's timestamps unnecessarily.

Fix this by comparing the current label with the desired label before
writing, and skipping the write when they already match. This is consistent
with how fd_set_perms() already skips chmod/chown when the values are
unchanged.

12 days agoMacroize option parsing in nspawn, vmspawn, journal-remote (#41542)
Daan De Meyer [Wed, 8 Apr 2026 13:33:51 +0000 (15:33 +0200)] 
Macroize option parsing in nspawn, vmspawn, journal-remote (#41542)

12 days agonetworkd-wwan: handle link_get_by_name() errors in modem_simple_connect()
noxiouz [Tue, 7 Apr 2026 13:47:11 +0000 (14:47 +0100)] 
networkd-wwan: handle link_get_by_name() errors in modem_simple_connect()

modem_simple_connect() ignored the return value of link_get_by_name()
and then checked link for NULL. Since the helper only sets the output
pointer on success, that could read an indeterminate value.

Check and log the return code directly with log_debug_errno().

Co-developed-by: Codex (GPT-5) <noreply@openai.com>
12 days agonetworkd: keep static lease section valid on MACAddress= reset
noxiouz [Tue, 7 Apr 2026 13:47:44 +0000 (14:47 +0100)] 
networkd: keep static lease section valid on MACAddress= reset

config_parse_dhcp_static_lease_hwaddr() uses a cleanup helper that marks
a lease section invalid unless ownership is taken.

Add TAKE_PTR(lease) on the empty-rvalue reset path so subsequent valid
MACAddress= assignments in the same section are not dropped.

Co-developed-by: Codex (GPT-5) <noreply@openai.com>
12 days agotmpfiles: do not require `STATX_ATIME` (#41232)
Zbigniew Jędrzejewski-Szmek [Wed, 8 Apr 2026 11:56:13 +0000 (13:56 +0200)] 
tmpfiles: do not require `STATX_ATIME` (#41232)

Timestamps are not guaranteed to be set by `statx()`, and their presence
should not be asserted as a proxy to judge the kernel version. In
particular, `STATX_ATIME` is omitted from the return when querying a
file on a `noatime` superblock, causing spurious errors from tmpfiles:

```console
# SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --clean
<...>
Running clean action for entry X /var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-*/tmp
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-prometheus-smartctl-exporter.service-GKguQK/tmp) failed: Protocol driver not attached
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-systemd-logind.service-k8j52T/tmp) failed: Protocol driver not attached
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-irqbalance.service-7RJkev/tmp) failed: Protocol driver not attached
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-chronyd.service-8hkO5G/tmp) failed: Protocol driver not attached
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-dbus-broker.service-6P6LVl/tmp) failed: Protocol driver not attached
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-nginx.service-B5HX8B/tmp) failed: Protocol driver not attached
Running clean action for entry x /var/tmp/systemd-private-94cc8a77688e497f96d5b9019e66ed6f-*
Running clean action for entry q /var/tmp
statx() does not support 'STATX_ATIME' mask (running on an old kernel?)
statx(/var/tmp) failed: Protocol driver not attached
<...>
```

Additionally, refactor `dir_cleanup()` slightly for self-consistency to
make
it evident that the `NSEC_INFINITY` transformation is correct.

Fixes #41227.

12 days agonspawn: make handling of compat --user=… less elaborate 41542/head
Zbigniew Jędrzejewski-Szmek [Tue, 7 Apr 2026 15:49:54 +0000 (17:49 +0200)] 
nspawn: make handling of compat --user=… less elaborate

Follow-up for e7fb7296f56dacc24054cddb2e1f0aa55ee7dc94.

12 days agofstab-generator: support swap on network block devices
Frantisek Sumsal [Tue, 7 Apr 2026 09:16:42 +0000 (11:16 +0200)] 
fstab-generator: support swap on network block devices

Teach swap units to support the _netdev option as well, which should
make swaps on iSCSI possible. This mirrors the logic we already have for
regular mounts in both the fstab-generator and the core
(mount.c/swap.c).

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
12 days agoMore assorted coverity fixes (#41548)
Luca Boccassi [Wed, 8 Apr 2026 10:26:27 +0000 (11:26 +0100)] 
More assorted coverity fixes (#41548)

One more round, this time with the help of the claudebot, especially for
spelunking in git blame to find the original commit and writing commit
messages from the list of warnings exported from coverity

Co-developed-by: Claude
[claude@anthropic.com](mailto:claude@anthropic.com)

12 days agosysext: provide systemd-{sysext,confext}-sysroot.service services (#41161)
Lennart Poettering [Wed, 8 Apr 2026 09:30:20 +0000 (11:30 +0200)] 
sysext: provide systemd-{sysext,confext}-sysroot.service services (#41161)

This should pretty much close #38985

The new services are used to activate system and configuration
extensions for the main system from the initrd, this allows to overcome
the limitation that sysext/confext cannot be used to update the
resources which are required in the earliest boot of the system (before
systemd-sysext/systemd-confext start).

To make it possible to disable sysext/confext merging logic,
`systemd.sysext=0`, `systemd.confext=0`, `rd.systemd.sysext=0`,
`rd.systemd.confext=0` kernel cmdline options are introduced.

Closes #38985

12 days agolimits-util: use MUL_SAFE for physical memory calculation 41548/head
Luca Boccassi [Tue, 7 Apr 2026 23:59:48 +0000 (00:59 +0100)] 
limits-util: use MUL_SAFE for physical memory calculation

Coverity flags (uint64_t)sc * (uint64_t)ps as a potential overflow.
Use MUL_SAFE which Coverity understands via __builtin_mul_overflow.
Physical page count times page size cannot realistically overflow
uint64_t, but this makes it provable to static analyzers.

CID#1548042

Follow-up for 09bb6448ae221c09a00d1f4a9b45ce8535003319

12 days agosd-event: validate ssi_signo fits in signed int
Luca Boccassi [Tue, 7 Apr 2026 23:53:07 +0000 (00:53 +0100)] 
sd-event: validate ssi_signo fits in signed int

Coverity flags si.ssi_signo as tainted data from read(), and warns
that casting it to signed could produce a negative value. Add an
explicit range check against INT_MAX before the SIGNAL_VALID check
to prove the cast is safe.

CID#1548033

Follow-up for c8b53fcfd3463679e6475e9b57b61a97dac1a287

12 days agosd-bus: assert ALIGN result in sd_bus_message_new
Luca Boccassi [Tue, 7 Apr 2026 23:40:01 +0000 (00:40 +0100)] 
sd-bus: assert ALIGN result in sd_bus_message_new

Coverity flags ALIGN(sizeof(sd_bus_message)) as potentially
returning SIZE_MAX, making the subsequent + sizeof(BusMessageHeader)
overflow. Store the ALIGN result in a local and assert it is not
SIZE_MAX.

CID#1548031

Follow-up for 4f5b28b72c7ff78c7eabcce7ad4f0eaebfd5545d

12 days agosd-bus: use INC_SAFE and assert for message_from_header allocation
Luca Boccassi [Tue, 7 Apr 2026 23:34:56 +0000 (00:34 +0100)] 
sd-bus: use INC_SAFE and assert for message_from_header allocation

Coverity flags ALIGN() as potentially returning SIZE_MAX and the
subsequent a += label_sz + 1 as overflowing. Assert ALIGN result
is not SIZE_MAX and use INC_SAFE for the addition.

CID#1548030

Follow-up for 55354d5930fd0b7952d649d9ad5a850279fc73e1

12 days agonss-myhostname: use INC_SAFE for buffer index accumulation
Luca Boccassi [Tue, 7 Apr 2026 23:26:33 +0000 (00:26 +0100)] 
nss-myhostname: use INC_SAFE for buffer index accumulation

Use overflow-safe INC_SAFE() instead of raw addition for idx
accumulation, so that Coverity can see the addition is checked.

CID#1548028

Follow-up for a05483a921a518fd283e7cb32dc8c8e816b2ab2c

12 days agotest-path: use usec_add() for timeout calculation
Luca Boccassi [Tue, 7 Apr 2026 23:15:18 +0000 (00:15 +0100)] 
test-path: use usec_add() for timeout calculation

Coverity flags now() + 30 * USEC_PER_SEC as overflowing because
now() can return USEC_INFINITY. Use usec_add() which saturates
on overflow instead of wrapping.

CID#1548025

Follow-up for 331461a5a2ffe323190c4ca6b7bcd35944e36f92

12 days agosd-bus: assert ALIGN8 result is not SIZE_MAX
Luca Boccassi [Tue, 7 Apr 2026 23:11:01 +0000 (00:11 +0100)] 
sd-bus: assert ALIGN8 result is not SIZE_MAX

Coverity flags sizeof(BusMessageHeader) + ALIGN8(m->fields_size)
as overflowing because ALIGN_TO can return SIZE_MAX as an overflow
sentinel. Assert that the aligned value is not SIZE_MAX to prove
the addition is safe.

CID#1548023
CID#1548046

Follow-up for 2ac7c17f9d8eeb403b91ee5a389562edaf47fb87

12 days agorecurse-dir: add assert for MALLOC_SIZEOF_SAFE lower bound
Luca Boccassi [Tue, 7 Apr 2026 22:59:16 +0000 (23:59 +0100)] 
recurse-dir: add assert for MALLOC_SIZEOF_SAFE lower bound

Coverity flags MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries,
buffer) as a potential underflow when MALLOC_SIZEOF_SAFE returns 0.
After a successful malloc the return value is at least as large as
the requested size, but Coverity cannot trace this. Add an assert
to establish the lower bound.

CID#1548020

Follow-up for 6393b847f459dba14d2b615ee93babb143168b57

12 days agouid-range: add assert to silence coverity
Luca Boccassi [Tue, 7 Apr 2026 22:45:30 +0000 (23:45 +0100)] 
uid-range: add assert to silence coverity

Coverity flags range->n_entries - j - 1 and j-- as potential
underflows. Add an assert that j > 0 before decrementing, since
j starts at i + 1 >= 1 and is never decremented below its
initial value.

CID#1548015

Follow-up for 8dcc66cefc8ab489568c737adcba960756d76a3c

12 days agoscsi_id: null-terminate serial after append_vendor_model
Luca Boccassi [Tue, 7 Apr 2026 22:08:29 +0000 (23:08 +0100)] 
scsi_id: null-terminate serial after append_vendor_model

append_vendor_model() uses memcpy() to write VENDOR_LENGTH +
MODEL_LENGTH bytes without null-terminating. While the caller
zeroes the buffer beforehand, Coverity cannot trace this. Add
explicit null termination so the subsequent strlen() is provably
safe.

CID#1469706

Follow-up for 86fd0337c652b04755008cdca23e2d9c727fa9a9

12 days agoshared/options: add helper function to peek at or consume the next arg
Zbigniew Jędrzejewski-Szmek [Tue, 7 Apr 2026 15:48:25 +0000 (17:48 +0200)] 
shared/options: add helper function to peek at or consume the next arg

The test was partially written with Claude Opus 4.6. It's a bit on the
verbose side, but does the job.

12 days agonspawn: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Tue, 7 Apr 2026 15:13:46 +0000 (17:13 +0200)] 
nspawn: convert to the new option parser

Uses stop_at_first_nonoption for POSIX-style option parsing.

Includes a fixup for b4df0a9ee62d553e21f3b70c28841cfd1b8736f1, where
global optarg was used instead of the function param. This made no
difference previously because they were always equal.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
12 days agovmspawn: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Tue, 7 Apr 2026 14:22:21 +0000 (16:22 +0200)] 
vmspawn: convert to the new option parser

Uses stop_at_first_nonoption for POSIX-style option parsing.

--help output is the same, apart from whitespace differences
and common strings.

The error message for --ssh-key-type= is fixed.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
12 days agocoredumpctl: use loop_write() for dumping inline journal coredumps
noxiouz [Tue, 7 Apr 2026 13:52:38 +0000 (14:52 +0100)] 
coredumpctl: use loop_write() for dumping inline journal coredumps

Replace the bare write() call with loop_write(), which handles short
writes and EINTR retries. This also drops the now-unnecessary ssize_t
variable and the redundant r = log_error_errno(r, ...) self-assignment,
since loop_write() already stores its result in r.

Co-developed-by: Codex (GPT-5) <noreply@openai.com>
12 days agoAnother batch of option/verb conversions (#41532)
Zbigniew Jędrzejewski-Szmek [Tue, 7 Apr 2026 14:13:31 +0000 (16:13 +0200)] 
Another batch of option/verb conversions (#41532)

Partially generated with Claude but then edited to fix conversions
errors.

13 days agoshared/options: add equivalent of "+…" for nested commandline parsing
Zbigniew Jędrzejewski-Szmek [Tue, 7 Apr 2026 13:54:54 +0000 (15:54 +0200)] 
shared/options: add equivalent of "+…" for nested commandline parsing

13 days agooci-registry: use overrideRegistry in fedora default
LevitatingBusinessMan (Rein Fernhout) [Mon, 6 Apr 2026 01:14:24 +0000 (03:14 +0200)] 
oci-registry: use overrideRegistry in fedora default

In registry.fedora.oci-registry use overrideRegistry instead of defaultRegistry.

fixes #41518

13 days agovmspawn: Always enable CXL on supported architectures
Daan De Meyer [Tue, 7 Apr 2026 08:59:03 +0000 (08:59 +0000)] 
vmspawn: Always enable CXL on supported architectures

Drop the --cxl= option and unconditionally enable cxl=on the QEMU
machine type whenever the host architecture supports it (x86_64 and
aarch64). The flag was only added for testing parity with mkosi's CXL=
setting and there is no reason to leave it as an opt-in toggle: with no
pxb-cxl device or cxl-fmw window attached, enabling it on the machine
only reserves a small MMIO region and emits an empty CEDT, so the cost
is negligible while removing one knob users would otherwise have to
flip explicitly to exercise the CXL code paths in QEMU.

13 days agorepart: fix option spelling and file path in comments and manpage (#41534)
Zbigniew Jędrzejewski-Szmek [Tue, 7 Apr 2026 09:42:25 +0000 (11:42 +0200)] 
repart: fix option spelling and file path in comments and manpage (#41534)

Two minor fixes in comments and documentation:

 - Update comment that mentions file renamed in 211d2f972dd1
 - Do not reference `SizeMin=` where `SizeMinBytes=` is meant

No functional changes.

13 days agojournald-native: fix field-count limit off-by-one
noxiouz [Mon, 6 Apr 2026 10:22:58 +0000 (11:22 +0100)] 
journald-native: fix field-count limit off-by-one

Reject entries once the configured maximum field count is reached.

The previous check used n > ENTRY_FIELD_COUNT_MAX before appending a new field,
which let one extra field through in boundary cases. Switch the check to
n >= ENTRY_FIELD_COUNT_MAX so an entry at the limit is rejected before adding
another property.

Co-developed-by: Codex (GPT-5) <noreply@openai.com>
13 days agorepart: Do not refer to SizeMinBytes= as SizeMin= 41534/head
Jonas Rebmann [Tue, 7 Apr 2026 09:06:25 +0000 (11:06 +0200)] 
repart: Do not refer to SizeMinBytes= as SizeMin=

No SizeMin= option exists for repart.d; it seems that SizeMinBytes= was
intended.

Update all references accordingly.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
13 days agotest-specifier: update comment to moved file
Jonas Rebmann [Tue, 7 Apr 2026 09:03:48 +0000 (11:03 +0200)] 
test-specifier: update comment to moved file

src/partition/repart.c was renamed to src/repart/repart.c in commit
211d2f972dd1 ("Rename src/partition to src/repart"), update the comment
accordingly.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
13 days agoboot-check-no-failures: convert to the new option parser 41532/head
Zbigniew Jędrzejewski-Szmek [Sun, 5 Apr 2026 15:41:12 +0000 (17:41 +0200)] 
boot-check-no-failures: convert to the new option parser

--help is identical except for whitespace changes.
Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agobattery-check: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sun, 5 Apr 2026 15:38:46 +0000 (17:38 +0200)] 
battery-check: convert to the new option parser

--help is identical except for whitespace changes.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agoupdatectl: convert to the new option and verb parsers
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 19:52:46 +0000 (21:52 +0200)] 
updatectl: convert to the new option and verb parsers

Cosmetic differences in --help only.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agotpm2-setup: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 19:29:38 +0000 (21:29 +0200)] 
tpm2-setup: convert to the new option parser

--help is identical except for whitespace changes.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agotpm2-clear: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 19:26:01 +0000 (21:26 +0200)] 
tpm2-clear: convert to the new option parser

--help is identical except for whitespace changes.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agotest-offline-passwd: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 19:15:54 +0000 (21:15 +0200)] 
test-offline-passwd: convert to the new option parser

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agosysusers: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 19:08:51 +0000 (21:08 +0200)] 
sysusers: convert to the new option parser

Cosmetic differences in --help only.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agotmpfiles: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 18:54:02 +0000 (20:54 +0200)] 
tmpfiles: convert to the new option parser

The --image fallthrough into -E is replaced by duplicating the
exclude_default_prefixes() call inline.

Cosmetic differences in --help only.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agovarlinkctl: convert to the new verb macros
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 18:24:16 +0000 (20:24 +0200)] 
varlinkctl: convert to the new verb macros

The description of --exec is moved to a separate footer. It requires
special formatting and doesn't fit in the autogenerated table of
verbs.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agovarlinkctl: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 18:16:28 +0000 (20:16 +0200)] 
varlinkctl: convert to the new option parser

The -E short option previously used fallthrough into the --more case;
since macro-generated case labels don't support fallthrough (with some
older compilers), the --more logic is now duplicated inline in the -E
handler.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agoimdsd: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 17:58:52 +0000 (19:58 +0200)] 
imdsd: convert to the new option parser

Previously -w was ambiguously described in --help as taking an argument,
but it is in fact an argumentless alias for --wait=yes.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agoshared/options: quote the metavar in --help output
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 18:38:52 +0000 (20:38 +0200)] 
shared/options: quote the metavar in --help output

imdsd uses --extra-header='NAME: VALUE'. We could include the quotes
in the metavar string, but I think it's nicer to only do that in the
printed output, so that later, when we add introspection, the value
there will not include the quotes.

13 days agoimds: convert to the new option parser
Zbigniew Jędrzejewski-Szmek [Sat, 4 Apr 2026 17:43:04 +0000 (19:43 +0200)] 
imds: convert to the new option parser

Cosmetic changes in --help output only.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agosysext: provide a cmdline kill switch for the sysext/confext merging logic 41161/head
Vitaly Kuznetsov [Thu, 19 Mar 2026 15:04:34 +0000 (16:04 +0100)] 
sysext: provide a cmdline kill switch for the sysext/confext merging logic

While it is possible to disable sysext/confext merging in the main system
with 'systemctl disable', sysext/confext are always merged in the initrd,
both by systemd-{sys,conf}ext-initrd.service and by
systemd-{sys,conf}ext-sysroot.service and especially the latter can be
unexpected. Provide kernel cmdline options systemd.{sys,conf}ext=0 and
rd.systemd.{sys,conf}ext=0 covering all options.

13 days agosysext: provide systemd-{sysext,confext}-sysroot.service services
Vitaly Kuznetsov [Wed, 18 Mar 2026 16:09:24 +0000 (17:09 +0100)] 
sysext: provide systemd-{sysext,confext}-sysroot.service services

The new services are used to activate system and configuration extensions
for the main system from the initrd, this allows to overcome the limitation
that sysext/confext cannot be used to update the resources which are required
in the earliest boot of the system (before systemd-sysext/systemd-confext
start).

13 days agoNEWS: fix sysext/confext configuration file names in v259
Vitaly Kuznetsov [Wed, 18 Mar 2026 14:46:01 +0000 (15:46 +0100)] 
NEWS: fix sysext/confext configuration file names in v259

/etc/systemd/systemd-{confext,sysext}.conf are likely just leftovers
from an older in-development version of the feature.

13 days agoTwo small fixes (#41506)
Christian Brauner [Tue, 7 Apr 2026 07:11:07 +0000 (09:11 +0200)] 
Two small fixes (#41506)

13 days agosd-json, ssh-proxy: two bugfixes (#41529)
Christian Brauner [Tue, 7 Apr 2026 06:53:36 +0000 (08:53 +0200)] 
sd-json, ssh-proxy: two bugfixes (#41529)

  - Fix sd_json_variant_unsigned() dispatching to the wrong accessor
    for json variant references.
  - Fix a use-after-free of a borrowed varlink reply reference in
    ssh-proxy.

13 days agovmspawn: use machine name in runtime directory path (#41530)
Christian Brauner [Mon, 6 Apr 2026 22:23:19 +0000 (00:23 +0200)] 
vmspawn: use machine name in runtime directory path (#41530)

Replace the random hex suffix in the runtime directory with the machine
name, changing the layout from /run/systemd/vmspawn.<random> to
/run/systemd/vmspawn/<machine-name>/.

This makes runtime directories machine-discoverable from the filesystem
and groups all vmspawn instances under a shared parent directory,
similar to how nspawn uses /run/systemd/nspawn/.

Use runtime_directory_generic() instead of runtime_directory() since
vmspawn is not a service with RuntimeDirectory= set and the
$RUNTIME_DIRECTORY check in the latter never succeeds. The directory is
always created by vmspawn itself and cleaned up via
rm_rf_physical_and_freep on exit. The parent vmspawn/ directory is
intentionally left behind as a shared namespace.

13 days agotmpfiles: do not mandate `STATX_ATIME` and `STATX_MTIME` 41232/head
Ivan Shapovalov [Fri, 20 Mar 2026 15:45:07 +0000 (16:45 +0100)] 
tmpfiles: do not mandate `STATX_ATIME` and `STATX_MTIME`

Timestamps are not guaranteed to be set by `statx()`, and their presence
should not be asserted as a proxy to judge the kernel version. In
particular, `STATX_ATIME` is omitted from the return when querying a
file on a `noatime` superblock, causing spurious errors from tmpfiles.

Correctness analysis
====================

The timestamps produced by the `statx()` call in `opendir_and_stat()`
are only ever used once, in `clean_item_instance()` (lines 3148-3149)
as inputs to `dir_cleanup()`. Convert absent timestamps into
`NSEC_INFINITY` as per the previous commit.

Fixes #41227.

13 days agotmpfiles: use `NSEC_INFINITY` consistently in dir_cleanup()
Ivan Shapovalov [Fri, 20 Mar 2026 15:36:44 +0000 (16:36 +0100)] 
tmpfiles: use `NSEC_INFINITY` consistently in dir_cleanup()

Correctness analysis
====================

The *time_nsec variables are used for a total of 2 or 3 times:

- twice in needs_cleanup() (lines 788, 839)
- once in a recursive dir_cleanup() (line 764) as self_*time_nsec

In needs_cleanup(), all passed timestamps are guarded against
NSEC_INFINITY (this does not fix any real bugs as a 0 value is also
older than any cutoff point and thus would not cause any deletions).

Recursively in dir_cleanup(), the self_* variables are used to reset
the toplevel directory utimes, where they are superficially compared
against NSEC_INFINITY as a guard, but subsequently mishandled in the
case when only one of the times is NSEC_INFINITY: in this case, it will
be a) logged as a bogus value and b) passed through directly to
timespec_store_nsec(), which does special-case it, but in a way that
is invalid for futimens(). This is further fixed up by explicitly
mapping NSEC_INFINITY to TIMESPEC_OMIT.

This constitutes a bugfix in theory, as a ~STATX_ATIME return from
statx() would have previously caused the corresponding utime to be
reset to 0 epoch) rather than being omitted from being set. However,
in a directory with ~STATX_ATIME, attempts to set atime would likely
be ignored as well.

Mostly this is a self-consistency fix that establishes that
dir_cleanup() should be called with NSEC_INFINITY in place of
absent timestamps.

13 days agotime-util: add TIMESPEC_STORE_NSEC()
Ivan Shapovalov [Mon, 6 Apr 2026 20:03:36 +0000 (22:03 +0200)] 
time-util: add TIMESPEC_STORE_NSEC()

13 days agovmspawn: use machine name in runtime directory path 41530/head
Christian Brauner [Wed, 1 Apr 2026 13:59:13 +0000 (15:59 +0200)] 
vmspawn: use machine name in runtime directory path

Replace the random hex suffix in the runtime directory with the machine
name, changing the layout from /run/systemd/vmspawn.<random> to
/run/systemd/vmspawn/<machine-name>/.

This makes runtime directories machine-discoverable from the filesystem
and groups all vmspawn instances under a shared parent directory, similar
to how nspawn uses /run/systemd/nspawn/.

Use runtime_directory_generic() instead of runtime_directory() since
vmspawn is not a service with RuntimeDirectory= set and the
$RUNTIME_DIRECTORY check in the latter never succeeds. The directory is
always created by vmspawn itself and cleaned up via
rm_rf_physical_and_freep on exit. The parent vmspawn/ directory is
intentionally left behind as a shared namespace.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
13 days agosd-json: fix sd_json_variant_unsigned() dispatching to wrong accessor for references 41529/head
Christian Brauner [Wed, 1 Apr 2026 21:23:18 +0000 (23:23 +0200)] 
sd-json: fix sd_json_variant_unsigned() dispatching to wrong accessor for references

sd_json_variant_unsigned() incorrectly calls sd_json_variant_integer()
for reference-type variants instead of recursing to itself. This silently
returns 0 for unsigned values in the range INT64_MAX+1 through
UINT64_MAX, since sd_json_variant_integer() cannot represent them.

The sibling functions sd_json_variant_integer() and
sd_json_variant_real() correctly recurse to themselves.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
13 days agossh-proxy: fix use-after-free of borrowed varlink reply reference
Christian Brauner [Thu, 2 Apr 2026 07:01:16 +0000 (09:01 +0200)] 
ssh-proxy: fix use-after-free of borrowed varlink reply reference

sd_varlink_call_full() returns borrowed references into the varlink
connection's receive buffer (v->current). fetch_machine() stored this
borrowed reference with _cleanup_(sd_json_variant_unrefp), which would
unref it on error paths -- potentially freeing the parent object while
the varlink connection still owns it. On success, TAKE_PTR passed the
raw borrowed pointer to the caller, but the varlink connection (and its
receive buffer) is freed when fetch_machine returns, leaving the caller
with a dangling pointer.

Fix by removing the cleanup attribute (the reference is borrowed, not
owned) and taking a real ref via sd_json_variant_ref() before returning
to the caller, so the data survives the varlink connection's cleanup.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
13 days agoshared: introduce MachineRegistrationContext to track bus and registration state
Christian Brauner [Mon, 6 Apr 2026 18:03:21 +0000 (20:03 +0200)] 
shared: introduce MachineRegistrationContext to track bus and registration state

Bundle scope, buses, and registration success booleans into a
MachineRegistrationContext struct. This eliminates the reterr_registered_system and
reterr_registered_user output parameters from
register_machine_with_fallback_and_log() and the corresponding input
parameters from unregister_machine_with_fallback_and_log().

The struct carries state from registration to unregistration so the
caller no longer needs to manually thread individual booleans between
the two calls.

register_machine_with_fallback_and_log() goes from 7 to 3 parameters,
unregister_machine_with_fallback_and_log() goes from 5 to 2.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
13 days agoshared: introduce MachineRegistration struct for machine registration
Christian Brauner [Mon, 6 Apr 2026 17:57:52 +0000 (19:57 +0200)] 
shared: introduce MachineRegistration struct for machine registration

Replace the long positional parameter lists in register_machine() and
register_machine_with_fallback_and_log() with a MachineRegistration
struct that bundles all machine-describing fields.

This reduces register_machine() from 13 parameters to 3 and
register_machine_with_fallback_and_log() from 17 parameters to 7.
Callers now use designated initializers, which makes omitted fields
(zero/NULL/false) implicit and the code much more readable.

Field names are aligned with the existing Machine struct in machine.h
(id, root_directory, vsock_cid, ssh_address, ssh_private_key_path).

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
13 days agoshared: document allocateUnit limitation on D-Bus fallback path
Christian Brauner [Mon, 6 Apr 2026 18:27:09 +0000 (20:27 +0200)] 
shared: document allocateUnit limitation on D-Bus fallback path

The D-Bus registration methods (RegisterMachineEx, RegisterMachineWithNetwork)
do not support the allocateUnit feature that the varlink path provides.
When varlink is unavailable and registration falls back to D-Bus, machined
discovers the caller's existing cgroup unit instead of creating a dedicated
scope. Callers that skip client-side scope allocation (relying on the
server to do it via allocateUnit) will end up without a dedicated scope
on the D-Bus fallback path.

Document this limitation at the fallback site so callers are aware.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
13 days agovmspawn: only open runtime bus when needed for registration or scope allocation
Christian Brauner [Mon, 6 Apr 2026 18:21:52 +0000 (20:21 +0200)] 
vmspawn: only open runtime bus when needed for registration or scope allocation

The runtime bus (user bus in user scope, system bus in system scope) is
only needed for scope allocation (!arg_keep_unit) or machine registration
(arg_register != 0). When both are disabled the bus was still opened
unconditionally which causes unnecessary failures if the user bus is
unavailable.

Gate the runtime bus opening on the same condition nspawn already uses.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
13 days agovmspawn: fix error message when opening user bus
Christian Brauner [Mon, 6 Apr 2026 18:20:49 +0000 (20:20 +0200)] 
vmspawn: fix error message when opening user bus

The error message incorrectly says "system bus" when the code is
actually opening the user bus via sd_bus_default_user().

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
13 days agonspawn: rename --user= to --uid= and repurpose --user/--system for runtime scope
Daan De Meyer [Sun, 29 Mar 2026 11:10:42 +0000 (11:10 +0000)] 
nspawn: rename --user= to --uid= and repurpose --user/--system for runtime scope

Rename nspawn's --user=NAME option to --uid=NAME for selecting the
container user. The -u short option is preserved. --user=NAME and
--user NAME are still accepted but emit a deprecation warning. A
pre-parsing step stitches the space-separated --user NAME form into
--user=NAME before getopt sees it, preserving backwards compatibility
despite --user now being an optional_argument.

Repurpose --user (without argument) and --system as standalone
switches for selecting the runtime scope (user vs system service
manager).

Replace all uses of the arg_privileged boolean with
arg_runtime_scope comparisons throughout nspawn. The default scope
is auto-detected from the effective UID.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agoshared: move machine registration to shared machine-register.{c,h}
Daan De Meyer [Sun, 29 Mar 2026 18:22:40 +0000 (18:22 +0000)] 
shared: move machine registration to shared machine-register.{c,h}

Move register_machine() and unregister_machine() from
vmspawn-register.{c,h} into shared machine-register.{c,h} so both
nspawn and vmspawn can use the same implementation.

The unified register_machine() uses varlink first (for richer
features like SSH support and unit allocation) with a D-Bus
RegisterMachineWithNetwork fallback for older machined. The
interface adds a class parameter ("vm" or "container") and
local_ifindex for nspawn's network interface support.

The unified unregister_machine() similarly tries varlink first
(io.systemd.Machine.Unregister) before falling back to D-Bus.

Both register_machine() and unregister_machine() only log at debug
level internally, leaving error/notice logging to callers.

Add register_machine_with_fallback() which tries system and/or user
scope registration based on a RuntimeScope parameter
(_RUNTIME_SCOPE_INVALID for both), and
unregister_machine_with_fallback() as its counterpart. Both use
RET_GATHER() to collect errors from each scope.

Make --register= a tristate (yes/no/auto) defaulting to auto. When
set to auto, registration failures are logged at notice level and
ignored. When set to yes, failures are fatal.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
13 days agomachined: skip leader ownership check for user scope
Daan De Meyer [Sat, 4 Apr 2026 18:00:13 +0000 (18:00 +0000)] 
machined: skip leader ownership check for user scope

When registering a machine, machined verifies that the leader process
is owned by the calling user via process_is_owned_by_uid(). This
check fails for user scope machined when the leader is inside a user
namespace: after the leader calls setns(CLONE_NEWUSER), it becomes
non-dumpable, and the subsequent ptrace_may_access() check in the
kernel denies access to the process's user namespace, since the
calling user lacks CAP_SYS_PTRACE in the mm's user namespace (the
host namespace), even though the user owns the child user namespace.

Skip this check when running in user scope. For system scope, the
check is important because multiple users share the same machined
instance, so one user must not be able to claim another user's process
as a machine leader. For user scope this is unnecessary: the varlink
socket lives under $XDG_RUNTIME_DIR (mode 0700), so only the owning
user can connect, and the user machined instance can only perform
operations bounded by that user's own privileges. Registering a
foreign PID does not escalate capabilities.

13 days agonamespace-util: Add logging to process_is_owned_by_uid()
Daan De Meyer [Sat, 4 Apr 2026 17:56:13 +0000 (19:56 +0200)] 
namespace-util: Add logging to process_is_owned_by_uid()

2 weeks agovmspawn: Redirect QEMU's stdin/stdout/stderr to the PTY
Daan De Meyer [Sun, 5 Apr 2026 20:51:37 +0000 (20:51 +0000)] 
vmspawn: Redirect QEMU's stdin/stdout/stderr to the PTY

When a PTY is allocated for the console, QEMU's own stdio file
descriptors were still inherited directly from vmspawn, meaning any
output QEMU writes to stdout/stderr (e.g. warnings) would bypass the
PTY forwarder and go straight to the terminal. Similarly, QEMU could
read directly from the terminal's stdin.

Fix this by opening the PTY slave side and passing it as stdio_fds to
the fork call with FORK_REARRANGE_STDIO, so that all of QEMU's I/O
goes through the PTY and is properly forwarded.

2 weeks agovmspawn: Use ~ instead of ! as negation prefix for --firmware-features=
Daan De Meyer [Sun, 5 Apr 2026 17:46:12 +0000 (17:46 +0000)] 
vmspawn: Use ~ instead of ! as negation prefix for --firmware-features=

Switch the negation character for firmware feature exclusion from
"!" to "~" to be consistent with other systemd options that support
negation such as SystemCallFilter=.

2 weeks agovmspawn: Add comment explaining substring match in firmware_data_matches_machine()
Daan De Meyer [Sun, 5 Apr 2026 17:43:33 +0000 (17:43 +0000)] 
vmspawn: Add comment explaining substring match in firmware_data_matches_machine()

The machine types in QEMU firmware descriptions are glob patterns
like "pc-q35-*", so we use strstr() substring matching to check if
our machine type is covered by a given firmware entry.

2 weeks agoswtpm-util: Silence noise from swtpm_setup
Daan De Meyer [Sun, 5 Apr 2026 17:36:14 +0000 (19:36 +0200)] 
swtpm-util: Silence noise from swtpm_setup

There's no way to configure the log level for swtpm_setup, so pipe
it's logfile (which defaults to stderr) to /dev/null unless debug
logging is enabled.

2 weeks agoswtpm: gracefully fall back when --print-profiles output is not JSON
Daan De Meyer [Sun, 5 Apr 2026 17:12:35 +0000 (17:12 +0000)] 
swtpm: gracefully fall back when --print-profiles output is not JSON

Older swtpm versions print --help output instead of JSON when
swtpm_setup --print-profiles is invoked. Previously, the JSON parse
failure was treated as fatal, preventing swtpm manufacture entirely on
these older versions.

Extract profile detection into a separate swtpm_find_best_profile()
helper and treat JSON parse failure as a graceful fallback: log a
notice and continue without a profile, same as when no builtin profiles
are found.

2 weeks agovmspawn: Fix qemu-kvm path on centos stream
Daan De Meyer [Sun, 5 Apr 2026 16:37:31 +0000 (18:37 +0200)] 
vmspawn: Fix qemu-kvm path on centos stream

Follow up for 41da1ae6a042363e856b1748c11cd176ef1991c8

2 weeks agohwdb: cooler master rgb controller is not a mouse
Luan Vitor Simião oliveira [Sun, 5 Apr 2026 05:37:05 +0000 (02:37 -0300)] 
hwdb: cooler master rgb controller is not a mouse

2 weeks agoudev: also trigger loop device for boot disk when partition scanning is unsupported...
Christian Brauner [Sun, 5 Apr 2026 14:33:46 +0000 (16:33 +0200)] 
udev: also trigger loop device for boot disk when partition scanning is unsupported (#41509)

Previously, probe_gpt_sector_size_mismatch() would bail out early when
the GPT sector size matched the device sector size. However, some
devices (e.g. certain CD-ROM drives) do not support kernel partition
scanning even when sector sizes match. In that case, the kernel still
cannot parse the partition table, and we need to set up a loop device to
expose the partitions — just as we do for the sector size mismatch case.

Check blockdev_partscan_enabled() when sector sizes match, and only skip
the boot partition check if partition scanning is actually supported.

Also rename the function, udev property, and log messages to reflect the
broader scope:

- probe_gpt_sector_size_mismatch() -> probe_gpt_boot_disk_needs_loop()
- ID_PART_GPT_AUTO_ROOT_DISK_SECTOR_SIZE_MISMATCH ->
ID_PART_GPT_AUTO_ROOT_DISK_NEEDS_LOOP

2 weeks agoboot: generalize CDROM terminology to El Torito 41509/head
Daan De Meyer [Sun, 5 Apr 2026 08:17:59 +0000 (08:17 +0000)] 
boot: generalize CDROM terminology to El Torito

Per UEFI specification §13.3.2, El Torito partition discovery applies to
any block device, not just optical media. Rename
disk_get_part_uuid_cdrom() to disk_get_part_uuid_eltorito() and update
all log messages and comments to say "El Torito" instead of "CDROM" to
reflect this.

2 weeks agovmspawn: also search for qemu binary at /usr/lib/qemu-kvm
Daan De Meyer [Sat, 4 Apr 2026 22:02:46 +0000 (22:02 +0000)] 
vmspawn: also search for qemu binary at /usr/lib/qemu-kvm

This is the qemu binary path on CentOS Stream.

2 weeks agoudev: also trigger loop device for boot disk when partition scanning is unsupported
Daan De Meyer [Sat, 4 Apr 2026 22:24:47 +0000 (22:24 +0000)] 
udev: also trigger loop device for boot disk when partition scanning is unsupported

Previously, probe_gpt_sector_size_mismatch() would bail out early when
the GPT sector size matched the device sector size. However, some
devices (e.g. certain CD-ROM drives) do not support kernel partition
scanning even when sector sizes match. In that case, the kernel still
cannot parse the partition table, and we need to set up a loop device to
expose the partitions — just as we do for the sector size mismatch case.

Check blockdev_partscan_enabled() when sector sizes match, and only skip
the boot partition check if partition scanning is actually supported.

Also rename the function, udev property, and log messages to reflect the
broader scope:

- probe_gpt_sector_size_mismatch() -> probe_gpt_boot_disk_needs_loop()
- ID_PART_GPT_AUTO_ROOT_DISK_SECTOR_SIZE_MISMATCH -> ID_PART_GPT_AUTO_ROOT_DISK_NEEDS_LOOP

2 weeks agoshutdown: enforce a minimum uptime to make boot loops less annoying (#41215)
Lennart Poettering [Sat, 4 Apr 2026 21:30:30 +0000 (23:30 +0200)] 
shutdown: enforce a minimum uptime to make boot loops less annoying (#41215)

Fixes: #9453
Split out of #41016

2 weeks agoupdate TODO 41215/head
Lennart Poettering [Wed, 25 Mar 2026 22:49:49 +0000 (23:49 +0100)] 
update TODO

2 weeks agoshutdown: enforce a minimum uptime to make boot loops less annoying
Lennart Poettering [Tue, 10 Mar 2026 07:06:02 +0000 (08:06 +0100)] 
shutdown: enforce a minimum uptime to make boot loops less annoying

Fixes: #9453
2 weeks agoshutdown: check WATCHDOG_PID= if it is set
Lennart Poettering [Thu, 26 Mar 2026 07:50:08 +0000 (08:50 +0100)] 
shutdown: check WATCHDOG_PID= if it is set

Alternative to: #35167