Commit Graph

83493 Commits

Author SHA1 Message Date
Luca Boccassi
2b3c02380c NEWS: update register-machine paragraph 2025-09-05 19:31:59 +01:00
Luca Boccassi
65badde82e machine: restrict register-machine action again
Follow-up for adaff8eb35
2025-09-05 19:29:09 +01:00
Anton Tiurin
9709deba91 test: use assertion macroses
An assertion macros helps to debug failing tests as it reports
expression, arguments and errno (if applicable)
2025-09-05 15:14:49 +02:00
Luca Boccassi
e418ba4074 meson: update version numbers for v258~rc4 2025-09-05 11:34:36 +01:00
Luca Boccassi
edf214d186 NEWS: update date 2025-09-05 11:34:07 +01:00
Luca Boccassi
67b10eb76b NEWS: note sd-stub incompatibility with older ukify 2025-09-05 11:33:51 +01:00
Luca Boccassi
28edbbdc1b test: add more debug output
The test occasionally fails with:

TEST-50-DISSECT.sh[3852]: Hierarchy '/usr' is already merged.

I can't really tell what is already merged as all previous ops
look as they are undone from the logs, so add status/list commands
just before the failing operation to hopefully give more info

For https://github.com/systemd/systemd/issues/38282
2025-09-05 12:13:25 +02:00
Daan De Meyer
aa4b1a97dc Update hwdb and contributor list for v258-rc4 (#38828) 2025-09-05 11:19:31 +02:00
Zbigniew Jędrzejewski-Szmek
711b5e805d Revert "terminal-util: explicitly reset cursor"
This reverts commit b177095bfa.

The original issue (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=375275,
https://github.com/systemd/systemd/issues/22168) was about having a block
cursor instead of a box cursor after VM reset, which doesn't seem particularly
urgent. OTOH, the patch causes a minor regression, where the splash screen is
cleared immediately and replaced by a blinking cursor. With the patch, we are
trading one visual issue for another visual issue. The second is probably more
noticeable, since some poeple put in quite a lot of work to have pretty boots
where the firmware splash screen is displayed until the login prompt pops up.
Avoiding a regression is more important than fixing a minor long-standing
issue, so let's revert this.

Fixes https://github.com/systemd/systemd/issues/38752.
2025-09-05 11:18:51 +02:00
Luca Boccassi
7b53fd6215 Clean up redirection ops in tests (#38827) 2025-09-05 09:41:53 +01:00
Zbigniew Jędrzejewski-Szmek
311cc3c78e NEWS: update contributor list 2025-09-05 09:18:19 +02:00
Zbigniew Jędrzejewski-Szmek
438ab26379 hwdb: run "update-hwdb"
As usual, just additions and corrections.
2025-09-05 09:18:06 +02:00
Daan De Meyer
f743084035 nspawn: Drop CAP_NET_BIND_SERVICE if in userns with identity mapping (#38723)
Even if there's no uid shift, we still won't be able to bind to
privileged ports in the host network namespace, so drop the capability
regardless of whether we have a uid shift or not.
2025-09-05 09:08:44 +02:00
Zbigniew Jędrzejewski-Szmek
e1485c0546 tests: drop pointless redirection of stderr from 'command -v'
The whole point of using 'command -v' is that it's a very portable
way to check if an executable exists. It doesn't print an error.
2025-09-05 08:29:52 +02:00
Zbigniew Jędrzejewski-Szmek
51fac9a0bf TEST-75-RESOLVED: drop whitespace after shell redirection ops 2025-09-05 08:29:52 +02:00
Daan De Meyer
cadeaef67c test: Add test for nspawn's handling of cap_net_bind_service 2025-09-05 08:24:39 +02:00
DaanDeMeyer
945e1fd37b nspawn: Drop CAP_NET_BIND_SERVICE if in userns with identity mapping
Even if there's no uid shift, we still won't be able to bind to privileged
ports in the host network namespace, so drop the capability regardless of
whether we have a uid shift or not.
2025-09-05 08:24:39 +02:00
Daan De Meyer
f70754b34f TEST-13-NSPAWN: Fix typo 2025-09-05 08:24:39 +02:00
Daan De Meyer
b21f52b6d1 mkosi: Install libcap-progs in main and minimal image
Let's make sure tools like capsh are available on OpenSUSE images
as well.
2025-09-05 08:24:39 +02:00
Daan De Meyer
a8211e88c7 gpt-auto-generator: Pass verity settings to dissect_loop_device()
The image policy might be configured to enforce verity protection on the
root or usr partitions. Currently, we get around that by ignoring the root
and usr partitions, given that by the time this code runs in the rootfs these
will have already been mounted.

However, we can't actually ignore the root partition, as we will enable
growfs and/or remounting the root partition rw based on the root partition
we find in the image.

Instead, let's just read any roothash= or usrhash= from the kernel command line
and pass in a populated verity settings struct into dissect_loop_device()
instead of NULL. If NULL is passed, any verity partitions in the image are
ignored. If we pass the default verity settings, the wrong verity partitions might
potentially be picked up, so we make sure to pass a fully populated instance. This
should be sufficient to satisfy any configured image policy verity protection checks.

Reverts 6d6538fb3f

Fixes #38788
2025-09-05 07:48:15 +02:00
Mike Yuan
1bc82e0c97 bootctl: make sure install verb also honors implied --graceful
Follow-up for bcc73cafdb
2025-09-05 04:45:33 +09:00
Mike Yuan
ebcb0a07d3 labeler: match src/bootctl/ for sd-boot/bootctl tag
Follow-up for 0b676aab33
2025-09-04 17:32:48 +01:00
val4oss
0c7764f2a7 mkosi conf opensuse: add systemd-journal-remote
* Add the missing package for mkosi opensuse conf, otherwise TEST-04-JOURNAL
  fails with "/usr/lib/systemd/systemd-journal-remote: No such file or
  directory"

Signed-off-by: val4oss <github.widget541@passmail.net>
2025-09-04 17:32:18 +01:00
Zbigniew Jędrzejewski-Szmek
4abf3694dd Several fixlets for Varlink IDL (#38809) 2025-09-04 14:41:29 +02:00
Yu Watanabe
d8af104fb0 ethtool-util: fix setting advertising link modes
Fixes a regression caused by d307410327.

The link_mode_masks flex array in struct ethtool_link_settings contains
three packed arrays, and the length of each array is given by
link_mode_masks_nwords field:
```
        __u32   link_mode_masks[];
        /* layout of link_mode_masks fields:
         * __u32 map_supported[link_mode_masks_nwords];
         * __u32 map_advertising[link_mode_masks_nwords];
         * __u32 map_lp_advertising[link_mode_masks_nwords];
         */
```
Hence, we cannot use the received data as is through the union, but need
to shift the array to make each map accessible through the union.
2025-09-04 12:57:10 +02:00
Yu Watanabe
2985840855 test: re-enable journal checks for varlink-idl and so on
Previously, we have checked journal after TEST-XX-YYYYY.sh, but it was
forgotten when we switched to mkosi.
This re-enable the check but through ExecStartPost=, and drops unnecessary
workarounds for end.service. Then, this drops unnecessary end.service
and testsuite.target.
2025-09-04 19:50:28 +09:00
Yu Watanabe
13852e1914 network: remove unnecessary fd saved in fd-store
Fixes the following warning:
```
[  130.968170] H systemd-networkd[4288]: Restart operation initiated.
[  130.968265] H systemd-networkd[4288]: Serializing...
[  130.968274] H systemd-networkd[4288]: There is nothing to serialize.
(snip)
[  130.978756] H systemd[1]: Stopped systemd-networkd.service.
(snip)
[  130.991407] H systemd[1]: Starting systemd-networkd.service...
(snip)
[  131.077440] H systemd-networkd[4318]: Enumeration completed.
[  131.077471] H systemd-networkd[4318]: Deserializing...
[  131.077491] H systemd-networkd[4318]: Failed to parse json (line=0, column=0): No data available
[  131.077524] H systemd-networkd[4318]: Failed to deserialize the previous invocation, ignoring: No data available
```
2025-09-04 19:50:28 +09:00
Yu Watanabe
df25e4af16 test: do not call GetUserRecord without "service" argument
Otherwise, following debugging log will be saved and the checker for
the varlink-idl log triggers failure:
```
systemd-userwork: processing[3110]: varlink-6-6: Parameters for method
  io.systemd.UserDatabase.GetUserRecord() didn't pass validation on field 'service': No anode
```
2025-09-04 19:50:28 +09:00
Yu Watanabe
2ce397125f core/varlink: do not call io.systemd.oom.ReportManagedOOMCGroups() with empty "cgroups" parameter
Fixes the following varlink IDL validation error:
```
systemd-oomd[1687]: varlink-11-11: Parameters for method io.systemd.oom.ReportManagedOOMCGroups()
  didn't pass validation on field 'cgroups': No anode
```
2025-09-04 19:50:28 +09:00
Yu Watanabe
f36f374447 core/varlink: do not send unrealized cgroups to oomd
Follow-ups for 23ac08115a.

Since the commit, the cgroup path is set only when it is realized.

Fixes the following varlink IDL validation failure:
```
systemd-oomd[1687]: Varlink-IDL: Mandatory field 'path' is null or missing on object, refusing.
```
2025-09-04 19:50:12 +09:00
Yu Watanabe
83cfc45dfb hostname: add missing varlink IDL fields
Follow-up for bc60034f43.
2025-09-04 18:15:33 +09:00
Yu Watanabe
ce631ae3d9 bootctl: add missing varlink IDL entries
Follow-up for f2751d757f.
2025-09-04 18:15:33 +09:00
Yu Watanabe
b10619484d Cleanups for test/units directory (#38807) 2025-09-04 18:11:27 +09:00
Yu Watanabe
2ddeb2adfd install: follow-up for initrd presets (#38790)
Follow up for 4a8c395167.
2025-09-04 18:03:21 +09:00
Daan De Meyer
67573e8b8b repart: add test case for btrfs specific options and MountPoint=, and update man page (#38756)
Closes #38749.
2025-09-04 09:00:09 +02:00
Daan De Meyer
af5dde2097 core/transaction: fix issue in dropping unmergeable jobs (#38776)
Fixes #38765.
2025-09-04 08:57:59 +02:00
Daan De Meyer
41ae31a9ac install: Fall back to system presets if there are no initrd presets
We might be operating with a newer systemctl on an image with older
systemd and thus without an initrd-preset directory. Before
4a8c395167, we would use the system
presets, let's make sure we keep doing that if we're operating on an
image without initrd presets.

Follow up for 4a8c395167.
2025-09-04 08:55:40 +02:00
Daan De Meyer
c8e1e5814f install: Coding style fixlet 2025-09-04 08:42:32 +02:00
Daan De Meyer
fcb90e6f55 core: fix segfault by drop-in config for masked unit (#38810) 2025-09-04 08:41:26 +02:00
Yu Watanabe
c02f570260 TEST-87-AUX-UTILS-VM: rotate journal at one more place
Follow-ups for ab56a96194.

Fixes the following failure:
```
TEST-87-AUX-UTILS-VM.sh[1196]: + systemd-run --user --wait --pipe -M testuser@.host -- coredumpctl
TEST-87-AUX-UTILS-VM.sh[1840]: Running as unit: run-p1840-i1841.service; invocation ID: 325a026377aa4cffb046c5a63a8906ab
TEST-87-AUX-UTILS-VM.sh[1853]: Hint: You are currently not seeing messages from other users and the system.
TEST-87-AUX-UTILS-VM.sh[1853]:       Users in groups 'adm', 'systemd-journal', 'wheel' can see all messages.
TEST-87-AUX-UTILS-VM.sh[1853]:       Pass -q to turn off this notice.
TEST-87-AUX-UTILS-VM.sh[1853]: Journal file /var/log/journal/6835d335b6684b6197bf071ad66f2678/user-4711.journal is truncated, ignoring file.
TEST-87-AUX-UTILS-VM.sh[1853]: No coredumps found.
TEST-87-AUX-UTILS-VM.sh[1840]:           Finished with result: exit-code
TEST-87-AUX-UTILS-VM.sh[1840]: Main processes terminated with: code=exited, status=1/FAILURE
TEST-87-AUX-UTILS-VM.sh[1840]:                Service runtime: 154ms
TEST-87-AUX-UTILS-VM.sh[1840]:              CPU time consumed: 78ms
TEST-87-AUX-UTILS-VM.sh[1840]:                    Memory peak: 21.9M (swap: 0B)
```
2025-09-04 08:39:39 +02:00
Yu Watanabe
642744b492 test: move test units to their own directories
This also add test cases for verifying loopy.service and friends,
which was added by e66047ff62 but never
used in integration tests.
2025-09-04 14:36:46 +09:00
Yu Watanabe
b419e927ee test: add comment about custom autorelabel.service
Salvaged from ead814a0b0.
2025-09-04 11:02:13 +09:00
Yu Watanabe
023de38782 TEST-07-PID1: add test cases for mask/unmask unit
For issue #38802.
2025-09-04 10:58:33 +09:00
Yu Watanabe
2ba0eacc6c core/unit: do not load drop-in configs for masked unit files
Otherwise, ExecXYZ= given by drop-ins may be added to a masked unit,
then commands may be unexpectedly executed. For example, if an ExecStop=
is set in a drop-in for a running unit, then 'systemctl mask --now' for
the unit try to invoke the command specified in ExecStop=.

Fixes #38802.
2025-09-04 10:58:33 +09:00
Ricky Tigg
fe3c1b0de6 po: Translated using Weblate (Finnish)
Currently translated at 100.0% (264 of 264 strings)

Co-authored-by: Ricky Tigg <ricky.tigg@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fi/
Translation: systemd/main
2025-09-04 10:14:52 +09:00
Yu Watanabe
975f27a2b5 repart: fix memleak
Fixes a bug in 1a0541d44c (v256).
2025-09-04 06:52:17 +09:00
Yu Watanabe
5b89cc2a5a test: add test case for issue #38765 2025-09-04 02:05:09 +09:00
Yu Watanabe
811af8d534 core/transaction: first drop unmergable jobs for anchor jobs
As you can see, something spurious happens in the logs below.
```
initrd-switch-root.target: Trying to enqueue job initrd-switch-root.target/start/isolate
systemd-repart.service: Looking at job systemd-repart.service/stop conflicted_by=no
systemd-repart.service: Looking at job systemd-repart.service/start conflicted_by=no
systemd-repart.service: Fixing conflicting jobs systemd-repart.service/stop,systemd-repart.service/start by deleting job systemd-repart.service/stop
initrd-switch-root.target: Fixing conflicting jobs initrd-switch-root.target/stop,initrd-switch-root.target/start by deleting job initrd-switch-root.target/stop
systemd-repart.service: Deleting job systemd-repart.service/start as dependency of job initrd-switch-root.target/stop
```

The two conflicting jobs for systemd-repart.service are initially queued
as the following:
- initrd-switch-root.target has Wants=initrd-root-fs.target, and
  initrd-root-fs.target has Wants=systemd-repart.service (through symlink),
  hence starting initrd-switch-root.target tries to start
  systemd-repart.service,
- systemd-repart.service has Conflicts=initrd-switch-root.target, hence
  starting initrd-switch-root.target tries to stop
  systemd-repart.service.

As similar, interestingly(?) starting initrd-switch-root.target tries to
stop initrd-switch-root.target.

So, now there are at least two pairs of conflicting jobs:
- systemd-repart.service: start vs stop,
- initrd-switch-root.target: start vs stop.

As these jobs are induced by starting initrd-switch-root.target, of course
the most important one is the start job for initrd-switch-root.target.

Previously, as you can see in the logs at the beginning, even if
the start job for initrd-switch-root.target is important, we may first
try to resolve the conflict in systemd-repart.service, and may drop the
stop job for systemd-repart.service even if it is relevant to the start
job of initrd-switch-root.target.

This makes first we solve the pair of conflicting jobs for anchor task.
So the stop job for initrd-switch-root.target is dropped first, and the
induced start job for systemd-repart.service is automatically removed,
thus it is not necessary to solve the conflict in systemd-repart.service
anymore.

This is especially important for services that are enabled both in initrd
and after switching root. If a stop job for one of the service is
unexpectedly dropped during switching root, then the service is not stopped
before switching root, and will never start after that.

Fixes #38765.
2025-09-04 02:04:56 +09:00
Yu Watanabe
a1eb53e934 man/repart.d: mention each field of MountPoint= needs to be quoted when contains colon
Closes #38749.
2025-09-04 01:46:11 +09:00
Yu Watanabe
e34f8128b1 TEST-58-REPART: add test case for btrfs specific options and MountPoint= 2025-09-04 01:45:38 +09:00