NamedTuple is an outdated solution… Make a normal dataclass to
match other places. Dataclasses also have nicer string representation.
Also let's not make the class nested. This doesn't matter terribly here,
but it makes the code unusual. Rename the type to "AptRepository"
to match RpmRepository.
Dataclasses are the more modern approach, with better string representation and
less hacks. A NamedTuple is also a tuple, which is rather surprising when we
don't use that.
Luca Boccassi [Sun, 16 Jun 2024 22:34:02 +0000 (23:34 +0100)]
qemu/vmspawn: check for an uncompressed kernel too
On some architecture/distributions (eg: ppc64el and riscv64 on Debian/Ubuntu)
the kernel is shipped uncompressed, as vmlinux. If vmlinuz cannot be found,
try looking for vmlinux.
Daan De Meyer [Thu, 13 Jun 2024 20:46:42 +0000 (22:46 +0200)]
centos: Fix GPG key search logic
Let's only look for the release key of the release we're building for
and add support for searching for the SHA256 key which is used by centos
stream 10.
We can't use the symlinked names because those don't exist on centos.org/keys.
Daan De Meyer [Thu, 13 Jun 2024 19:38:39 +0000 (21:38 +0200)]
centos: Change local rpm GPG key location
Let's look for the one suffixed with the release number. This doesn't
change behavior for c9s as this is a symlink to the file we looked for
previously but will fix our behavior for c10s which uses a different key.
Michael Ferrari [Sun, 9 Jun 2024 10:34:38 +0000 (12:34 +0200)]
Set default output name for `mkosi-tools`
This should allow one to invoke `mkosi --directory "" --include mkosi-tools`
in the project root to create a tools tree that is automatically
detected and used in subsequent invocations.
Daan De Meyer [Fri, 7 Jun 2024 18:01:59 +0000 (20:01 +0200)]
action: Disable apparmor completely
These are ephemeral CI machines with full root access without password,
there's really no point in running apparmor in the first place so instead
of trying to work around broken apparmor policies, just disable apparmor
completely.
Daan De Meyer [Thu, 6 Jun 2024 13:35:07 +0000 (15:35 +0200)]
mkosi-initrd: Include more modules
- systemd logs an error if x_tables.ko is missing so let's include it.
- For cryptsetup, let's make sure we include all crypto modules so it
always has everything it needs
Daan De Meyer [Wed, 5 Jun 2024 07:59:34 +0000 (09:59 +0200)]
opensuse: Add glibc-gconv-modules-extra to default tools tree
This package was split off from glibc but mtools does not yet have
a required dependency on it (see
https://bugzilla.opensuse.org/show_bug.cgi?id=1225982) so for now
let's install it ourselves.
Daan De Meyer [Wed, 5 Jun 2024 07:15:50 +0000 (09:15 +0200)]
Make sure we don't fail when there is no sdmagic section in sd-stub
The sdmagic section in sd-stub was only introduced in systemd 250.
Since Ubuntu Jammy ships systemd 249, let's make sure we gracefully
handle the scenario where we can't find the sdmagic section.
Daan De Meyer [Wed, 5 Jun 2024 07:29:50 +0000 (09:29 +0200)]
dnf: Enable versionlock plugin by default
Let's allow users to make use of the versionlock plugin by enabling
it by default. To make sure it doesn't fail, we write a noop
configuration that makes the plugin do nothing at all which users
can then override using PackageManagerTrees=.
Michael Ferrari [Tue, 4 Jun 2024 11:26:00 +0000 (13:26 +0200)]
Add `UnifiedKernelImageFormat=` with specifiers
This can be used to control the name to use for the UKI during image
generation. Special `&` specifiers can be used to include kernel
specific information in the filename.
This is useful for the `systemd-sysupdate` case, as you can set this to
`%i_%v` to use a format that can be parse by its configuration. The
current format used includes both a roothash as well as the kernel
version which both can't be matched by sysupdate.
Daan De Meyer [Sun, 2 Jun 2024 09:37:16 +0000 (11:37 +0200)]
Have coredumpctl and journalctl operate on forwarded journal if available
If ForwardJournal= is configured, have coredumpctl and journalctl operate
on it instead of on the image itself. While this doesn't handle the edge
case where the journal is forwarded but the coredumps are stored in the image,
let's assume that users that enable ForwardJournal= will also configure coredumps
to be stored in the journal.
With this option on, builds that have an existing cache directory will
generally fail. Fedora doesn't keep old packages on mirrors, and metadata
refers to specific package versions, so stale metadata will cause dnf to fail.
This fixes mkosi test image builds in systemd for me.
Jörg Behrmann [Tue, 28 May 2024 15:08:01 +0000 (17:08 +0200)]
doc: change X in tables to checkmark
We already have two different X in there, X and x, which are hard to tell
apart, and since we want to say something positive, let's make it a checkmark.
Jörg Behrmann [Wed, 15 May 2024 07:36:01 +0000 (09:36 +0200)]
doc: remove "mkosi." prefix from environment variable table
pandoc has a weird algorithm to define the width of tables in markdown. The
width cannot be specified absolutely, but is made relative to the text width by
how many dashes are in the horizontal line under the header in each
column. This can lead to spurious word breaks even on wide displays where the
whole table would fit. Removing the prefix should somewhat ameliorate the
problem until a better solution is found.
Daan De Meyer [Tue, 28 May 2024 13:21:55 +0000 (15:21 +0200)]
Pass arguments that look like env variables as env to systemd-nspawn
The kernel passes unknown parameters as environment variables to pid1.
Let's do the same for systemd-nspawn. Of course we don't know what is
known and unknown so let's take advantage of the fact that kernel cmdline
arguments are (usually) lower case and environment variables are (usually)
upper case and use that to determine whether to pass something as an argument
or an environment variable.