tree-wide: add dlopen ELF notes to all dlopen() deps of ours
Use 'recommended' priority for the default compression library, to
indicate that it should be prioritized over the other ones, as it
will be used to compress journals/core files.
Also use 'recommended' for kmod, as systems will likely fail to boot
if it's missing from the initrd.
Use 'suggested' for everything else.
There is one dlopen'ed TPM library that has the name generated
at runtime (depending on the driver), so that cannot be added, as it
needs to be known at build time.
Also when we support multiple ABI versions list them all, as for the
same reason we cannot know which one will be used at build time.
dlfcn: add macro for exporting dlopen() module names in ELF sections
This allows code to declare "weak" dlopen() style deps via an ELF
section following the just added specification.
The idea is that any user of dlopen() will place ELF_NOTE_DLOPEN(…)
somewhere close which will synthesize the note.
Tools such as rpm/dpkg package builders as well as initrd generators
(such as dracut) can then automatically pick up these weak deps of
suggested dependencies for their purposes.
Luca Boccassi [Sun, 5 May 2024 15:45:21 +0000 (16:45 +0100)]
docs: add specification for ELF dlopen metadata
Tool to parse it and to use it for Debian packaging available at
https://github.com/systemd/package-notes
Add 3 levels of priority like Debian does, but using terminology
from RPM as it seems more apt.
We will very likely never use 'required', as we use this functionality
for optional features, but it is worth having it in the spec nonetheless
as we want it to be generalized.
preset-all: continue on errors, report more errors
Firstly, if we encounter an error when iterating over the directory, gather
the error but continue. This is unlikely to happen, but if it happens, then
it doesn't seem very useful to break the preset processing at a random
point. If we can't process a unit — too bad, but since we already might
have processed some units earlier, we might as well try to process the
remaining ones.
Secondly, add missing error codes for units that are in a bad state to the
exclusion list. Those, we report them in the changes list, but consider the
whole operation a success. (-ETXTBSY and -ENOLINK were missing.)
Daan De Meyer [Tue, 7 May 2024 13:20:44 +0000 (15:20 +0200)]
test: Add infra to mark integration tests as slow
Some integration tests take much more time than others, let's add
a test param that can be used to configure this and integrate it
with the slow-tests meson option.
Daan De Meyer [Tue, 7 May 2024 07:33:10 +0000 (09:33 +0200)]
mkosi: Switch to fedora 40
Enable updates-testing and use the most recent mirror to make sure
we get util-linux 2.40.1 which contains a crucial fix to make sure
the serial terminal in virtual machines works properly.
This commit fixes two instances of a miscount. As the number is not important in either case, and seemingly subject to changes, it was removed entirely.
Another sentence was reworded to improve readability.
Moritz Sanft [Mon, 29 Apr 2024 11:03:40 +0000 (13:03 +0200)]
repart: respect `SOURCE_DATE_EPOCH` on `mkdir_p_root`
This let's systemd-repart respect the `SOURCE_DATE_EPOCH` environment
variable when creating directories in the local tree through `CopyFiles`
or `MakeDirectories`.
To do this, we pass a timestamp `ts` to `mkdir_p_root`, which it will
use to fix up `mtime` and `atime` of the directory it creates as
well as the `mtime` of the directory it creates the other directory *in*,
as the `mtime` of the latter is modified when creating a directory in it.
For the same reason, it also needs to fixup the `mtime` of the upper
directory when copying a file into it through `CopyFiles`.
If `SOURCE_DATE_EPOCH`, times are left as is. (`UTIME_OMIT`)
Jörg M. Sigle contriutes configuration ROM image for Tascam IF-FW/DM mkII,
which includes a quirk that the values of model fields in both root and
unit directory entries are different. In device attributes, it appears
that the value of model attribute in unit device is different from the one
in node device.
Daan De Meyer [Mon, 6 May 2024 14:21:53 +0000 (16:21 +0200)]
mkosi: Install python3-psutil
Required to run systemd-networkd-tests.py. Already a dependency of
systemd-tests on Fedora so we don't add it there as it'll be pulled
in via the prepare script.
As for the other fields let's check if the actual variable we serialize
is set before serializing it.
This shouldn't make any difference, since the pubkey and the PCR mask
should always be set together or neither, but I think it's easier to
grok this way, and makes the function nicely "dumb": it serializes what
is specified, without trying to be smart by suppressng specified fields.
cryptenroll: do not combine pcrlock and signed PCR policies in TPM mode
We currently do not support pcrlock policies and signed PCR policies in
combination. Hence, when we auto-discover both, let's disable signed PCR
policies if pcrlock is available too (simple because that covers more
ground).
Daan De Meyer [Fri, 3 May 2024 08:57:22 +0000 (10:57 +0200)]
ci: Reduce the number of integration tests we run concurrently
Since there's a bunch of CPU hungry systemd-journal-remote processes
running on the host to received the forwarded logs, by running as many
test as the VM has cores we overload the available resources. Let's leave
use the number of cores - 1 to reduce resource contention.
Daan De Meyer [Sun, 5 May 2024 16:14:44 +0000 (18:14 +0200)]
test: Default to linux qemu firmware
Direct kernel boot results in much faster boot times so let's use
it by default.
We disable it for tests that need to reboot because +-50% of the
time, doing a reboot when using direct kernel boot causes qemu to
hang on reboot. Until we figure that out, let's use UEFI for the
tests that need to reboot.
Daan De Meyer [Mon, 6 May 2024 09:47:34 +0000 (11:47 +0200)]
TEST-46-HOMED: Skip barely fits test on ext4
For some reason this fails on ext4 with "No space left on device".
Until we figure out why, let's skip the test on ext4 (which is reported
as ext2/ext3 by stat).
Daan De Meyer [Sat, 4 May 2024 14:32:57 +0000 (16:32 +0200)]
TEST-04-JOURNAL: Make more robust
Avoid hitting https://github.com/systemd/systemd/issues/2913 by adding
some more sleeps. This is required to make the test pass when executed
with mkosi on my machine.
Daan De Meyer [Fri, 3 May 2024 13:56:52 +0000 (15:56 +0200)]
TEST-74-AUX-UTILS: Drop usage of loop module
This module is builtin on ubuntu causing the test to fail. Let's
use just dummy instead. I tried replacing it with scsi_debug but
that caused issues with modprobe complaining it could not remove
scsi_debug because it was in use.
Richard Maw [Thu, 22 Feb 2024 13:01:13 +0000 (13:01 +0000)]
TEST-74-AUX-UTILS: Support credential-provided root SSH public key
When root authorized keys are provided by mkosi they are not
newline-terminated so appending a public key to the file results
in a corrupt key, so just to be safe we add an empty line.