Commit Graph
10450 Commits
Author SHA1 Message Date
Yu Watanabe 8e910fcaf1 dissect: optionally allow attaching images that do not qualify as DDIs with --attach (#43583)
It's nice to use --attach since it validates our images. So far, it
strictly insisted on checking that the image was a DDI however, which
limits its use for certain usecases.

Add "--relax" to address this limitation.

Fixes: #43605
2026-09-23 08:54:29 +09:00
Nandakumar Raghavan c99af7968e repart: add EncryptAddToken= to register custom LUKS2 tokens at provisioning time
Adds EncryptAddToken=<type>[:<source>:<value>] to repart.d partition
files, registering one or more LUKS2 token objects in the partition
header after the keyslot is created. This allows custom token plugins
(e.g. a TDX KBS plugin) to be wired up at provisioning time without a
separate cryptsetup token import step.

The type name is always explicit and extra token fields can be supplied as
a JSON file (:file:/path) or base64-encoded JSON (:data:<base64>). The
type and keyslots fields are always injected by repart. The option is
repeatable; an empty value clears all tokens for the partition.

Supported with Encrypt=key-file, tpm2, and key-file+tpm2.
2026-09-22 21:26:20 +02:00
Luca Boccassi 06c2dfa73c bless-boot: skip gracefully on kexec
If KExecsCount > 0 then do not attempt to mark a UKI, as the stub (and also
any addon and the bootloader) will not have been exercised, so there's no
guaranteed a full reboot with the same image will actually work.

Fixes https://github.com/systemd/systemd/issues/43738
2026-09-22 21:25:20 +02:00
Lennart Poettering 6a16394cd6 units: use --relax in systemd-loop@.service
Our primary usecase for this service is to deal with sector issues
around CDROMs. For that insisting on proper DDI layout and a root
partition is overkill. Let's hence relax the logic for this.

Fixes: #43605
2026-09-22 16:04:26 +02:00
Lennart Poettering b0edc60661 dissect: optionally allow attaching images that do not qualify as DDIs with --attach
It's nice to use --attach since it validates our images. So far, it
strictly insisted on checking that the image was a DDI however, which
limits its use for certain usecases.

Add "--relax" to address this limitation.
2026-09-22 16:04:26 +02:00
Zbigniew Jędrzejewski-Szmek 541b1335f5 Rename KExecsCount to KExecCount 2026-09-22 14:38:02 +02:00
Lennart Poettering 41bf07afe1 man: add missing = 2026-09-18 20:23:00 +02:00
Yu Watanabe 194c72b37f man: fix parameter controlling activatable names query for sd_bus_list_names()
The second conditional checked "acquired", but the ListActivatableNames
call is governed by the "activatable" argument.
2026-09-17 11:49:45 +09:00
Yu Watanabe 83c4191e25 man: fix inverted -ENODATA description for sd_bus_message_get_reply_cookie()
-ENODATA is returned when the message carries no (reply) cookie, but the
text stated the message "carries a reply cookie field". Say it does not
carry one.
2026-09-17 11:49:45 +09:00
Yu Watanabe 8787df83fe man: several fixlets for documentation of sd_bus_message_read_array()
- It does not accept NUL for type.
- ret_size is zero and ret_ptr is non-NULL when it returns positive.
- Fixed argument names: ptr -> ret_ptr, size -> ret_size.
2026-09-17 11:49:45 +09:00
Yu Watanabe 15bd45d113 man: fix typos and grammar in various man pages 2026-09-17 02:25:12 +09:00
Lennart Poettering f0baee29b3 sysupdate: change "appstream" json prop back to "appStream"
Similar as the previous commit: the field was renamed by accident, and
we should revert to the old name to not break compat needlessly, and
because the old name actually made sense, given the underlying .transfer
file knob is AppStream=
2026-09-14 15:15:58 +02:00
Lennart Poettering f05a0cef9f sysupdate: rename isEnabled to enabled
The "isEnabled" name was changed from "enabled" post v261 by accident
(because a6f7ded859 replaced json
formatting via table formatter to a native json generator which was
introduced for varlink, which changed the names). THis was later made
official in #43603, but it should rather have changed things back to the
original name, in particular as the underling .feature file field
actually is called "Enabled=" and not "IsEnabled=".

We really should take care to generate the same names for Varlink JSON
data as for the data returned by the systemd-sysupdate cli.
a6f7ded859 ensured that, so that's great.
But at the same time I think the varlink names should be adjusted to the
old names, since varlink support for this was just added in this cycle.

Given that v262 is not tagged yet, let's now revert to the old name.
2026-09-14 14:33:33 +02:00
Cathal Mullan 1f66b52452 nspawn: align config PrivateUsersOwnership default with CLI
The `systemd-nspawn` manpage says:

    The `--private-users-ownership=auto` option is implied if
    `--private-users=pick` is used.

This is true for the CLI, but not when set in a `.nspawn` file.
Assuming these defaults should be the same across both.

This default was also not updated when `managed` was added by #35685.

As a result, this is a change in behavior for users who didn't set an
explicit `PrivateUsersOwnership=` value in their `.nspawn` file.
2026-09-14 08:10:27 +01:00
KingPointer 52a7574625 docs: clarify ConditionPathExists= semantics (#43724)
## Summary

Clarify `ConditionPathExists=` in `systemd.unit(5)`:

- It checks for any filesystem object (regular file, directory, device
node, FIFO, socket), not only regular files.
- Symbolic links are followed, so a broken symbolic link is not
considered to exist.

Fixes #41900
2026-09-11 12:15:59 +02:00
Lennart Poettering aaab1f107c tree-wide: reference UAPI.20 spec that has been published for Varlink now
This updates a couple of links talking about Varlink:

1. anything that refers to specific Varlink concepts now point to the
   UAPI.20 spec

2. More general references to Varlink as a whole point to both the
   varlink.org domain and the spec.
2026-09-10 12:07:06 +01:00
Zbigniew Jędrzejewski-Szmek ce04f8a331 updatectl: fix feature JSON parsing (#43617)
## Summary

`updatectl features` failed because it expected the old feature JSON
fields,
while `systemd-sysupdate` now returns `id`, `isEnabled`, and
`documentation`
as an array.

This change:

- Aligns `updatectl` with the current feature JSON schema.
- Unifies JSON output between `systemd-sysupdate`, D-Bus, and Varlink.
- Adds support for multiple `Documentation=` entries for Features and
  Components.
- Exposes and parses `appstream` and `suggested` metadata.
- Propagates condition-evaluation errors through `condition_test_list()`
and
  `feature_is_suggested()`.
- Reports suggestion-evaluation failures instead of silently treating
them as
  `false`.
- Improves JSON dump error handling.
- Expands `TEST-72-SYSUPDATE` coverage and fixes its unknown-field
assertion.
- Documents the `DescribeFeature()` JSON field transition in `NEWS`.
- Keeps the existing Component name list for `sysupdated` compatibility.

The `name`/`enabled` to `id`/`isEnabled` transition is intentional and
documented as a v262 payload change.

Fixes #43603
2026-09-08 16:08:11 +02:00
dongshengyuan a6f7ded859 updatectl: fix feature JSON parsing
The feature JSON payload switched to `id`, `isEnabled`, and `appstream`,
and made `documentation` an array of URLs.
`updatectl` still parsed legacy table-derived names and a single URL.
This broke feature JSON parsing and made output inconsistent.
Features without documentation could also cause a null dereference.

Align `updatectl` with the current schema and preserve all
documentation URLs across sysupdate, D-Bus, and Varlink payloads.
Propagate condition evaluation errors through `condition_test_list()`
and `feature_is_suggested()`, with consistent JSON error handling and
tests.
The `suggested` field is now optional and always a boolean when
present; it is omitted rather than set to an error string when
SuggestOn*= conditions cannot be evaluated.
Add `suggested` metadata and document the field transition.

Follow-up for 3e34ccf6df.
Follow-up for 75a247d4de.
Follow-up for 40e727c93b.

Fixes #43603
2026-09-08 16:05:36 +02:00
tunaichao 85599996a1 man: fix cgtop --recursive= and --cpu= documentation
--recursive=no is not silently ignored when all tasks are counted,
as claimed: cgtop rejects it with an error unless -P or -k is used,
since task counting is always recursive. Also document that --cpu
without an argument is equivalent to --cpu=time.
2026-09-08 15:34:58 +02:00
Zbigniew Jędrzejewski-Szmek 9c665ee7aa units: allow disabling systemd-coredumpd.service
The new unit is nice, but it might not be appropriate in all scenarios. It
requires a new kernel, which might be known to not be available, and also
changes sysctl kernel.core_pattern at runtime, which might not be desired.
Replace static enablement by a normal [Install] section and add the unit
to presets to enable it by default.

The awkward instructions in the man page are simplified and adjusted.
2026-09-08 14:31:45 +09:00
Luca Boccassi 548f87538a measure: expose offline signing data in policy-digest output
The PolicyPCR digest is not always the complete input to an offline
signature. PolicyAuthorize also includes the hashed policy reference.
This is now required for NVPCRs to work in the initrd.

Expose the complete data as "tbs" (to-be-signed) and use it when ukify
matches offline signatures. Keep "pol" as the compatibility fallback.

Fixes: https://github.com/systemd/systemd/issues/43635

Follow-up for f0f3687700
2026-09-07 16:15:42 +01:00
Yu Watanabe 0b5d9bf140 wifi-util: update string tables
Note, NL80211_CMD_PROBE_CLIENT is renamed to NL80211_CMD_PROBE_PEER
in kernel v7.3:
https://github.com/torvalds/linux/commit/4ab9b637b94a3821acfcd6d6037dffe33669245a
2026-09-07 19:08:35 +09:00
benkigeek 9457f81485 man: document that stdio file targets are opened before the MAC transition 2026-09-05 11:57:23 +01:00
Ivan Kruglov 2b42e4f0c9 man: document what a failure action returns without an exit status 2026-09-03 10:18:29 -07:00
Luca Boccassi 8cceaab8f5 ukify: generate initrd policy digests for offline signing
When --sign-initrd-pcrs is used with --policy-digest, generate the
extra enter-initrd policy with the "initrd" policy reference. This
matches the policy produced when ukify signs with a private key.

Fixes building UKIs with offline signing (e.g.: on OBS) and using
NVPCRs.

Follow-up for f0f3687700
2026-09-03 12:55:15 +02:00
Yu Watanabe 736cb91535 resolved: actually unregister DNS-SD services when the D-Bus client vanishes (#43578)
Since the D-Bus DNS-SD API was introduced in c3036641f0ed (v236),
`RegisterService()` has created an `sd_bus_track` object to destroy the
registered service when the registering client disconnects from the bus.
However, the track object is a `_cleanup_(sd_bus_track_unrefp)` local in
`bus_method_register_service()` that is never stored anywhere, so it is
destroyed again as soon as the method handler returns. The vanish
handler (`dnssd_registered_service_on_bus_track()`) has thus been dead
code for the past ~8 years.

The observable effect: services registered via D-Bus silently persist
after the client disconnects — unowned, advertised until resolved exits,
and impossible to re-register since the identifier stays taken
(`DNSSD_SERVICE_EXISTS`). At the same time, the registration doesn't
survive a resolved restart, so the current behavior is neither reliably
ephemeral nor reliably persistent. Noticed while reviewing a project
that (unknowingly relying on this bug) registers a service with a
one-shot `gdbus call` and expects it to persist.

This PR:
1. splits the goodbye/zone-removal logic out of
`bus_dnssd_method_unregister()` into a helper — the vanish path needs
the full teardown, not just `dnssd_registered_service_free()`, which
would leave the service's RRs published in the per-link mDNS zones;
2. stores the track object in `DnssdRegisteredService`, making client
tracking work as originally intended;
3. documents the lifetime semantics in `org.freedesktop.resolve1(5)`
(matching the equivalent Avahi D-Bus API, whose entry groups are
likewise bound to the client connection) and points to `*.dnssd` files
for registrations independent of a client's lifetime;
4. adds a TEST-75 case covering the connection-bound lifetime.

Note this is a behavioral change for fire-and-forget clients (one-shot
`busctl`/`gdbus` invocations). Arguably those were never working
reliably (registrations silently vanished on any resolved restart, and
stale entries blocked re-registration), but if this is deemed too risky,
the alternative would be to drop the dead tracking code and codify the
persist-until-exit behavior instead — I'd argue tracking as originally
intended is the better contract.

Verification: code compiles; the new integration test is included.
2026-09-03 06:14:31 +09:00
Stefan Agner 11e4e35f4c resolved: actually unregister DNS-SD services when the bus client vanishes
Since the D-Bus DNS-SD API was introduced in c3036641f0 ("resolved:
implement D-Bus API for DNS-SD", v236), RegisterService() has set up an
sd_bus_track object so that a registered service is destroyed when the
client that registered it disconnects from the bus — there's even a
handler logging "Client of active request vanished, destroying DNS-SD
service."

However, the track object was never stored anywhere: it is declared as
a _cleanup_(sd_bus_track_unrefp) local in bus_method_register_service()
and hence destroyed again when the method handler returns, taking the
tracking down with it. The vanish handler was thus dead code, and
services registered via D-Bus silently persisted after their client
disconnected — unowned, impossible to re-register (the identifier
stays taken, failing with DNSSD_SERVICE_EXISTS), and advertised until
systemd-resolved itself exited.

Store the track object in DnssdRegisteredService, pinning it for the
lifetime of the service, so that client tracking works as originally
intended. Route the vanish path through the full unregistration logic
(goodbye packets + removal from the per-link mDNS zones), since freeing
the service alone would leave its RRs published in the zones.

Note for fire-and-forget clients (e.g. one-shot busctl/gdbus calls):
these were never reliable — the registration silently vanished on any
resolved restart — and now behave as documented for the corresponding
Avahi API as well: the bus connection must be kept open for as long as
the service is to remain registered. Document that in the man page and
NEWS, and point to *.dnssd files for registrations independent of a
client's lifetime.
2026-09-02 10:40:34 +02:00
Christian Brauner e0be975735 man: document RestrictFileSystemAccess= W^X hardening
Describe the system-wide W^X rule and the new proc_mem.force_override=never
and seccomp prerequisites, and drop the advice to block writable and
executable mappings by other means, which the policy now does itself.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:40 +02:00
Fabian Vogt 10913c02a4 Typo fix: "tempered" -> "tampered" 2026-08-31 16:01:41 +02:00
Yu Watanabe e7e91b9bc1 man: also document -V option for udevd and run0
The option -V has been documented in their help message, but not in the
corresponding man pages.
2026-08-29 07:40:43 +09:00
Zbigniew Jędrzejewski-Szmek 51636f3c39 repart: clamp copied timestamps to $SOURCE_DATE_EPOCH (#43545)
This greatly helps reproducibility, and we can actually achieve it with
https://github.com/dosfstools/dosfstools/commit/8da7bc93315c.
2026-08-28 13:22:41 +02:00
Michael Vogt 3b4c759a07 hostname-wordlist: replace "petnames" wordlists
The petnames wordlist added in [1] is Apache-2.0 and this
causes problems with the distribution of systemd as the
GPL-2 and Apache-2.0 are considered incompatible by the FSF.

So this commit replaces the previous wordlist with
a new one:
- weather (basic english weather adjectives)
- colors (basic english color names)
- worlds (planets, moons, minor bodies of the solar system)

All common vocabulary and compiled for this project, not taken
from anywhere.

An example with the new list:
- wintry-rust-dione-9393
- warm-yellow-saturn-39f9

The "worlds" are picked on the following principles:
- well-known
- memorable
- short(ish)
- cool

This is why e.g. we have "thetis" (an astroid) instead of
"tethys" (a moon): easier to spell and more well known.

[1] https://github.com/systemd/systemd/pull/42566
2026-08-28 12:45:23 +02:00
Martin Pitt 94bb5f8e4d repart: clamp copied timestamps to $SOURCE_DATE_EPOCH
Use the new copy timestamp clamping mechanism from the previous commit
to fix unreproducible wall-clock files in the generated images.

That covers both modes: online mode writes through the kernel, and
offline mode stages the tree in a temporary directory before handing it
to mkfs or mcopy. `mcopy -m` then carries the clamped mtimes into the
FAT.

This complements commit 34c3d57474 (directory times) and commit
f191ca982c (FAT insertion order).

Cover all combinations (online/offline, with and without epoch) in the
new `testcase_vfat_reproducibility()`. Update `testcase_make_symlinks()`
to cover the symlink creation/re-fix their parent directory code paths.

Sadly, images are still not reproducible byte for byte. Document
systemd-repart's $SOURCE_DATE_EPOCH handling and remaining
reproducibility issues in the manpage.
2026-08-28 11:16:29 +02:00
Zbigniew Jędrzejewski-Szmek 3d0ef4aefe various: mark files with the usual license tags
For .clang-format and pytest.ini, MIT-0 is used because people might want
to copy those.
2026-08-28 06:26:09 +09:00
Luca Boccassi 2de150d7b7 Add experimental manpage marker, use it for sd-sysupdate and move it back to libexecdir (#43533) 2026-08-27 10:46:01 +01:00
Yu Watanabe 29de356679 man: update documentation for systemd-coredump 2026-08-27 05:55:03 +09:00
Luca Boccassi 9df2b26334 man: mark systemd-sysupdate[d] as experimental 2026-08-26 19:51:31 +01:00
quanyeyang a9ff124143 repart: Keep new partitions after existing same-type partitions
When a partition is deleted from a table containing multiple partitions
of the same type, filling the resulting partition-number gap can place
a new partition before an existing partition matched to an earlier
definition. This changes definition matching on the next invocation and
breaks idempotency.

Keep new partitions after existing partitions of the same type. If no
partition table slot is available after them, fall back to the first
unused slot.

Which existing partition is matched to which definition is still
determined by partition type and partition number order, as documented,
and is unchanged by this.

Fixes #43449
2026-08-26 19:43:03 +01:00
Yu Watanabe 6fe09adf81 network: several follow-ups for proxy neighbor setting (#43408)
Follow-ups for 08bebda611.
2026-08-27 00:09:59 +09:00
Luca Boccassi 1637c093d3 man: add 'experimental feature' XML snippet 2026-08-26 15:02:55 +01:00
zouge666 eb020fc492 import: merge default OpenPGP keyrings
When an administrator installed a custom keyring under /etc,
signature verification selected it instead of the vendor keyring
under /usr. That could make vendor-signed system updates stop
verifying after adding local keys.

Collect all readable default keyrings, including the current and
legacy /etc paths, and pass temporary copies to GnuPG with
separate --keyring options. Keep SYSTEMD_OPENPGP_KEYRING as an
explicit override, add regression coverage for keyring
coexistence, override behavior, and current-path signing, and
silence the expected shellcheck false positive in the test
cleanup helper.

Closes: #40702
2026-08-26 11:35:55 +01:00
Martin Pitt b8bcae41ac ukify: add naming a certificate created by genkey
Image builds create a key separate from the SecureBoot one for verity
signing. Its certificate ships inside the image as the sysext trust
anchor.

`genkey` certs had a hardcoded "SecureBoot signing key on host <fqdn of
the build machine>" CN, which describes neither that verity role nor a
meaningful hostname.

Make that name configurable with `SecureBootCertificateCommonName=`,
like mkosi's `--genkey-common-name`. That allows image build tools to
re-use `ukify genkey` for non-SB keys.

Unlike the implicit truncation for the default name, a specified one
which is too long is an error. Add a citation where that limit comes
frm.
2026-08-25 07:22:47 +09:00
Yu Watanabe 2d31e784f1 vconsole: allow to control font scaling
This adds FONT_SCALE= setting in vconsole.conf,
vconsole.font_scale= kernel command line option and credential support.
When 2 or 200% is specified, the console font size will be doubled.

Closes #43273.
2026-08-25 06:58:06 +09:00
dongshengyuan 471e34d5cb homectl: write recovery key file via linkable tmpfile
Create the file with open_tmpfile_linkable_at().
Write the recovery key and trailing newline to the temporary fd.
Set the final mode to 0600 before publishing it.
Link it into place with link_tmpfile_at(..., LINK_TMPFILE_SYNC).
2026-08-25 06:57:32 +09:00
Luca Boccassi ffb861ef22 man: add some notes regarding security features (#43434) 2026-08-24 15:12:03 +01:00
David 'equinox' Lamparter 1aedc8fe5e core/service: document & improve STOPPING=1
`STOPPING=1` is final, explain in the sd_notify man page that this is
the case and log an error if a service attempts to get back out of
STOPPING with another notification.

Fixes #43465 / 98734ac74d
2026-08-24 22:46:01 +09:00
Luca Boccassi dfaa2d3ee1 man: note that blocking w+x memory is required for RestrictFileSystemAccess= 2026-08-24 13:22:56 +01:00
Luca Boccassi 8ae9973783 man: note that overriding TTY isolation with run0 is discouraged 2026-08-24 13:22:56 +01:00
Luca Boccassi 744b7801cb man: note that GPT is implicitly trusted by sd-mountfsd 2026-08-24 13:22:56 +01:00
Luca Boccassi e8e852fa76 man: note that mixing sd-nsresourced and /etc/subuid is unsupported 2026-08-24 13:22:56 +01:00