Daan De Meyer [Tue, 28 May 2024 12:08:18 +0000 (14:08 +0200)]
TEST-64-UDEV-STORAGE: Replace megasas2 controller with virtio scsi controller
The virtio-scsi driver is available in the KVM/cloud kernel
packages provided by distributions whereas the megasas2 driver is
not. Let's switch to virtio-scsi so we can switch back to the KVM/cloud
kernel packages.
Daan De Meyer [Tue, 28 May 2024 21:15:25 +0000 (23:15 +0200)]
mkosi: Switch from btrfs to ext4
Mounting multiple btrfs filesystems with the same fsid only works
properly from kernel 6.7 onwards. Let's switch to ext4 for now which
does support this.
Luca Boccassi [Tue, 28 May 2024 17:59:24 +0000 (18:59 +0100)]
bpf: add helper to translate kernel error codes from libbpf
libbpf returns error codes from the kernel unmodified, and we don't understand
them so non-fatal ones are handled as hard errors.
Add a translation helper, and start by translating 524 to EOPNOTSUPP, which is
returned when nsresourced tries to use LSM BPF hooks that are not
implemented on a given arch (in this case, arm64 is misssing trampolines).
Yu Watanabe [Tue, 28 May 2024 09:15:02 +0000 (18:15 +0900)]
test-network: tun/tap fd may be owned by tentative worker processes
PID1 may invoke a helper process, e.g. sd-close, during the test.
So, processes other than networkd and PID1 may be shown.
```
testtap99: tap pi multi_queue vnet_hdr persist filter
Attached to processes:systemd-network(2852)(sd-close)(2863)systemd(1)
```
machined: downgrade warning if we cannot drop ref to systemd unit if disconnected from bus
if machined exits while a machine is still running, we'll issue the
UnrefUnit() call on the unit. This quite likely will fail if during
shutdown the bus connection is already down. But that's no reason to
warn at all, since the ref count will implicitly be dropped if our side
disappears from the bus. Hence, downgrade to LOG_DEBUG in case of
connection problems.
Mathias Lang [Thu, 25 Apr 2024 10:38:09 +0000 (12:38 +0200)]
docs/CONTRIBUTING.md: Fix links in CONTRIBUTING
Get them to point to the rendered version, instead of
letting Github thinks they are absolute links in the
repository. The rendered version is much more user-friendly.
Franck Bui [Fri, 24 May 2024 12:11:54 +0000 (14:11 +0200)]
meson: don't put a symlink pointing to '20-systemd-ssh-proxy.conf' in /etc in all cases
On distros like SUSE where ssh config dropins in /usr are supported, there's no
need for a symlink in /etc/ssh/ssh_config.d/ that points to the dropin
installed somewhere in /usr (that is not reachable by ssh).
Mike Yuan [Sun, 26 May 2024 19:23:37 +0000 (03:23 +0800)]
man/run0: remove @ syntax for --machine=
For run0 (as opposed to systemd-run in general), connecting to
the system bus (of localhost or container) as a different user
than root and then trying to elevate privilege from that
makes little sense:
https://github.com/systemd/systemd/issues/32997#issuecomment-2127992973
The @ syntax is mostly useful when connecting to the user bus,
which is not a use case for run0. Hence, let's remove the example.
The syntax will be properly refused in #32999.
Yu Watanabe [Sun, 26 May 2024 21:01:05 +0000 (06:01 +0900)]
blockdev-util: also check loop/partscan sysattr
With https://github.com/torvalds/linux/commit/b9684a71fca793213378dd410cd11675d973eaa1 (v5.19),
we cannot check partition scanning is enabled for a loopback block device
without checking the attribute.
Yu Watanabe [Mon, 27 May 2024 00:21:41 +0000 (09:21 +0900)]
blockdev-util: also check newer value of GENHD_FL_NO_PART flag
With https://github.com/torvalds/linux/commit/430cc5d3ab4d0ba0bd011cfbb0035e46ba92920c,
the value of GENHD_FL_NO_PART, previously named as GENHD_FL_NO_PART_SCAN,
is changed from 0x0200 to 0x0004. So, we need to check both flags.
Yu Watanabe [Sun, 26 May 2024 01:05:57 +0000 (10:05 +0900)]
test: use SYSLOG_IDENTIFIER= filter instead of "journalctl -u"
"journalctl -u foo.service" may not work as expected, especially entries
for _TRANSPORT=stdout, for short-living services or when the service manager
generates debugging logs. Instead, SYSLOG_IDENTIFIER= should be reliable for
stdout. Let's use it.
Before this commit, if WorkingDirectory= is empty or literally "-",
'simplified' is not populated, resulting in the ASSERT_PTR
in unit_write_settingf() below getting triggered.
Also, do not accept "-", so that the parser is consistent
with load-fragment.c
Yu Watanabe [Fri, 24 May 2024 21:09:52 +0000 (06:09 +0900)]
unit: also stop systemd-journal-flush.service on soft-reboot
After soft-reboot, /var/log/journal may be initially read-only,
and becomes writable a bit later. In such case, runtime journal is
initially opened by journald. Hence, we need to flush to /var when it is
ready.
Yu Watanabe [Fri, 24 May 2024 21:02:39 +0000 (06:02 +0900)]
journald: always unset flushed flag when the runtime journal is opened
If the runtime journal is opened, we will anyway write journal entries
to the runtime journal, even if the persistent journal is writable.
Hence, we need to flush the runtime journal file later.
Yu Watanabe [Fri, 24 May 2024 16:32:21 +0000 (01:32 +0900)]
test: applying timezone is asynchronous
So, we need to try to read timezone several times.
Also, on failure, show journal of timedated instead of hostnamed,
as the timezone is handled by timedated.
Yu Watanabe [Fri, 24 May 2024 16:47:23 +0000 (01:47 +0900)]
machine-id-setup: update comment
If an initrd has an empty or uninitialized /etc/machine-id file,
then PID1 write a valid machine ID. So, the logic is important only on
soft-reboot. Let's mention that explicitly.
Yu Watanabe [Fri, 24 May 2024 17:01:53 +0000 (02:01 +0900)]
man: update machine-id-setup(1)
- mention that /run/machine-id is used if exist.
- mention system.machine_id credential,
- credential, VM uuid, and container uuid are not read when --root=
is specified or running in a chroot environment.
https://github.com/systemd/systemd/pull/32915#discussion_r1608258136
> In many cases we allow --root=/ as a mechanism for forcing an "offline" mode,
> while still operating on the root dir. if we do the getenv_for_pid() thing
> below I'd claim this is very much an "online" operation, and hence --root=/
> should really disable that.
The logged test failure was because of missing memory controller in
testing cgroup. With the test fixed in previous commit, memory
attributes are delegated as expected.
Michal Koutný [Thu, 23 May 2024 16:01:24 +0000 (18:01 +0200)]
test: Ensure delegation test unit has memory controller
When the test used to be run on distro that doesn't enable memory
accounting by default (such as openSUSE TW), there is no guarantee that
testing unit has memory.* cgroup attributes and delegation test would
fail if they are missing.
Require memory controller explicitly inside the unit so that test can
work in any environment.
cryptenroll: explicitly pick PCR bank if literal PCR binding is off, but signed PCR binding is on
We so far derived the PCR bank to use from the PCR values specified fr
literal PCR binding. However, when that's not used then we left the bank
uninitialized – which will break if signed PCR binds are used (where we
need to pick a bank too after all).
Hence, let's explicitly pick a bank to use if literal PCR values are not
used, to make things just work.