]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 months agohwdb: update to main@{2025-08-04} 38477/head
Luca Boccassi [Mon, 4 Aug 2025 16:49:08 +0000 (17:49 +0100)] 
hwdb: update to main@{2025-08-04}

git restore -s origin/main hwdb.d/ test/hwdb.d
git checkout hwdb.d/meson.build

3 months agotest: Fix typing error in integration-test-wrapper.py
Daan De Meyer [Thu, 10 Apr 2025 18:38:49 +0000 (20:38 +0200)] 
test: Fix typing error in integration-test-wrapper.py

(cherry picked from commit beecd4e3446c1159d85e148f12e1a58f6878c4f2)

3 months agojournal-file: let's make journal_file_copy_entry() robust against concurrent writing...
Lennart Poettering [Wed, 4 Jun 2025 15:00:29 +0000 (17:00 +0200)] 
journal-file: let's make journal_file_copy_entry() robust against concurrent writing of the source

As usual, we need to protect ourselves against concurrent modification
of journal files. We a pretty good at that these days when reading
journal files. But journal_file_copy_entry() so far wasn't too good with
that. journal_file_append_data() so far returned EINVAL when you pass
invalid data to it. Since we pass the source data as-is in there, it's
going to fail if the journal source file is slightly invalid due to a
concurrent update.

Hence, we need to validate data gracefully here that we think comes from
a safe place, because actually it doesn't, it's directly copied from an
unsafe journal file.

Hence, let's introduce a clear error code here, and look for it in
journal_file_copy_entry(), and handle it gracefully.

Pretty sure this fixes #33372, but it's a race, so I don't know for
sure. If this remains reproducible we need to look at this again.

Fixes: #33372
(cherry picked from commit 9151a60a4e0c36bcf06463a78ad3e81b9bcbf47c)

3 months agocompress: get rid of a bunch of 'else'
Lennart Poettering [Wed, 4 Jun 2025 15:00:21 +0000 (17:00 +0200)] 
compress: get rid of a bunch of 'else'

(cherry picked from commit e74c1e1cac587fb5832ab46d709913c0f3792ff0)

3 months agojournal: replace a bunch of assert() with friendlier checks
Lennart Poettering [Thu, 5 Jun 2025 20:26:03 +0000 (22:26 +0200)] 
journal: replace a bunch of assert() with friendlier checks

We should not rely that data stored in the journal files remains
entirely untouched at all times. Because we unallocate files, data might
go away any time. Hence, never assert() on any expectations on what the
file contains. Instead, handle it more gracefully as a corruption issue,
and return EBADMSG.

Fixes: #35229 #32436
(cherry picked from commit 5ee8b3edb385b216eb4f3316323ae1287824971a)

3 months agojournal: add 'const' at one more place
Lennart Poettering [Thu, 5 Jun 2025 20:25:33 +0000 (22:25 +0200)] 
journal: add 'const' at one more place

(cherry picked from commit 813facd3ba59865c127ebaf5eb8e8884e7ccb689)

3 months agojournal: determine compression once, not twice
Lennart Poettering [Thu, 5 Jun 2025 20:22:55 +0000 (22:22 +0200)] 
journal: determine compression once, not twice

This is just paranoia: let's determine the compression to use once,
instead of twice, after all te data is in journal files which might be
corrupted any time, and it would be weird if we came to different
results here each time.

(cherry picked from commit b16cb30edd9b008f8d3dcacb6b6abe8009fa5315)

3 months agojournal: use EBADMSG for invalid data in file mmap
Lennart Poettering [Thu, 5 Jun 2025 20:21:16 +0000 (22:21 +0200)] 
journal: use EBADMSG for invalid data in file mmap

We must assume that any data in the mmap can change anytime because the
file is deallocated or similar. Let's strictly use EBADMSG for reporting
invalid file contents though (as opposed to using EINVAL if our own code
passes a wrong parameter somwhere).

(cherry picked from commit 7d52a608438948b523681653550bc2e90ee9dc9b)

3 months agoterminal-util: switch from TCSADRAIN to TCSANOW for all tcsetattr() calls
Lennart Poettering [Wed, 25 Jun 2025 09:49:47 +0000 (11:49 +0200)] 
terminal-util: switch from TCSADRAIN to TCSANOW for all tcsetattr() calls

TCSADRAIN means tcsetattr() will become blocking (waiting for ability to
write out queued bytes), which is problematic, if the referenced TTY is
dead for some reason.

Since all these calls just modify *input* parameters anyway (i.e. mostly
local echo, and canonical mode), forcing out queued output is kinda
pointless anyway, hence just don't do it: leave it in the queue and just
change the flags we want to change.

The tcsetattr(3) man page kinda hints that we want to use TCSANOW here,
because it documents for TCSADRAIN:

"This option should be used when changing parameters that affect
output."

Which one can read so that TCSADRAIN should not be used if it doesn't
affect output, which is the case here.

This probably fixes: #37854

(cherry picked from commit f789b17e87b675acf1638a1801d9b16a377742e0)

3 months agoukify: fix parsing uname version with '+'
Luca Boccassi [Sat, 5 Jul 2025 20:10:01 +0000 (21:10 +0100)] 
ukify: fix parsing uname version with '+'

Debian started using '+' in the kernel uname version, which fails the
regex in ukify. Fix it.

(cherry picked from commit 6cc01c8cc48f4d5408fc43046cc8655170e8694b)

3 months agonetwork/bridge-vlan: allow to configure bridge vlan on stacked bridge master interface
Yu Watanabe [Fri, 11 Jul 2025 03:58:33 +0000 (12:58 +0900)] 
network/bridge-vlan: allow to configure bridge vlan on stacked bridge master interface

Fixes #38157.

(cherry picked from commit 78738adf88ad288a6af37a1998adc749ac6b5f2d)

3 months agojournalctl: track more closely whether we're within --until= range
Mike Yuan [Sat, 12 Jul 2025 16:35:14 +0000 (18:35 +0200)] 
journalctl: track more closely whether we're within --until= range

Follow-up for 81fb5375b3b3bfc22d023d7908ad9eee4b3c1ffb

The offending commit fails to account for the case where
we have fewer lines before --until= than what's specified
in --lines=. Aside from that, if --grep= + --lines=+N are used,
we might also seek forward in the middle of the loop,
breaking the --until= boundary.

Let's turn the logic around then. Context.until_safe will
be set iff we're certain that there's enough to output,
and it gets reset whenever we seek forward.

Fixes #38121
Replaces #38122

(cherry picked from commit f11e882721f81c3379eb0902dad2ffb9d9a72175)

3 months agonetworkctl-config-file: validate args are valid filenames
Mike Yuan [Wed, 23 Jul 2025 08:30:18 +0000 (10:30 +0200)] 
networkctl-config-file: validate args are valid filenames

... as opposed to full paths

Fixes #38288

(cherry picked from commit a6da6c9050e9965c1459efc231f0595c76bb41f0)

3 months agomeson: adjust indentation
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 15:18:35 +0000 (17:18 +0200)] 
meson: adjust indentation

(cherry picked from commit 13bdaad1d4ed665655c115664fb2d74577f2147d)

3 months agomeson: drop explicit custom_target names
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 15:14:50 +0000 (17:14 +0200)] 
meson: drop explicit custom_target names

[1] says:
> Since 0.60.0 the name argument is optional and defaults to the basename of
> the first output
We specify >= 0.62 as the supported version, so drop the duplicate name in all cases
where it is the same as outputs[0], i.e. almost all cases.

[1] https://mesonbuild.com/Reference-manual_functions.html#custom_target

(cherry picked from commit 7d247d3cb875e1778e6cc81dbf255b13092b29e0)

3 months agoman: drop inadvertently added -x, make shellcheck clean
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 13:31:46 +0000 (15:31 +0200)] 
man: drop inadvertently added -x, make shellcheck clean

aecb6eaed7d39d73f296c86a882c644b18b7e634 added -x most likely for debugging,
drop it. Also, adjust quoting to make the generated scripts liked by shellcheck.

(cherry picked from commit e11041d30f7be2ea18b0ea1a95f5f7ab8c4bcae8)

3 months agoman: fix @BUILD_ROOT@ insertion
Yu Watanabe [Tue, 24 Jun 2025 17:31:48 +0000 (02:31 +0900)] 
man: fix @BUILD_ROOT@ insertion

@BUILD_ROOT@ is replaced with the _quoted_ build path. Hence, if
@BUILD_ROOT@ is quoted, the result is doubly quoted, and the script does
not work if the path contains spaces.

Fixes #37953.

(cherry picked from commit aecb6eaed7d39d73f296c86a882c644b18b7e634)

3 months agomkosi: update mkosi commit reference to 655baf24474a6f0732ec1b82a71c2f6fe4eeeb49
Yu Watanabe [Fri, 1 Aug 2025 11:18:41 +0000 (20:18 +0900)] 
mkosi: update mkosi commit reference to 655baf24474a6f0732ec1b82a71c2f6fe4eeeb49

655baf2447 mkosi-initrd: move udev rules files for dm and md
dec7c3e754 mkosi-vm: Drop tpm_tis change
021e3af926 shim: fix log message of installed binary
07c24a7d42 mkosi-initrd/vm: ensure TPM2 core modules are installed in the initrd

(cherry picked from commit 1afcf37a73e16d0a829634307374b65c5bf3e440)

3 months agoCorrect order for implied time & date specifications.
Graham Clinch [Fri, 1 Aug 2025 11:16:08 +0000 (12:16 +0100)] 
Correct order for implied time & date specifications.

The text now reads as:
[if] time specification is omitted, 00:00:00 is implied
[if] date specification is omitted, *-*-* is implied

(cherry picked from commit 9753ab34cdcd4068a0bc0b8e49dedef493fb7f20)

3 months agovirt: Actually use DMI detection on RISC-V as well
Fabian Vogt [Fri, 1 Aug 2025 08:59:09 +0000 (10:59 +0200)] 
virt: Actually use DMI detection on RISC-V as well

When booting Linux with ACPI in QEMU, the device tree is not used and
the DT based detection will not work. DMI values are accurate though
and indicate QEMU.

While detect_vm_dmi_vendor() was enabled for RISC-V in a previous commit,
it missed detect_vm_dmi(), so it was never actually used. Fix that.

Signed-off-by: Fabian Vogt <fvogt@suse.de>
(cherry picked from commit f305c8f4a7d65b758b3392798495a712f6b2c0e3)

3 months agoTEST-13-NSPAWN: wait for a few seconds after markers found
Yu Watanabe [Thu, 31 Jul 2025 23:29:19 +0000 (08:29 +0900)] 
TEST-13-NSPAWN: wait for a few seconds after markers found

Otherwise, the scope that the nspawn container belonging to may be
removed before the grandchild process of the machined exits and it may
be SIGKILLed.
```
[  100.829613] systemd-machined[678]: Successfully forked off '(sd-bindmnt)' as PID 2962.
[  100.833366] systemd-nspawn[2953]: Inner child finished, invoking payload.
[  100.836111] (sd-bindmnt)[2962]: Skipping PR_SET_MM, as we don't have privileges.
[  100.836401] (sd-bindmnt)[2962]: Successfully forked off '(sd-bindmnt-inner)' as PID 2964.
[  100.846498] (sd-bindmnt)[2962]: (sd-bindmnt-inner) terminated by signal KILL.
[  100.848846] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: cgroup is empty
[  100.849303] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: Deactivated successfully.
[  100.849317] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: Changed running -> dead
[  100.849752] systemd[1]: machine-TEST\x2d13\x2dNSPAWN.machinectl\x2dbind.7ye.scope: Consumed 91ms CPU time, 1.3M memory peak.
[  100.850399] systemd-machined[678]: (sd-bindmnt) failed with exit status 1.
[  100.850414] systemd-machined[678]: Child failed.
[  100.854574] systemd-machined[678]: Failed to mount /tmp/marker-varlink on /tmp/marker-varlink in the namespace of machine 'TEST-13-NSPAWN.machinectl-bind.7ye': Protocol error
```

Hopefully fixes #38434.

(cherry picked from commit 7b20a5cbf33f0ec29613e29c69803310e51a3212)

3 months agojournald: add debug logs around offlining/archiving/rotating/varlink operations
Luca Boccassi [Thu, 31 Jul 2025 12:23:59 +0000 (13:23 +0100)] 
journald: add debug logs around offlining/archiving/rotating/varlink operations

It is not easy to understand what happens to a journal file
even with debug logs enabled. Add more dbg messages around operations
started by users to make it possible to follow the flow of operations.

(cherry picked from commit 8cc1748ddcbccbe442761416f012da4d746afd3a)

3 months agotest: run test-journal-append binary with info level logging
Luca Boccassi [Thu, 31 Jul 2025 15:30:09 +0000 (16:30 +0100)] 
test: run test-journal-append binary with info level logging

It is ran thousands of times so the logs are overwhelming otherwise

(cherry picked from commit 090b23e051a14162a2a35ed05fd2059dc7fe34d6)

3 months agoTEST-64-UDEV-STORAGE: add stress tests for creating/removing device node symlinks
Yu Watanabe [Wed, 30 Jul 2025 12:44:04 +0000 (21:44 +0900)] 
TEST-64-UDEV-STORAGE: add stress tests for creating/removing device node symlinks

For issue #37823.

(cherry picked from commit fdb86005755ab0e6764696e1c862ec25bf1bca60)

3 months agoTEST-64-UDEV-STORAGE: several cleanups
Yu Watanabe [Wed, 30 Jul 2025 12:43:06 +0000 (21:43 +0900)] 
TEST-64-UDEV-STORAGE: several cleanups

- drop unused variables,
- adjust number of partitions, interations, and timeout,
- clear partitions on each test case finished,
- check if unnecessary devlinks are removed,
- several coding style cleanups.

(cherry picked from commit 35e4cfa83db1348157f0dd33a3cfc880c369b932)

3 months agoTEST-64-UDEV-STORAGE: several fixlets for check_device_units()
Yu Watanabe [Thu, 31 Jul 2025 18:35:55 +0000 (03:35 +0900)] 
TEST-64-UDEV-STORAGE: several fixlets for check_device_units()

To suppress the following warnings in case check_device_unit() failed e.g.
when the device is already removed:
```
sed: couldn't write 130 items to stdout: Broken pipe
awk: write failure (Broken pipe)
awk: close failed on file "/dev/stdout" (Broken pipe)
```

(cherry picked from commit 453cbbe47b4e268f239f75d7c19f2ddef495bd81)

3 months agoudev/node: check the target device node of devlink on removal
Yu Watanabe [Thu, 31 Jul 2025 17:06:08 +0000 (02:06 +0900)] 
udev/node: check the target device node of devlink on removal

If the removal of the devlink is requested due to this is a 'remove' event,
it is trivial that the devlink will not be owned by this device anymore.
Let's read the devlink and if it points to our device node, then we need
to update the devlink. If it points to another device node, then it is already
owned by another device, hence we should not touch it and keep it as is.

Fixes #37823.

(cherry picked from commit 453e1375d0606a212433e137c7f204279a8ecc35)

3 months agoudev/node: split out link_search_and_update() and reduce indentation
Yu Watanabe [Thu, 31 Jul 2025 11:18:54 +0000 (20:18 +0900)] 
udev/node: split out link_search_and_update() and reduce indentation

No functional change, just refactoring and preparation for later change.

(cherry picked from commit 239c9a2e5fd9cd6d0163886fa8cd667cfd946432)

3 months agoukify: fix hwids section reproducibility
Luca Boccassi [Wed, 30 Jul 2025 23:04:33 +0000 (00:04 +0100)] 
ukify: fix hwids section reproducibility

When there are multiple json files the glob list output is
not stable. Sort it before use.

Follow-up for 0333b9d5892983efc690d444fb8783624a1ef476

(cherry picked from commit 3ddb2ee1721f568c3b9340e2dc78bd5b78bf397c)

3 months agotest: several cleanups for DeferReactivation=
Yu Watanabe [Wed, 30 Jul 2025 00:51:55 +0000 (09:51 +0900)] 
test: several cleanups for DeferReactivation=

- move to TEST-07-PID1, as it is a timer setting,
- rename the timer and service, to emphasize they are for testing
  DeferReactivation=,
- use timeout command to wait for the timer being triggered several times,
- stop the timer when not necessary,
- accept 9 seconds as delta, as there are fluctuations.

Fixes the following failure:
```
TEST-74-AUX-UTILS.sh[422]: + last=
TEST-74-AUX-UTILS.sh[422]: + read -r time
TEST-74-AUX-UTILS.sh[422]: + '[' -n '' ']'
TEST-74-AUX-UTILS.sh[422]: + last=1753779616
TEST-74-AUX-UTILS.sh[422]: + read -r time
TEST-74-AUX-UTILS.sh[422]: + '[' -n 1753779616 ']'
TEST-74-AUX-UTILS.sh[422]: + delta=9
TEST-74-AUX-UTILS.sh[422]: + '[' 9 -lt 10 ']'
TEST-74-AUX-UTILS.sh[422]: + echo 'Timer fired too early: 9 < 10'
```

Fixes #38403.

(cherry picked from commit 922885e0a5b729a3faaba35676b37013f323d309)

3 months agoTEST-71-HOSTNAME: specify job mode for the stop job (#38413)
Zbigniew Jędrzejewski-Szmek [Tue, 29 Jul 2025 23:25:28 +0000 (01:25 +0200)] 
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.

(cherry picked from commit 57fbe401f5ef03af503a10e9c3339d646fb84dd3)

3 months agodocs/ENVIRONMENT: fix typo and adjust grammar
Zbigniew Jędrzejewski-Szmek [Tue, 29 Jul 2025 09:33:29 +0000 (11:33 +0200)] 
docs/ENVIRONMENT: fix typo and adjust grammar

(cherry picked from commit b68b9f8f7f5b7590f4369d24371af7a18a8702a3)

3 months agoman/systemd-boot: recommend holding space by default
Zbigniew Jędrzejewski-Szmek [Mon, 28 Jul 2025 13:14:57 +0000 (15:14 +0200)] 
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.

(cherry picked from commit 509f701ab3b1294e6935561a2d212db48fccd7c5)

3 months agoman/systemd-boot: describe which keys use EFI variables
Zbigniew Jędrzejewski-Szmek [Mon, 28 Jul 2025 12:57:09 +0000 (14:57 +0200)] 
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.

(cherry picked from commit 7a800a66561490d12483053e28c57deae6bedcd4)

3 months agoman/loader.conf: wrap some very wrong lines
Zbigniew Jędrzejewski-Szmek [Mon, 28 Jul 2025 12:38:56 +0000 (14:38 +0200)] 
man/loader.conf: wrap some very wrong lines

(cherry picked from commit ec7e81ae3dfc4f8dedfefea6f6eccef30981c8b1)

3 months agoman: fix confusion in loader.conf
Zbigniew Jędrzejewski-Szmek [Mon, 28 Jul 2025 12:38:39 +0000 (14:38 +0200)] 
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 f37d3835828c45b3a92ed12d9a6a30796c0a4a27, was then
reported in #10923, which was closed by cbae79b8d07327051c1e1f438f7086ab634b93f8,
but that didn't fix the actual issue.

Really fixes #10923.

While at it, simplify and improve the wording a bit.

(cherry picked from commit a83de23353aa9e41d59cf198f1c8fd5d56c1e97b)

3 months agoTEST-03-JOBS: modernize test code and extend timeout
Yu Watanabe [Tue, 29 Jul 2025 02:07:35 +0000 (11:07 +0900)] 
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.

(cherry picked from commit 065941a92c81dde6706215cb3390b90fc06ff2ce)

3 months agoTEST-04-JOURNAL: add one more missing journalctl --sync
Yu Watanabe [Mon, 28 Jul 2025 23:25:23 +0000 (08:25 +0900)] 
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
```

(cherry picked from commit f9b56cf3b6d781f28c4e0c3e55bc5dc0797c312c)

3 months agotest: add a secureboot test with an addon
Luca Boccassi [Sun, 27 Jul 2025 20:23:17 +0000 (21:23 +0100)] 
test: add a secureboot test with an addon

(cherry picked from commit 5ae58ac2b93a4046fbae4e0c825b8cc9d03d10d8)

3 months agomkosi: enable secure boot and autoenroll by default
Luca Boccassi [Sun, 27 Jul 2025 12:17:04 +0000 (13:17 +0100)] 
mkosi: enable secure boot and autoenroll by default

With GHA now fixed, just always enable SB so that we get extra
coverage

(cherry picked from commit 5ba50a7f2c7af482e08fade7eb8cf4e0f130df5c)

3 months agotest: preserve ESP when testing bootctl
Luca Boccassi [Sun, 27 Jul 2025 12:16:23 +0000 (13:16 +0100)] 
test: preserve ESP when testing bootctl

(cherry picked from commit b61bff3436b1f04978983739cf5c1aeb7f618e75)

3 months agotest: do not fail TEST-70-TPM2 when secure boot is enabled
Luca Boccassi [Mon, 28 Jul 2025 00:55:27 +0000 (01:55 +0100)] 
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.

(cherry picked from commit add7a4a9f20467f12d9a791b5907c59e9d223d24)

3 months agomkosi: update mkosi commit reference to cb1a3c90490922441548d09b09c7b76426e4bc20
Luca Boccassi [Mon, 28 Jul 2025 22:10:03 +0000 (23:10 +0100)] 
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

(cherry picked from commit 8631b0f8b9b76e861e68da93bb427c559ed215af)

3 months agoman: correct the number of active unit states
Brett Holman [Mon, 28 Jul 2025 19:14:41 +0000 (13:14 -0600)] 
man: correct the number of active unit states

(cherry picked from commit 04abe03189d90a8fb2de29f2d72a9c81c8014353)

3 months agoefi-api: cast before shift
Yu Watanabe [Mon, 28 Jul 2025 17:00:44 +0000 (02:00 +0900)] 
efi-api: cast before shift

Fixes the following error when running with sanitizers:
```
TEST-87-AUX-UTILS-VM.sh[670]: + bootctl install --make-entry-directory=yes
TEST-87-AUX-UTILS-VM.sh[695]: Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed" to "/boot/EFI/systemd/systemd-bootx64.efi".
TEST-87-AUX-UTILS-VM.sh[695]: Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed" to "/boot/EFI/BOOT/BOOTX64.EFI".
TEST-87-AUX-UTILS-VM.sh[695]: Created "/boot/fedora".
TEST-87-AUX-UTILS-VM.sh[695]: Random seed file /boot/loader/random-seed successfully refreshed (32 bytes).
TEST-87-AUX-UTILS-VM.sh[695]: ../src/shared/efi-api.c:618:38: runtime error: left shift of 243 by 24 places cannot be represented in type 'int'
```

(cherry picked from commit be876c5933a5eb223565e70773746a4b49d49c9f)

3 months agoTEST-23-UNIT-FILE: do not wait indefinitely but set a reasonable timeout
Yu Watanabe [Mon, 28 Jul 2025 13:57:07 +0000 (22:57 +0900)] 
TEST-23-UNIT-FILE: do not wait indefinitely but set a reasonable timeout

Otherwise, the test does not finish until the global timeout is reached.

This is for making the test fail earlier when something spurious happens:
```
[FAILED] Failed to start TEST-23-UNIT-FILE-short-lived.service - Shortlived Unit.
TEST-23-UNIT-FILE.sh[776]: + '[' 0 -eq 0 ']'
TEST-23-UNIT-FILE.sh[776]: + sleep .5
(snip)
58/98 systemd:integration-tests / TEST-23-UNIT-FILE  TIMEOUT  1800.52s  killed by signal 9 SIGKILL
```

(cherry picked from commit e43efecc8f43d4c0b4007630a55e75ab28032beb)

3 months agoTEST-87-AUX-UTILS-VM: make coredumps stored in archived journal file
Yu Watanabe [Mon, 28 Jul 2025 07:40:27 +0000 (16:40 +0900)] 
TEST-87-AUX-UTILS-VM: make coredumps stored in archived journal file

Fixes the following race:
```
TEST-87-AUX-UTILS-VM.sh[839]: + coredumpctl -1
TEST-87-AUX-UTILS-VM.sh[1169]: TIME                        PID UID GID SIG     COREFILE EXE             SIZE
TEST-87-AUX-UTILS-VM.sh[1169]: Sun 2025-07-27 23:22:02 UTC 885   0   0 SIGABRT present  /tmp/test-dump 19.9K
TEST-87-AUX-UTILS-VM.sh[839]: + coredumpctl -n 1
TEST-87-AUX-UTILS-VM.sh[1172]: Journal file /var/log/journal/a8285330872602d1377cbaaf68869946/system.journal is truncated, ignoring file.
TEST-87-AUX-UTILS-VM.sh[1172]: No coredumps found.
```

(cherry picked from commit ab56a96194d102cb4ec279fc4eb181d16c1251ea)

3 months agoTEST-04-JOURNAL: add test case for log filtering through syslog
Yu Watanabe [Sun, 27 Jul 2025 19:52:37 +0000 (04:52 +0900)] 
TEST-04-JOURNAL: add test case for log filtering through syslog

For issue #38361.

(cherry picked from commit e0b5e148352955b0441e2dd134ccab1b8432bd73)

3 months agoTEST-04-JOURNAL: several cleanups
Yu Watanabe [Sun, 27 Jul 2025 15:33:28 +0000 (00:33 +0900)] 
TEST-04-JOURNAL: several cleanups

- move scripts from test/units/ to the test specific units directory,
- drop meaningless true from silent-success.service,
- call journalctl from the same bash invocation of echo.

No functional change, just refactoring and preparation for the next
commit.

(cherry picked from commit b926dda2efab4b25e59291545c4ec24b781beaff)

3 months agoTEST-04-JOURNAL: add more test cases for LogFilterPatterns=
Yu Watanabe [Sat, 26 Jul 2025 22:10:36 +0000 (07:10 +0900)] 
TEST-04-JOURNAL: add more test cases for LogFilterPatterns=

For issue #38361.

(cherry picked from commit 7db7b75ab3b6df43c85039db6f22b2b7f82e1dd7)

3 months agotest: add sync request until all logging about the test unit is done
Lennart Poettering [Tue, 8 Apr 2025 16:35:35 +0000 (18:35 +0200)] 
test: add sync request until all logging about the test unit is done

(cherry picked from commit 80ab0e04d38017fa9db0c4af1bdca8f83e4234e4)

3 months agojournal: check filtering after parsing timestamp, identifier, pid, and so on
Yu Watanabe [Sun, 27 Jul 2025 15:23:21 +0000 (00:23 +0900)] 
journal: check filtering after parsing timestamp, identifier, pid, and so on

Otherwise, filtering regex with '^' does not work.

Fixes a bug in 87a13dabbd81c2e31fd5ac7b81cce61baf23e59c (v253).
Fixes #38361.

(cherry picked from commit c60a16ba8fa2a57af23f7653fd2316c26e06c577)

3 months agotest: skip verification for racy test cases
Yu Watanabe [Sun, 27 Jul 2025 12:42:12 +0000 (21:42 +0900)] 
test: skip verification for racy test cases

FORMAT_LIFETIME() internally calls now(), hence we cannot provide any
reliable verifications for finite lifetime.

(cherry picked from commit 7292d676d0514150572fcc15ac68b26d900b12a7)

3 months agolocale: escape invalid keymap on logging
Yu Watanabe [Sat, 26 Jul 2025 19:04:27 +0000 (04:04 +0900)] 
locale: escape invalid keymap on logging

The keymap string may come from dbus method and may contain invalid
characters.

(cherry picked from commit 0464222aed4bc025c117df9b650d62684274c6fd)

3 months agoTEST-21-DFUZZER: suppress debugging logs from homed, nsresourced, and userdbd
Yu Watanabe [Sat, 26 Jul 2025 14:19:50 +0000 (23:19 +0900)] 
TEST-21-DFUZZER: suppress debugging logs from homed, nsresourced, and userdbd

(cherry picked from commit 69865ca69764ec79f84c27ececb6595d0409ad40)

3 months agoTEST-21-DFUZZER: enable services to be tested
Yu Watanabe [Mon, 16 Jun 2025 18:17:36 +0000 (03:17 +0900)] 
TEST-21-DFUZZER: enable services to be tested

Since e19e17df579823093238edb60470b29a2c5e24a6, timesyncd is disabled by
default, and fuzzing for timesyncd failed.

```
[  754.247451] TEST-21-DFUZZER.sh[658]: Bus: org.freedesktop.timesync1 (system)
[  754.247725] TEST-21-DFUZZER.sh[658]: + systemd-run --pipe --wait -- dfuzzer -b 10000 -n org.freedesktop.timesync1
[  754.282237] TEST-21-DFUZZER.sh[3236]: Running as unit: run-p3236-i3237.service
[  754.348983] TEST-21-DFUZZER.sh[3238]: [SESSION BUS]
[  754.350443] TEST-21-DFUZZER.sh[3238]: Bus not found.
[  754.350705] TEST-21-DFUZZER.sh[3238]: [SYSTEM BUS]
[  754.359249] TEST-21-DFUZZER.sh[3238]: Error while calling method 'GetConnectionUnixProcessID': GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: The connection does not exist
[  754.359520] TEST-21-DFUZZER.sh[3238]: Couldn't get the PID of the tested process
[  754.359764] TEST-21-DFUZZER.sh[3238]: Exit status: 4
[  754.386721] TEST-21-DFUZZER.sh[3236]:           Finished with result: exit-code
[  754.387331] TEST-21-DFUZZER.sh[3236]: Main processes terminated with: code=exited, status=4/NOPERMISSION
[  754.387537] TEST-21-DFUZZER.sh[3236]:                Service runtime: 74ms
[  754.387706] TEST-21-DFUZZER.sh[3236]:              CPU time consumed: 21ms
[  754.389210] TEST-21-DFUZZER.sh[3236]:                    Memory peak: 12.9M (swap: 0B)
```

Also, create dummy interface for networkd and resolved.

Fixes #37834.

(cherry picked from commit 2487f72bdc9c8c718c5ce7c46d9804de03c0f7eb)

3 months agoTEST-21-DFUZZER: first test session bus, then service bus, finally system bus
Yu Watanabe [Thu, 19 Jun 2025 10:01:57 +0000 (19:01 +0900)] 
TEST-21-DFUZZER: first test session bus, then service bus, finally system bus

(cherry picked from commit 5e2b606e4e3939b057395feaadee01ef68b43286)

3 months agoTEST-21-DFUZZER: update the list of destructive methods
Yu Watanabe [Thu, 19 Jun 2025 09:42:03 +0000 (18:42 +0900)] 
TEST-21-DFUZZER: update the list of destructive methods

(cherry picked from commit 951e313b9ace658b7a1d01ee9febaa26f6afe6ea)

3 months agoTEST-64-UDEV-STORAGE: clear MD superblock on exit
Yu Watanabe [Tue, 29 Jul 2025 04:02:25 +0000 (13:02 +0900)] 
TEST-64-UDEV-STORAGE: clear MD superblock on exit

Workaround for issue #38240.

(cherry picked from commit 5ad6fe9850e0ecad7415bfbdd547d07b9b1177c7)

3 months agoTEST-46-HOMED: remove unnecessary users
Yu Watanabe [Tue, 29 Jul 2025 03:29:12 +0000 (12:29 +0900)] 
TEST-46-HOMED: remove unnecessary users

Workaround for issue #38240.

(cherry picked from commit f48068a379caae0c884b1364571f0d3283aeacf1)

3 months agoTEST-46-HOMED: modernize test
Yu Watanabe [Tue, 29 Jul 2025 03:27:18 +0000 (12:27 +0900)] 
TEST-46-HOMED: modernize test

- use command to check the existence of homectl,
- use timeout for waiting user,
- use 4ch indentation.

(cherry picked from commit 454edd9e7a122816b140e30e5824c07e8cd4b5ff)

3 months agoTEST-64-UDEV-STORAGE: wait for partition devices being created before calling udevadm...
Yu Watanabe [Sat, 26 Jul 2025 06:08:21 +0000 (15:08 +0900)] 
TEST-64-UDEV-STORAGE: wait for partition devices being created before calling udevadm trigger

For some reasons, kernel or sfdisk once remove the created partitions
and recreated them. And if 'udevadm trigger' triggers devices currently
being removed, the udevd does not receive the triggered events, and the
command stuck.

```
[   33.150452] TEST-64-UDEV-STORAGE.sh[546]: + sfdisk --wipe=always /dev/md/mdmirpar
[   33.478336] systemd-udevd[442]: md127: Device is queued (SEQNUM=2163, ACTION=change)
[   33.480153] kernel:  md127: p1 p2 p3
[   33.483772] systemd-udevd[442]: md127p1: Device is queued (SEQNUM=2164, ACTION=add)
[   33.483914] systemd-udevd[442]: md127p2: Device is queued (SEQNUM=2165, ACTION=add)
[   33.484999] systemd-udevd[442]: md127p3: Device is queued (SEQNUM=2166, ACTION=add)
[   33.485564] systemd-udevd[442]: md127: Received inotify event of watch handle 164.
[   33.503016] TEST-64-UDEV-STORAGE.sh[546]: + SYSTEMD_LOG_LEVEL=debug
[   33.503016] TEST-64-UDEV-STORAGE.sh[546]: + timeout 30 udevadm trigger --settle --parent-match /dev/md/mdmirpar
[   33.485905] systemd-udevd[442]: Successfully forked off '(udev-synth)' as PID 3208.
[   33.486067] systemd-udevd[442]: md127: Removing watch handle 164.
[   33.489035] systemd-udevd[442]: md127p1: Device is queued (SEQNUM=2167, ACTION=remove)
[   33.489048] systemd-udevd[442]: Received inotify event about removal of watch handle 164.
[   33.489507] systemd-udevd[442]: md127p2: Device is queued (SEQNUM=2168, ACTION=remove)
[   33.496298] systemd-udevd[442]: md127p3: Device is queued (SEQNUM=2169, ACTION=remove)
[   33.500628] systemd-udevd[442]: md127: Device is queued (SEQNUM=2170, ACTION=change)
[   33.502355] systemd-udevd[442]: md127p1: Device is queued (SEQNUM=2171, ACTION=add)
[   33.509371] TEST-64-UDEV-STORAGE.sh[3211]: md127: Triggered device with action 'change'.
[   33.509371] TEST-64-UDEV-STORAGE.sh[3211]: md127p1: Triggered device with action 'change'.
[   33.509371] TEST-64-UDEV-STORAGE.sh[3211]: md127p2: Triggered device with action 'change'.
[   33.512532] systemd-udevd[442]: md127: Device is queued (SEQNUM=2172, ACTION=change, UUID=a0b75692-08ad-428a-859b-9ef8772874d7)
[   33.512666] systemd-udevd[442]: md127p1: Device is queued (SEQNUM=2173, ACTION=change, UUID=4cd75a91-aa5b-4678-878c-0420b6c2e1e9)
[   33.512796] systemd-udevd[442]: md127p2: Device is queued (SEQNUM=2174, ACTION=add)
[   33.512910] systemd-udevd[442]: md127p3: Device is queued (SEQNUM=2175, ACTION=add)
[   33.531834] TEST-64-UDEV-STORAGE.sh[3211]: md127: Got uevent without UUID, ignoring: No such file or directory
[   33.553563] TEST-64-UDEV-STORAGE.sh[3211]: md127p1: Got uevent without UUID, ignoring: No such file or directory
[   33.561262] TEST-64-UDEV-STORAGE.sh[3211]: md127p2: Got uevent without UUID, ignoring: No such file or directory
[   33.562468] TEST-64-UDEV-STORAGE.sh[3211]: md127p2: Got uevent without UUID, ignoring: No such file or directory
[   33.563143] TEST-64-UDEV-STORAGE.sh[3211]: md127p3: Got uevent without UUID, ignoring: No such file or directory
[   33.564174] TEST-64-UDEV-STORAGE.sh[3211]: md127p1: Got uevent without UUID, ignoring: No such file or directory
[   33.567614] TEST-64-UDEV-STORAGE.sh[3211]: md127p3: Got uevent without UUID, ignoring: No such file or directory
[   33.597750] TEST-64-UDEV-STORAGE.sh[3211]: md127: Got uevent without UUID, ignoring: No such file or directory
[   33.623522] TEST-64-UDEV-STORAGE.sh[3211]: md127p1: Got uevent without UUID, ignoring: No such file or directory
[   33.676268] TEST-64-UDEV-STORAGE.sh[3211]: md127p3: Got uevent without UUID, ignoring: No such file or directory
[   33.686088] TEST-64-UDEV-STORAGE.sh[3211]: md127p2: Got uevent without UUID, ignoring: No such file or directory
```

Let's wait for partition devices being actually created, and wait for
all queued events being processed. Then, call 'udevadm trigger'.

(cherry picked from commit 3ea86aa6739717fd84b4f16e1394d15c77f65775)

3 months agoTEST-64-UDEV-STORAGE: enable debug logging and set timeout
Yu Watanabe [Fri, 4 Apr 2025 15:21:16 +0000 (00:21 +0900)] 
TEST-64-UDEV-STORAGE: enable debug logging and set timeout

For debugging the following failure:
```
41/95 systemd:integration-tests / TEST-64-UDEV-STORAGE-mdadm_basic                              TIMEOUT        1800.02s   killed by signal 15 SIGTERM
[   30.902392] TEST-64-UDEV-STORAGE.sh[517]: + sfdisk --wipe=always /dev/md/mdmirpar
[   31.326202] TEST-64-UDEV-STORAGE.sh[517]: + udevadm trigger --settle --parent-match /dev/md/mdmirpar
[  900.971338] kauditd_printk_skb: 10 callbacks suppressed
[  900.971343] audit: type=1130 audit(1743767825.783:146): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  900.974057] audit: type=1131 audit(1743767825.786:147): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-tmpfiles-clean comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Finishing after writing 68494 entries
qemu-kvm: terminating on signal 15 from pid 131949 (/usr/bin/python3)
```

(cherry picked from commit c3c905c6c1391a917919563bd6b05c479dc0fbcb)

3 months agotest: stop firewalld and friends to make them not disturb test-firewall-util
Yu Watanabe [Thu, 24 Jul 2025 20:55:20 +0000 (05:55 +0900)] 
test: stop firewalld and friends to make them not disturb test-firewall-util

Hopefully fixes #35526.

(cherry picked from commit 7bef072ca986f8641881a15bd6ae1659883338f2)

3 months agosysupdate: Prevent unnecessary failure when a transfer Path is not present
Nick Labich [Thu, 24 Jul 2025 19:25:58 +0000 (15:25 -0400)] 
sysupdate: Prevent unnecessary failure when a transfer Path is not present

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

(cherry picked from commit 85e9805903d146f81551cb2c8398fb7f2345a55e)

3 months agoTEST-10-MOUNT: wait for userspace mount options being loaded
Yu Watanabe [Thu, 24 Jul 2025 19:12:10 +0000 (04:12 +0900)] 
TEST-10-MOUNT: wait for userspace mount options being loaded

When a device is mounted with userspace options such as _netdev, even when the mount event source is
triggered, only /proc/self/mountinfo may be updated, and /run/mount/utab may not be updated yet.
Hence, the mount unit may be created/updated without the userspace options. In that case, the mount
event source will be retriggered when /run/mount/utab is updated, and the mount unit will be updated
again with the userspace options. Typically, the window between the two calls is very short, but when
the mount event source is ratelimited after the first event, processing the second event may be delayed
about 1 secound. Hence, here we need to wait for a while.

By adding a debugging logs in mount_setup_unit(), the userspace mount is
not obtained in the first event, and the second event is delayed by the ratelimit.
```
[   20.023086] H TEST-10-MOUNT.sh[446]: + mount -t ext4 -o _netdev /dev/loop1p1 /tmp/deptest
[   20.026255] H kernel: EXT4-fs (loop1p1): mounted filesystem c1fa00ea-2ba8-46b2-9002-2ac997f4cda9 r/w with ordered data mode. Quota mode: none.
[   20.026537] H TEST-10-MOUNT.sh[446]: + timeout 10 bash -c 'until systemctl -q is-active tmp-deptest.mount; do sleep .1; done'
[   20.032293] H systemd[1]: tmp-deptest.mount: mount_setup_unit: proc: yes, netdev: no
[   20.035978] H systemd[1]: Unit blockdev@dev-loop1p1.target has alias blockdev@.target.
[   20.039765] H systemd[1]: tmp-deptest.mount: Changed dead -> mounted
[   20.046598] H systemd[1]: Event source 0x7c73093e05e0 (mount-monitor-dispatch) entered rate limit state.
```

Hopefully fixes #32712.

(cherry picked from commit 3f6e7ac27a4ed431c50577c7983a4043c8d853b0)

3 months agoTEST-10-MOUNT: make cleanup function run on error
Yu Watanabe [Thu, 24 Jul 2025 16:17:44 +0000 (01:17 +0900)] 
TEST-10-MOUNT: make cleanup function run on error

(cherry picked from commit 1edc81aa134ccf68dfe568fba2dda0d668ece59b)

3 months agotest: move testcase_dependencies() to TEST-10-MOUNT
Yu Watanabe [Thu, 24 Jul 2025 15:14:59 +0000 (00:14 +0900)] 
test: move testcase_dependencies() to TEST-10-MOUNT

TEST-60-MOUNT_RATELIMIT is run on nspawn by default, and currently run
on vm only on arch mkosi. Let's move the test case to new TEST-10-MOUNT,
which always run on vm.

(cherry picked from commit 62c3f42debde313f42cafbce52562aa00d9aaed9)

3 months agotest: drop unnecessary line continuation
Yu Watanabe [Fri, 11 Jul 2025 11:24:57 +0000 (20:24 +0900)] 
test: drop unnecessary line continuation

(cherry picked from commit f2e9193fcf12ce384488e79b9adef8b870e1db4c)

3 months agotest: set timeout for udevadm settle/wait/lock
Yu Watanabe [Wed, 2 Apr 2025 16:48:19 +0000 (01:48 +0900)] 
test: set timeout for udevadm settle/wait/lock

Otherwise, if a test in a spurious state, it consumes quite long time.
Let's fail earlier in such case.

This also drops an unnecessary calls of 'udevadm settle' in
testcase_nvme_basic() of TEST-64-UDEV-STORAGE.

(cherry picked from commit 3ff6d023202f040c3405dc7625f7b689c0505305)

3 months agointegration-test: mention TEST_SAVE_JOURNAL in README
Yu Watanabe [Thu, 24 Jul 2025 17:50:06 +0000 (02:50 +0900)] 
integration-test: mention TEST_SAVE_JOURNAL in README

(cherry picked from commit 122779536254469ce55a31139985c7e5be434d79)

3 months agointegration-test: show journalctl command for showing saved journal when TEST_SAVE_JO...
Yu Watanabe [Thu, 24 Jul 2025 17:46:07 +0000 (02:46 +0900)] 
integration-test: show journalctl command for showing saved journal when TEST_SAVE_JOURNAL=1

(cherry picked from commit 82693960784427ad8583e6a7570c2f4834a6d397)

3 months agovmspawn: add machine types for m68k/sparc64 and default to 'none' if unknown
Luca Boccassi [Thu, 24 Jul 2025 13:13:11 +0000 (14:13 +0100)] 
vmspawn: add machine types for m68k/sparc64 and default to 'none' if unknown

Qemu has a 'none' machine that can be used for very basic booting
on weird arches, just default to that unless otherwise specified

(cherry picked from commit c1fb58cc4853319240f40ac3c9bbab49554abd1a)

3 months agoTEST-07-PID1: add test case for #38320
Mike Yuan [Thu, 24 Jul 2025 14:29:41 +0000 (16:29 +0200)] 
TEST-07-PID1: add test case for #38320

(cherry picked from commit c8895f5b0f38f9be2f9b55de48a64efa55fd28fd)

3 months agocore/dbus-manager: validate unit type before calling into service-specific methods
Mike Yuan [Thu, 24 Jul 2025 13:55:29 +0000 (15:55 +0200)] 
core/dbus-manager: validate unit type before calling into service-specific methods

Fixes #38320

(cherry picked from commit 39a8029f4e267f1e7c128c96672f035e62d02ee7)

3 months agocore/dbus-manager: don't ever try to dump fdstore for units not properly loaded
Mike Yuan [Thu, 24 Jul 2025 14:07:28 +0000 (16:07 +0200)] 
core/dbus-manager: don't ever try to dump fdstore for units not properly loaded

(cherry picked from commit 5c94f12fa6399a3d3fa572598d88e07675d64ce5)

3 months agoTEST-04-JOURNAL: use bash to make builtin echo command used
Yu Watanabe [Wed, 23 Jul 2025 18:34:26 +0000 (03:34 +0900)] 
TEST-04-JOURNAL: use bash to make builtin echo command used

When non-builtin echo command is used, then the command may exit before
journald find the source of the stream, and the log filtering may not be
applied.

Hopefully fixes #37143.

(cherry picked from commit 7532bc8718eb1c90fc822c2742bc2439ab6604e9)

3 months agoLICENSES/README: update file paths after moves
Luca Boccassi [Thu, 24 Jul 2025 11:20:26 +0000 (12:20 +0100)] 
LICENSES/README: update file paths after moves

Follow-up for 1a60b97524d8408e5f059b09ae316987c698e671

(cherry picked from commit 486fa5ece69f9cdd4e29c013936251f340c012f5)

3 months agomeson: Detect ELF ABI version for bpf build on ppc64 (#38307)
Cosima Neidahl [Wed, 23 Jul 2025 20:42:13 +0000 (22:42 +0200)] 
meson: Detect ELF ABI version for bpf build on ppc64 (#38307)

On 64-bit POWER, there are multiple versions of the ELF ABI in use.

- little-endian powerpc64 is ELFv2
- big-endian powerpc64 is
  - ELFv2 when using musl
  - either ELFv1 or ELFv2 when using glibc

Previously, the BPF build was hard-coding `-D_CALL_ELF=2`, which is
ELFv2. This makes the build fail on ELFv1, similarly to the original
issue that necessitated the addition of this flag on powerpc64le.

To fix this:

1. Use ELFv1 as the default (when `_CALL_ELF` is not defined, this is
the assumption that should be made about the ABI version).
2. Check if the C compiler has `_CALL_ELF` defined, and if it does,
override the default with that.
That's technically not the *correct* compiler in this situation, but I'm
unsure how to get a compiler object for the BPF one from Meson to do the
`*_define('_CALL_ELF')` checks with, and they *should* both be targeting
the same ABI version anyway.
3. Add the ABI version to the `_CALL_ELF` definition for the BPF
compiler flags.

This makes a BPF-enabled build succeed on powerpc64 w/ ELFv1 glibc.

(cherry picked from commit f9509192512a4c4b9e3915a096333d4b6b297956)

3 months agomeson: prepend sys_root to bpf isystem
James Hilliard [Mon, 21 Jul 2025 19:04:49 +0000 (13:04 -0600)] 
meson: prepend sys_root to bpf isystem

These sort of absolute include paths are generally unsafe when cross compiling.

(cherry picked from commit 28575ac014194d0040e38db3e95edc5fb8b4b96b)

3 months agounits/ssh-access.target: enable StopWhenUnneeded=
Mike Yuan [Sat, 19 Jul 2025 09:11:31 +0000 (11:11 +0200)] 
units/ssh-access.target: enable StopWhenUnneeded=

This combines nicely with the X_SYSTEMD_UNIT_INACTIVE= notification
we send out, to ensure when all sshd units go down the actual
status is always reflected on the target.

(cherry picked from commit 8c7dfa0ff4dc4a8c97b3b764ca642000eb63f35d)

3 months agovarlink-idl: fix type of ProcessId.bootId
Yu Watanabe [Mon, 21 Jul 2025 19:26:07 +0000 (04:26 +0900)] 
varlink-idl: fix type of ProcessId.bootId

Fixes a bug in 0fc530d15709a4b531412fdadf3cfb5d0433b62f (v257).
Fixes #38276.

(cherry picked from commit 0c699debde1f4a3641bbba4ef8541c183153221c)

3 months agoci/build-test: install libarchive-dev
Yu Watanabe [Sun, 20 Jul 2025 00:48:08 +0000 (09:48 +0900)] 
ci/build-test: install libarchive-dev

Previously, the package was not installed, hence the feature was always
disabled in the build test.

(cherry picked from commit 94ad755008a8594832ced751972a54ca305fd2c7)

3 months agosd-dhcp6-lease: fix calculation of t2
Beniamino Galvani [Mon, 21 Jul 2025 12:24:27 +0000 (14:24 +0200)] 
sd-dhcp6-lease: fix calculation of t2

sd_dhcp6_lease_get_t2() was returning t1, and so the client was going directly
to the rebind state skipping the lease renewal.

Reported-by: Jaime Caamano <jcaamano@redhat.com>
Fixes: 394fac52d0e7 ("sd-dhcp6-client: introduce sd_dhcp6_lease_get_t1() and friends")
(cherry picked from commit 8f5eaeb143dd9e58503980ae5f63dd78c463180e)

3 months agobootctl: do not fail when the same file is updated multiple times
Yu Watanabe [Wed, 19 Jun 2024 07:11:23 +0000 (16:11 +0900)] 
bootctl: do not fail when the same file is updated multiple times

In the second or later trial, copy_file_with_version_check() -> version_check()
fails with -ESRCH. Let's ignore the failure.

This also adds missing assertions in update_efi_boot_binaries(), and
drop redundant version check in update_efi_boot_binaries(), as version
will be anyway checked later.

Fixes a regression caused by 929f41c6528fb630753d4e2f588a8eb6c2f6a609.
Fixes #33392.

(cherry picked from commit 7107cfbf4f0bcb377f533f0dbc5b5a5ea41b41c0)

3 months agotest: add test case for issue #38265
Yu Watanabe [Sat, 19 Jul 2025 16:27:10 +0000 (01:27 +0900)] 
test: add test case for issue #38265

(cherry picked from commit b92258eb229f84680b91e744e98d72429710770e)

3 months agosd-event: drop inotify event from buffer when no event source is triggered
Yu Watanabe [Sat, 19 Jul 2025 17:12:00 +0000 (02:12 +0900)] 
sd-event: drop inotify event from buffer when no event source is triggered

Even when we receive an inotify event, there is no relevant event source
exists. In that case, we need to drop the event from the buffer,
otherwise we cannot escape from the loop.

Fixes #38265.

(cherry picked from commit 064b9b2bb3544707171662f548677259c3d6aa7f)

3 months agoreadme: update ubuntu autopkgtest infra support channels
Luca Boccassi [Fri, 18 Jul 2025 11:14:38 +0000 (12:14 +0100)] 
readme: update ubuntu autopkgtest infra support channels

ubuntu is moving away from IRC

(cherry picked from commit 042138fbe711655b7cfa8e3f03edbf18a2bce5c1)

3 months agobasic/socket-util: reserve more space for timeval/timespec messages
Zbigniew Jędrzejewski-Szmek [Thu, 17 Jul 2025 14:35:01 +0000 (16:35 +0200)] 
basic/socket-util: reserve more space for timeval/timespec messages

As reported in https://github.com/systemd/systemd/issues/38222, we get the
buffer size calculation wrong on 32-bit arm. The reporter suggested checking if
__TIMESIZE == 64, but I think it's better to just use the bigger size in all
cases. The code to guesstimate the buffer size was already tweaked a few times
and apparently it's not easy to get it right. Systemd and glibc might be
compiled with different combinations of __TIMESIZE, so the compile-time check
is not super reliable, and by using the bigger size, we don't depend on the
details of how glibc decided whether to duplicate the struct or not. The cost
is negligible, 16 bytes on stack, so let's do the easy and robust thing.

Solution based on the suggestion by UZver24.

While at it, drop the mock struct definitions. They are only used to calculate
the size, but since the types involved are 8-bit values, there are no alignment
issues and we can just calculate the size directly.

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

(cherry picked from commit 0c927c98a7ba58e036a34f705c2a6b366107b6ea)

3 months agoelf2efi: ignore .sframe
Sam James [Wed, 16 Jul 2025 10:05:11 +0000 (11:05 +0100)] 
elf2efi: ignore .sframe

SFrames are a new format for stack unwinding information. Ignore it if
preset as is done for .eh_frame.

(cherry picked from commit e65455feade65c798fd1742220768eba7f81755b)

3 months agotests: avoid apt-get asking for user input
Matteo Croce [Tue, 15 Jul 2025 15:32:00 +0000 (17:32 +0200)] 
tests: avoid apt-get asking for user input

apt needs to be called with `-y` to avoid asking for user input,
and thus blocking the script execution when ran non-interactively.

(cherry picked from commit 2e354ac7da7018fc8df355c4f362ee2ff7765f2a)

3 months agorepart: do not enforce 10M min size for immutable file systems by default
Lennart Poettering [Tue, 15 Jul 2025 12:06:08 +0000 (14:06 +0200)] 
repart: do not enforce 10M min size for immutable file systems by default

(cherry picked from commit f6c81cc80537c207709edd853777c1ba92284bb5)

3 months agomkosi: Disable systemd-timesyncd by default
DaanDeMeyer [Sun, 13 Jul 2025 09:31:35 +0000 (11:31 +0200)] 
mkosi: Disable systemd-timesyncd by default

It causes quite a bit of debug log noise by repeated DNS lookups so
let's disable it by default to avoid log noise.

(cherry picked from commit e19e17df579823093238edb60470b29a2c5e24a6)

3 months agomeson: Fix missing test dependencies
DaanDeMeyer [Mon, 14 Jul 2025 09:54:00 +0000 (11:54 +0200)] 
meson: Fix missing test dependencies

These test would fail when executed directly with meson test before
doing a build because the required dependencies are not declared, let's
fix that.

(cherry picked from commit 140850531877aad2401c7f83e60a3a2eac687883)

3 months agovcs-tag.sh: use more compatible shebang
Linus Heckemann [Mon, 14 Jul 2025 11:01:41 +0000 (13:01 +0200)] 
vcs-tag.sh: use more compatible shebang

(cherry picked from commit 8a7a33ab1eb7f59da827b576368c2df3f8552074)

3 months agoworkflows: Use hyphens in filenames instead of underscores
DaanDeMeyer [Sun, 13 Jul 2025 10:39:38 +0000 (12:39 +0200)] 
workflows: Use hyphens in filenames instead of underscores

(cherry picked from commit 13a86b4d9ffbcf2f1300d35ce622513152078c38)

3 months agoci: re-enable uefi secure boot
Luca Boccassi [Sat, 12 Jul 2025 08:58:17 +0000 (09:58 +0100)] 
ci: re-enable uefi secure boot

Kernel 6.11.0-1018-azure is now in use, which has a workaround
for the HyperV bug, so this should work again in GHA

(cherry picked from commit 375d80b04a95bc460f54df26308ad4adcfce9bc4)

3 months agocore: Fix scope SIGTERM logging
DaanDeMeyer [Sat, 12 Jul 2025 07:40:22 +0000 (09:40 +0200)] 
core: Fix scope SIGTERM logging

KILL_TERMINATE_AND_LOG doesn't do anything at the moment, let's fix
that.

(cherry picked from commit b98d6bff23c61d536cd75435c46c58f1783e5bfd)

3 months agounits: check if kmod command exists
Yu Watanabe [Fri, 11 Jul 2025 15:50:02 +0000 (00:50 +0900)] 
units: check if kmod command exists

We already check existences of quotaon in quotaon@.service and
quotacheck in systemd-quotacheck@.service.
Let's also check if kmod command exists.

Closes #38179.

(cherry picked from commit 7c208a64bab5532235a05755d72aab78675b9ec3)

3 months agouki.conf is used by the ukify tool to create an Unified Kernel Image. It
vlefebvre [Fri, 11 Jul 2025 10:17:46 +0000 (12:17 +0200)] 
uki.conf is used by the ukify tool to create an Unified Kernel Image. It
would make sense to install it only if ukify is wanted.

(cherry picked from commit 96ba43388f253cf94791bc46e1424359f836f2e3)