Commit Graph
85335 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 1d26e7c1d5 bootctl: round the timeout up
I think this is better: if I specify 0.5s, I'd be suprised if the
menu didn't show up at all.
2026-01-04 13:58:37 +01:00
Zbigniew Jędrzejewski-Szmek abd17aa3f4 bootctl: rework setting of menu timeout variables
menu-force and menu-hidden were added in 97f077df05,
menu-disable was added in 6efdd7fec5, a year later.
So we can assume that if the feature flag is set, the other string values are
supported too. The comment that there's no way check that was added later in
5b45fad4fc, but it was incorrect even at that
time.

Fixes https://github.com/systemd/systemd/issues/39167. As described in the
issue, we documented various string values in the BLI, but bootctl didn't use
the string values. At the time menu-force and menu-hidden were added, using
numerical values for compatibility made sense. But that stopped being needed
when a string value that didn't have a strictly equivalent numerical value and
a feature flag were added.

When converting a large number to menu-force, message is downgraded to debug,
since the severity of the issue is very minor. Debug messages are added in
other places when the requested setting is modified too.
2026-01-04 13:55:44 +01:00
QuickSwift315490 f9425092c6 hwdb: fix unstable button triggering on Mipad 2 under GNOME (#40071)
Change unknown key mappings to reserved.

A KEY_RESERVED button is marked as reserved and passed to the kernel. This will stop the kernel from passing this keystroke event to user space.

If unknown, the key is set to KEY_UNKNOWN and the event is passed to user space, which we want to avoid.
2025-12-17 13:26:47 +00:00
Haiyue Wang 568fe0294d meson: fix BPF build warnings due to MS extensions
Fix BPF program build warnings on Linux-6.19.0-rc1, more detail is [1]:

A). clang-bpf

[781/2458] Generating src/network/bpf/sysctl-monitor/sysctl-monitor.bpf.unstripped.o with a custom command
In file included from ../src/network/bpf/sysctl-monitor/sysctl-monitor.bpf.c:3:
./vmlinux.h:60263:3: warning: declaration does not declare anything [-Wmissing-declarations]
 60263 |                 struct ns_tree;
       |                 ^~~~~~~~~~~~~~
./vmlinux.h:80251:2: warning: declaration does not declare anything [-Wmissing-declarations]
 80251 |         struct __fs_path;
       |         ^~~~~~~~~~~~~~~~
./vmlinux.h:96184:2: warning: declaration does not declare anything [-Wmissing-declarations]
 96184 |         struct freelist_tid;
       |         ^~~~~~~~~~~~~~~~~~~
./vmlinux.h:114441:2: warning: declaration does not declare anything [-Wmissing-declarations]
 114441 |         struct renamedata;
        |         ^~~~~~~~~~~~~~~~~
./vmlinux.h:118480:2: warning: declaration does not declare anything [-Wmissing-declarations]
 118480 |         union pipe_index;
        |         ^~~~~~~~~~~~~~~~
./vmlinux.h:130452:4: warning: declaration does not declare anything [-Wmissing-declarations]
 130452 |                         struct freelist_counters;
        |                         ^~~~~~~~~~~~~~~~~~~~~~~~
6 warnings generated.

B). gcc-bpf

meson setup -Dbpf-compiler=gcc build

[1040/2458] Generating src/network/bpf/sysctl-monitor/sysctl-monitor.bpf.unstripped.o with a custom command
In file included from ../src/network/bpf/sysctl-monitor/sysctl-monitor.bpf.c:3:
./vmlinux.h:60263:31: warning: declaration does not declare anything
60263 |                 struct ns_tree;
      |                               ^
./vmlinux.h:80251:25: warning: declaration does not declare anything
80251 |         struct __fs_path;
      |                         ^
./vmlinux.h:96184:28: warning: declaration does not declare anything
96184 |         struct freelist_tid;
      |                            ^
./vmlinux.h:114441:26: warning: declaration does not declare anything
114441 |         struct renamedata;
       |                          ^
./vmlinux.h:118480:25: warning: declaration does not declare anything
118480 |         union pipe_index;
       |                         ^
./vmlinux.h:130452:49: warning: declaration does not declare anything
130452 |                         struct freelist_counters;
       |                                                 ^

[1] https://git.kernel.org/torvalds/c/639f58a0f480
    "bpftool: Fix build warnings due to MS extensions"

Signed-off-by: Haiyue Wang <haiyuewa@163.com>
2025-12-17 12:58:33 +00:00
Andrew Halaney 0927356f8e man/systemd.exec: Make EnvironmentFile error conditions more explicit
It is not entirely clear what happens when EnvironmentFile fails in the
prior wording. With the new wording it should now be clear that if it
fails to process the file the service will fail, and if it is prefixed
with "-" all errors are silently ignored.

Signed-off-by: Andrew Halaney <ahalaney@netflix.com>
2025-12-17 11:56:52 +01:00
Luca Boccassi 8fba2ed258 test: fix race condition in TEST-80-NOTIFYACCESS
In some cases systemd is faster to send the SIGHUP
than the script is to start the 'sleep' and background
it, so it never gets interrupted later and the test
is left hanging waiting for it.

[ 5028.410588] systemd[1]: Starting reload-timeout.service...
[ 5028.429544] reload-timeout.sh[165]: + set -o pipefail
[ 5028.429544] reload-timeout.sh[165]: + COUNTER=0
[ 5028.429841] reload-timeout.sh[165]: + trap sighup_handler SIGHUP
[ 5028.429841] reload-timeout.sh[165]: + export SYSTEMD_LOG_LEVEL=debug
[ 5028.429841] reload-timeout.sh[165]: + SYSTEMD_LOG_LEVEL=debug
[ 5028.429841] reload-timeout.sh[165]: + systemd-notify --ready
[ 5028.432891] systemd[1]: reload-timeout.service: Got notification message from PID 165: READY=1
[ 5028.432908] systemd[1]: reload-timeout.service: Changed start -> running
[ 5028.432983] systemd[1]: reload-timeout.service: Job 409 reload-timeout.service/start finished, result=done
[ 5028.432997] systemd[1]: Started reload-timeout.service.
[ 5028.433941] TEST-80-NOTIFYACCESS.sh[164]: Job for reload-timeout.service finished.
[ 5028.433941] TEST-80-NOTIFYACCESS.sh[164]: Got result done/Success for job reload-timeout.service.
[ 5028.433941] TEST-80-NOTIFYACCESS.sh[164]: Bus n/a: changing state RUNNING → CLOSED
[ 5028.436949] TEST-80-NOTIFYACCESS.sh[99]: + systemctl reload --no-block reload-timeout.service
[ 5028.444523] TEST-80-NOTIFYACCESS.sh[167]: Bus n/a: changing state UNSET → OPENING
[ 5028.444523] TEST-80-NOTIFYACCESS.sh[167]: sd-bus: starting bus by connecting to /run/systemd/private...
[ 5028.444523] TEST-80-NOTIFYACCESS.sh[167]: Bus n/a: changing state OPENING → AUTHENTICATING
[ 5028.444523] TEST-80-NOTIFYACCESS.sh[167]: Executing dbus call org.freedesktop.systemd1.Manager ReloadUnit(reload-timeout.service, replace)
[ 5028.444523] TEST-80-NOTIFYACCESS.sh[167]: Bus n/a: changing state AUTHENTICATING → RUNNING
[ 5028.445202] reload-timeout.sh[165]: + wait_for_signal
[ 5028.445586] reload-timeout.sh[169]: + sleep infinity
[ 5028.447285] reload-timeout.sh[165]: ++ sighup_handler
[ 5028.447285] reload-timeout.sh[165]: ++ echo hup1
[ 5028.444886] systemd[1]: reload-timeout.service: Trying to enqueue job reload-timeout.service/reload/replace
[ 5028.445228] systemd[1]: reload-timeout.service: Installed new job reload-timeout.service/reload as 491
[ 5028.445240] systemd[1]: reload-timeout.service: Enqueued job reload-timeout.service/reload as 491
[ 5028.446601] systemd[1]: reload-timeout.service: Service has no extensions to reload.
[ 5028.446799] systemd[1]: reload-timeout.service: Changed running -> reload-signal
[ 5028.446881] systemd[1]: Reloading reload-timeout.service...
[ 5028.451343] TEST-80-NOTIFYACCESS.sh[167]: Bus n/a: changing state RUNNING → CLOSED
[ 5028.452421] TEST-80-NOTIFYACCESS.sh[99]: + timeout 10 bash -c 'until [[ $(systemctl show reload-timeout.service -P SubState) == "reload-signal" ]]; do sleep .5; done'
[ 5028.460676] TEST-80-NOTIFYACCESS.sh[172]: Bus n/a: changing state UNSET → OPENING
[ 5028.460676] TEST-80-NOTIFYACCESS.sh[172]: sd-bus: starting bus by connecting to /run/systemd/private...
[ 5028.462029] TEST-80-NOTIFYACCESS.sh[172]: Bus n/a: changing state OPENING → AUTHENTICATING
[ 5028.462029] TEST-80-NOTIFYACCESS.sh[172]: Showing one /org/freedesktop/systemd1/unit/reload_2dtimeout_2eservice
[ 5028.463759] TEST-80-NOTIFYACCESS.sh[172]: Bus n/a: changing state AUTHENTICATING → RUNNING
[ 5028.470322] TEST-80-NOTIFYACCESS.sh[172]: Bus n/a: changing state RUNNING → CLOSED
[ 5028.472991] TEST-80-NOTIFYACCESS.sh[99]: + sync_in hup1
[ 5028.472991] TEST-80-NOTIFYACCESS.sh[99]: + read -r x
[ 5028.473839] reload-timeout.sh[165]: + wait 169
[ 5028.473996] TEST-80-NOTIFYACCESS.sh[99]: + test hup1 = hup1
[ 5028.473996] TEST-80-NOTIFYACCESS.sh[99]: + timeout 10 bash -c 'until [[ $(systemctl show reload-timeout.service -P SubState) == "reload-notify" ]]; do sleep .5; done'
[ 5038.477383] systemd[1]: TEST-80-NOTIFYACCESS.service: Failed with result 'exit-code'.

(note how the 'wait' is long after SIGHUP has been processed already)

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

Follow-up for ca8658120e
2025-12-17 18:41:59 +09:00
Yu Watanabe b6abe84602 core: fix extensions refreshing (dlopen() shenanigans) (#40112) 2025-12-17 18:41:23 +09:00
Vivian Wang 2e8985113b stub: Use log_debug if addons has no applicable sections
This can happen expectedly if an addon purely provides .dtbauto
sections, and there's no match for this machine. Reduce the log message
of this case to "debug" level.
2025-12-17 18:37:49 +09:00
Priit Jõerüüt b5a920cee1 po: Translated using Weblate (Estonian)
Currently translated at 91.6% (242 of 264 strings)

Co-authored-by: Priit Jõerüüt <jrtkbfdr@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/et/
Translation: systemd/main
2025-12-17 14:21:20 +09:00
Mike Yuan 5a2340aeb3 core/exec-credential: fix credentials plain dir exchanging (#40108)
Follow-ups for #39637

Split out from #40093
2025-12-17 00:25:11 +01:00
Mike Yuan 4d136f1462 core: dlopen() libcryptsetup in extensions refreshing
Follow-up for a08f2ea02d

This fixes extensions refreshing + verity-protected DDIs.
TEST-50-DISSECT previously passed because confext refreshing
is tested after live mount, the latter of which used to
load libcryptsetup in pid1.
2025-12-16 22:11:45 +01:00
Yu Watanabe 650fc62526 TEST-70-TPM2: re-enable tpm2-setup test on Alpine/postmarketOS
After 64b5c5f593, the test passes on
Alpine/postmarketOS.

This partially reverts 9fafe89bcc.
2025-12-16 21:10:12 +00:00
Mike Yuan 12df39fadf core/service: defer cryptsetup dlopen to helper process
This should still be safe, as we block dlopen() in namespace_fork().

Partially reverts 9252e26f4c.
2025-12-16 21:57:37 +01:00
Mike Yuan 8f397d5922 core/unit: add unit_fork_helper_process_full() that takes ForkFlags 2025-12-16 21:30:36 +01:00
Mike Yuan 3602308480 TEST-54-CREDS: add test case for #40108 2025-12-16 21:28:19 +01:00
Mike Yuan 6c1bcdd614 core/exec-credential: fix credentials plain dir exchanging
Follow-up for d796c6b7c6

rename() may yield ENOTEMPTY rather than EEXIST for existing dir,
so catch that too. Also, both the source and target must be
writable when exchanging.

Test coverage for this logic (i.e. user units with ExecStartPre=)
will be added later.
2025-12-16 21:25:51 +01:00
Mike Yuan 29a823b3b6 process-util: add a flag for retaining dlopen()-ability
While blocking dlopen() in child generally makes sense, it does
also lead to misery - in the very case of extension/cred refreshing
it then enforces loading of libcryptsetup/libacl in pid1, which
are otherwise never used. Let's add a flag to opt out hence, but
still prohibit it in namespace_fork/enter().
2025-12-16 21:07:20 +01:00
Mike Yuan 5188da568c acl-util: systematically fall back to fchmod() if acl is not available
Same as 2a64b56da4, but for
fd_acl_make_writable().

While at it, un-export fd_acl_make_{read_only,writable}_fallback(),
instead apply ifdeffery in .c
2025-12-16 20:16:58 +01:00
Mike Yuan 4abf7ee02e Revert "acl-util: drop now unused fd_acl_make_writable()"
This reverts commit 4175cd4f40.

It turned out that we still need this. Preparation for later commits.
2025-12-16 20:16:57 +01:00
Mike Yuan e6e001cdd4 acl-util: treat pointer type as a whole
Follow-up for 4976d6e9ac
2025-12-16 20:16:57 +01:00
Mike Yuan 552822992c core/service: do not honor SuccessExitStatus= for our own helpers
They're exclusively under our control, hence errors should not be
suppressed based on external user input.
2025-12-17 04:04:02 +09:00
Luca Boccassi c78d18096d mkosi: drop gh from mkosi-tools debian/ubuntu
It was removed from testing so building images fails
2025-12-16 17:54:15 +00:00
Luca Boccassi 830275f343 mkosi: update mkosi commit reference to 9e31235211d975bae25622d6205a8396d104335e
* 9e31235211 pacman: Make sure hookdir exists
* 20009b7f48 make_image: log systemd-repart *.conf files at the --debug level
* b94b415db9 run: Increase string limit for strace when debugging sandbox
* 9f6d9405d6 Ring the terminal bell after the last image has been built
* b509b4246d Add glob in default initrd to exclude some exotic drivers
* 189394b8b9 Allow KernelModules= globs to also match relative to modules root dir
* 92bd086e4e zypper: add --force-resolution flag
* 3637749702 kmod: Only add fully resolved fw path if it exists
* d41ac276c9 Add details to KernelModulesInitrd= doc
* 1b6960ddb1 Fix SplitArtifacts=repart-definitions for addons
* 07464f38d6 Add log_step call in build_kernel_modules_initrd
* 18f5885362 Use proper constants for ansi colors
* 454c1602b6 mkosi-obs: add SplitArtifacts=repart-definitions and use it
* 9e57461af6 Copy repart definitions to staging directory
* 1acab18874 Add SplitArtifacts=repart-definitions
* c5c5c225e8 mkosi-obs: always include verity certificate
* ac5babb8e0 Revert "Use Path.relative_to instead of Path.parts"
* cbb1daeb76 action: Use environment variables instead of inputs
* 97c81eef72 portable: support split roothash
2025-12-16 15:59:02 +00:00
Lennart Poettering 200f792b3e tpm2-util: create leading dirs for anchor secret
Fixes #40087
2025-12-16 22:28:10 +09:00
Lennart Poettering 64b5c5f593 test: prefer tests with PCR 16 over PCR 11
PCR 16 is intended for debugging purposes, and is the only PCR that can
be reset by software. Let's prefer that for testing.

PCR 11 has a purpose (i.e. kernel is measured there on UKI systems, as
are the boot phases), hence let's not use that for testing.

That should remove any interference of boot time ordering and testing
our tpm code, as we will write to PCR 16 only, and reset it before we
rely on it.

This likely, kind of fixes #39582, but the issue mixes two things, PCR
11 issues on real-life hardware, and PCR 11 isues in our artificial
tests. Only the latter is addressed by this PR, the other issue needs
more debugging, but without logs we cannot do much.
2025-12-16 22:28:10 +09:00
Zbigniew Jędrzejewski-Szmek 3310f979f8 Sync kernel headers and add GUEST_MEMFD_MAGIC (#40104) 2025-12-16 14:04:03 +01:00
Mike Yuan 4f25248b6e core/service: set unit log context in helper processes that bypass cgroup
Since these helper processes aren't spawned in the unit cgroup,
let's explicitly attach unit log context so that all logging gets
attributed to the unit, including the ones done in library calls.
2025-12-16 12:49:06 +01:00
Luca Boccassi f9a6c04d14 basic: add GUEST_MEMFD_MAGIC from 6.19
1/1815 systemd:kernel-filesystem-magics FAIL 0.05s exit status 1
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――
stderr:
kernel knows additional filesystem magics: GUEST_MEMFD_MAGIC
2025-12-16 11:44:43 +00:00
Luca Boccassi e20e9d2968 include: update kernel headers from v6.19~rc1 2025-12-16 11:43:29 +00:00
Mike Yuan fd99348353 bus-unit-util: ReloadSignal is a Service property
Follow-up for c133545430
2025-12-16 10:37:09 +01:00
Luca Boccassi 6066106b3c 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.

Partially reverts 9848f56cc6
2025-12-16 09:11:06 +01:00
Luca Boccassi b5032cf979 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/).



Current translation status:

![Weblate translation
status](https://translate.fedoraproject.org/widget/systemd/main/horizontal-auto.svg)
2025-12-15 20:51:04 +00:00
Priit Jõerüüt eb307eebb0 po: Translated using Weblate (Estonian)
Currently translated at 90.1% (238 of 264 strings)

Co-authored-by: Priit Jõerüüt <jrtkbfdr@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/et/
Translation: systemd/main
2025-12-15 19:58:24 +00:00
Henri Aunin 56ae796774 po: Translated using Weblate (Estonian)
Currently translated at 90.1% (238 of 264 strings)

Co-authored-by: Henri Aunin <contact+fedora@hen.ee>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/et/
Translation: systemd/main
2025-12-15 19:58:23 +00:00
Nick Rosbrook 39d3f63782 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.
2025-12-15 19:16:57 +00:00
Yu Watanabe fd2cdadc14 integration-test: check tools distribution rather than image distribution
The tools and image distributions may be different.

This also fixes invalid escape sequence.

Follow-up for 9b42cc3b12.
2025-12-15 23:11:47 +09:00
Yu Watanabe 2960889a2c mount-util: fix typo
Follow-up for 273c6bc045.
2025-12-15 11:20:29 +09:00
Yu Watanabe 82e3f6c5f9 sysext: Fix config file section docs and --root= (#40063) 2025-12-15 09:45:29 +09:00
Yu Watanabe 93378148d4 tree-wide: normalize comment style 2025-12-15 08:50:13 +09:00
0x06 8e20b9a79d hwdb: Fix ACCEL_MOUNT_MATRIX for Lenovo Ideapad MIIX 310-ICR (#40067)
Tested with monitor-sensor on bvr1HCN44WW
2025-12-15 07:19:10 +09:00
David Santamaría Rogado a0a64f6b67 hwdb: sensor: Remove Lenovo IdeaPad Duet 3 accel mount matrix (#40075)
Same case as IdeaPad D330, matrix applied to solve issues in wayland
compositors when is not the way because correct data is send by the
sensor.

As described in #39529, let's remove the matrix.
2025-12-15 07:16:10 +09:00
David Santamaría Rogado 6855c4a7f7 hwdb: sensor: Add HP OmniBook Ultra Flip 14 accel mount matrix (#40076)
HP OmniBook Ultra Flip Laptop 14-fh0xxx tilt is inverted by default so
screen tilt-face down is up and vice versa, invert the axis then.
2025-12-15 07:14:00 +09:00
Daan De Meyer b96dccaba3 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.
2025-12-14 13:34:17 +01:00
Daan De Meyer 2cee5c22b6 TEST-50-DISSECT: Make sure RootDirectoryFileDescriptor= can be reused 2025-12-14 11:32:08 +01:00
Daan De Meyer 5eb0639faa 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.
2025-12-14 11:32:06 +01:00
Daan De Meyer 273c6bc045 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.
2025-12-14 11:31:59 +01:00
Alexis-Emmanuel Haeringer 595d88cdc8 conf-files: include the expected suffix in the 'unexpected suffix' debug message. 2025-12-13 11:46:37 +01:00
Mike Yuan 7524671f74 core/execute-serialize: do not gracefully skip unknown image policies in executor (#40062) 2025-12-12 16:20:14 +01:00
Kai Lueke 4938777695 man/sysext.conf: Fix section name to match code
The code uses SysExt and ConfExt for section names but the docs use
Sysext and Confext.
Align the docs with the code.
2025-12-12 21:54:47 +09:00
Kai Lueke f351668cbe 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.
2025-12-12 21:50:45 +09:00