Commit Graph
85425 Commits
Author SHA1 Message Date
Lennart Poettering f42ac24772 userdbctl: add missing --uuid= to --help text
Follow-up for: 466562c69b
2025-12-20 08:09:05 +00:00
Daan De Meyer ba037640bf Make .standalone programs same as normal and avoid double compilation (#40148) 2025-12-19 14:58:34 +01:00
Luca Boccassi 059b3b466d core: reuse existing dm-verity device for single filesystem images pinned by policy (#40007)
Loading images is, generally speaking, the slowest part of sd-executor
when spawning a service. This is due to multiple factors. dm-verity is
obviously a big part of the cost, but dissecting in general via libblkid
also can take a lot of time, due to probing the images and their
filesystems.

A performance test doing service restarts in a row shows these
results, ran on a production system (low power and slow ARM64 SOC) with
a real production service, show the following service interruption
intervals:

```
Count | P50 (ms)  | P90 (ms) | P95 (ms) | P99 (ms) | P99.9 (ms)
507   | 1,532     | 1,726    | 2,548    | 4,112    | 4,592
```

One iteration is 507 restarts in this case, but this has ran hundreds
of times and the results are always in line within margin of error.
This also holds true for metrics from live systems, same numbers.
Between 1.0s and 1.2s can be attributed by profiling to the time needed
for the service code itself to start up and sd_notify, the rest is spent
inside systemd's code.

This means there is currently a tradeoff for services - either use
secure
images, or make restarting fast. Downtime of services is a very
important
metric, as for many cases this directly translates to outages, total or
partial (blackouot or greyout).

In order to facilitate using secure images without downsides, skip the
slow dissect steps (probing, loop devices, etc) when the configured
image is a single filesystem dm-verity image with a policy that pins it
to a single filesystem, and an already existing and open dm-verity
device
can be found and reused.

This allows orchestrators to pre-open images on download, before
restarting
services, to minimize downtimes.
2025-12-19 13:19:16 +00:00
Luca Boccassi 6ceb76bfcf mkosi: update fedora commit (#40146) 2025-12-19 12:49:27 +00:00
Zbigniew Jędrzejewski-Szmek 736fc4b479 meson: avoid double compilation for standalone progs
So far we compiled the normal and standalone versions completely
independently. Let's use the 'extract' template pattern to avoid any
additional compilation and only require an single link to produce the
.standalone variants.

Unfortunately, as designed, the 'extract' framework only allows one set of
object files to be extracted. Since we need all the files for the
.standalone version, we cannot use 'extract' for other purposes. Thus, in
the two cases where 'extract' was used for the test binaries, this is now
changed to compile the files a second time. But the number of files in that
list is small, so this seems like a better option.

(If we weren't using the template system, we could easily extract just the
objects we need. But with the current system, at the point of the
definition, the binaries are not defined yet. We'd need to handle all of
this through sets of dictionaries, and that just seems like too much
trouble to avoid double compilation of a few small files.)
2025-12-19 13:15:49 +01:00
Zbigniew Jędrzejewski-Szmek b6c86e145a meson: drop now-unused -DSTANDALONE
If we ever want to add it back, it should be with -DSTANDALONE=0|1, so
that #if instead of #ifdef can be used. We generally converted our internal
defines to that form.
2025-12-19 13:15:49 +01:00
Zbigniew Jędrzejewski-Szmek 795e066d22 sysusers,tmpfiles: make standalone versions full-featured
This effectively reverts 3537577c37. Originally,
the #ifdefs were added because we didn't want to pull in the whole tree of
libmount and other dependencies in standalone versions. But dependencies are
now loaded through dlopen(), so this is not needed anymore. (And doesn't even
make much of a difference.)
2025-12-19 13:15:49 +01:00
Zbigniew Jędrzejewski-Szmek 54492552a1 meson: allow .standalone version to be always built
Allow .standalone version to be built on-demand, even if -Dstandalone=false
is configured. In other words, this changes the meson option from a hard
disablement to a soft "build is on/off by default".

The meson config was originally written in this way but we lost this feature
after the transition to templates. It is nice to build additional targets on
demand during development, so add this back.
2025-12-19 13:14:19 +01:00
Zbigniew Jędrzejewski-Szmek 9e104bd3aa meson: put src/import source lists directly in templates
The indirection through variables doesn't seem that useful here:
OTOH, the lists are short, and OTOH, there is a bunch of different
programs with similar names. Overall, it's all easier to follow if
the lists are inline.
2025-12-19 13:12:35 +01:00
Luca Boccassi 56a53a5974 mkosi: update fedora commit reference to cac8dde28a1298bbc2bee40e9ab3b9308392f691
* cac8dde28a test: Allow passing in extra tests to skip via TEST_SKIP
* 56377438ba Disable sysinit-path for upstream builds
* 0c8ea706f9 Fix links to patches
* 4f5b5a9615 Version 259
* bf8019c840 Version 259~rc3
* ef777d6572 Check if --max-lines is supported by meson
* b562e38e22 Fix use of removed $LOCAL_CONF variable
* 0289127dae Patch machined to continue after selinux denial
* 7e409130ee Version 259~rc2
* 33b38cdbc7 Suppress errors from tar
* ddb6474e94 Drop provides for removed sysvinit tools
* 9ac8c36307 Set meson auto features to auto when building for upstream
2025-12-19 11:35:21 +00:00
Luca Boccassi 2791af18e4 tools: use -f in mkosi summary in fetch-distro.py
$ ./tools/fetch-distro.py -u fedora
+ mkosi --json -d fedora summary
‣ Ignoring --distribution from the CLI. Run with -f to rebuild the image with this setting

Follow-up for 35f6e5c327
2025-12-19 11:35:21 +00:00
Luca Boccassi 0bd766553c core: reuse existing dm-verity device for single filesystem images pinned by policy
Loading images is, generally speaking, the slowest part of sd-executor
when spawning a service. This is due to multiple factors. dm-verity is
obviously a big part of the cost, but dissecting in general via libblkid
also can take a lot of time, due to probing the images and their filesystems.

A performance test doing service restarts in a row shows these
results, ran on a production system (low power and slow ARM64 SOC) with
a real production service, show the following service interruption intervals:

Count | P50 (ms)  | P90 (ms) | P95 (ms) | P99 (ms) | P99.9 (ms)
507   | 1,532     | 1,726    | 2,548    | 4,112    | 4,592

One iteration is 507 restarts in this case, but this has ran hundreds
of times and the results are always in line within margin of error.
This also holds true for metrics from live systems, same numbers.
Between 1.0s and 1.2s can be attributed by profiling to the time needed
for the service code itself to start up and sd_notify, the rest is spent
inside systemd's code.

This means there is currently a tradeoff for services - either use secure
images, or make restarting fast. Downtime of services is a very important
metric, as for many cases this directly translates to outages, total or
partial (blackouot or greyout).

In order to facilitate using secure images without downsides, skip the
slow dissect steps (probing, loop devices, etc) when the configured
image is a single filesystem dm-verity image with a policy that pins it
to a single filesystem, and an already existing and open dm-verity device
can be found and reused.

This allows orchestrators to pre-open images on download, before restarting
services, to minimize downtimes.
2025-12-19 11:20:48 +00:00
seidlerv bd6d8eec5e man/org.freedesktop.systemd1.xml: Fix wording 2025-12-19 11:28:46 +01:00
Daan De Meyer 9d10457a3e test-user-util: Migrate to new assertion macros 2025-12-19 11:11:39 +01:00
Luca Boccassi 4be5c2870f image-policy: add helper to determine fstype 2025-12-19 09:17:41 +00:00
Luca Boccassi d0cb79b8a9 image-policy: add support for restricting to specific filesystems 2025-12-19 09:17:41 +00:00
Daan De Meyer bc3f700a4a logs-show: match init.scope rather than _PID=1 for UNIT= (#40142) 2025-12-19 08:50:33 +01:00
Mike Yuan 7f9e3c5919 logs-show: match init.scope rather than _PID=1 for UNIT=
We should consider the whole init.scope trusted, and any
process trying to log on behalf of a unit there should be
attributed as so.

Follow-up for 4f25248b6e
Only with this commit is the change in effect.
2025-12-19 02:18:44 +01:00
Mike Yuan 79e6bfb1e6 core/manager: use UNIT_IS_ACTIVE_OR_RELOADING rather than hardcoding service states
except for SERVICE_EXITED which has to be checked manually.
2025-12-19 02:18:44 +01:00
Luca Boccassi 2f363b407f mkosi: update debian commit reference to d9f2aa1704bc98d1aec6519a863a07eaf12b76ad
* d9f2aa1704 Install systemd-tpm2-generator.8 only for UEFI builds
* ac1c7d8048 Drop dependencies on libcap-dev, no longer used since v259
* c36e5871ca Do not install systemd-sysv-generator.8 in upstream build
* bac0cca0e8 Install new files for upstream build
* 2855fb1302 Update changelog for 259-1 release
2025-12-18 22:15:14 +01:00
Daan De Meyer 4c1a2f7d95 Revert qemu debugs (#40138)
Captured some in https://github.com/systemd/systemd/issues/38240 and
they do not look too useful, and add noise, so remove them again
2025-12-18 22:14:21 +01:00
Lennart Poettering 2062b817d4 keyutil: Add extract-certificate (#39962)
Useful to extract a certificate from a hardware token to a file, for
example in mkosi to ship the certificate from a hardware token in
/usr/lib/verity.d in an image
2025-12-18 21:25:57 +01:00
Lennart Poettering b15cf11327 repart: add basic support for LUKS2 integrity verification (#39295)
Authenticated disk encryption is experimentally supported by cryptsetup
since v2.0.0 and allows for automatic dm-integrity setup for LUKS
devices. Add support for the mode to systemd-repart. The PR adds support
for `cryptsetup luksFormat --integrity` to systemd-repart and
"encryptedwithintegrity" dissection policy.

Limitations:
- No discard, online-only mode for repart.

Closes #39250
2025-12-18 21:19:39 +01:00
Miao Wang dc3e544104 ssh-proxy: expect OK PORT response from vsock-mux
The unix-domain socket to AF_VSOCK multiplexers in Firecracker and
vhost-device-vsock sends OK PORT response to the client, resulting
ssh clients to abort the connection with the additional response. This
patch addresses this issue by waiting and expecting the possible OK PORT
response from the multiplexer, if any, and then handover the socket fd
to the ssh client. It only checks if the response begins with OK and
consume the response till the first \n, for simplicity.

Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
2025-12-18 21:15:41 +01:00
Mike Yuan 71aaa744b8 Assorted minor cleanups (#40136) 2025-12-18 20:53:58 +01:00
Lennart Poettering 627e583c64 Use ANSI CSI 18 to query console size (#39833) 2025-12-18 20:49:26 +01:00
Luca Boccassi 84079cd158 Revert "tests: run qemu with cpu_reset,guest_errors debug messages"
This reverts commit b169c7512c.
2025-12-18 17:51:07 +00:00
Luca Boccassi d6514ebf33 Revert "tests: also add qemu shutdown trace debug logs to integration script"
This reverts commit 9b42cc3b12.
2025-12-18 17:51:07 +00:00
Luca Boccassi 293a925e9e Revert "integration-test: check tools distribution rather than image distribution"
This reverts commit fd2cdadc14.
2025-12-18 17:51:06 +00:00
Daan De Meyer 30465f789c test: introduce test-sleep and use it in several integration tests (#40086) 2025-12-18 17:47:57 +01:00
Franck Bui 25393c7c90 man: generate systemd-tpm2-generator man page only when ENABLE_BOOTLOADER is enabled 2025-12-18 17:39:25 +01:00
Mike Yuan 6dacabe534 journalctl-show: drop redundant condition
The combination of --follow and --reverse would have been
rejected in parse_argv() already.
2025-12-18 17:37:26 +01:00
Mike Yuan 58e9239fd7 core/dbus-manager: drop dangling verify_run_space_and_log() prototype
Follow-up for 65d9ef40f2
2025-12-18 17:37:26 +01:00
Mike Yuan f145fc8c7e core/manager: constify DEFAULT_TASKS_MAX 2025-12-18 17:37:25 +01:00
Mike Yuan c53b324ecf socket-label: mark socket_address_bind_ipv6_only_or_bool_from_string as _pure_ 2025-12-18 17:37:25 +01:00
Mike Yuan 4a6e5b0ae9 core: various cleanups for setup_input/output (#39860) 2025-12-18 15:56:42 +01:00
Mike Yuan 6e44160e0f docs/RELEASE: correct numbering without 7
Follow-up for b1192a01cd
2025-12-18 15:44:08 +01:00
Daan De Meyer 42b6f87a42 keyutil: Add extract-certificate
Useful to extract a certificate from a hardware token to a file, for
example in mkosi to ship the certificate from a hardware token in
/usr/lib/verity.d in an image
2025-12-18 13:57:32 +01:00
Daan De Meyer 9fc537437b keyutil: Rename public to extract-public 2025-12-18 13:56:38 +01:00
Daan De Meyer 8440492e90 openssl-util: Cast to const type 2025-12-18 13:56:38 +01:00
Daan De Meyer 8ecb7deafa openssl-util: Fix logging 2025-12-18 13:56:37 +01:00
Luca Boccassi 9e418cd075 inhibit: allow filtering and add --json support for --list (#39973) 2025-12-18 10:47:23 +00:00
Luca Boccassi 9a34971421 fido2: fix enrolling when UV is required ('alwaysUv')
When a Yubikey or other fido2 device has FIPS mode enabled, UV will
always be required and cannot be disabled. Unhelpfully, when it is not
sent down, the hardware token (not the library) returns a generic
FIDO_ERR_MISSING_PARAMETER:

$ systemd-cryptenroll --fido2-device=auto --fido2-with-client-pin=no foo
<...>
libfido2: rx: payload_len=1
libfido2: fido_rx: buf=0x55c9ce170940, len=1
libfido2: 0000: 14
libfido2: cbor_parse_reply: blob[0]=0x14
libfido2: fido_dev_get_assert_rx: adjust_assert_count
Failed to ask token for assertion: FIDO_ERR_MISSING_PARAMETER

This can be set even when the token doesn't support UV (as in, fingerprint
reader), in which case using the PIN is required.

Check if 'alwaysUv' is set, and if not already configured, force
either UV (if available) or PIN when enrolling.
2025-12-18 10:56:43 +01:00
Jeremy Kerr cc1ed77280 udev-builtin-net_id: Extend persistent naming support to MCTP interfaces
Now that we have Management Component Transport Protocol (MCTP) transports
available over USB, it would be helpful to apply udev's persistent
naming rules to MCTP interfaces, to follow the USB hub/port topology.

Enable persistent naming for ARPHRD_MCTP-type devices, using a "mc" name
prefix, and add appropriate definitions for the v260 naming sheme.
2025-12-18 10:54:51 +01:00
Popax21 f603bc37f4 nss-resolve: add env var to specify resolved ifindex
Adds a new `SYSTEMD_NSS_RESOLVE_INTERFACE` environment variable to the nss-resolve module, whose value is subsequently passed down to the `ifindex` resolved lookup option.
This allows name lookups to be constrained to a just single interface for e.g. captive portal browsers.
2025-12-18 10:53:27 +01:00
Lennart Poettering 18d90c1628 bash: clarfiy what 80-systemd-osc-context.sh is about in the spec 2025-12-18 10:50:23 +01:00
Lennart Poettering d91aed3b55 docs: add redirection of the osc context to uapi website 2025-12-18 10:50:23 +01:00
Zbigniew Jędrzejewski-Szmek d91a184509 core: use terminal_get_size_by_csi18 to query terminal size
This allows us to query the window size without moving the cursor. We have
various reports about the cursor being in an unexpected position and/or state.

Closes https://github.com/systemd/systemd/issues/37526.
2025-12-18 10:47:19 +01:00
Luca Boccassi f33d550d44 Add polkit support to varlinkctl and sd-sysext (#39796) 2025-12-18 09:10:53 +00:00
Vitaly Kuznetsov 9e78b1e817 TODO: add unimplemented Integrity= systemd-repart options 2025-12-18 09:12:54 +01:00