Commit Graph
88651 Commits
Author SHA1 Message Date
Yu Watanabe 3c5bb1f352 option: fix typo 2026-05-13 01:57:12 +09:00
Yu Watanabe 47eb11e4c2 po: update Japanese translation 2026-05-13 01:51:48 +09:00
Daan De Meyer d0234450b6 json-stream: tolerate truncated SCM_RIGHTS on inbound messages
When an LSM (e.g. SELinux) denies an fd transfer or the receiver hits
RLIMIT_NOFILE, the kernel drops the fd(s) from the SCM_RIGHTS cmsg and
sets MSG_CTRUNC on the recvmsg(). recvmsg_safe() turns that into
-ECHRNG, which causes json_stream_read() to discard the data bytes
that were nevertheless received and the varlink server to silently
tear down the connection — leaving the caller waiting for a reply
that never comes.

Inline the recvmsg() call instead and, on MSG_CTRUNC, drop the partial
fds but keep the message data. The method handler will surface a clean
-ENXIO when it tries to peek the missing fd, which sd-varlink wraps as
io.systemd.System for the peer, instead of a hang. This matches the
recent sd-bus fix in 6c8de404c9 ('sd-bus: allow receiving messages with
MSG_CTRUNC set').
2026-05-12 18:54:28 +02:00
Lennart Poettering 183ce1da4e update TODO 2026-05-12 18:49:43 +02:00
Bone NI ee2c2b1b89 po: Translated using Weblate (Lao)
Currently translated at 100.0% (266 of 266 strings)

po: Added translation using Weblate (Lao)

Co-authored-by: Bone NI <bounkirdni@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/lo/
Translation: systemd/main
2026-05-12 18:01:20 +02:00
Zbigniew Jędrzejewski-Szmek 143f5911b1 core: when skipping state deserializing units, also skip job subsections (#41957)
If a unit has active jobs, when it gets serialized there are job
subsections, each with their own empty line marker. The skipping
function ignores this and skips until the marker, but then leaves
the job in place, breaking deserialization.
Consume jobs subsections too.

This shows up now that there's TEST-07-PID1.alias-corruption,
which occasionally fails when the aliased unit happens to
still have a job when the reexec happens.

```
[  967.551630] TEST-07-PID1.sh[179]: + echo 'Testing with: systemctl daemon-reexec'
[  967.551630] TEST-07-PID1.sh[179]: Testing with: systemctl daemon-reexec
[  968.405274] TEST-07-PID1.sh[179]: + echo '--- Attempt 1/3 ---'
[  968.405274] TEST-07-PID1.sh[179]: --- Attempt 1/3 ---
[  968.698641] TEST-07-PID1.sh[179]: + echo 'Running daemon-reexec...'
[  968.698641] TEST-07-PID1.sh[179]: Running daemon-reexec...
[  969.130261] TEST-07-PID1.sh[179]: + echo 'legit.service PID remains 1282. Attempt 1 passed.'
[  969.130261] TEST-07-PID1.sh[179]: legit.service PID remains 1282. Attempt 1 passed.
[  970.870456] TEST-07-PID1.sh[179]: + echo '--- Attempt 2/3 ---'
[  970.870456] TEST-07-PID1.sh[179]: --- Attempt 2/3 ---
[  971.267205] TEST-07-PID1.sh[179]: + echo 'Running daemon-reexec...'
[  971.267205] TEST-07-PID1.sh[179]: Running daemon-reexec...
[  971.715743] TEST-07-PID1.sh[179]: + echo 'legit.service PID changed from 1282 to 1643!'
[  971.715743] TEST-07-PID1.sh[179]: legit.service PID changed from 1282 to 1643!
```


https://github.com/systemd/systemd/actions/runs/25376867873/job/74414201255
2026-05-12 17:12:59 +02:00
Yu Watanabe 8bc6aa614d network: use TLV and iovec to manage several DHCP options (#42045) 2026-05-13 00:02:10 +09:00
Lennart Poettering 219d894db9 Implement Path/Scope/Swap/Timer Context/Runtime for io.systemd.Unit.List (#41980)
The PR implements the following objects + tests for
io.systemd.Unit.List:
* PathContext
* PathRuntime
* ScopeContext
* ScopeRuntime
* SwapContext
* SwapRuntime
* TimerContext
* TimerRuntime

It's a continuation of the following PRs:
* https://github.com/systemd/systemd/pull/37432
* https://github.com/systemd/systemd/pull/37646
* https://github.com/systemd/systemd/pull/38032
* https://github.com/systemd/systemd/pull/38212
* https://github.com/systemd/systemd/pull/39391
2026-05-12 16:12:36 +02:00
Daan De Meyer e530ef6761 btrfs-util: clear RDONLY flag on subvolume before destroy ioctl
Without CAP_SYS_ADMIN, btrfs_ioctl_snap_destroy() runs an
inode_permission(MAY_WRITE) check against the target subvolume root, which
btrfs_permission() rejects with EROFS for a read-only subvolume. As a
result, unprivileged removal of a read-only subvolume fails — both via
btrfs_subvol_remove_at() directly and via the recursive cleanup path used
by rm_rf_subvolume_and_freep(), which propagates the EROFS up.

Detect EROFS after the destroy ioctl, clear the RDONLY flag (only inode
ownership is required for BTRFS_IOC_SUBVOL_SETFLAGS), and retry once.

While at it, fix the surrounding comments: BTRFS_IOC_SNAP_DESTROY drops the
entire subvolume tree, so regular files inside are irrelevant; ENOTEMPTY
from the ioctl indicates nested subvolumes (BTRFS_ROOT_REF_KEY entries) via
may_destroy_subvol(), not non-empty contents.
2026-05-12 16:03:08 +02:00
drhydroxide 1f4052a2f2 60-sensor.hwdb iio/accel fix for Advan Evo-X 13 (#42037)
Added fix for Advan Evo-X 13 2-in-1 laptop

Relevant output of `udevadm info --export-db`
```
P: /devices/pci0000:00/0000:00:15.2/i2c_designware.3/i2c-2/i2c-NSA2513:00/iio:device0
M: iio:device0
R: 0
J: +iio:iio:device0
U: iio
T: iio_device
E: DEVPATH=/devices/pci0000:00/0000:00:15.2/i2c_designware.3/i2c-2/i2c-NSA2513:00/iio:device0
E: DEVTYPE=iio_device
E: SUBSYSTEM=iio
E: USEC_INITIALIZED=5462149
E: ACCEL_MOUNT_MATRIX=-1,0,0;0,-1,0;0,0,1
E: IIO_SENSOR_PROXY_TYPE=iio-poll-accel
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:
```
2026-05-12 14:27:02 +01:00
Daan De Meyer 8b81e3b751 chase: Use openat2() if available
Let's make use of openat2() if we can in chaseat().
2026-05-12 14:43:39 +02:00
Daan De Meyer 452214c09b chase: Use ELOOP for CHASE_PROHIBIT_SYMLINKS error
Matches the behavior of openat2() with RESOLVE_NO_SYMLINKS
which makes introducing support for openat2() easier.
2026-05-12 14:43:39 +02:00
hschloss 1ea3359793 pe-binary: fix "systemd-sbsign calculates wrong PE checksum" 2026-05-12 14:15:05 +02:00
Yu Watanabe 0b8b2af657 Introduce helper functions to parse and build length-prefixed data and TLV data (#41802)
These are currently not used yet, but will be used later in
parsing/building network packets like DHCP message.
2026-05-12 20:08:40 +09:00
Yu Watanabe 30b14a0886 dhcp: use struct iovec_wrapper to manage user class 2026-05-12 20:06:28 +09:00
Yu Watanabe fa881fda15 sd-dhcp-option: drop unused sd_dhcp_option 2026-05-12 20:06:28 +09:00
Yu Watanabe 431ec1b145 dhcp: use TLV object to manage extra and vendor options
Note, previously we replaced the previous option with the same option code with
new one. But, DHCP message can have multiple options with same option code.
Hence, this make the conf parser not replace, but append new one.
2026-05-12 20:06:28 +09:00
Yu Watanabe 47747cd212 sd-dhcp-protocol: rename DHCP option 43, 124, and 125
There are four DHCP options with confusing names:
Option 43: Vendor-Specific Information
Option 60: Vendor Class Identifier
Option 124: Vendor-Identifying Vendor Class
Option 125: Vendor-Identifying Vendor-Specific Information

Let's use their full names for their corresponding enums.
2026-05-12 20:06:28 +09:00
Daan De Meyer 60d6f70ca4 btrfs-util: Make nested subvolume operations work unpriv
BTRFS_IOC_SEARCH is only available to root in the
initial userns. This means we fail to recursively 
snapshot even if a subvolume has no nested subvolumes
at the moment.

Let's fix this by using the newer btrfs ioctls which
do work even if we don't have CAP_SYS_ADMIN in the initial
userns.
2026-05-12 13:03:06 +02:00
Artem Proskurnev dc6b6e9d64 hwdb/keyboard: Map f21 key on Wareus B15
Addition to PR https://github.com/systemd/systemd/pull/41181
Plasma-workspace OSD notifications about turning the touchpad on
and off are guided by f21. When this match is specified,
KDE notifies on this laptop that the on/off switch of the atchpad
state is pressed.
Fix dmesg:
atkbd serio0: Unknown key pressed (translated set 2, code 0xc1 on isa0060/serio0).
2026-05-12 11:23:52 +01:00
Luca Boccassi 53b16b68e1 test: start systemd-report-basic.socket again
SUSE uses a different preset, so don't just assert in the test,
instead just start the socket in case it is not enabled

TEST-74-AUX-UTILS.sh[1594]: ++ systemctl is-enabled systemd-report-basic.socket
TEST-74-AUX-UTILS.sh[1540]: + [[ disabled == enabled ]]
TEST-74-AUX-UTILS.sh[120]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.report.sh failed'

Follow-up for 4409e52494
2026-05-12 11:18:50 +01:00
Yu Watanabe 320ae462b1 tlv-util: introduce tlv-util that handles Tag-Length-Value data format
In many network protocols e.g. DHCP, the TLV format is used.
Let's introduce a simple parser and builder of the data format.
2026-05-12 15:53:12 +09:00
Yu Watanabe 4fc58bf621 iovec-wrapper: reintroduce iovw_free() and iovw_free_free()
They were dropped by the commit 267b16f33c,
but will be used later. Hence, let's reintroduce them.
2026-05-12 15:33:21 +09:00
Yu Watanabe 32729ae92f iovec-wrapper: introduce iovec_split() and iovw_merge()
In many network protocols, the length-prefixed data format is often
used. Let's add a simple parser and builder for the format.
2026-05-12 15:33:21 +09:00
Yu Watanabe fe6fed5d97 iovec-wrapper: introduce iovw_put_full() and friends to make them accept zero length entry
These will be used later. Preparation for later commits.
2026-05-12 15:33:21 +09:00
Yu Watanabe 58863bdaec iovec-wrapper: make iovw_size() take NULL again
This partially reverts 267b16f33c.

We usually make xyz_size() take NULL, e.g. hashmap_size().
2026-05-12 15:33:21 +09:00
Daan De Meyer 2fcf963273 vmspawn: Add missing error logging 2026-05-12 08:16:24 +02:00
Lennart Poettering 324fab7ed6 firstboot,sysinstall,hostnamed: always show FANCY_NAME=
This makes sure that whenever we want to show the OS name we can show
the fancy name. Thus this moves the escaping/validation of the fancy
name out of hostnamed into generic code, and then makes use of it in
sysinstall,firstboot,prompt-util.
2026-05-12 00:07:42 +01:00
Daan De Meyer d0168f4db6 mkosi: Drop CPUs= limit
Limiting VMs to 2 cpus was cargo culting without any
actual data that this benefits performance. The host OS
has a scheduler, let's make use of it and give the VM access
to all the CPUs. This doesn't mean they become inaccessible to
the host, it just means the VM gets as many virtual CPUs as the
host has CPU cores (threads). How they get scheduled is still up
to the host OS.
2026-05-11 23:13:10 +01:00
Lennart Poettering a19d92003d units: pull in basic.target rather than sysinit.target from system-install.target
Many of our services are nowadays implemented via socket activation, and
hence require sockets.target to be active to be accessible. One of them
is mute-console.socket, which we typically want to use from
systemd-firstboot.service, systemd-sysinstall.service and other related
services. Hence let's pull in basic.target rather than sysinit.target
from system-install.target since it pulls sockets.target in too.

Effectively, this doesn't change much except for pulling in a bunch more
sockets, and frankly going for sysinit.target was really a bug to begin
width.
2026-05-11 22:34:28 +01:00
Daan De Meyer f0064f1b05 Add liburing to build image packages 2026-05-11 21:11:28 +02:00
Daan De Meyer 54776b5fce vmspawn: Use builtin vdagent instead of spicevmc
The builtin one also makes the clipboard and such work. spicevmc
is only required for remote desktop use cases, so let's use the 
builtin one instead.
2026-05-11 21:10:48 +02:00
Daan De Meyer 7b9d76cba7 boot,vconsole: Propagate UEFI HII keyboard layout to the OS
UEFI firmware can report the currently-active keyboard layout via
EFI_HII_DATABASE_PROTOCOL.GetKeyboardLayout(). The layout descriptor
includes an RFC 4646 / BCP 47 language tag (e.g. "en-US"). Query this
from sd-boot/sd-stub and write it to a new LoaderKeyboardLayout EFI
variable, advertised through a new EFI_LOADER_FEATURE_KEYBOARD_LAYOUT
feature bit.

On the OS side, systemd-vconsole-setup reads the variable as a
lowest-priority fallback for the console keymap. To map the BCP 47
tag to a vconsole keymap we extend /usr/share/systemd/kbd-model-map
with an optional sixth column listing the comma-separated BCP 47 tags
each row covers; a new find_vconsole_keymap_for_bcp47() helper walks
the file, preferring an exact tag match and otherwise falling back to
the row whose tag matches the input's primary subtag. Credentials,
/etc/vconsole.conf, and vconsole.keymap= on the kernel command line
continue to take precedence.

bootctl status surfaces the new variable, printing the language tag
or "n/a (not reported by firmware)" when sd-boot advertises the
feature but the firmware HII database didn't expose a layout (common
on QEMU without a USB keyboard, since EDK2's PS/2 driver does not
register an HII keyboard layout).
2026-05-11 21:10:11 +02:00
Luca Boccassi 6f49c7e598 hwdb/keyboard: fix match for X+ Piccolo & revert workaround (#42018)
The controller is used in other devices, and some of these do have a
separate keypad with enter key.

This also reverts a workaround made for *Clevo PA70ES (Avell C73)* in
b7be9ccc8f.

Fixes: 7ae0a58815
2026-05-11 19:17:42 +01:00
Daan De Meyer 5173116fdb curl-util: Fix clang-tidy warnings (#42030)
Use the ref/unref macros to make sure the parameter names match

Follow-up for 87cec65cae
2026-05-11 18:17:53 +01:00
Christian Hesse 96a61b5483 Revert "hwdb/keyboard: fix KP_Enter on Clevo PA70ES"
Fixed in previous commit.

This reverts commit b7be9ccc8f.
2026-05-11 18:26:15 +02:00
Christian Hesse 033be1a41b hwdb/keyboard: use vendor/product specific match for X+ Piccolo
The controller is used in other devices, and some of these do have a
separate keypad with enter key.

Fixes: 7ae0a58815
2026-05-11 18:26:15 +02:00
Lennart Poettering e902a9346c sysupdate: Allow vacuuming partially downloaded updates and improve error reporting in that case (#41775)
See the commit messages for details.

Fixes: https://github.com/systemd/systemd/issues/41502
2026-05-11 17:27:05 +02:00
Daan De Meyer 6f3fa71775 vmspawn: Attach a USB keyboard in GUI mode
EDK2's UsbKbDxe is the only driver that registers a default HII
keyboard layout via the HII database protocol; the PS/2 driver does
not. Adding a USB xHCI controller and usb-kbd in CONSOLE_GUI mode
gives us a layout to query, which systemd-boot exports through the
LoaderKeyboardLayout EFI variable — useful for exercising that
codepath end-to-end.
2026-05-11 16:16:14 +01:00
Michael Vogt 4409e52494 units: enable systemd-report-basic.socket by default
In https://github.com/systemd/systemd/pull/41688 we merged metrics
and facts for systemd-report. However while some metric sources
are enabled by default (like `io.systemd.{Manager,Network}`) the
`io.systemd.Basic` service is not enabled by default.

This commit changes this and enables it by default.

We could also enable the systemd-report-cgroup.socket but that sends
a lot more data not sure that is a good default.
2026-05-11 17:09:14 +02:00
Lennart Poettering 6e7f59884e repart: make definitions varlink parameter actually optional
The Varlink iterface said the definitions directory was mandatory, and
so did the dispatch table. But that's nonsense, the code is completely
fine to operate without (same as cmdline repart invocations): it will
just use the standard definitions dir.

Fix that.
2026-05-11 17:07:12 +02:00
Lennart Poettering 24706513c8 Some curl improvements (#41905) 2026-05-11 16:56:03 +02:00
Luca Boccassi f68fa99a07 TEST-67-INTEGRITY: pre-load crypto modules and skip unsupported algorithms
The test occasionally fails on GHA CI when formatting with xxhash64
because dm-integrity's crypto_alloc_shash() -> request_module() path
flakily fails to load the algorithm:

[   29.172664] TEST-67-INTEGRITY.sh[447]: + for a in crc32c crc32 xxhash64 sha1 sha256
[   29.172664] TEST-67-INTEGRITY.sh[447]: + [[ xxhash64 == crc32 ]]
[   29.172664] TEST-67-INTEGRITY.sh[447]: + test_one xxhash64 0
[   29.172664] TEST-67-INTEGRITY.sh[447]: + integritysetup format /dev/loop0 --batch-mode -I xxhash64 ''
[   29.223383] TEST-67-INTEGRITY.sh[1220]: device-mapper: reload ioctl on temporary-cryptsetup-fa8bebe3-1d87-4796-91e8-abc02c487bb5 (254:0) failed: No such file or directory
[   29.226916] kernel: device-mapper: table: 254:0: integrity: Invalid internal hash (-ENOENT)
[   29.227415] kernel: device-mapper: ioctl: error adding target to table
[   29.231586] TEST-67-INTEGRITY.sh[1220]: Cannot format integrity for device /dev/loop0.

Preload each algorithm's crypto module before use, and skip algorithms
that are not registered in /proc/crypto.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 14:37:08 +01:00
Daan De Meyer 263335518b clang-tidy: Drop unknown gcc compiler args
clang-tidy recently gained support to allow dropping
compiler args from the entries parsed from the compilation
database. Let's make use of this to drop the two compiler
args we use with gcc that clang doesn't support so we can
run clang-tidy on meson build trees configured to use gcc
without getting tons of false positives.
2026-05-11 13:25:12 +01:00
Lennart Poettering dde54e510d fileio: add new read_boolean_file() helper (#41963)
This adds a new read_boolean_file() helper that combines
read_one_line_file() and parse_boolean() into one. 3 call sites are
converted to us it.
2026-05-11 14:16:05 +02:00
Ivan Kruglov cb3a1a1b2f test: use jq // empty instead of grep -v null in Unit.List tests
Replace `grep -v null` with jq's `// empty` alternative operator when filtering unit IDs. With `set -o pipefail`, `grep` returns 1 when no lines match, which aborts the script before conditional guards can run. The `// empty` operator suppresses null output directly in jq without risking a pipeline failure.
2026-05-11 04:32:14 -07:00
Ivan Kruglov ae619b1224 core: implement TimerContext/Runtime for io.systemd.Unit.List + tests
Add varlink context and runtime builders for .timer units:

TimerContext: MonotonicTimers (with MonotonicTimerBase enum), CalendarTimers, Unit, OnClockChange, OnTimezoneChange, AccuracyUSec, RandomizedDelayUSec, RandomizedOffsetUSec, FixedRandomDelay, Persistent, WakeSystem, RemainAfterElapse, DeferReactivation
TimerRuntime: Result (TimerResult enum), NextElapseUSecRealtime, NextElapseUSecMonotonic, LastTriggerUSec

MonotonicTimerSpec and CalendarTimerSpec are separate types since they have different value types (int vs string). MonotonicTimerBase and TimerResult are proper varlink enum types.

Compared to the old io-systemd-Unit-List branch, this adds RandomizedOffsetUSec and DeferReactivation (both present in D-Bus but previously missing), and adds full runtime fields.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-11 04:32:14 -07:00
Ivan Kruglov ed4740a0dc core: implement SwapContext/Runtime for io.systemd.Unit.List + tests
Add varlink context and runtime builders for .swap units:

SwapContext: What, Priority, Options, TimeoutUSec, ExecActivate, ExecDeactivate
SwapRuntime: ControlPID, Result, CleanResult, UID, GID (SwapResult enum)

SwapResult is exposed as a proper varlink enum type. Runtime follows the same pattern as MountRuntime (ControlPID, Result, CleanResult, ref UID/GID).

The integration test is conditional since swap units may not be present on all systems.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-11 04:32:14 -07:00
Ivan Kruglov 412b2d3101 core: implement ScopeContext/Runtime for io.systemd.Unit.List + tests
Add varlink context and runtime builders for .scope units:

ScopeContext: OOMPolicy (enum), RuntimeMaxUSec, RuntimeRandomizedExtraUSec, TimeoutStopUSec
ScopeRuntime: Result (ScopeResult enum)

Both OOMPolicy and ScopeResult are exposed as proper varlink enum types.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-11 04:32:03 -07:00
Lennart Poettering 4f63cff1f4 tree-wide: port various places to read_boolean_file() 2026-05-11 12:04:02 +02:00