homectl: fix confusion between "FOO" and "RLIMIT_FOO" as json keys
We parse RLIMIT_FOO, FOO, and LimitFOO all the same. But the keys in the
JSON dict are supposed to be "RLIMIT_FOO". We were creating such keys,
but then filtering them using "FOO", i.e. the filtering was not effective.
Using strjoina since both strings are under our control.
homectl: split out parser parse_ssh_authorized_keys
The idea is to split out helpers to make parse_argv() itself more
manageable. If possible, the helpers will be reused in many places. But
even if not, as in this case, it seems good to split out the code for a
specific option. Always, the sd_json_variant** pointer or pointers that
are operated on are selected in the caller. This way it is easier to see
which of the identity variables is used and if two different ones are
used.
The test passes but for two minutes the cleanup function just logs:
Failed to inspect home: No home for user homedsshtest known
Failed to inspect home: No home for user homedsshtest known
Failed to inspect home: No home for user homedsshtest known
...
Do not wait for the user to become inactive or remove the user if 'homectl
inspect' doesn't find the user. This brings a successfull run from 176 s
to 58 s here.
Luca Boccassi [Mon, 15 Dec 2025 22:51:16 +0000 (22:51 +0000)]
ci: remove --quiet from mkosi integration suite run
Given the integration tests take a while to run, it is useful to see
at which point it is while it is running. Sometimes only a test
script or such subset is changed, which means there's no need to
wait for the entire suite to run, especially with the sanitizers
job which is super slow.
Luca Boccassi [Mon, 15 Dec 2025 20:51:04 +0000 (20:51 +0000)]
Translations update from Fedora Weblate (#40097)
Translations update from [Fedora
Weblate](https://translate.fedoraproject.org) for
[systemd/main](https://translate.fedoraproject.org/projects/systemd/main/).
Nick Rosbrook [Wed, 10 Dec 2025 21:56:50 +0000 (16:56 -0500)]
mkosi: use qemu from noble-proposed instead of ppa
This is also temporary, but demonstrates that the version of qemu
currently in noble-proposed fixes https://launchpad.net/bugs/2127974,
which will ultimately allow for the fix to be released to noble-updates.
Daan De Meyer [Sun, 14 Dec 2025 12:34:17 +0000 (13:34 +0100)]
namespace: Clone root dir descriptor before use (#39939)
Before doing anything with the root directory file descriptor, let's
make sure we clone it first so that the caller can't mess with mount fd
attributes via mount_setattr() anymore.
We clone during parsing instead of in executor so that the caller can't
mess with the mount fd between invocations.
Daan De Meyer [Fri, 28 Nov 2025 19:28:01 +0000 (20:28 +0100)]
namespace: Clone root dir descriptor before use
Before doing anything with the root directory file descriptor, let's
make sure we clone it first so that the caller can't mess with mount fd
attributes via mount_setattr() anymore.
We clone during parsing instead of in executor so that the caller can't
mess with the mount fd between invocations.
Daan De Meyer [Fri, 28 Nov 2025 18:06:37 +0000 (19:06 +0100)]
mount-util: Add mount_fd_clone() helper
The kernel prevents you from open_tree()'ing an open_tree() fd unless it
was created from the caller's mount namespace. For various use cases, we
want to be able to open_tree() arbitrary mount file descriptors. Turns
out there's a way go get around it by mounting the mount file descriptor
in a throw-away mount namespace and then open_tree()'ing the mount file
descriptor. Let's implement this as a new helper mount_fd_clone() and
add a test for it.
Because move_mount()'ing the original fd makes it pretty useless as it
can't be move_mount()'ed again, we optionally make a second clone which
can replace the original fd so it can be cloned again later.
Kai Lueke [Thu, 11 Dec 2025 10:49:20 +0000 (19:49 +0900)]
sysext: Fix config file support with --root=
Config files for --root= weren't picked up as expected because the
--root= flag got parsed after the config file.
Switch the order of config file and CLI flag parsing while letting the
CLI flags overwrite things set by the config files by tracking state
during parsing.
Daan De Meyer [Wed, 3 Dec 2025 10:08:56 +0000 (11:08 +0100)]
discover-image: Rework image_make()
Currently, image_new() will calculate the image
path as the combination of dir_path and filename,
which is completely broken if filename is absolute
and dir_path is set.
Let's fix this by thoroughly cleaning up the
image_make() interface. Instead of having four
different arguments to pass in the image path,
let's reduce that to two, a file descriptor and a
path. If no file descriptor is provided, we create
own ourselves by opening the given path.
The callsites are updated to pass in an existing file
descriptor when available. Path calculation is moved
to callers instead of image_make().
Daan De Meyer [Thu, 11 Dec 2025 16:21:08 +0000 (17:21 +0100)]
tree-wide: Use meson test -q
meson test output is extremely verbose, printing
a separate line for each successful test. Let's
add -q/--quiet everywhere so it only prints full
lines for skipped and failed tests.
As commented, the unknown values should have been filtered out
in pid1's initial parsing already, and the communication between
pid1 and executor is entirely internal which makes the graceful
practice counterproductive.
Luca Boccassi [Thu, 11 Dec 2025 05:38:26 +0000 (05:38 +0000)]
core: gracefully skip unknown policy designators in RootImagePolicy et al (#40060)
Usually we gracefully ignore unknown configuration parameters, so that
service files can be written by upstreams and used across a variegated
range of distributions with various versions of systemd, to avoid
forcing users to the minimum common denominator and only adding settings
that are supported by the oldest distro supported.
Image policies do not behave like this, and any unknown partition or
policy designator causes the whole unit to fail to parse and a hard
error.
Change it so that parsing RootImagePolicy and friends via unit file or
D-Bus logs but otherwise ignores unknown specifiers, like other options
do.
This allows us to add new specifiers in the future, and users to adopt
them immediately.
Daan De Meyer [Wed, 3 Dec 2025 12:36:52 +0000 (13:36 +0100)]
test: Stop using grep -q in integration test
When a TTY is attached to the test unit, grep -q will generate SIGPIPE
for the previous command in the pipeline which in combo with `pipefail`
will cause the command to fail with exit status 141 which will fail the
test.
Replace with >/dev/null to avoid this from happening.
See also https://www.gnu.org/software/grep/manual/html_node/Usage.html
> There is a related problem with Bash’s set -e -o pipefail. Since grep
> does not always read all its input, a command outputting to a pipe read
> by grep can fail when grep exits before reading all its input, and the
> command’s failure can cause Bash to exit.
tar-util: allow to build without acl support (#39965)
This adds minimal definitions provided by libacl to make tar-util built
without libacl support.
Fixes the following compile error:
```
../src/shared/tar-util.c:62:9: error: unknown type name 'acl_t'
62 | acl_t acl_access, acl_default;
| ^~~~~
```
hwdb: sensor: Remove Lenovo IdeaPad D330 accel mount matrix
Reading values from iio-sensor we are getting bad values. This matrix was added because the panel was a vertical one but the normal position is horizontal and the sensor is not bad oriented.
Removing the matrix ensure we have correct orientation values and prevent from misleads where the incorrect values we were getting messed up.
For example mutter actually is setting incorrect screen rotation for devices with panel orientation quirks.
I'm pretty sure that there are more devices where we have incorrectly "corrected" the sensor values when the only problem was the panel orientation.
Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
resolve: always read /etc/resolv.conf on reload systemd-resolved
When systemd-resolved is used in resolv.conf foreign mode, reloading the
systemd-resolved daemon does not read resolv.conf when not touched since
the last time resolved read the file. Since the DNS servers list is
flushed during a reload, resolved forgets about the servers
in /etc/resolv.conf
When reloading the daemon it is expected that all configuration is
reloaded regardless of the disk timestamps.
Ricardo Salveti [Tue, 9 Dec 2025 19:55:57 +0000 (04:55 +0900)]
boot: handle empty initrd files (#40040)
Commit f8fa4222c9ac3e74e91c64e25e9532c99559cf99 added extra logic to
account for the size of the initrds before allocating the required memory pages,
but missed checking if the initrds were empty before allocating memory.
Extend the initrd options only when the initrd is valid, and add extra
check for validating that there is at least one valid initrd file before
allocating memory, fixing the following crash when booting with empty
initrd files:
Jeremy Kerr [Tue, 9 Dec 2025 13:22:55 +0000 (22:22 +0900)]
udev-builtin-net_id: fix construction of USB specifier-based names
Commit 0bac1ed242 ("tree-wide: Fix constness issues with newer glibc")
split a temporary var in get_usb_specifier to const and non-const
versions, but missed converting a couple of uses. This means we get
names of with components of:
port: uN
config: cC.I
interface: iC.I
instead of:
port: uN
config: cC
interface: iI
This results in net names like enu1c1.0i1.0, as we also no longer hit
the config==1 and interf==0 elision cases.
Change the config portion handling to start from the correct position,
and the earlier check for NULL.
Lukáš Zaoral [Mon, 8 Dec 2025 14:42:40 +0000 (15:42 +0100)]
ukify: prefer compression.zstd when available
Python 3.14 introduced support for zstd in the standard library [1]. Therefore,
let's prefer it when available to decrease the number of necessary external
dependencies.
David Tardon [Fri, 5 Dec 2025 12:09:16 +0000 (13:09 +0100)]
find-esp: replace assert by a runtime check
The path--as a whole--is no longer being opened with O_DIRECTORY, hence
the assertion is not valid.
Reproducer:
# SYSTEMD_RELAX_ESP_CHECKS=1 bootctl list --esp-path=`pwd`/README
Assertion 'S_ISDIR(sxa.stx_mode)' failed at src/shared/find-esp.c:295, function verify_fsroot_dir(). Aborting.
q66 [Sat, 6 Dec 2025 16:53:29 +0000 (17:53 +0100)]
meson: drop ln --relative check
The coreutils release that included this was in 2012. Since then,
systemd requires a newer meson, mostly uses install_symlink, and
so on. Additionally, where it does use this feature, it uses the
'-r' short flag. There are implementations of 'ln' that do have
support for '-r' but no longopts. Things will still work on those
but this check will fail.