]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
2 years agoGet rid of unnecessary usage of TypeVar 1606/head
Daan De Meyer [Thu, 1 Jun 2023 11:08:21 +0000 (13:08 +0200)] 
Get rid of unnecessary usage of TypeVar

2 years agoLog some notify stats at debug level
Daan De Meyer [Thu, 1 Jun 2023 11:02:33 +0000 (13:02 +0200)] 
Log some notify stats at debug level

2 years agotests: add missing asserts
Joerg Behrmann [Wed, 24 May 2023 15:11:38 +0000 (17:11 +0200)] 
tests: add missing asserts

2 years agoconfig: add missing whitespace
Joerg Behrmann [Wed, 24 May 2023 14:07:01 +0000 (16:07 +0200)] 
config: add missing whitespace

2 years agoconfig: only use host release if we can detect one
Joerg Behrmann [Mon, 22 May 2023 15:19:43 +0000 (17:19 +0200)] 
config: only use host release if we can detect one

2 years agoci: add --debug flag
Joerg Behrmann [Fri, 26 May 2023 12:29:20 +0000 (14:29 +0200)] 
ci: add --debug flag

2 years agoUpdate installation instructions in the README
Joerg Behrmann [Wed, 31 May 2023 13:55:06 +0000 (15:55 +0200)] 
Update installation instructions in the README

2 years agoMerge pull request #1600 from DaanDeMeyer/fedora
Jörg Behrmann [Thu, 1 Jun 2023 07:45:26 +0000 (09:45 +0200)] 
Merge pull request #1600 from DaanDeMeyer/fedora

fedora: Add Enterprise Linux Next (ELN) support

2 years agoUse repart's new --architecture option
Daan De Meyer [Tue, 30 May 2023 11:40:21 +0000 (13:40 +0200)] 
Use repart's new --architecture option

This makes sure that --architecture works with user specified repart
configs as well instead of just the ones that we generate ourselves.

2 years agofedora: Add Enterprise Linux Next (ELN) support 1600/head
Daan De Meyer [Wed, 31 May 2023 20:42:55 +0000 (22:42 +0200)] 
fedora: Add Enterprise Linux Next (ELN) support

Let's add support for ELN (https://docs.fedoraproject.org/en-US/eln/)
which builds Fedora with the RHEL toolchain.

2 years agofedora: Simplify url handling
Daan De Meyer [Wed, 31 May 2023 19:58:58 +0000 (21:58 +0200)] 
fedora: Simplify url handling

2 years agoAdd QemuSwtpm option
Daan De Meyer [Wed, 31 May 2023 13:51:09 +0000 (15:51 +0200)] 
Add QemuSwtpm option

2 years agoUse VMADDR_PORT_ANY
Daan De Meyer [Wed, 31 May 2023 09:04:44 +0000 (11:04 +0200)] 
Use VMADDR_PORT_ANY

Just cleanup, shouldn't cause any change in behavior

2 years agoaction: Install systemd-measure
Daan De Meyer [Tue, 30 May 2023 12:36:17 +0000 (14:36 +0200)] 
action: Install systemd-measure

2 years agoMerge pull request #1592 from DaanDeMeyer/arch
Daan De Meyer [Tue, 30 May 2023 11:39:46 +0000 (13:39 +0200)] 
Merge pull request #1592 from DaanDeMeyer/arch

Rework architecture handling

2 years agoUse dnf when building foreign architectures 1592/head
Daan De Meyer [Tue, 30 May 2023 10:15:42 +0000 (12:15 +0200)] 
Use dnf when building foreign architectures

dnf5 does not support --forcearch yet which means it can't build
foreign architectures.

2 years agoRework architecture handling
Daan De Meyer [Mon, 29 May 2023 20:41:31 +0000 (22:41 +0200)] 
Rework architecture handling

Let's lock architectures down by making it an enum instead of a
free form string. We also introduce a bunch of mapping functions
to map the Architecture enum to qemu, distribution arches, efi
arches. We only support the architectures defined in the discoverable
partitions spec and use those architectures as the default representation.

2 years agoMerge pull request #1591 from DaanDeMeyer/exception-handling
Daan De Meyer [Sat, 27 May 2023 09:11:10 +0000 (11:11 +0200)] 
Merge pull request #1591 from DaanDeMeyer/exception-handling

Make sure we handle any exceptions thrown in MkosiAsyncioThread()

2 years agoci: Make sure we're running qemu with a vsock 1591/head
Daan De Meyer [Sat, 27 May 2023 09:01:14 +0000 (11:01 +0200)] 
ci: Make sure we're running qemu with a vsock

Let's add a little extra coverage by enforcing that qemu runs with
a vsock.

2 years agoMake sure we handle any exceptions thrown in MkosiAsyncioThread()
Daan De Meyer [Sat, 27 May 2023 08:54:20 +0000 (10:54 +0200)] 
Make sure we handle any exceptions thrown in MkosiAsyncioThread()

Any unhandled exceptions from run() are by default just printed to
stderr. Let's make sure that these exceptions cause mkosi itself to
fail by catching them and re-raising them when the thread is joined.

2 years agoMerge pull request #1583 from Cornelicorn/output-uids
Daan De Meyer [Fri, 26 May 2023 11:46:31 +0000 (13:46 +0200)] 
Merge pull request #1583 from Cornelicorn/output-uids

Improve basename symlinks

2 years agoAdd --all-architectures when we run bootctl
Daan De Meyer [Fri, 26 May 2023 11:27:41 +0000 (13:27 +0200)] 
Add --all-architectures when we run bootctl

To make sure that we install correctly even when doing cross builds

2 years agoVarious improvements
Daan De Meyer [Fri, 26 May 2023 10:01:35 +0000 (12:01 +0200)] 
Various improvements

- Move workspace and install/cache directory handling into MkosiState
- Stop running the build as the user running mkosi, this makes things
simpler as the root user in the userns can write to directories owned
by the user running mkosi but vice versa is not possible. The build
script still can't modify the build image as we mount the build overlay
read-only.
- Create directories that need to be owned by the user running mkosi
before switching to the user namespace
- Various refactorings

2 years agodebian: Fix foreign architecture builds
Daan De Meyer [Fri, 26 May 2023 10:16:50 +0000 (12:16 +0200)] 
debian: Fix foreign architecture builds

--force-architecture forces dpkg to install packages for other
architectures than the host architecture. --force-depends is required
because when building for arm64 it seems it can't quite figure out
all the pre-depends. For extra safety, we also set APT::Architectures
on top of APT::Architecture.

2 years agoAlways overwrite the basename symlink to point to the newest version 1583/head
Cornelius Hoffmann [Fri, 26 May 2023 09:37:41 +0000 (11:37 +0200)] 
Always overwrite the basename symlink to point to the newest version

Having the symlink point to the oldest image is somewhat counterintuitive

2 years agoFix wrong uid:gid on the basename symlink
Cornelius Hoffmann [Fri, 26 May 2023 07:31:50 +0000 (09:31 +0200)] 
Fix wrong uid:gid on the basename symlink

Before this would have the uid:gid of root in the uidmap space
The link is now created in the staging area first to make the change atomic,
so that the wrong uid:gid pair is never seen in the output directory

2 years agoAdd support for pesign to sign secure boot binaries
Daan De Meyer [Thu, 25 May 2023 19:33:09 +0000 (21:33 +0200)] 
Add support for pesign to sign secure boot binaries

sbsign is not packaged on CentOS so let's add support for pesign as
well as support for pesign was recently added to ukify as well.

2 years agoukify: always sign kernel inside of uki if secure boot is enabled
Malte Poll [Thu, 25 May 2023 09:53:47 +0000 (11:53 +0200)] 
ukify: always sign kernel inside of uki if secure boot is enabled

This overrides the auto detection of ukify and always signs the kernel bevore embedding it in the uki (even if the kernel is already signed).
Rationale: When building Fedora 37 images, the Fedora provided kernel is signed with an expired key (id 2574709492).
I would like to add an additional signature with my own signing key to enable kexec and other features that require a correctly signed kernel image.

Co-authored-by: Otto Bittner <cobittner@posteo.net>
2 years agofix missing exist_ok for debian /usr
Cornelius Hoffmann [Wed, 24 May 2023 22:24:41 +0000 (00:24 +0200)] 
fix missing exist_ok for debian /usr

This would prevent having /usr in a skeleton tree

2 years agoFirstboot improvements
Daan De Meyer [Wed, 24 May 2023 12:33:49 +0000 (14:33 +0200)] 
Firstboot improvements

- Merge --root-password-hashed and --root-password-file into
  --root-password. If prefixed with hashed:, we treat it as a hashed
  root password.
- When not building an initrd, also store corresponding credentials
in /usr/lib/credstore, so that the settings work even if only /usr
is shipped in the final image. We don't do this for initrds since
those generally ship with /etc populated.
- Drop setting of firstboot.hostname which isn't actually used by
systemd-firstboot

2 years agoCompress centos 8 variant cpios with xz instead of zstd
Daan De Meyer [Tue, 23 May 2023 10:58:39 +0000 (12:58 +0200)] 
Compress centos 8 variant cpios with xz instead of zstd

The kernel for CentOS 8 and its variants doesn't ship with zstd
initrd compression support, so let's default to xz instead.

2 years agoRefactor image growing
Daan De Meyer [Mon, 22 May 2023 12:08:28 +0000 (14:08 +0200)] 
Refactor image growing

2 years agoUse systemd-repart to grow disk image
Daan De Meyer [Mon, 22 May 2023 12:08:28 +0000 (14:08 +0200)] 
Use systemd-repart to grow disk image

Using truncate isn't entirely right, let's do this properly by letting
systemd-repart handle it.

2 years agoMerge pull request #1571 from DaanDeMeyer/fixes
Daan De Meyer [Mon, 22 May 2023 08:01:38 +0000 (10:01 +0200)] 
Merge pull request #1571 from DaanDeMeyer/fixes

Fixes

2 years agorocky: Drop epel repository from bootable config 1571/head
Daan De Meyer [Mon, 22 May 2023 05:46:22 +0000 (07:46 +0200)] 
rocky: Drop epel repository from bootable config

systemd-boot is provided by the base repositories now so let's drop
the epel repository config.

2 years agoMake mkosi the foreground process again when child process finishes
Daan De Meyer [Sun, 21 May 2023 15:08:51 +0000 (17:08 +0200)] 
Make mkosi the foreground process again when child process finishes

We currently get "Job mkosi has stopped" when fetching running the
summary verb. Let's fix this by making sure we make mkosi the foreground
process again when we finish running a child process.

2 years agoMake sure we page summaries only once when there's multiple presets
Daan De Meyer [Sun, 21 May 2023 15:07:26 +0000 (17:07 +0200)] 
Make sure we page summaries only once when there's multiple presets

2 years agoReturn early if verb is "clean"
Daan De Meyer [Sun, 21 May 2023 15:06:35 +0000 (17:06 +0200)] 
Return early if verb is "clean"

Otherwise we start checking the inputs of the presets which we don't
wanna do if we're just cleaning outputs

2 years agoAdd RepartDirectories to summary
Daan De Meyer [Sun, 21 May 2023 15:06:12 +0000 (17:06 +0200)] 
Add RepartDirectories to summary

2 years agoUse slightly better dnf5 check
Daan De Meyer [Tue, 16 May 2023 12:17:58 +0000 (14:17 +0200)] 
Use slightly better dnf5 check

Instead of checking whether dnf5 exists all the time, just reuse
the first check results

2 years agoVarious dnf fixes
Daan De Meyer [Tue, 16 May 2023 09:16:28 +0000 (11:16 +0200)] 
Various dnf fixes

- Put the logs in a subdirectory of the workspace
- Make sure we configure the persistdir to be inside the workspace
as well. Otherwise dnf5 tries to use the system directory which fails
with a permission error
- Use the non-compat dnf5 option names instead of the compat ones

2 years agoPass firstboot settings to generated initrd as well
Daan De Meyer [Mon, 15 May 2023 13:55:32 +0000 (15:55 +0200)] 
Pass firstboot settings to generated initrd as well

It generally doesn't make sense to have these differ between the
initrd and the rootfs, so let's pass these settings through to the
initrd as well.

The only setting we don't pass through is the root shell as configuring
a different root shell might mean installing extra packages which might
be undesireable in the initrd.

2 years agoOnly clean cache images if cache dir exists
Daan De Meyer [Mon, 15 May 2023 13:47:35 +0000 (15:47 +0200)] 
Only clean cache images if cache dir exists

2 years agoDo not check inputs up front
Daan De Meyer [Fri, 12 May 2023 12:59:16 +0000 (14:59 +0200)] 
Do not check inputs up front

They could be generated by the previous preset

2 years agoMerge pull request #1563 from DaanDeMeyer/fix-needs-build
Jörg Behrmann [Fri, 12 May 2023 12:24:32 +0000 (14:24 +0200)] 
Merge pull request #1563 from DaanDeMeyer/fix-needs-build

Fix needs_build()

2 years agoCheck inputs/outputs before removing any files. 1563/head
Daan De Meyer [Fri, 12 May 2023 11:31:15 +0000 (13:31 +0200)] 
Check inputs/outputs before removing any files.

2 years agoFix needs_build()
Daan De Meyer [Fri, 12 May 2023 11:10:10 +0000 (13:10 +0200)] 
Fix needs_build()

2 years agoDon't install a boot loader if we can't find bootctl
Daan De Meyer [Fri, 12 May 2023 08:42:54 +0000 (10:42 +0200)] 
Don't install a boot loader if we can't find bootctl

Also fail if a bootable image is requested and we can't find bootctl.

2 years agoDon't install a boot loader if no kernels are installed
Daan De Meyer [Fri, 12 May 2023 08:40:03 +0000 (10:40 +0200)] 
Don't install a boot loader if no kernels are installed

If a bootable image has not been explicitly requested, don't install
a boot loader if we can't find any kernel images installed in the image.

2 years agoCheck for btrfs before invoking run()
Daan De Meyer [Fri, 12 May 2023 08:13:31 +0000 (10:13 +0200)] 
Check for btrfs before invoking run()

check= does not handle missing binaries so let's check explicitly
before running btrfs.

2 years agoDo not reuse cache if there is no manifest
Daan De Meyer [Fri, 12 May 2023 06:26:26 +0000 (08:26 +0200)] 
Do not reuse cache if there is no manifest

This makes sure there's no need to remove the cache manually to
make sure the manifest gets generated.

2 years agoMerge pull request #1557 from DaanDeMeyer/vsock
Daan De Meyer [Fri, 12 May 2023 06:10:08 +0000 (08:10 +0200)] 
Merge pull request #1557 from DaanDeMeyer/vsock

Add a feature for enabling/disabling qemu vsock usage

2 years agoAdd a feature for enabling/disabling qemu vsock usage 1557/head
Daan De Meyer [Thu, 11 May 2023 13:26:52 +0000 (15:26 +0200)] 
Add a feature for enabling/disabling qemu vsock usage

2 years agoMove qemu logic into qemu.py
Daan De Meyer [Thu, 11 May 2023 13:18:38 +0000 (15:18 +0200)] 
Move qemu logic into qemu.py

We also introduce a new function qemu_check_vsock_support()

2 years agoMake config_kvm a proper ConfigFeature
Daan De Meyer [Thu, 11 May 2023 13:09:54 +0000 (15:09 +0200)] 
Make config_kvm a proper ConfigFeature

2 years agoMerge pull request #1555 from DaanDeMeyer/notify
Daan De Meyer [Thu, 11 May 2023 12:10:23 +0000 (14:10 +0200)] 
Merge pull request #1555 from DaanDeMeyer/notify

Propagate systemd exit status from the VM

2 years agoci: Add console=ttyS0 to the kernel command line 1555/head
Daan De Meyer [Thu, 11 May 2023 12:07:09 +0000 (14:07 +0200)] 
ci: Add console=ttyS0 to the kernel command line

It's the default but since we override the default we lose the
default value so add it back explicitly.

2 years agoUse /efi as the ESP path when building the image
Daan De Meyer [Thu, 11 May 2023 11:42:21 +0000 (13:42 +0200)] 
Use /efi as the ESP path when building the image

We used to use /boot because kernel-install would hardcode it but since
we don't use kernel-install anymore, let's use /efi instead. This way,
if anyone wants to install grub, they can do so in /boot and package
/boot up as an XBOOTLDR partition.

2 years agoci: Simplify checks
Daan De Meyer [Thu, 11 May 2023 11:53:15 +0000 (13:53 +0200)] 
ci: Simplify checks

Instead of mounting the filesystem and checking the contents of the
failed-services file, let's just shut down the machine with a non-zero
exit status if there are failed services. This works for both nspawn
and qemu now that we have the vsock notify socket set up.

2 years agoaction: Allow unprivileged access to kvm, vhost-vsock and vhost-net devices
Daan De Meyer [Thu, 11 May 2023 08:55:18 +0000 (10:55 +0200)] 
action: Allow unprivileged access to kvm, vhost-vsock and vhost-net devices

These are restricted on Debian/Ubuntu but we want to allow running
unprivileged qemu so let's loosen the permissions on these devices
to make that possible.

2 years agoFix vhost-vsock access check
Daan De Meyer [Thu, 11 May 2023 09:50:55 +0000 (11:50 +0200)] 
Fix vhost-vsock access check

Let's make sure we use exactly the same open() command that qemu
uses to check if we can access the /dev/vhost-vsock device.

2 years agoDrop kernel modules add/remove debug log messages
Daan De Meyer [Thu, 11 May 2023 09:37:54 +0000 (11:37 +0200)] 
Drop kernel modules add/remove debug log messages

Too noisy when there's lots of kernel modules

2 years agoPropagate systemd exit status from the VM
Daan De Meyer [Thu, 11 May 2023 08:45:54 +0000 (10:45 +0200)] 
Propagate systemd exit status from the VM

Let's make use of the new vmm.notify_socket credential to fetch
systemd's exit status from the VM and propagate it as our own exit
status, just like already happens automatically for containers with
systemd-nspawn.

2 years agoci: Drop epel repository for alma
Daan De Meyer [Thu, 11 May 2023 09:10:49 +0000 (11:10 +0200)] 
ci: Drop epel repository for alma

systemd-boot should be available in the base OS now.

2 years agoaction: Drop linux-modules-extra-azure again
Daan De Meyer [Thu, 11 May 2023 08:47:26 +0000 (10:47 +0200)] 
action: Drop linux-modules-extra-azure again

This doesn't work since the modules don't match the running kernel
version.

2 years agoFix output check
Daan De Meyer [Wed, 10 May 2023 16:54:40 +0000 (18:54 +0200)] 
Fix output check

2 years agoaction: Install extra azure modules package
Daan De Meyer [Wed, 10 May 2023 14:14:59 +0000 (16:14 +0200)] 
action: Install extra azure modules package

This contains the erofs kernel module which is required for mounting
erofs filesystems in systemd-nspawn.

2 years agoaction: Sort package list
Daan De Meyer [Wed, 10 May 2023 14:13:59 +0000 (16:13 +0200)] 
action: Sort package list

2 years agoFix failure when we have a build script without build packages
Daan De Meyer [Wed, 10 May 2023 12:56:47 +0000 (14:56 +0200)] 
Fix failure when we have a build script without build packages

2 years agoubuntu: Use linux-kvm package in CI
Daan De Meyer [Wed, 10 May 2023 08:15:24 +0000 (10:15 +0200)] 
ubuntu: Use linux-kvm package in CI

2 years agoDon't check for /usr/lib/kernel/cmdline on the host system
Daan De Meyer [Wed, 10 May 2023 08:13:27 +0000 (10:13 +0200)] 
Don't check for /usr/lib/kernel/cmdline on the host system

2 years agoFix --sign-expected-pcr
Daan De Meyer [Tue, 9 May 2023 15:01:28 +0000 (17:01 +0200)] 
Fix --sign-expected-pcr

Fall out from the introduction of ConfigFeature

2 years agoOnly try to apply ACL to image output if it's a directory
Daan De Meyer [Tue, 9 May 2023 09:56:35 +0000 (11:56 +0200)] 
Only try to apply ACL to image output if it's a directory

2 years agoMerge pull request #1548 from DaanDeMeyer/cache
Daan De Meyer [Tue, 9 May 2023 09:53:19 +0000 (11:53 +0200)] 
Merge pull request #1548 from DaanDeMeyer/cache

Add some very basic cache invalidation

2 years agoMake sure the initrd outputs are prefixed with the image name 1548/head
Daan De Meyer [Tue, 9 May 2023 09:23:13 +0000 (11:23 +0200)] 
Make sure the initrd outputs are prefixed with the image name

This makes sure that they're cleaned up in unlink_output() together with the image.

2 years agoAdd some very basic cache invalidation
Daan De Meyer [Tue, 9 May 2023 09:09:26 +0000 (11:09 +0200)] 
Add some very basic cache invalidation

Let's compare the packages, build packages, repositories and the
contents of the prepare script. This doesn't cover everything but
should be sufficient to catch most changes without having to run
with "-ff".

2 years agoMake sure we build initrd with same force as final image
Daan De Meyer [Tue, 9 May 2023 09:07:29 +0000 (11:07 +0200)] 
Make sure we build initrd with same force as final image

2 years agoMove save_cache() next to reuse_cache_tree()
Daan De Meyer [Tue, 9 May 2023 08:36:52 +0000 (10:36 +0200)] 
Move save_cache() next to reuse_cache_tree()

Also rename reuse_cache_tree() to reuse_cache().

2 years agoGet rid of build_stuff()
Daan De Meyer [Tue, 9 May 2023 08:16:05 +0000 (10:16 +0200)] 
Get rid of build_stuff()

The distinction between build_stuff() and build_image() is quite
arbitrary these days. build_stuff() used to build multiple images,
and build_image() would build a single image, but that's not the
case anymore, so let's merge build_stuff() into build_image().

2 years agoGet rid of init_mount_namespace()
Daan De Meyer [Tue, 9 May 2023 08:07:20 +0000 (10:07 +0200)] 
Get rid of init_mount_namespace()

Let's just unshare the mount namespace as well as part of
become_root(). Also stop making every mount a slave mount, since
we don't really care about host mounts propagating into our mount
namespace.

2 years agoDo not cache skeleton trees
Daan De Meyer [Tue, 9 May 2023 07:55:24 +0000 (09:55 +0200)] 
Do not cache skeleton trees

There's no point, we're either copying the files from the cache or
from the skeleton tree, so let's not duplicate those files
unnecessarily.

2 years agoGet rid of for_cache argument of build_image()
Daan De Meyer [Tue, 9 May 2023 07:50:41 +0000 (09:50 +0200)] 
Get rid of for_cache argument of build_image()

It's trivial to save and reuse the cache directly in build_image(),
so let's get rid of for_cache and just do the logic directly in
build_image().

2 years agoMerge pull request #1547 from DaanDeMeyer/fixes
Luca Boccassi [Mon, 8 May 2023 23:38:51 +0000 (00:38 +0100)] 
Merge pull request #1547 from DaanDeMeyer/fixes

Fixes

2 years agochmod /etc/machine-id and not the root directory 1547/head
Daan De Meyer [Mon, 8 May 2023 20:41:52 +0000 (22:41 +0200)] 
chmod /etc/machine-id and not the root directory

Fixes #1546

2 years agoMore ACL fixes
Daan De Meyer [Mon, 8 May 2023 20:25:43 +0000 (22:25 +0200)] 
More ACL fixes

Let's make sure we actually add ACLs to directories that initally
don't exist yet.

2 years agoMerge pull request #1545 from DaanDeMeyer/erofs
Daan De Meyer [Mon, 8 May 2023 14:06:18 +0000 (16:06 +0200)] 
Merge pull request #1545 from DaanDeMeyer/erofs

action: Install erofs-utils and drop zypper

2 years agoaction: Install erofs-utils and drop zypper 1545/head
Daan De Meyer [Mon, 8 May 2023 13:57:16 +0000 (15:57 +0200)] 
action: Install erofs-utils and drop zypper

2 years agoMerge pull request #1543 from DaanDeMeyer/firstboot
Daan De Meyer [Mon, 8 May 2023 13:39:24 +0000 (15:39 +0200)] 
Merge pull request #1543 from DaanDeMeyer/firstboot

Adopt systemd-firstboot

2 years agoSet tty size and term for /dev/console as well 1543/head
Daan De Meyer [Mon, 8 May 2023 07:40:09 +0000 (09:40 +0200)] 
Set tty size and term for /dev/console as well

When emergency.service is started, it's started connected to
/dev/console, so make sure we configure default term and tty size
for that one as well.

2 years agoACL fixes
Daan De Meyer [Sun, 7 May 2023 19:18:53 +0000 (21:18 +0200)] 
ACL fixes

- Toggle ACLs only if they're actually set in the first place on
inputs
- Toggle ACLs on skeleton and extra trees as well

2 years agoOutput size of each UKI we assemble
Daan De Meyer [Sun, 7 May 2023 18:06:30 +0000 (20:06 +0200)] 
Output size of each UKI we assemble

2 years agoMake KernelModulesInclude take priority over KernelModulesExclude=
Daan De Meyer [Sun, 7 May 2023 17:42:53 +0000 (19:42 +0200)] 
Make KernelModulesInclude take priority over KernelModulesExclude=

If exclude takes priority over include, it becomes hard to exclude
directories of drivers except for a few. If include takes priority
over exclude, we can do stuff like exclude "drivers/gpu/*" and
include "drivers/gpu/nvidia" to only include nvidia drivers.

The current behavior easily be reproduced by adding exclude "*"
followed by include patterns.

2 years agoAdd KernelModulesInclude= and KernelModulesExclude=
Daan De Meyer [Sun, 7 May 2023 16:18:13 +0000 (18:18 +0200)] 
Add KernelModulesInclude= and KernelModulesExclude=

These are like KernelModulesInitrdInclude= and
KernelModulesInitrdExclude= but they apply to the image itself
instead of to the kernel modules initrd.

The main use case is when using mkosi as an initramfs builder and
you want to exclude kernel modules from the initramfs but it can
also be useful when distros only ship large kernel packages that
you want to trim down.

2 years agoarch: Always exclude initramfs generator if we're doing a bootable image
Daan De Meyer [Sun, 7 May 2023 13:16:31 +0000 (15:16 +0200)] 
arch: Always exclude initramfs generator if we're doing a bootable image

The current condition is wrong as we'll generate an initrd ourselves
if none are provided by the user, so update the condition to not install
initramfs generators unless generating a bootable image is explicitly
disabled.

2 years agoKernel modules initramfs improvements
Daan De Meyer [Sun, 7 May 2023 13:05:23 +0000 (15:05 +0200)] 
Kernel modules initramfs improvements

- Use relative paths over full absolute paths
- Put all the firmware directories into the initramfs as well (just
the dirs, not all the firmware files)
- Return sets from resolve kernel modules function
- Operate on sorted lists of the sets to improve reproduciblity
- Split out filter_kernel_modules()
- Take builtin modules into account as well
- Use name field instead of filename from modinfo output
- Stop using joinpath() in favor of parentheses

2 years agoFall back to regular copying if doing a btrfs snapshot fails
Daan De Meyer [Sun, 7 May 2023 13:02:35 +0000 (15:02 +0200)] 
Fall back to regular copying if doing a btrfs snapshot fails

2 years agoGive disk images some extra free disk space when we boot them
Daan De Meyer [Sun, 7 May 2023 07:10:19 +0000 (09:10 +0200)] 
Give disk images some extra free disk space when we boot them

truncate creates the extra disk space sparse so this doesn't affect
the host's disk usage. The extra disk space will have to be partitioned
to be usable inside the image though (but this is perfect for systemd's
use case as we want to partition the free space with systemd-repart).

2 years agoIntroduce separate settings for configuring the verity key/certificate
Daan De Meyer [Sat, 6 May 2023 12:06:28 +0000 (14:06 +0200)] 
Introduce separate settings for configuring the verity key/certificate

These also default to mkosi.key and mkosi.crt but give the option to
use different files if required.

2 years agoFix sections for a number of settings
Daan De Meyer [Sat, 6 May 2023 11:45:13 +0000 (13:45 +0200)] 
Fix sections for a number of settings

Let's move a bunch of settings to a section that makes more sense
for them. No functional change, just moving stuff around.

2 years agoMake secure boot key and certificate required if set
Daan De Meyer [Sat, 6 May 2023 11:34:27 +0000 (13:34 +0200)] 
Make secure boot key and certificate required if set

If these are explicitly configured, we should make sure the paths
exist.