Commit Graph
83205 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek fbbcd0edef journal: store counts, not byte sizes, in table size constants
It's easier to think about the size in "objects", not bytes. Let's convert to
bytes at the last moment.

Also drop some of the pointless size suffixes. In general, it's the size of the
variable that matters, not the constant that is written to it.

No functional change.
2025-07-30 15:51:00 +02:00
Zbigniew Jędrzejewski-Szmek 58ecb72bcf test-journal-dump: dump the headers of journal files
We have journal_file_print_header(), but it's not exposed anywhere in
a way that it is easy to call.
2025-07-30 15:51:00 +02:00
Luca Boccassi e7feab79bc Several fixlets for PTY forwarder and systemd-run (#38385)
Hopefully fixes #38237.
2025-07-30 10:29:06 +01:00
SoloSaravanan 2c1881f42c hwdb: Acer Nitro ANV15-51 Nitro Sense Toggle
This fixes Acer Nitro ANV15-51 Nitro sense toggle

Event: time 1753852156.475850, -------------- SYN_REPORT ------------
Event: time 1753852156.565054, type 4 (EV_MSC), code 4 (MSC_SCAN), value f5
Event: time 1753852156.565054, type 1 (EV_KEY), code 148 (KEY_PROG1), value 0
2025-07-30 17:00:03 +09:00
Jesse Guo 0d2679ab16 po: Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (264 of 264 strings)

Co-authored-by: Jesse Guo <jesseguotech@outlook.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_CN/
Translation: systemd/main
2025-07-30 08:26:29 +09:00
Emir SARI d1aa2f20a9 po: Translated using Weblate (Turkish)
Currently translated at 98.1% (259 of 264 strings)

Co-authored-by: Emir SARI <emir_sari@icloud.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/tr/
Translation: systemd/main
2025-07-30 08:26:29 +09:00
Luna Jernberg e02e36b192 po: Translated using Weblate (Swedish)
Currently translated at 100.0% (264 of 264 strings)

Co-authored-by: Luna Jernberg <bittin@reimu.nl>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sv/
Translation: systemd/main
2025-07-30 08:26:29 +09:00
Ivan Kruglov c5df8c2323 core: merging errno usage in access_init() 2025-07-30 08:25:58 +09:00
Zbigniew Jędrzejewski-Szmek 57fbe401f5 TEST-71-HOSTNAME: specify job mode for the stop job (#38413)
The CI run is failing in the stop command:
```
[ 4841.936906] TEST-71-HOSTNAME.sh[140]: + stop_hostnamed
[ 4841.936906] TEST-71-HOSTNAME.sh[140]: + systemctl stop systemd-hostnamed.service
[ 4845.959747] TEST-71-HOSTNAME.sh[226]: Job for systemd-hostnamed.service canceled.
[ 4846.013286] systemd[1]: TEST-71-HOSTNAME.service: Main process exited, code=exited, status=1/FAILURE
[ 4846.013792] systemd[1]: TEST-71-HOSTNAME.service: Failed with result 'exit-code'.
[ 4846.021821] systemd[1]: Failed to start TEST-71-HOSTNAME.service - TEST-71-HOSTNAME.
```
This happens when we create the stop job, but while we're waiting for
it to finish, something triggers a start of the unit and we lose to competing
start job.

Hopefully fixes #36089.
2025-07-30 08:25:28 +09:00
Yu Watanabe 0140f26046 login: fix typo 2025-07-30 08:18:46 +09:00
Yu Watanabe 8757987ec2 Use ERRNO_NAME in most places to figure out errno names (#38409) 2025-07-30 07:05:43 +09:00
Yu Watanabe aa9ff03f1e pam_systemd: never reset existing $XDG_RUNTIME_DIR for non-area logins (#38405) 2025-07-30 07:05:03 +09:00
DaanDeMeyer cb372a3ce4 docs: Add policy on AI generated code to contributing doc
Contributors making use of AI should clearly mention so in their
PR descriptions and include the prompt used to generate the pull
request.
2025-07-29 18:40:26 +02:00
Zbigniew Jędrzejewski-Szmek 467ff7929f selinux fixes for varlink (#38404)
- fixes `mac_selinux_unit_access_check_varlink` macro
- more usage of `log_selinux_enforcing_errno()` for consistency
2025-07-29 18:30:37 +02:00
Yu Watanabe b749f77ad0 run: make PTY forwarder honor vhangup() after service finished
Like we already do in machinectl.
2025-07-30 01:15:29 +09:00
Yu Watanabe dce66b0688 ptyfwd,run: make pty_forward_drain() trigger defer event to call shovel()
drained() checks PTYForward.master_readable flag, but it may be
tentatively unset due to a tentative error like EAGAIN in the previous
IO event. Let's try to call shovel() one more time, which re-read the
master and call drained() at the end. Otherwise, we may lost some data.
2025-07-30 01:15:29 +09:00
Yu Watanabe 446431f5c9 ptyfwd: do not try to read master if already disconnected
When PTYForward.done is set, the PTYForward.master is already
disconnected. Let's not try to read the already closed file descriptor.

Also, if we previously received vhangup, then it is not necessary to
re-read the device to check vhangup, as we already know.

This also make the check slightly delayed, and use a defer event source,
to make the function can be called safely in another event source.
2025-07-30 01:15:29 +09:00
Yu Watanabe 7cd26f3560 ptyfwd: replace pty_forward_set_ignore_vhangup() with pty_forward_honor_vhangup()
Currently, pty_forward_set_ignore_vhangup() is only used for disabling
the flag. To make the function also disable PTY_FORWARD_IGNORE_INITIAL_VHANGUP
flag, this renames it to pty_forward_honor_vhangup().

Also, for consistency, pty_forward_get_ignore_vhangup() and
ignore_vhangup() are replaced with pty_forward_vhangup_honored().
2025-07-30 01:14:57 +09:00
Yu Watanabe b823809bca ptyfwd: split-out shovel_force()
No functional change. Preparation for later change.
2025-07-30 01:10:24 +09:00
Yu Watanabe 5ce1c39f2d ptyfwd: do not call pty_forward_done() in do_shovel()
Previously, do_shovel() sometimes call pty_forward_done(), and
its caller shovel() also call pty_forward_done(). Let's move all
pty_forward_done() calls to shovel(), and do_shovel() not call it.

No functional change, just refactoring.
2025-07-30 01:10:24 +09:00
Zbigniew Jędrzejewski-Szmek 9c11175db9 sd-bus: drop unnecessary check
errno_name_no_fallback() (and errno_to_name() before that) already
handle negative errnos properly.
2025-07-29 18:05:54 +02:00
Zbigniew Jędrzejewski-Szmek 858cb6e49e tree-wide: use ERRNO_NAME almost everywhere
We had errno_to_name() which works for "known" errnos, and returns NULL for
unknown ones, and then ERRNO_NAME which always returns an answer, possibly just
a number as a string, but requires a helper buffer.

It is possible for the kernel to add a new errno. We recently learned that some
architectures define custom errno names. Or for some function to unexpectedly
return a bogus errno value. In almost all cases it's better to print that value
rather than "n/a" or "(null)". So let's use ERRNO_NAME is most error handling
code. Noteably, our code wasn't very good in handling the potential NULL, so
in various places we could print "(null)". Since this is supposed to be used
most of the time, let's shorten the names to ERRNO_NAME/errno_name.

There are a few places where we don't want to use the fallback path, in
particular for D-Bus error names or when saving the error name. Let's rename
errno_to_name() to errno_name_no_fallback() to make the distinction clearer.
2025-07-29 18:05:20 +02:00
Ivan Kruglov ce6bdb7969 core: more use of log_selinux_enforcing_errno() in selinux-access.c 2025-07-29 07:22:16 -07:00
Mike Yuan f55219c1aa pam_systemd: never reset existing $XDG_RUNTIME_DIR for non-area logins
Follow-up for cfb7abc7fc

For whatever reason, ly is setting $XDG_RUNTIME_DIR before invoking
PAM session on its own
(https://github.com/fairyglade/ly/blob/v1.1.1/src/auth.zig#L45),
which after the offending commit will potentially be unset again
by pam_systemd. Let's restore the previous behavior if not switching area.

Fixes #38402
2025-07-29 16:20:43 +02:00
Mike Yuan 514885b240 pam_systemd: use update_environment() where appropriate 2025-07-29 16:15:10 +02:00
Ivan Kruglov 98b9f1c519 core: fix mac_selinux_unit_access_check_varlink() macro 2025-07-29 06:36:58 -07:00
Yu Watanabe bbc10f31ae Print location of loader.conf in bootctl status and related updates (#38389) 2025-07-29 22:34:16 +09:00
Zbigniew Jędrzejewski-Szmek 225450d043 Revert "errno-list: fallback to use our errno name table"
This reverts commit c4ffd0a020.

With this change we fully duplicate the functionality in glibc. This patch
was motivated by glibc missing some names, but those are in the process of
being added:
https://sourceware.org/pipermail/libc-alpha/2025-July/169007.html
2025-07-29 15:14:27 +02:00
Zbigniew Jędrzejewski-Szmek b68b9f8f7f docs/ENVIRONMENT: fix typo and adjust grammar 2025-07-29 11:36:21 +02:00
Zbigniew Jędrzejewski-Szmek 509f701ab3 man/systemd-boot: recommend holding space by default
https://github.com/systemd/systemd/pull/15509/files#r2234113960 complains that the
advice is still not clear enough. systemd-boot itself says
  "Menu hidden. Hold down key at bootup to show menu."
so let's do the same and tell users to hold down space as the first option.
This should work fine for 99% of people. Then invert the following advice to
try repeated pressing as the alternative option.

Also, fix the advice about --boot-loader-menu=. The whole para is about getting
the menu to show, so 0 is not a good value.

Follow-up for https://github.com/systemd/systemd/pull/15509.
2025-07-29 11:36:21 +02:00
Zbigniew Jędrzejewski-Szmek 7a800a6656 man/systemd-boot: describe which keys use EFI variables
Some keys have only a transient effect, e.g. 'e', but some have a persistent
effect, e.g. 'd'. This is important informations, but the reader might be
forgiven for not finding that at all obvious when reading the descriptions of
the keys.

Also, mention in loader.conf man page that the settings there might be overriden
by EFI variables. This is another thing that is important but not obvious.
2025-07-29 11:36:21 +02:00
Zbigniew Jędrzejewski-Szmek ec7e81ae3d man/loader.conf: wrap some very wrong lines 2025-07-29 11:36:21 +02:00
Zbigniew Jędrzejewski-Szmek a83de23353 man: fix confusion in loader.conf
For some reason, the man page for loader.conf also mentioned type#1 entries
in passing. Except for using the same file extension, those files are in a
completely different format and with a different purpose. This mixup was
first introduced in f37d383582, was then
reported in #10923, which was closed by cbae79b8d0,
but that didn't fix the actual issue.

Really fixes #10923.

While at it, simplify and improve the wording a bit.
2025-07-29 11:36:21 +02:00
Zbigniew Jędrzejewski-Szmek 57684a2554 bootctl: print location/status of loader.conf
The usual pattern of using colors to distinguish the mount path (/efi/)
and the rest is used. If the file cannot be read for reasons other than
-ENOENT, the error message is highlighted.

I considered a few places where to add this, but this section seems the
most reaosonable. We already print the 'token' there, which is also part of
the configuration.

Boot Loader Entry Locations:
          ESP: /efi (/dev/disk/by-partuuid/31659406-5a17-46ec-8195-0dea1667db58)
       config: /efi//loader/loader.conf
     XBOOTLDR: /boot (/dev/disk/by-partuuid/4f8a8fe9-4b45-4070-9e9b-a681be51c902, $BOOT)
        token: fedora
2025-07-29 11:36:21 +02:00
Luca Boccassi d0cd25fff6 test: add workaround for unexpected VM restart (#38397)
Workarounds for issue #38240.
2025-07-29 09:52:37 +01:00
Yu Watanabe 065941a92c TEST-03-JOBS: modernize test code and extend timeout
- use timeout command more,
- use `(! cmd)` rather than `cmd && exit 1`,
- drop unnecessary `|| exit 1`,
- extend timeout to support slow test environment.

Fixes #38395.
2025-07-29 09:51:02 +01:00
Yu Watanabe 5ad6fe9850 TEST-64-UDEV-STORAGE: clear MD superblock on exit
Workaround for issue #38240.
2025-07-29 14:32:25 +09:00
Yu Watanabe f48068a379 TEST-46-HOMED: remove unnecessary users
Workaround for issue #38240.
2025-07-29 12:29:47 +09:00
Yu Watanabe 454edd9e7a TEST-46-HOMED: modernize test
- use command to check the existence of homectl,
- use timeout for waiting user,
- use 4ch indentation.
2025-07-29 12:27:25 +09:00
Yu Watanabe db1e099a7a ci: add test coverage for secure boot and addons, and shim integration (#38377)
Now that we can enable SB on GHA do it by default in mkosi images with
selfenroll, and add a smoke test.
Also add one CI job that tests the shim integration. This will catch
regressions like https://github.com/systemd/systemd/issues/38349
2025-07-29 12:08:42 +09:00
Yu Watanabe f9b56cf3b6 TEST-04-JOURNAL: add one more missing journalctl --sync
Fixes the following failure:
```
TEST-04-JOURNAL.sh[124]: + add_logs_filtering_override delegated-cgroup-filtering.service 01-discard-hello '~hello'
TEST-04-JOURNAL.sh[124]: + local unit=delegated-cgroup-filtering.service
TEST-04-JOURNAL.sh[124]: + local override_name=01-discard-hello
TEST-04-JOURNAL.sh[124]: + local 'log_filter=~hello'
TEST-04-JOURNAL.sh[124]: + mkdir -p /run/systemd/system/delegated-cgroup-filtering.service.d/
TEST-04-JOURNAL.sh[124]: + echo -ne '[Service]\nLogFilterPatterns=~hello'
TEST-04-JOURNAL.sh[124]: + NEEDS_RELOAD=1
TEST-04-JOURNAL.sh[1408]: ++ run_service_and_fetch_logs delegated-cgroup-filtering.service
TEST-04-JOURNAL.sh[1408]: ++ local unit=delegated-cgroup-filtering.service
TEST-04-JOURNAL.sh[1408]: ++ [[ -n 1 ]]
TEST-04-JOURNAL.sh[1408]: ++ systemctl daemon-reload
TEST-04-JOURNAL.sh[1408]: ++ NEEDS_RELOAD=
TEST-04-JOURNAL.sh[1408]: ++ systemctl start delegated-cgroup-filtering.service
TEST-04-JOURNAL.sh[1408]: ++ journalctl --sync
TEST-04-JOURNAL.sh[1408]: ++ journalctl -q -u delegated-cgroup-filtering.service -I -p notice
TEST-04-JOURNAL.sh[124]: + [[ -z Jul 28 22:41:41 H delegated_cgroup_filtering_payload.sh[1448]: child_process: hello, world!
TEST-04-JOURNAL.sh[124]: Jul 28 22:41:41 H delegated_cgroup_filtering_payload.sh[1448]: child_process: hello, people! ]]
TEST-04-JOURNAL.sh[124]: + at_exit
```
2025-07-29 12:07:36 +09:00
Luca Boccassi 31ae0d088f ci: test integration with shim in debian jobs
Debian provides a signed shim that trusts sdboot and can be
installed without pulling in grub automatically. Install it
in the debian mkosi CI job, and build a custom efivars with
the mkosi cert enrolled in MOK but not DB, to test those
code paths.
2025-07-28 23:27:23 +01:00
Luca Boccassi 285b3d544f basic: follow-ups for CHASE_MUST_BE_DIRECTORY/REGULAR (#38390)
Follow-up for 90b9f7a07e.
2025-07-28 23:16:53 +01:00
Luca Boccassi d48a071f7a Translations update from Fedora Weblate (#38387) 2025-07-28 23:12:54 +01:00
Luca Boccassi 5ae58ac2b9 test: add a secureboot test with an addon 2025-07-28 23:11:04 +01:00
Luca Boccassi 5ba50a7f2c mkosi: enable secure boot and autoenroll by default
With GHA now fixed, just always enable SB so that we get extra
coverage
2025-07-28 23:11:04 +01:00
Luca Boccassi b61bff3436 test: preserve ESP when testing bootctl 2025-07-28 23:11:04 +01:00
Luca Boccassi add7a4a9f2 test: do not fail TEST-70-TPM2 when secure boot is enabled
[  183.037401] TEST-70-TPM2.sh[2876]: + systemd-creds decrypt --name=pcrlock.arch /tmp/fakexbootldr/loader/credentials/pcrlock.arch.cred
[  183.054755] TEST-70-TPM2.sh[3003]: Found container virtualization none.
[  183.083789] TEST-70-TPM2.sh[3003]: Reading EFI variable /sys/firmware/efi/efivars/LoaderTpm2ActivePcrBanks-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f.
[  183.094377] TEST-70-TPM2.sh[3003]: Detected slow EFI variable read access on LoaderTpm2ActivePcrBanks-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f: 55.799ms
[  183.095353] TEST-70-TPM2.sh[3003]: Reading EFI variable /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c.
[  183.099653] TEST-70-TPM2.sh[3003]: Credential uses fixed key for fallback use when TPM2 is absent — but TPM2 is present, and SecureBoot is enabled, refusing.
2025-07-28 23:11:04 +01:00
Luca Boccassi 8631b0f8b9 mkosi: update mkosi commit reference to cb1a3c90490922441548d09b09c7b76426e4bc20
* cb1a3c9049 FirmwareVariables: allow generating during image build
* 6104923534 env: export $EFI_ARCHITECTURE in hook scripts on EFI arches
* fef33f96a2 mkosi-tools: ukify moved to systemd-ukify in openSUSE
* ec4475a846 ensure builds with cache over device boundaries
* 7be5159f24 Change UnifiedKernelImages to enum and accept signed/unsigned
* 071ac4a575 mkosi-vm: install systemd-boot-efi-signed where available
* 1865be628e opensuse: Install OpenSUSE-release if another release package is not installed
* 0381b17819 qemu: Disable hpet for x86 VMs
* 4f63700eb3 mkosi-tools: install systemd-boot-tools for bootctl
* 1230ed333b man: remove duplicate 'the' in FirmwareVariables description
2025-07-28 23:11:04 +01:00
Jesse Guo 1f92fec2e9 po: Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 100.0% (264 of 264 strings)

Co-authored-by: Jesse Guo <jesseguotech@outlook.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/zh_CN/
Translation: systemd/main
2025-07-28 21:33:09 +02:00