Commit Graph

82945 Commits

Author SHA1 Message Date
Yu Watanabe
ff4c911ffd analyze: merge if branches on debugger
No functional changes, just refactoring.
2025-07-18 01:39:51 +09:00
Yu Watanabe
3bfc3414e6 analyze: fix memleak and missing oom check
Follow-up for ad6e02e7b4.
2025-07-18 01:39:51 +09:00
Yu Watanabe
33502785de analyze-unit-shell: drop unnecessary error check
execl() and friends will not return on success.

Follow-up for 9a08000d18.
2025-07-18 01:39:51 +09:00
Yu Watanabe
6e7bb4d3e3 analyze: add missing full stop in the log message
Follow-up for 9a08000d18 and
ad6e02e7b4.
2025-07-18 01:39:51 +09:00
Matteo Croce
9b31b3d5ee test: add basic test for timer serialization
Set an OnCalendar= timer before the downgrade, then test for its
validity after the downgrade and the upgrade.
2025-07-17 17:22:32 +01:00
ZIHCO
ad6e02e7b4 systemd-analyze: added the verb unit-gdb to spawn and attach gdb 2025-07-17 15:09:58 +01:00
Luca Boccassi
6235121abf netdev-util: allow setting local address based on dhcp-pd addresses as well (#38211)
This extends the functionality introduced in #21648 to allow using
addresses chosen from a delegated prefix as well as the existing
SLAAC/LL/DHCP functionality.
2025-07-17 14:14:49 +01:00
Linus Heckemann
94e5d8b0e0 netdev-util: allow finding addresses from dhcp-pd 2025-07-16 16:17:19 +02:00
Sam James
e65455fead elf2efi: ignore .sframe
SFrames are a new format for stack unwinding information. Ignore it if
preset as is done for .eh_frame.
2025-07-16 14:57:30 +02:00
Antonio Alvarez Feijoo
600bbac35f systemctl: remove unnecessary assignment 2025-07-16 21:03:10 +09:00
Yu Watanabe
8013beb4a2 Revert "test: skip one test case when running on coverage"
This reverts commit 2cc6c651ee.

The issue was fixed by b955051244.

Closes #38163.
2025-07-16 10:50:36 +01:00
Mike Yuan
f11e882721 journalctl: track more closely whether we're within --until= range
Follow-up for 81fb5375b3

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
2025-07-16 17:01:25 +09:00
Yu Watanabe
6e6c3b8d21 NEWS: fix typo
Follow-up for 644b6041d4.
2025-07-16 10:38:07 +09:00
Matteo Croce
2e354ac7da 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.
2025-07-16 02:05:41 +01:00
DaanDeMeyer
1a324fb05c vmspawn: Drop unused arg_settings_mask 2025-07-16 09:13:54 +09:00
Yu Watanabe
ee7ed2f067 fsck,quotacheck: add credentials support and drop support of /forcefsck and friends (#38197) 2025-07-16 08:29:20 +09:00
Yu Watanabe
c0c8f918bb test-network: stop varlink.socket before stopping networkd.service
To avoid the following warnings:
```
systemd-networkd-tests.py[3139]: Stopping 'systemd-networkd.service', but its triggering units are still active:
systemd-networkd-tests.py[3139]: systemd-networkd-varlink.socket
```

Follow-up for b0ea79c5b5.
2025-07-16 08:28:23 +09:00
Yu Watanabe
48bc6f47ea mkosi: update debian commit reference to 61144ff7a6747bd3cc6340fbac38a8e15e9a239b
* 61144ff7a6 Install new quota manpages for upstream build
* a50c51d8c8 systemd-boot: fix initramfs post-update hook for uncompressed kernels
2025-07-16 05:50:01 +09:00
Yu Watanabe
d48387623b mkosi: patch filelists by opensuse 2025-07-16 05:49:34 +09:00
Yu Watanabe
644b6041d4 NEWS: mention changes in systemd-fsck and systemd-quotacheck 2025-07-16 05:47:38 +09:00
Yu Watanabe
dba4fe9a60 quotacheck: add quotacheck.mode credential support 2025-07-16 05:47:38 +09:00
Yu Watanabe
d73691c64e quotacheck: introduce string table for quota check mode
No functional change, just refactoring.
2025-07-16 05:47:38 +09:00
Yu Watanabe
e5a017becf quotacheck: drop unnecessary use of global variable 2025-07-16 05:47:38 +09:00
Yu Watanabe
59a6ae4e16 man: fix service names 2025-07-16 05:47:38 +09:00
Yu Watanabe
fff4dcc6de man: fix reference to systemd-quotacheck@.service
Also this makes the man page mentions systemd-quotacheck-root.service.
2025-07-16 05:47:38 +09:00
Yu Watanabe
059afcadfd fsck: add fsck.mode and fsck.repair credentials support
Maybe useful when kernel command line is hard to change, e.g. when UKI
is used.
2025-07-16 05:47:38 +09:00
Yu Watanabe
a85428b1d3 fsck: introduce string tables for fsck.mode= and fsck.repair=
No functional change, just refactoring and preparation for later change.
2025-07-16 05:47:38 +09:00
Yu Watanabe
d3445ec416 fsck,quotacheck: drop support for traditional /forcefsck, /fastboot, and /forcequotacheck files
Instead, please use the kernel command line options with the same name.

I am not sure these files are System V complieant or not, but at least
they are very traditional way to control fsck or quotacheck.
However, the concept of the files are really broken, especially for
fsck. As when we want to fsck the root filesystem, we need to access the
filessystem, but it may be broken...

Let's drop such traditional ways to control fsck and quotacheck.
We already support kernel command line options to control the behaviors.
Maybe, also it is better to provide ways to control them by credentials.
2025-07-16 05:47:38 +09:00
Yu Watanabe
14ce99aefc Add build/unit-tests CI jobs for s390x (#38232) 2025-07-16 05:30:35 +09:00
Yu Watanabe
319fe95fa3 btrfs: use unpriv subvol info ioctl (#38230)
Let's stop doing privileged low-level ioctls, if we also can get
unprivileged high-level ioctls for the same.
2025-07-16 05:24:28 +09:00
Zbigniew Jędrzejewski-Szmek
cf71be0a9e resolvectl: use pager for help output 2025-07-15 20:31:58 +01:00
Lennart Poettering
4b27025223 discover-image: pick up subvol ctime, too
The btrfs subvol ctime is conceptually what we call the images "mtime",
hence expose it like that, since we get it anyway these days.
2025-07-15 17:24:18 +02:00
Lennart Poettering
95e63822c2 btrfs-util: use BTRFS_IOC_GET_SUBVOL_INFO ioctl()
Since kernel 4.18 BTRFS_IOC_GET_SUBVOL_INFO exists to query subvolume
metadata without privs. This is much better than the manual approach
with finding objects in the fs tree (which is priv). Let's use it, and
drop the old code (since 4.18 is older than our baseline).
2025-07-15 17:24:18 +02:00
Luca Boccassi
4a095d9df6 ci: add build/unit-tests jobs for s390x 2025-07-15 16:18:48 +01:00
Luca Boccassi
b735d01c8a test: skip tpm2 test on s390x on GHA
The test reliably fails on s390x but only on the GHA worker,
on a native s390x VM it works. Skip it for now.
2025-07-15 16:17:34 +01:00
Lennart Poettering
f6c81cc805 repart: do not enforce 10M min size for immutable file systems by default 2025-07-15 22:58:27 +09:00
Li Tian
9e3c496bd3 90-uki-copy.install: Skip removing UKI related when BOOT_ENTRY_TYPE=type1
Commit b6d4997683
("Add --entry-type=type1|type2 option to kernel-install.")

Skip removing UKI related contents when BOOT_ENTRY_TYPE=type1

Signed-off-by: Li Tian <litian@redhat.com>
2025-07-15 22:56:33 +09:00
Lennart Poettering
987d283aca machined mini tweaks (#38226) 2025-07-15 14:33:44 +02:00
DaanDeMeyer
dbbbdde266 nspawn: Generalize parse_bind_user_shell()
Preparation for reuse in vmspawn.
2025-07-15 14:22:52 +02:00
Lennart Poettering
d32ca63318 machined: use RET_GATHER() more 2025-07-15 13:09:08 +02:00
Lennart Poettering
4baede011d machined: align string table 2025-07-15 12:49:08 +02:00
Lennart Poettering
0fa8b51962 tree-wide: the env var is called $XDG_RUNTIME_DIR, not $XDG_RUNTIME_DIRECTORY 2025-07-15 12:49:08 +02:00
Luca Boccassi
5b94f463f0 shell-completion: prettify and discard error messages (#38210)
followup of #38182
2025-07-15 09:30:30 +01:00
Luca Boccassi
7ebbe57ece Kill several SysV compat functionalities (v258) (#38178) 2025-07-15 01:21:13 +01:00
Luca Boccassi
9ae2dbf7f4 Two fixlets for coverage test (#38183) 2025-07-14 21:16:36 +01:00
Luca Boccassi
6eab4cd44c boot: add LoaderTpm2ActivePcrBanks runtime variable
It turns out checking sysfs is not 100% reliable to figure out whether
the firmware had TPM2 support enabled or not. For example with EDK2 arm64, the
default upstream build config bundles TPM2 support with SecureBoot support,
so if the latter is disabled, TPM2 is also unavailable. But still, the ACPI
TPM2 table is created just as if it was enabled. So /sys/firmware/acpi/tables/TPM2
exists and looks correct, but there are no measurements, neither the firmware
nor the loader/stub can do them, and /sys/kernel/security/tpm0/binary_bios_measurements
does not exist.

The loader can use the apposite UEFI protocol to check, which is a more
definitive answer. Given userspace can also make use of this information, export
the bitmask with the list of active banks as-is. If it's not 0, then we can be
sure a working TPM2 was available in EFI mode.

Partially fixes https://github.com/systemd/systemd/issues/38071
2025-07-14 20:56:22 +01:00
Daan De Meyer
9120022587 vmspawn: Run auxiliary daemons inside scope instead of separate service (#38047)
Currently, vmspawn is in this really weird state where vmspawn itself
and qemu will inherit the caller's execution environment but the
auxiliary
daemons it spawn will run in a fully pristine environment in the service
manager. In practice, this causes issues as checks for whether auxiliary
daemons are installed happen in the caller's execution environment but
they
might not exist in the spawned service's execution environment.

A good example of where this causes issues is trying to use
systemd-vmspawn
in our CI. We use mkosi in CI to run systemd-vmspawn in a custom
userspace
with all the necessary tools available, but systemd-vmspawn then tries
to
spawn services that run these tools using the host userspace, where the
tools are not available or too old and hence systemd-vmspawn fails to
start.

Let's make things more consistent and allow using systemd-vmspawn in CI
at
the same time by having systemd-vmspawn spawn auxiliary daemons itself
instead of having the service manager spawn them. We use
systemd-socket-activate to still have socket activation for these
services,
even though we now spawn them ourselves. To make sure we wait for
systemd-socket-activate to bind to its socket before continuing, we use
the
new general fork_notify() helper.

Why not support both "online" and "offline" operation? systemd-vmspawn
is not
well tested as is and supporting two completely separate modes for
spawning
auxiliary daemons will drastically increase the surface area for bugs.
Given
there doesn't seem to be a major benefit to running daemons in services,
it
seems better to only support offline operation and not both. Should we
want
separate resource control for the auxiliary daemons in the future, we
can run
move them into separate scopes if needed.
2025-07-14 16:51:18 +02:00
DaanDeMeyer
852de7ed70 nspawn: Prepare --bind-user= logic for reuse in systemd-vmspawn
Aside from the usual boilerplate of moving the shared logic to shared/,
we also rework the implementation of --bind-user= to be similar to what
we'll do in systemd-vmspawn. Instead of messing with the nspawn container
user namespace, we use idmapped mounts to map the user's home directory on
the host to the mapped uid in the container.

Ideally we'd also use the "userdb.transient" credentials to provision the
user records, but this would only work for booted containers, whereas the
current logic works for non-booted containers as well.

Aside from being similar to how we'll implement --bind-user= in vmspawn,
using idmapped mounts also allows supporting --bind-user= without having to
use --private-users=.
2025-07-14 16:25:22 +02:00
DaanDeMeyer
c81fa16ddf vmspawn: Run auxiliary daemons inside scope instead of separate service
Currently, vmspawn is in this really weird state where vmspawn itself
and qemu will inherit the caller's execution environment but the auxiliary
daemons it spawn will run in a fully pristine environment in the service
manager. In practice, this causes issues as checks for whether auxiliary
daemons are installed happen in the caller's execution environment but they
might not exist in the spawned service's execution environment.

A good example of where this causes issues is trying to use systemd-vmspawn
in our CI. We use mkosi in CI to run systemd-vmspawn in a custom userspace
with all the necessary tools available, but systemd-vmspawn then tries to
spawn services that run these tools using the host userspace, where the
tools are not available or too old and hence systemd-vmspawn fails to start.

Let's make things more consistent and allow using systemd-vmspawn in CI at
the same time by having systemd-vmspawn spawn auxiliary daemons itself
instead of having the service manager spawn them. We use
systemd-socket-activate to still have socket activation for these services,
even though we now spawn them ourselves. To make sure we wait for
systemd-socket-activate to bind to its socket before continuing, we use the
new general fork_notify() helper.

Why not support both "online" and "offline" operation? systemd-vmspawn is not
well tested as is and supporting two completely separate modes for spawning
auxiliary daemons will drastically increase the surface area for bugs. Given
there doesn't seem to be a major benefit to running daemons in services, it
seems better to only support offline operation and not both. Should we want
separate resource control for the auxiliary daemons in the future, we can run
move them into separate scopes if needed.

As a bonus, this approach allows us to get rid of the extra complexity of
having to fork off the qemu process first so we can allocate a scope for it
that the other services bind to. This means large parts of
0fc45c8d20 are reverted by this commit.
2025-07-14 15:07:48 +02:00
DaanDeMeyer
e4691ebb49 fork-journal: Generalize to fork-notify
Most of the logic isn't journalctl specific, let's generalize a bit
so we can reuse this for other commands as well.
2025-07-14 15:07:48 +02:00