]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
20 months agoMake kernel image lookup logic more robust 2166/head
Daan De Meyer [Tue, 12 Dec 2023 14:39:54 +0000 (15:39 +0100)] 
Make kernel image lookup logic more robust

20 months agoRevert "Look for vmlinuz.efi as well"
Daan De Meyer [Tue, 12 Dec 2023 14:32:47 +0000 (15:32 +0100)] 
Revert "Look for vmlinuz.efi as well"

The kernel install target will install vmlinuz.efi as vmlinuz,
so no need to look for vmlinuz.efi after all.

This reverts commit f3871e3e843cbe28a03175aa14dc060e0ce06897.

20 months agoLook for vmlinuz.efi as well
Daan De Meyer [Mon, 11 Dec 2023 22:53:43 +0000 (23:53 +0100)] 
Look for vmlinuz.efi as well

On aarch64, vmlinuz.efi is installed instead of vmlinuz so let's
make sure we look for both.

20 months agotests: Test "none" output format as well
Daan De Meyer [Mon, 11 Dec 2023 17:51:28 +0000 (18:51 +0100)] 
tests: Test "none" output format as well

Let's build an image with "none" as well. There won't be any output,
but we can at least test that nothing breaks when specifying "none"
as the output format.

Also apply the "integration" marker to the entire file while we're
at it.

20 months agoMinor fix: remove duplicate shim-signed package
Renjaya Raga Zenta [Mon, 11 Dec 2023 14:03:12 +0000 (21:03 +0700)] 
Minor fix: remove duplicate shim-signed package

20 months agoman: fix name of option RepartOffline
Joerg Behrmann [Mon, 11 Dec 2023 11:21:13 +0000 (12:21 +0100)] 
man: fix name of option RepartOffline

20 months agoAdd RepartOffline= option
Daan De Meyer [Mon, 11 Dec 2023 09:17:19 +0000 (10:17 +0100)] 
Add RepartOffline= option

Instead of auto-detecting all cases where --offline=no has to be
used with systemd-repart, let's allow configuring it via an option
so that if we discover any new cases, users can easily disable
offline mode themselves.

20 months agoqemu: Remove --posix-acl and add --no-announce-submounts to virtiofsd
Daan De Meyer [Sun, 10 Dec 2023 21:09:55 +0000 (22:09 +0100)] 
qemu: Remove --posix-acl and add --no-announce-submounts to virtiofsd

--posix-acl causes an error from virtiofsd saying the client doesn't
support this feature. We also get a warning about announcing submounts
not being supported so let's make sure we disable both features to
avoid these warnings/errors.

20 months agoUpdate NEWS.md
Daan De Meyer [Sun, 10 Dec 2023 22:47:47 +0000 (23:47 +0100)] 
Update NEWS.md

20 months agoMerge pull request #2155 from DaanDeMeyer/grub
Daan De Meyer [Sun, 10 Dec 2023 20:53:30 +0000 (21:53 +0100)] 
Merge pull request #2155 from DaanDeMeyer/grub

undefined

20 months agoWrite grub BIOS partition definition after ESP definition 2155/head
Daan De Meyer [Sun, 10 Dec 2023 18:40:41 +0000 (19:40 +0100)] 
Write grub BIOS partition definition after ESP definition

The BIOS partition is ordered after the ESP so let's write their
config file in the same order for clarity.

20 months agoMake sure grub fonts directory exists
Daan De Meyer [Sun, 10 Dec 2023 18:40:24 +0000 (19:40 +0100)] 
Make sure grub fonts directory exists

20 months agoUse grub's search.file module instead of hardcoding partition numbers
Daan De Meyer [Sun, 10 Dec 2023 18:39:05 +0000 (19:39 +0100)] 
Use grub's search.file module instead of hardcoding partition numbers

We can tell grub to search for the first partition containing a
/grub/grub.cfg file. This still isn't ideal, but it's better than
hardcoding partition numbers.

20 months agoMove ESP grub shim configuration to prepare_grub_efi()
Daan De Meyer [Sun, 10 Dec 2023 18:37:23 +0000 (19:37 +0100)] 
Move ESP grub shim configuration to prepare_grub_efi()

20 months agoMerge pull request #2154 from DaanDeMeyer/kernel-install
Jörg Behrmann [Sun, 10 Dec 2023 18:48:28 +0000 (19:48 +0100)] 
Merge pull request #2154 from DaanDeMeyer/kernel-install

Use kernel-install entry token if available

20 months agoInstall kernels to /boot 2154/head
Daan De Meyer [Sun, 10 Dec 2023 16:06:51 +0000 (17:06 +0100)] 
Install kernels to /boot

If users want to use XBOOTLDR partitions, then we have to put the
kernels in a separate location from the ESP stuff. Currently we put
everything in /efi when building the image, which means that users
don't have a way to specify that the kernels should be put in an
XBOOTLDR partition.

Let's fix this by installing kernels to /boot so that users can
populate an XBOOTLDR partition by simply using CopyFiles=/boot:/
in a repart xbootldr partition definition.

20 months agoUse kernel-install entry token if available
Daan De Meyer [Sun, 10 Dec 2023 13:24:04 +0000 (14:24 +0100)] 
Use kernel-install entry token if available

Let's try and look for the kernel-install entry token if
kernel-install v255 or newer is available. This makes us more
compatible with package manager upgrades as we'll use the same
directory that kernel-install will look for when invoked by a
package manager.

20 months agoFix tool display in check_systemd_tool()
Daan De Meyer [Sun, 10 Dec 2023 16:14:05 +0000 (17:14 +0100)] 
Fix tool display in check_systemd_tool()

20 months agoReturn full version from systemd_tool_version()
Daan De Meyer [Sun, 10 Dec 2023 16:10:33 +0000 (17:10 +0100)] 
Return full version from systemd_tool_version()

Let's allow comparing against stable releases as well by returning
the full version.

20 months agoaction: Switch to systemd v255 stable branch
Daan De Meyer [Sun, 10 Dec 2023 15:30:43 +0000 (16:30 +0100)] 
action: Switch to systemd v255 stable branch

Let's stop tracking systemd's latest commit on main and switch to
the v255 stable branch instead.

20 months agoAdd QemuFirmwareVariables=
Daan De Meyer [Sun, 10 Dec 2023 11:48:15 +0000 (12:48 +0100)] 
Add QemuFirmwareVariables=

This allows configuring the path to the qemu firmware variables to
use. This allows users to configure their own variables using
https://pypi.org/project/virt-firmware/ before passing it to mkosi.

This also fixes a bug where we didn't pass the variables file to
qemu if the firmware doesn't support secure boot.

20 months agoLook for /usr/lib/kernel/uki.conf as well
Daan De Meyer [Sun, 10 Dec 2023 13:23:37 +0000 (14:23 +0100)] 
Look for /usr/lib/kernel/uki.conf as well

20 months agoMerge pull request #2153 from DaanDeMeyer/min-version
Jörg Behrmann [Sun, 10 Dec 2023 13:18:47 +0000 (14:18 +0100)] 
Merge pull request #2153 from DaanDeMeyer/min-version

Allow specifying minimum mkosi version

20 months agoAllow specifying minimum mkosi version 2153/head
Daan De Meyer [Sun, 10 Dec 2023 12:17:45 +0000 (13:17 +0100)] 
Allow specifying minimum mkosi version

Currently, users often get a confusing message about some property
not existing when they try to use an older version of mkosi to build
a configuration that requires a newer version. Let's improve on this
by allowing configurations to declare the minimum version required to
build the configuration.

20 months agoClean up load_config() a little
Daan De Meyer [Sun, 10 Dec 2023 12:06:28 +0000 (13:06 +0100)] 
Clean up load_config() a little

20 months agoMerge pull request #2151 from DaanDeMeyer/pacman
Daan De Meyer [Sun, 10 Dec 2023 11:21:02 +0000 (12:21 +0100)] 
Merge pull request #2151 from DaanDeMeyer/pacman

arch: Move arch specific configuration out of setup_pacman()

20 months agotests: Use temporary mount point
Daan De Meyer [Sun, 10 Dec 2023 09:54:31 +0000 (10:54 +0100)] 
tests: Use temporary mount point

Instead of creating a directory owned by root in the cwd, let's just
use a temporary directory that we remove again afterwards.

20 months agoarch: Unconditionally assume initramfs package is installed 2151/head
Daan De Meyer [Sun, 10 Dec 2023 10:31:23 +0000 (11:31 +0100)] 
arch: Unconditionally assume initramfs package is installed

This doesn't prevent installing individual initramfs generators so
let's always set it and require users to specify mkinitcpio or dracut
if they really need one of these.

20 months agoarch: Move arch specific configuration out of setup_pacman()
Daan De Meyer [Sun, 10 Dec 2023 10:20:56 +0000 (11:20 +0100)] 
arch: Move arch specific configuration out of setup_pacman()

Let's make setup_pacman() about pacman and not about Arch.

20 months agodnf: Rename Repo to RpmRepository
Daan De Meyer [Sun, 10 Dec 2023 10:10:15 +0000 (11:10 +0100)] 
dnf: Rename Repo to RpmRepository

20 months agomkosi-initrd: Make locale configurable
Daan De Meyer [Sun, 10 Dec 2023 08:33:39 +0000 (09:33 +0100)] 
mkosi-initrd: Make locale configurable

Now that we use it as the default initrd, let's make the locale
configurable so we can override it when building an image.

20 months agoMerge pull request #2147 from DaanDeMeyer/gdb
Daan De Meyer [Sat, 9 Dec 2023 15:46:37 +0000 (16:46 +0100)] 
Merge pull request #2147 from DaanDeMeyer/gdb

Add gdb to default image

20 months agoAdd gdb to default image 2147/head
Daan De Meyer [Sat, 9 Dec 2023 13:57:28 +0000 (14:57 +0100)] 
Add gdb to default image

20 months agoFix ruff error
Daan De Meyer [Sat, 9 Dec 2023 14:57:34 +0000 (15:57 +0100)] 
Fix ruff error

20 months agoMerge pull request #2137 from DaanDeMeyer/shim
Daan De Meyer [Sat, 9 Dec 2023 13:57:00 +0000 (14:57 +0100)] 
Merge pull request #2137 from DaanDeMeyer/shim

Add support for installing shim

20 months agoMerge pull request #2142 from DaanDeMeyer/tests
Daan De Meyer [Sat, 9 Dec 2023 13:52:12 +0000 (14:52 +0100)] 
Merge pull request #2142 from DaanDeMeyer/tests

tests: Make more robust on distros with recent systemd

20 months agoMerge pull request #2145 from DaanDeMeyer/uname
Daan De Meyer [Sat, 9 Dec 2023 13:51:20 +0000 (14:51 +0100)] 
Merge pull request #2145 from DaanDeMeyer/uname

Pass uname to ukify

20 months agoarch: Add debug repositories
Daan De Meyer [Sat, 9 Dec 2023 12:10:46 +0000 (13:10 +0100)] 
arch: Add debug repositories

20 months agoRelax qemu check in uncaught_exception_handler() 2142/head
Daan De Meyer [Sat, 9 Dec 2023 11:51:46 +0000 (12:51 +0100)] 
Relax qemu check in uncaught_exception_handler()

qemu binaries can have many different names (qemu, qemu-kvm,
qemu-system-xxx, ...) so let's not log a stacktrace for any binary
that starts with "qemu".

20 months agotests: Make more robust on distros with recent systemd
Daan De Meyer [Fri, 8 Dec 2023 15:53:51 +0000 (16:53 +0100)] 
tests: Make more robust on distros with recent systemd

Let's make use of the fact that we can communicate the exit status
from VMs on recent versions of systemd. Even when it fails to run
qemu will often exit with exit status 0 so let's make our successful
exit status 123 and check for that instead of 0.

Let's also rework how we have systemd log. Instead of using
default_standard_output, let's have journald forward all logs to the
console. While we're at, let's also add some general useful debugging
kernel command line arguments that we also use in the systemd repository.

20 months agoMerge pull request #2144 from behrmann/ruffga
Daan De Meyer [Sat, 9 Dec 2023 12:05:17 +0000 (13:05 +0100)] 
Merge pull request #2144 from behrmann/ruffga

Use ruff in CI

20 months agoRevert "mkosi: include binutils in the packages for building" 2145/head
Daan De Meyer [Sat, 9 Dec 2023 11:59:16 +0000 (12:59 +0100)] 
Revert "mkosi: include binutils in the packages for building"

Now that we pass the kernel version explicitly to ukify, we
don't need to have binutils installed anymore as ukify only uses
readelf to autodetect the kernel version if it wasn't supplied
explicitly by the user.

This reverts commit 4953e2cb66f0713dc302d089e92894e852e5a045.

20 months agoPass uname to ukify
Daan De Meyer [Sat, 9 Dec 2023 11:58:33 +0000 (12:58 +0100)] 
Pass uname to ukify

Let's avoid triggering ukify's autodetect logic by passing in the
kernel version ourselves.

20 months agoUse mkosi-initrd to build the default initrd
Daan De Meyer [Fri, 8 Dec 2023 12:52:01 +0000 (13:52 +0100)] 
Use mkosi-initrd to build the default initrd

Instead of maintaining a separate default initrd, let's use
mkosi-initrd for the default initrd. This provides users with a more
batteries included initrd by default and saves us from having to
maintain two separate initrd definitions.

20 months agoci: print version of used tools 2144/head
Joerg Behrmann [Sat, 9 Dec 2023 11:26:02 +0000 (12:26 +0100)] 
ci: print version of used tools

20 months agoci: exchange isort and pyflakes for ruff
Joerg Behrmann [Sat, 9 Dec 2023 11:23:41 +0000 (12:23 +0100)] 
ci: exchange isort and pyflakes for ruff

20 months agofix ruff warnings
Joerg Behrmann [Sat, 9 Dec 2023 11:17:32 +0000 (12:17 +0100)] 
fix ruff warnings

20 months agoAdd support for installing shim 2137/head
Daan De Meyer [Thu, 7 Dec 2023 22:11:19 +0000 (23:11 +0100)] 
Add support for installing shim

Unfortunately shim is a necessary evil that we have to support. We
add a new option that allows choosing either a signed version, an
unsigned version or none at all (the default).

We also stop redirecting /boot/efi to /efi so that /efi is our pristine
directory for populating the ESP whereas /boot is unclaimed wasteland
free for package managers to write all kinds of stuff to.

20 months agomkosi: include binutils in the packages for building
Josef Bacik [Fri, 8 Dec 2023 22:28:21 +0000 (22:28 +0000)] 
mkosi: include binutils in the packages for building

On aarch64 the dependencies are different than x86 and we don't end up
with binutils getting picked up, which means readelf isn't available for
systemd-ukify when using mkosi-kernel on aarch64.  Explicitly add
bintuils to the list of packages, this allows mkosi-kernel to work
properly on an aarch64 machine.

20 months agomkosi-initrd: Fix typo
Daan De Meyer [Fri, 8 Dec 2023 13:01:16 +0000 (14:01 +0100)] 
mkosi-initrd: Fix typo

Fixes #2138

20 months agoqemu: Become root when copying for Ephemeral=
Daan De Meyer [Thu, 7 Dec 2023 21:49:16 +0000 (22:49 +0100)] 
qemu: Become root when copying for Ephemeral=

To copy the directory, we need to be root (either real or in the
user namespace), so let's do just that.

20 months agoShare default image configuration between debian and ubuntu
Daan De Meyer [Fri, 8 Dec 2023 09:13:26 +0000 (10:13 +0100)] 
Share default image configuration between debian and ubuntu

20 months agoRemove no longer necessary __init__.py from mkosi.resources
Joerg Behrmann [Thu, 7 Dec 2023 19:13:35 +0000 (20:13 +0100)] 
Remove no longer necessary __init__.py from mkosi.resources

20 months agoMove off of the deprecated importlib.resources API
Joerg Behrmann [Thu, 7 Dec 2023 18:09:34 +0000 (19:09 +0100)] 
Move off of the deprecated importlib.resources API

Python 3.9 brought a new importlib.resources API and deprecated the old
one. This introduces a small shim to use the part of the APi that guarantees a
Path object, thus making our usage of this just pathlike.

20 months agoMerge pull request #2131 from DaanDeMeyer/fork
Daan De Meyer [Thu, 7 Dec 2023 18:26:15 +0000 (19:26 +0100)] 
Merge pull request #2131 from DaanDeMeyer/fork

Run image builds in a fork again

20 months agoHandle SIGTERM like a keyboard interrupt 2131/head
Daan De Meyer [Thu, 7 Dec 2023 11:51:13 +0000 (12:51 +0100)] 
Handle SIGTERM like a keyboard interrupt

Let's make sure we do proper cleanup on SIGTERM as well.

20 months agoLog "Interrupted by ..." when we interrupt a child process
Daan De Meyer [Thu, 7 Dec 2023 11:50:23 +0000 (12:50 +0100)] 
Log "Interrupted by ..." when we interrupt a child process

Instead of logging the full command line with exit status, let's
just log "Interrupted" when a child process is interrupted with CTRL+C.

20 months agoImprove exception handling for subprocess.run()
Daan De Meyer [Thu, 7 Dec 2023 11:48:53 +0000 (12:48 +0100)] 
Improve exception handling for subprocess.run()

Instead of having subprocess.run() kill child processes on exceptions
with SIGKILL, let's have it use SIGTERM instead. Because this is not
configurable, we have to override signal.SIGKILL with signal.SIGTERM
before we call subprocess.run().

20 months agoRun image builds in a fork again
Daan De Meyer [Thu, 7 Dec 2023 10:21:30 +0000 (11:21 +0100)] 
Run image builds in a fork again

This solves two problems:
- When not using a tools tree, we can run qemu outside of the user
namespace which means that we don't need to pass fds to /dev/kvm and
/dev/vhost-vsock to keep things working unprivileged
- The vmspawn verb we're about to introduce will not be able to run
properly inside a user namespace, so we need to make sure we're not
inside a user namespace after the image build.

Compared to our original implementation of this way back with exception
propagation, this time we opt to do things differently by doing all
exception handling and logging inside the fork to avoid having to
propagate exceptions. This makes the overall implementation a lot
simpler.

We can also run the other verbs outside of the user namespace as long
as we're not using a tools tree. Because we want to keep support for
using a tools tree with all verbs, we keep support for running them
inside a user namespace as well. Because we already use INVOKING_USER
everywhere, this actually turns out to require very little changes. We
only need to make sure when starting virtiofsd that we unshare the user
namespace ourselves if we're not uid mapping.

20 months agoMerge pull request #2132 from DaanDeMeyer/fix-kmods
Daan De Meyer [Thu, 7 Dec 2023 17:49:45 +0000 (18:49 +0100)] 
Merge pull request #2132 from DaanDeMeyer/fix-kmods

Fix kmods

20 months agoDon't consider include filters when deciding whether to run depmod 2132/head
Daan De Meyer [Thu, 7 Dec 2023 12:33:29 +0000 (13:33 +0100)] 
Don't consider include filters when deciding whether to run depmod

The include filters only do something if there's an exclude filter,
so we don't need to run depmod if only include filters are defined.

20 months agoFix filter_kernel_modules()
Daan De Meyer [Thu, 7 Dec 2023 12:32:53 +0000 (13:32 +0100)] 
Fix filter_kernel_modules()

Make sure we skip the include/exclude logic if no filters are defined.

20 months agoMerge pull request #2128 from DaanDeMeyer/extensions
Daan De Meyer [Thu, 7 Dec 2023 17:15:38 +0000 (18:15 +0100)] 
Merge pull request #2128 from DaanDeMeyer/extensions

Add sysext, confext and portable support

20 months agoAdd sysext, confext and portable support 2128/head
Daan De Meyer [Wed, 6 Dec 2023 14:04:54 +0000 (15:04 +0100)] 
Add sysext, confext and portable support

Wwe also write the extension-release file in case of sysexts and
confexts and make sure we skip a bunch of our automatic features
when building extension  images or enabling the Overlay= option
as in these cases many of our automatic features are undesireable.

20 months agoMake sure networking works on debian
Daan De Meyer [Thu, 7 Dec 2023 14:11:33 +0000 (15:11 +0100)] 
Make sure networking works on debian

Also drop some unused stuff from the preset file.

20 months agomkosi-initrd: Fix md rules
Daan De Meyer [Thu, 7 Dec 2023 12:56:32 +0000 (13:56 +0100)] 
mkosi-initrd: Fix md rules

This somehow ended up being copied wrongly from dracut so let's fix
that.

20 months agoAdd QemuVsockCID= option
Daan De Meyer [Wed, 6 Dec 2023 17:06:16 +0000 (18:06 +0100)] 
Add QemuVsockCID= option

This makes it a bit more streamlined to run multiple VMs with vsock
concurrently.

20 months agomkosi-initrd: Apply cryptsetup creds to all instances of systemd-cryptsetup@.service
Daan De Meyer [Wed, 6 Dec 2023 08:52:59 +0000 (09:52 +0100)] 
mkosi-initrd: Apply cryptsetup creds to all instances of systemd-cryptsetup@.service

This follows the suggestion made in https://github.com/systemd/systemd/pull/30309
to apply "cryptsetup.*" credentials to all instances of
systemd-cryptsetup@.service instead of only to
systemd-cryptsetup@root.service.

20 months agodocs: Mention that all the sysext steps should be done in an empty dir
Daan De Meyer [Wed, 6 Dec 2023 09:58:42 +0000 (10:58 +0100)] 
docs: Mention that all the sysext steps should be done in an empty dir

20 months agodocs: Mention how to provide your own key and certificate
Daan De Meyer [Wed, 6 Dec 2023 09:26:05 +0000 (10:26 +0100)] 
docs: Mention how to provide your own key and certificate

20 months agoExecute user presets alongside system presets
Winterhuman [Wed, 6 Dec 2023 07:01:13 +0000 (07:01 +0000)] 
Execute user presets alongside system presets

Adds `systemctl --root "$ROOT" --global preset-all` to the **Applying presets...** build step.

20 months agoMerge pull request #2124 from behrmann/pyrightfix
Daan De Meyer [Wed, 6 Dec 2023 08:22:47 +0000 (09:22 +0100)] 
Merge pull request #2124 from behrmann/pyrightfix

Fix pyright errors

20 months agoMake DistributionInstaller.architecture a classmethod 2124/head
Joerg Behrmann [Wed, 6 Dec 2023 08:17:05 +0000 (09:17 +0100)] 
Make DistributionInstaller.architecture a classmethod

This was already done in CentOS, but not in the base class.

20 months agoconfig: name parameter for MkosiJsonEncoder.default as in base class
Joerg Behrmann [Wed, 6 Dec 2023 08:16:33 +0000 (09:16 +0100)] 
config: name parameter for MkosiJsonEncoder.default as in base class

20 months agoMerge pull request #2122 from DaanDeMeyer/sysext
Jörg Behrmann [Wed, 6 Dec 2023 08:07:43 +0000 (09:07 +0100)] 
Merge pull request #2122 from DaanDeMeyer/sysext

docs: Add doc on generating system extensions with mkosi

20 months agodocs: Add doc on generating system extensions with mkosi 2122/head
Daan De Meyer [Tue, 5 Dec 2023 14:31:10 +0000 (15:31 +0100)] 
docs: Add doc on generating system extensions with mkosi

20 months agoStrip usr/lib/sysimage/libdnf5 when dnf5 is not installed
Daan De Meyer [Tue, 5 Dec 2023 14:30:45 +0000 (15:30 +0100)] 
Strip usr/lib/sysimage/libdnf5 when dnf5 is not installed

20 months agoMerge pull request #2120 from DaanDeMeyer/initrd
Zbigniew Jędrzejewski-Szmek [Tue, 5 Dec 2023 13:23:50 +0000 (14:23 +0100)] 
Merge pull request #2120 from DaanDeMeyer/initrd

mkosi-initrd: various improvements

20 months agomkosi-initrd: Port tests from old repository 2120/head
Daan De Meyer [Mon, 4 Dec 2023 07:12:51 +0000 (08:12 +0100)] 
mkosi-initrd: Port tests from old repository

This commit ports some of the tests from
https://github.com/systemd/mkosi-initrd/blob/main/.github/workflows/build-fedora.sh
over.

The LUKS test is modified to generate the LUKS root partition using
repart instead of doing it manually. For the LVM tests we're forced
to do it manually as systemd-repart doesn't support setting up LVM
(and probably never will).

We also add an initrd size test so we notice when initrds grow due
to distribution packaging changes.

20 months agoFix nspawn settings
Daan De Meyer [Tue, 5 Dec 2023 09:28:31 +0000 (10:28 +0100)] 
Fix nspawn settings

When --machine= is used, nspawn looks for a settings file named after
the machine so we have to make sure to copy to the right location.

While we're at it, let's also stop considering the nspawn settings
an output artifact, since this means we have to build the image to
apply new settings. Instead, let's copy the settings when running
the image and remove the copied file again afterwards. This means
that new settings are applied immediately instead of only after a
rebuild.

20 months agoTemporarily default to debian unstable for builtin image
Daan De Meyer [Mon, 4 Dec 2023 12:14:43 +0000 (13:14 +0100)] 
Temporarily default to debian unstable for builtin image

Booting off virtiofs only works properly from systemd v255 onwards
when virtiofs and virtio_pci are not builtin to the kernel so let's
default to unstable for now which has systemd v255.

20 months agomkosi-initrd: Ship preset to disable services by default
Daan De Meyer [Mon, 4 Dec 2023 09:58:02 +0000 (10:58 +0100)] 
mkosi-initrd: Ship preset to disable services by default

Debian doesn't ship any presets so all services are enabled by default.
Let's ship our own to disable everything by default instead.

20 months agomkosi-initrd: Enable cryptsetup.* credentials for systemd-gpt-auto-generator
Daan De Meyer [Mon, 4 Dec 2023 07:10:29 +0000 (08:10 +0100)] 
mkosi-initrd: Enable cryptsetup.* credentials for systemd-gpt-auto-generator

systemd-cryptsetup will read credentials in the "cryptsetup" namespace but
none of the generated service units import credentials from that namespace
yet. Let's add a dropin to have systemd-cryptsetup@root.service (generated
by systemd-gpt-auto-generator) load these credentials by default so that we
can use them in integration tests.

Upstream PR in systemd related to this: https://github.com/systemd/systemd/pull/30309

20 months agoSuspend stdin capture if --capture=no is specified
Daan De Meyer [Mon, 4 Dec 2023 05:52:54 +0000 (06:52 +0100)] 
Suspend stdin capture if --capture=no is specified

20 months agoPassthrough stdin/stdout in Image
Daan De Meyer [Mon, 4 Dec 2023 05:38:58 +0000 (06:38 +0100)] 
Passthrough stdin/stdout in Image

20 months agoInstall less in default images initrds
Daan De Meyer [Mon, 4 Dec 2023 05:38:31 +0000 (06:38 +0100)] 
Install less in default images initrds

20 months agoDon't pass --debug when running mkosi clean
Daan De Meyer [Sun, 3 Dec 2023 13:25:23 +0000 (14:25 +0100)] 
Don't pass --debug when running mkosi clean

20 months agoqemu: Don't synthesize root= if it's provided on the kernel command line
Daan De Meyer [Sun, 3 Dec 2023 13:24:48 +0000 (14:24 +0100)] 
qemu: Don't synthesize root= if it's provided on the kernel command line

20 months agoqemu: Use full output path everywhere
Daan De Meyer [Sun, 3 Dec 2023 13:23:58 +0000 (14:23 +0100)] 
qemu: Use full output path everywhere

Let's make sure we use whatever the configured output format is instead
of going via the symlink we create in the output directory.

20 months agotree: Pass in use_subvolumes feature instead of MkosiConfig object
Daan De Meyer [Sun, 3 Dec 2023 12:21:35 +0000 (13:21 +0100)] 
tree: Pass in use_subvolumes feature instead of MkosiConfig object

This makes the tree functions a little more generic.

20 months agomkosi-initrd: Move tests to pytest
Daan De Meyer [Sun, 3 Dec 2023 10:59:34 +0000 (11:59 +0100)] 
mkosi-initrd: Move tests to pytest

While we're at it, also build our default images with a mkosi-initrd
produced initrd to verify that it boots.

20 months agomkosi-initrd: Add opensuse support
Daan De Meyer [Sun, 3 Dec 2023 11:19:25 +0000 (12:19 +0100)] 
mkosi-initrd: Add opensuse support

20 months agomkosi-initrd: Default to cleaning package manager metadata
Daan De Meyer [Sun, 3 Dec 2023 11:17:33 +0000 (12:17 +0100)] 
mkosi-initrd: Default to cleaning package manager metadata

Various package managers are pulled in as dependencies of core
system software (dpkg by dash on Debian, rpm by kmod via
suse-module-tools on opensuse) so let's default to always cleaning
package manager metadata even if the package manager is installed.

We still allow disabling it as having the package manager metadata
available is useful when debugging dependencies and why specific
packages are installed in the initrd.

20 months agomkosi-initrd: Apply centos specific config to RHEL as well
Daan De Meyer [Sun, 3 Dec 2023 11:00:49 +0000 (12:00 +0100)] 
mkosi-initrd: Apply centos specific config to RHEL as well

20 months agoIntroduce name() method for MkosiConfig
Daan De Meyer [Sun, 3 Dec 2023 10:57:40 +0000 (11:57 +0100)] 
Introduce name() method for MkosiConfig

20 months agomkosi-initrd: Bring Arch and Debian up-to-date with Fedora
Daan De Meyer [Sun, 3 Dec 2023 10:36:31 +0000 (11:36 +0100)] 
mkosi-initrd: Bring Arch and Debian up-to-date with Fedora

20 months agomkosi-initrd: Exclude more files on Arch
Daan De Meyer [Sun, 3 Dec 2023 10:35:50 +0000 (11:35 +0100)] 
mkosi-initrd: Exclude more files on Arch

Let's exclude a bunch of unnecessary stuff on Arch.

20 months agoImplement WithDocs= for apt
Daan De Meyer [Sun, 3 Dec 2023 10:04:38 +0000 (11:04 +0100)] 
Implement WithDocs= for apt

20 months agomkosi-initrd: Strip all files starting with vmlinuz
Daan De Meyer [Sun, 3 Dec 2023 08:20:19 +0000 (09:20 +0100)] 
mkosi-initrd: Strip all files starting with vmlinuz

Fedora has started shipping vmlinuz-virt.efi in the kernel modules
directory so we have to make sure we strip that from the initrd as
well.

20 months agomkosi-initrd: Strip documentation from the initrd
Daan De Meyer [Sun, 3 Dec 2023 08:19:58 +0000 (09:19 +0100)] 
mkosi-initrd: Strip documentation from the initrd