Commit Graph

82930 Commits

Author SHA1 Message Date
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
DaanDeMeyer
be3f7aaf44 fork-journal: Don't log if process is already gone in journal_terminate() 2025-07-14 15:07:48 +02:00
Daan De Meyer
43d0d111d2 core/cgroup: always submit unit to realize queue if all controllers are being invalidated (#38194) 2025-07-14 15:07:16 +02:00
DaanDeMeyer
a79e94aa58 vmspawn: Pass credentials via files
Credentials data can get potentially very large. Passing it all via
the command line is rather messy. Let's pass all the credential data
via files instead to both make the final command line less verbose
and reduce the chance of us running into command line size limits if
many or large credentials are used.
2025-07-14 14:54:19 +02:00
DaanDeMeyer
e19e17df57 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.
2025-07-14 14:51:52 +02:00
DaanDeMeyer
1408505318 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.
2025-07-14 13:07:29 +01:00
Eisuke Kawashima
c2b0f637c2 fix(shell-completion): discard error messages 2025-07-14 20:24:26 +09:00
Eisuke Kawashima
86fff7fb38 fix(shell-completion): strictly parse env output
shell functions may be exported, when env prints their body in multiple
lines
2025-07-14 20:24:26 +09:00
Eisuke Kawashima
b371e7252c fix(SC2164): robust cd conditional 2025-07-14 20:24:26 +09:00
Eisuke Kawashima
01e769bc2e fix(SC2162): add -r to read 2025-07-14 20:24:26 +09:00
Eisuke Kawashima
cb2e0dc4f5 fix(shell-completion): correct conditional 2025-07-14 20:24:26 +09:00
Eisuke Kawashima
12e64a4848 style(shell-completion): remove unnecessary backslashes 2025-07-14 20:24:25 +09:00
Eisuke Kawashima
5300aa7a1d style(shell-completion): remove trailing semicolons 2025-07-14 20:24:25 +09:00
Eisuke Kawashima
56c093004c style(shell-completion): add missing semicolons 2025-07-14 20:24:25 +09:00