]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 months agoRevert "resolved: don't wait for TLS close_notify replies unnecessarily"
Luca Boccassi [Mon, 18 Aug 2025 12:38:32 +0000 (13:38 +0100)] 
Revert "resolved: don't wait for TLS close_notify replies unnecessarily"

This change introduced a regression that stops DNSOverTLS from working
after some time. Revert it for now, as there's no fixup available at
the moment.

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

This reverts commit 12a455db368340733ac9a701d9a5864b612d3408.

(cherry picked from commit e9caf17f6312c16762ade266fa2a8acddf3eb763)

2 months agonspawn: fix --link-journal=host with --private-users=pick and friends
Yu Watanabe [Mon, 18 Aug 2025 15:13:48 +0000 (00:13 +0900)] 
nspawn: fix --link-journal=host with --private-users=pick and friends

Fixes #38611.

(cherry picked from commit 88fce090263ba8944cf491346eae2e8022dfd88d)

2 months agotest: fix typo
Yu Watanabe [Tue, 19 Aug 2025 21:30:16 +0000 (06:30 +0900)] 
test: fix typo

(cherry picked from commit 045227426e29e92a5d9b682b399c216a529a0d18)

2 months agotest: also edit /etc/os-release if it's not a symlink when patching /usr/lib/os-relea...
Luca Boccassi [Tue, 19 Aug 2025 11:32:00 +0000 (12:32 +0100)] 
test: also edit /etc/os-release if it's not a symlink when patching /usr/lib/os-release (#38628)

mkosi patches up /etc/os-release to add local IDs and fixup certain
issues, so when tests patch /usr/lib/ on the fly, copy to the version in
/etc/ too to avoid test failures when querying

6370s 10/98 systemd:integration-tests / TEST-07-PID1 FAIL 31.03s exit
status 1
6370s 25/98 systemd:integration-tests / TEST-29-PORTABLE FAIL 12.76s
exit status 1
6370s 33/98 systemd:integration-tests / TEST-43-PRIVATEUSER-UNPRIV FAIL
6.57s exit status 1
6370s 37/98 systemd:integration-tests / TEST-50-DISSECT FAIL 16.97s exit
status 1

This is particularly an issue when running these tests on debian unstable,
where mkosi has to fixup os-release to make it valid and avoid further
breakages:

https://github.com/systemd/mkosi/blob/main/mkosi/distributions/debian.py#L234
(cherry picked from commit b1cd38e893c5a0d353e2112acfc701ed29449c5e)

2 months agoimportd: accept a single space as SHA256SUMS separator
Lennart Poettering [Tue, 19 Aug 2025 07:23:07 +0000 (09:23 +0200)] 
importd: accept a single space as SHA256SUMS separator

The SHA256SUMS files provided by https://images.linuxcontainers.org/
are slightly non-conforming, insted of using " *" or "  " as separator
between hash and file name they use " ". Let's accept that too, in the
interest of maximizing compatibility.

(cherry picked from commit 265386ba35463bf38f309cce7ef0dc78769eb2b3)

2 months agocryptsetup: reference right variable
Lennart Poettering [Mon, 18 Aug 2025 07:30:19 +0000 (09:30 +0200)] 
cryptsetup: reference right variable

Fixes: #38576
(cherry picked from commit b5be05a106a205e845556442b28ff8262ad08e2c)

2 months agodocs: fix typo
Salim B [Sun, 17 Aug 2025 19:37:12 +0000 (21:37 +0200)] 
docs: fix typo

(cherry picked from commit d92990c783e884c56eb8a69cf128a2b332c7357f)

2 months agocore/service: do not reset watchdong when unit is frozen
Yu Watanabe [Sat, 16 Aug 2025 16:00:37 +0000 (01:00 +0900)] 
core/service: do not reset watchdong when unit is frozen

Even watchdog for a service is stopped when freezing the unit is
requested, sd-notify message WATCHDOG=1 or friends may come after
that due to ordering of event priority. In that case,
service_reset_watchdog() is called for frozen unit and thus previously
watchdog was reenabled.

Follow-up for 25178aadb2bd04ef9e63f48c1ef42fb309f9332e.
Fixes #38551 (the second failure case).

(cherry picked from commit 0cf84c9a60eb833252c77ab96ef2d4f094f39dc1)

2 months agotest: fix typo in comment
Luca Boccassi [Sat, 16 Aug 2025 09:53:07 +0000 (10:53 +0100)] 
test: fix typo in comment

(cherry picked from commit 855b6b77e0333ed9217ea01344ee7c1415d3e0b6)

2 months agomkosi: install util-linux-script on F44
Luca Boccassi [Thu, 14 Aug 2025 15:43:38 +0000 (16:43 +0100)] 
mkosi: install util-linux-script on F44

Once F41 is EOL we can just move this to the main list and
stop doing this dance every 6 months

(cherry picked from commit 57aeb4a403bd6897b99f07c6efa9e8618df55731)

2 months agoman: add missing comma
Yu Watanabe [Thu, 14 Aug 2025 14:33:39 +0000 (23:33 +0900)] 
man: add missing comma

(cherry picked from commit 4fd9b83c209b34ada9ba7111123a6eb7acc54868)

2 months agoTEST-72-SYSUPDATE: fix indentation and drop space in blank line
Yu Watanabe [Wed, 13 Aug 2025 14:53:13 +0000 (23:53 +0900)] 
TEST-72-SYSUPDATE: fix indentation and drop space in blank line

(cherry picked from commit 53878b5b3e50539d40d5a5da9da0968e84770bf8)

2 months agoTEST-72-SYSUPDATE: make randomly generated image file not have compression header
Yu Watanabe [Wed, 13 Aug 2025 06:57:15 +0000 (15:57 +0900)] 
TEST-72-SYSUPDATE: make randomly generated image file not have compression header

Otherwise, the generated image may be wrongly detected as compressed,
and importing the image may fail:
```
[   35.194578] TEST-72-SYSUPDATE.sh[411]: + dd if=/dev/urandom of=/var/tmp/test-72-N7uTeO/source/part1-v5.raw bs=4096 count=2048
[   35.236342] TEST-72-SYSUPDATE.sh[1075]: 2048+0 records in
[   35.236342] TEST-72-SYSUPDATE.sh[1075]: 2048+0 records out
[   35.236342] TEST-72-SYSUPDATE.sh[1075]: 8388608 bytes (8.4 MB, 8.0 MiB) copied, 0.0408601 s, 205 MB/s
(snip)
[   35.948634] TEST-72-SYSUPDATE.sh[1085]: \ Acquiring /var/tmp/test-72-N7uTeO/source/part1-v5.raw → /proc/self/fd/3p2...
[   35.952878] TEST-72-SYSUPDATE.sh[1085]: Successfully forked off '(sd-import-raw)' as PID 1089.
[   35.958952] TEST-72-SYSUPDATE.sh[1089]: Importing '/var/tmp/test-72-N7uTeO/source/part1-v5.raw', saving at offset 9437184 in '/dev/loop0'.
[   35.959575] TEST-72-SYSUPDATE.sh[1089]: Failed to decode and write: Input/output error
[   35.959575] TEST-72-SYSUPDATE.sh[1089]: Exiting.
```

Fixes #38524.

(cherry picked from commit 535539222d0636fade66236d4d1603f49a6c7a13)

2 months agoimport: add a debugging log of importing blob
Yu Watanabe [Wed, 13 Aug 2025 06:26:35 +0000 (15:26 +0900)] 
import: add a debugging log of importing blob

This should be helpful for debugging issue #38524.

(cherry picked from commit 2633ed01caa93a7bf909fc2c6ee4af1ff6fb48d4)

2 months agodetect-virt: bare-metal GCE only for x86 and i386
keentux [Wed, 13 Aug 2025 07:52:12 +0000 (09:52 +0200)] 
detect-virt: bare-metal GCE only for x86 and i386

From the previous changes, bare-metal support has been added by using
the `detect_vm_cpuid()` which works only for x86_64 and i386 architecture.
Do not use this change for other architectures to avoid wrong result of
the detect-virt tool.

Follow-up for fb71571d3a4efddeb44f02939304be9007301974.
Fixes #38125.

(cherry picked from commit 3e14d02500cd213a4a364961125c4e39423b51e5)

2 months agobootctl: specify that kernel image commands require a kernel image argument
Antonio Alvarez Feijoo [Wed, 13 Aug 2025 09:15:33 +0000 (11:15 +0200)] 
bootctl: specify that kernel image commands require a kernel image argument

(cherry picked from commit 13358b7ce2bfd2a08e2fe684aa0801a68f81e9ca)

2 months agoTEST-38-FREEZER: use 'systemctl show' to get freezer state
Yu Watanabe [Wed, 13 Aug 2025 03:30:25 +0000 (12:30 +0900)] 
TEST-38-FREEZER: use 'systemctl show' to get freezer state

Also, use timeout command for waiting freezer state applied.

(cherry picked from commit ee76ac1411549dc5517b2c58ff1dc84f01c24183)

2 months agoTEST-38-FREEZER: check if watchdog is not restarted by systemctl daemon-reload or...
Yu Watanabe [Tue, 12 Aug 2025 06:44:02 +0000 (15:44 +0900)] 
TEST-38-FREEZER: check if watchdog is not restarted by systemctl daemon-reload or daemon-reexec

(cherry picked from commit 0e25939a9de04ec3b826757a939294013afd2fa0)

2 months agocore/service: do not start watchdog on frozen unit when service manager is reloaded...
Yu Watanabe [Tue, 12 Aug 2025 06:35:21 +0000 (15:35 +0900)] 
core/service: do not start watchdog on frozen unit when service manager is reloaded or reexecuted

Otherwise, when service manager is reloaded or reexecuted, watchdong
will be started for frozen services, and they may be killed after
timeout.

Fixes #38551.

(cherry picked from commit c70816fd09a0e37732f48f204be282fda09918cf)

2 months agotest-cgroup: cleanup test cgroup
Luca Boccassi [Tue, 12 Aug 2025 22:59:15 +0000 (23:59 +0100)] 
test-cgroup: cleanup test cgroup

One test cgroup gets left behind by the test, as it moves itself
into it. Move itself and back to the original cgroup at the end
and clean up.

This fixes a failure when running the test first as root, and then
as unprivileged (initial cleanup fails as the leftover test cgroup
is owned by root).

(cherry picked from commit 998bb9600e3e3d5f2db93508a69657e197e7f5b7)

2 months agoCI: run ruff format before ruff check
Luca Boccassi [Tue, 12 Aug 2025 22:40:11 +0000 (23:40 +0100)] 
CI: run ruff format before ruff check

Otherwise you get a failure but no hint on how to fix it

(cherry picked from commit e1311b10f808bd3a9897cd744e0823bbe1e65fc7)

2 months agotpm2-util: copy serialized result in tpm2_serialize()
Yu Watanabe [Fri, 8 Aug 2025 02:27:21 +0000 (11:27 +0900)] 
tpm2-util: copy serialized result in tpm2_serialize()

For safety, though typically Esys_Free() is just a simple wrapper of
free(), but let's do unconditionally. See the comment in the code.

While at it, this makes it store the result into struct iovec.

(cherry picked from commit 48d06b99e6a048d5adc90851cceef89621b8b517)

2 months agotpm2-util: gracefully skip deserialization when no input
Yu Watanabe [Fri, 8 Aug 2025 02:07:30 +0000 (11:07 +0900)] 
tpm2-util: gracefully skip deserialization when no input

While at it, this also makes tpm2_deserialize() take struct iovec.

Fixes #38507.

(cherry picked from commit 8d40f3f42e04bf45d337e9b03d0750f3f34b92bb)

2 months agopcrlock: make-policy should use path specified by --policy= rather than --pcrlock
Yu Watanabe [Fri, 8 Aug 2025 04:09:14 +0000 (13:09 +0900)] 
pcrlock: make-policy should use path specified by --policy= rather than --pcrlock

Follow-up for a43427013949c6593629f551cf46e9cf9c167100.
Fixes #38506.

(cherry picked from commit 59c26be53c1181af3856cd16aad72a4524b17507)

2 months agoinclude: update kernel headers from v6.17-rc2
Luca Boccassi [Tue, 2 Sep 2025 20:46:34 +0000 (21:46 +0100)] 
include: update kernel headers from v6.17-rc2

2 months agotest: add coverage for kernel keyring in TEST-50-DISSECT
Luca Boccassi [Fri, 8 Aug 2025 21:59:45 +0000 (22:59 +0100)] 
test: add coverage for kernel keyring in TEST-50-DISSECT

Use the kernel keyring to verify images in the dissect test.
The userspace keyring is still covered by the DDI and mountfsd tests.

(cherry picked from commit 208ba34a43c5372131406329bccf026abef026ed)

2 months agoman: fix links
Zbigniew Jędrzejewski-Szmek [Sun, 10 Aug 2025 11:38:44 +0000 (13:38 +0200)] 
man: fix links

Found using linkchecker.
For virtiofsd, the man page is maintained upstream, but doesn't seem to be
available in any of the usual places. So let's link to the Debian version.
systemd.filter I have no idea what it is.

(cherry picked from commit f8976ad3c16d74967ef29b011d1d50e8d55fbc3e)

2 months agoservice: stop/reset watchdog on freeze/thaw
Luca Boccassi [Fri, 8 Aug 2025 19:08:20 +0000 (20:08 +0100)] 
service: stop/reset watchdog on freeze/thaw

Otherwise the unit will be killed by the watchdog given it's frozen
but the clock keeps ticking

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

(cherry picked from commit 25178aadb2bd04ef9e63f48c1ef42fb309f9332e)

2 months agoci: add mkosi job for debian stable
Luca Boccassi [Sat, 9 Aug 2025 14:09:35 +0000 (15:09 +0100)] 
ci: add mkosi job for debian stable

Debian 13 has just been released and can build and run everything,
so add CI coverage for it

(cherry picked from commit 5ecd16be685e2634fa00db76f146d0df20898888)

2 months agoman: add sd-path page
Zbigniew Jędrzejewski-Szmek [Sun, 10 Aug 2025 11:20:01 +0000 (13:20 +0200)] 
man: add sd-path page

We have similar pages for other parts of libsystemd too.

(cherry picked from commit ee1ded6cd6a7247e9ec64f2220af05325bcf3b33)

2 months agonetwork/bridge-vlan: fix segfault
Yu Watanabe [Fri, 8 Aug 2025 10:39:28 +0000 (19:39 +0900)] 
network/bridge-vlan: fix segfault

Fixes a bug introduced by 78738adf88ad288a6af37a1998adc749ac6b5f2d.
Fixes #38515.

(cherry picked from commit 570210eb281f33e4c013cfdabc142838691aaa9f)

2 months agomkosi: include ip in the main image
Franck Bui [Thu, 7 Aug 2025 12:57:32 +0000 (14:57 +0200)] 
mkosi: include ip in the main image

It's needed by TEST-85-NETWORK.

(cherry picked from commit 1f05d6a0de324ba574fa644ed6993b307e98be81)

2 months agologging: Improve logging messages related to NFTSet.
Kevin P. Fleming [Wed, 6 Aug 2025 21:33:31 +0000 (17:33 -0400)] 
logging: Improve logging messages related to NFTSet.

The 'NFTSet' directive in various units adds and removes entries in nftables
sets, it does not add or remove entire sets. The logging messages should
indicate that an entry was added or removed, not that a set was added or
removed.

(cherry picked from commit 2fe2ee9adb18347efc0f6856830b63ba0aa874a2)

2 months agotest: use Europe/Helsinki instead of Europe/Kyiv in test-calendarspec
Luca Boccassi [Wed, 6 Aug 2025 13:33:10 +0000 (14:33 +0100)] 
test: use Europe/Helsinki instead of Europe/Kyiv in test-calendarspec

Europe/Kyiv was added somewhat recently. Use Europe/Helsinki which is
much older and thus works with older tzdata like version 2022a.

line 193: "2016-03-27 03:17:00" new_tz=:Europe/Kyiv
At: Sun 2016-03-27 03:17:00.000000 Europe
Assertion 'r == -ENOENT' failed at src/test/test-calendarspec.c:70, function _test_next(). Aborting.

Follow-up for aa077884c13769ae3bd6aa98978b4ac9e64b5365

(cherry picked from commit f391d6c9ba1277a2d148f30db18fc615763a834d)

2 months agoci: add build job on Ubuntu Jammy with Python 3.7
Luca Boccassi [Wed, 6 Aug 2025 11:42:35 +0000 (12:42 +0100)] 
ci: add build job on Ubuntu Jammy with Python 3.7

In order to avoid regressions with glibc < 2.39 and Python 3.7

(cherry picked from commit 4f49a6f572043dbc3a302302464fad5ffbd40e01)

2 months agotest: fix repeated runs of test-oomd-util by clearing test cgroup
Luca Boccassi [Wed, 6 Aug 2025 13:07:26 +0000 (14:07 +0100)] 
test: fix repeated runs of test-oomd-util by clearing test cgroup

If the test is ran multiple times in a row, without an ephemeral
scope (eg: non-booted nspawn), then subsequent runs will fail as
the test cgroup is not cleared so the previous xattrs are still
present. Trim the test cgroup before and after the test.

Follow-up for 61ff7397d08375ce0950fb7b546c08e4a657f273

(cherry picked from commit 0d333ed8e302e48efdfc26cb4c8e467a4863f460)

2 months agonetwork: fix build with libbpf < 0.7
Luca Boccassi [Wed, 6 Aug 2025 11:58:20 +0000 (12:58 +0100)] 
network: fix build with libbpf < 0.7

bpf_loop() and bpf_strncmp(), used by sysctl-monitor, were introduced
in libbpf 0.7, so skip the module if using an older version

Follow-up for 6d9ef22acdeac4b429efb75164341233955484af

(cherry picked from commit 7108a882b34789be203cc6a9a3f7722f1929f21f)

2 months agoukify: fix insertion of padding in merged sections
Zbigniew Jędrzejewski-Szmek [Tue, 19 Aug 2025 09:02:44 +0000 (11:02 +0200)] 
ukify: fix insertion of padding in merged sections

The padding was done to expand the new section contents to the expected size of
the new section. And this then would be used for the content in the existing
section. The new section cannot be larger than the old section, but it can be
smaller. If the new section was smaller, then we'd not write enough padding and
the output file would be corrupted.

This was observed in CI when the .sbat section in the stub was padded to 1k.
The UKI with an .sbat section that was merged and was fairly short would hit
this scenario and be corrupted.

(cherry picked from commit ec1d031f3de02f84beca89e2b402d085fba62be4)

3 months agomeson: bump version to 257.8 v257.8
Luca Boccassi [Tue, 5 Aug 2025 15:31:37 +0000 (16:31 +0100)] 
meson: bump version to 257.8

3 months agounits: Order systemd-oomd after systemd-sysusers
Daan De Meyer [Sat, 21 Dec 2024 16:01:27 +0000 (17:01 +0100)] 
units: Order systemd-oomd after systemd-sysusers

systemd-sysusers might create the systemd-oom system user that
systemd-oomd runs under so let's order systemd-oomd after
systemd-sysusers.

(cherry picked from commit 36dd4296806b5541eb67cd13c535eb0fe3213121)

3 months agoTEST-74-AUX-UTILS: fail earlier when systemd-run fail to reconnect to bus
Yu Watanabe [Mon, 10 Mar 2025 19:27:18 +0000 (04:27 +0900)] 
TEST-74-AUX-UTILS: fail earlier when systemd-run fail to reconnect to bus

Note, the default timeout for systemctl daemon-reload is 270 seconds.
Hence, 300 seconds should be enough.

(cherry picked from commit 07355061db88d95b81cfdc3510eb57a0940daac1)

3 months agoTEST-23-UNIT-FILE: skip verifying masked unit
Yu Watanabe [Mon, 10 Mar 2025 19:21:11 +0000 (04:21 +0900)] 
TEST-23-UNIT-FILE: skip verifying masked unit

This fixes the following failure:
TEST-23-UNIT-FILE.sh[2408]: + systemd-analyze --recursive-errors=no --man=no verify /usr/lib/systemd/system/sysinit.target.wants/systemd-hwdb-update.service
systemd-analyze[2737]: sys-kernel-config.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: proc-sys-fs-binfmt_misc.automount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: dev-hugepages.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: sys-kernel-tracing.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: sys-kernel-debug.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: sys-fs-fuse-connections.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: dev-mqueue.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: Unit systemd-hwdb-update.service is masked.
TEST-23-UNIT-FILE.sh[166]: + :
TEST-23-UNIT-FILE.sh[166]: + kill -0 2408
TEST-23-UNIT-FILE.sh[166]: + wait 2408
TEST-23-UNIT-FILE.sh[166]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE.verify-unit-files.sh failed'
TEST-23-UNIT-FILE.sh[166]: Subtest /usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE.verify-unit-files.sh failed

(cherry picked from commit e5e7cc9a98155b031d9855527da08ac87617f427)

3 months agoTEST-64-UDEV-STORAGE: mdadm --zero-superblock seems to not support symlink
Yu Watanabe [Mon, 4 Aug 2025 18:48:55 +0000 (03:48 +0900)] 
TEST-64-UDEV-STORAGE: mdadm --zero-superblock seems to not support symlink

On CentOS 9:
```
TEST-64-UDEV-STORAGE.sh[522]: + mdadm -v --zero-superblock --force /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadmlvm0 ...
TEST-64-UDEV-STORAGE.sh[1014]: mdadm: Unrecognised md component device - /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadmlvm4
```

This also adds `udevadm settle` before clearing superblocks for safety.

Follow-up for 5ad6fe9850e0ecad7415bfbdd547d07b9b1177c7.

(cherry picked from commit 3d4977a12b0ed298c02fb3b757961de3229ce025)

3 months agoudev/spawn: continue to read stdout even if the result buffer is full
Yu Watanabe [Mon, 4 Aug 2025 17:44:18 +0000 (02:44 +0900)] 
udev/spawn: continue to read stdout even if the result buffer is full

Previously, when the stdout of a spawned process (e.g. dmi_memory_id) is
truncated, the event source was not re-enabled, that will cause the process
to remain in a write-blocked state if the stdout buffer is full, and the
process will time out:
```
Spawned process 'dmi_memory_id' [1116] timed out after 2min 59s, killing.
Process 'dmi_memory_id' terminated by signal KILL.
```

The solution is to continue enabling the event source so that on_spawn_io()
can continue reading the stdout buffer. When the result buffer is full, the
local `buf` variable will be used to drain remaining stdout.

Co-authored-by: Deli Zhang <deli.zhang@cloud.com>
(cherry picked from commit 406d8cb029db9801585e6779e9cefc29bf4b79e4)

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)