]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
8 months agoaction: Install to $HOME/.local/bin as well 3243/head
Daan De Meyer [Fri, 29 Nov 2024 09:27:56 +0000 (10:27 +0100)] 
action: Install to $HOME/.local/bin as well

8 months agoSkip tools checks for build step if output format is none
Daan De Meyer [Fri, 29 Nov 2024 08:37:45 +0000 (09:37 +0100)] 
Skip tools checks for build step if output format is none

If we're only running things up until the build scripts we're not
going to be running any of the tools we check for so skip the checks
in that case.

8 months agoFix unified kernel image profiles check
Daan De Meyer [Fri, 29 Nov 2024 08:34:33 +0000 (09:34 +0100)] 
Fix unified kernel image profiles check

Turns out we already had this check, so remove the extra one we added
and fix the existing one.

8 months agoFix Partition split_path calculation
Daan De Meyer [Thu, 28 Nov 2024 21:43:03 +0000 (22:43 +0100)] 
Fix Partition split_path calculation

Now that we use workdir() in make_image(), we have to change the
Partition initializer to remove the path added by workdir() again
to get the proper path on the host.

Fixes #3242.

8 months agoImprove maybe_compress() formatting
Daan De Meyer [Thu, 28 Nov 2024 21:41:16 +0000 (22:41 +0100)] 
Improve maybe_compress() formatting

8 months agoRevert "Remove tools argument from finaiize_default_initrd()"
Daan De Meyer [Wed, 27 Nov 2024 18:52:27 +0000 (19:52 +0100)] 
Revert "Remove tools argument from finaiize_default_initrd()"

This reverts commit 75a22e52602f18f887a0bac82eaf84e5983941c1.

8 months agoMake sure ukify is recent enough to build UKI profiles
Daan De Meyer [Tue, 26 Nov 2024 15:34:14 +0000 (16:34 +0100)] 
Make sure ukify is recent enough to build UKI profiles

8 months agoMerge pull request #3233 from DaanDeMeyer/initrd
Daan De Meyer [Tue, 26 Nov 2024 15:38:03 +0000 (16:38 +0100)] 
Merge pull request #3233 from DaanDeMeyer/initrd

Various default initrd fixes

8 months agoRemove tools argument from finaiize_default_initrd() 3233/head
Daan De Meyer [Tue, 26 Nov 2024 14:52:32 +0000 (15:52 +0100)] 
Remove tools argument from finaiize_default_initrd()

Not required anymore since the tools tree isn't part of the cache
manifest anymore.

8 months agoRework default initrd cleanup
Daan De Meyer [Tue, 26 Nov 2024 14:48:38 +0000 (15:48 +0100)] 
Rework default initrd cleanup

Currently we only remove the default initrd image cache if the
main image cache is out-of-date and not if the initrd cache is
out-of-date.

Let's fix the problem by calling run_clean() separately on the default
initrd.

Fixes #3231

8 months agoFix metadata removal
Daan De Meyer [Tue, 26 Nov 2024 14:46:08 +0000 (15:46 +0100)] 
Fix metadata removal

8 months agoRemove --force from default initrd command line
Daan De Meyer [Tue, 26 Nov 2024 14:44:21 +0000 (15:44 +0100)] 
Remove --force from default initrd command line

We don't use the resulting Args instance so no point in passing
--force.

8 months agomkosi-initrd: Install btrfs-progs
Daan De Meyer [Sun, 24 Nov 2024 20:34:57 +0000 (21:34 +0100)] 
mkosi-initrd: Install btrfs-progs

Even if fsck.btrfs doesn't do anything particularly useful, given we
install the fs tools of all the other filesystems, let's install btrfs-progs
as well. This is also useful when using systemd-repart to create the
root filesystem on first boot.

8 months agoFix typo
Daan De Meyer [Sun, 24 Nov 2024 17:45:11 +0000 (18:45 +0100)] 
Fix typo

8 months agonspawn: Fix uidmap for build directory
Daan De Meyer [Sun, 24 Nov 2024 11:51:41 +0000 (12:51 +0100)] 
nspawn: Fix uidmap for build directory

The build directory is now owned by the running user as well so we
have to apply rootidmap just like we do with all the other mounts
already.

8 months agoMerge pull request #3227 from DaanDeMeyer/extra-search-paths
Daan De Meyer [Sat, 23 Nov 2024 15:10:45 +0000 (16:10 +0100)] 
Merge pull request #3227 from DaanDeMeyer/extra-search-paths

Use tools tree again for ssh, coredumpctl and journalctl

8 months agoDrop ForwardJournal= integration for coredumpctl and journalctl verbs 3227/head
Daan De Meyer [Sat, 23 Nov 2024 13:54:59 +0000 (14:54 +0100)] 
Drop ForwardJournal= integration for coredumpctl and journalctl verbs

Now that we have the sandbox verb, this is trivial to achieve with the
sandbox verb so let's keep the coredumpctl and journalctl verbs focused
solely on reading the journal and coredumps from the image itself and leave
inspecting the forwarded journal to mkosi sandbox.

Technically this breaks compat but I'm convinced nobody's actually using this
specific bit of integration so it shouldn't matter if we remove it.

8 months agoUse tools tree again for ssh, coredumpctl and journalctl
Daan De Meyer [Sat, 23 Nov 2024 13:36:19 +0000 (14:36 +0100)] 
Use tools tree again for ssh, coredumpctl and journalctl

In effect these verbs are very similar to the sandbox verb except
they run a predefined command line instead of an arbitrary one. So
let's make them behave the same as the sandbox verb when it comes to
the tools tree.

8 months agoFix CodeQL warning
Daan De Meyer [Sat, 23 Nov 2024 14:02:03 +0000 (15:02 +0100)] 
Fix CodeQL warning

8 months agomkosi-tools: Only install pkcs11-provider where available
Daan De Meyer [Fri, 22 Nov 2024 18:52:50 +0000 (19:52 +0100)] 
mkosi-tools: Only install pkcs11-provider where available

Fixes #3224

8 months agoDocument where kernels go
Brendan Jackman [Fri, 22 Nov 2024 16:54:41 +0000 (16:54 +0000)] 
Document where kernels go

As pointed out to me by Nils K on Matrix:

https://github.com/systemd/mkosi/blob/b2f818c6f7df0f9def7fc6eeec0de8354b67d02d/mkosi/bootloader.py#L726

8 months agoClarify shell vs boot in man page
Brendan Jackman [Fri, 22 Nov 2024 14:14:58 +0000 (14:14 +0000)] 
Clarify shell vs boot in man page

In retrospect it seems like this should have been obvious but it
confused me. Thanks to Daan for pointing it out on Matrix. Reword to
help out people like me in the future.

8 months agomkosi-initrd: Disable split artifacts
Daan De Meyer [Fri, 22 Nov 2024 13:21:25 +0000 (14:21 +0100)] 
mkosi-initrd: Disable split artifacts

8 months agoInclude machine name in virtiofsd unit name
Daan De Meyer [Fri, 22 Nov 2024 09:37:06 +0000 (10:37 +0100)] 
Include machine name in virtiofsd unit name

If the same directory is shared across multiple guests, we end up
with duplicate unit names even though we need separate virtiofsd
instances. Let's fix this by including the machine name in the
virtiofsd unit name so that the unit names will be unique across
guests.

8 months agoMake ConfigSetting generic
Septatrix [Wed, 20 Nov 2024 20:48:16 +0000 (21:48 +0100)] 
Make ConfigSetting generic

8 months agosysupdate: Make it work in combination with a tools tree
Daan De Meyer [Thu, 21 Nov 2024 20:51:43 +0000 (21:51 +0100)] 
sysupdate: Make it work in combination with a tools tree

- We have to make sure systemd-sysupdate looks at the os-release
from the host even when using a tools tree.
- systemd-sysupdate can't detect the root block device when running
with a tools tree. Let's abuse /run/systemd/volatile-root to shortcut
the detection logic instead.

8 months agomkosi-initrd: Include extra modules
Daan De Meyer [Thu, 21 Nov 2024 14:27:43 +0000 (15:27 +0100)] 
mkosi-initrd: Include extra modules

These are all modules that the kernel tries to load while in the
initrd on my laptop. All of these seem generic enough to include by
default.

8 months agoKeep track of collection resets from CLI arguments (fixes #3208)
Septatrix [Wed, 20 Nov 2024 22:10:45 +0000 (23:10 +0100)] 
Keep track of collection resets from CLI arguments (fixes #3208)

Previously it was only possible to completely reset but not append,
or only append but not reset to collection/list settings
via command line arguments.
Now we track if a setting has ever been set to None (i.e. reset)
during command line parsing.
This information is used during value finalization
to decide whether to merge both collections or only keep the CLI value.

8 months agoImprove formatting of needs_build() a little
Daan De Meyer [Wed, 20 Nov 2024 13:28:45 +0000 (14:28 +0100)] 
Improve formatting of needs_build() a little

8 months agoci: make the output of the formatting job actionable
Jörg Behrmann [Wed, 20 Nov 2024 09:24:19 +0000 (10:24 +0100)] 
ci: make the output of the formatting job actionable

8 months agoRename "systemd" signtool to "systemd-sbsign" signtool
Daan De Meyer [Wed, 20 Nov 2024 09:26:18 +0000 (10:26 +0100)] 
Rename "systemd" signtool to "systemd-sbsign" signtool

Matches the naming used by ukify.

8 months agoPass sandbox to workdir() in one more function
Daan De Meyer [Wed, 20 Nov 2024 09:23:15 +0000 (10:23 +0100)] 
Pass sandbox to workdir() in one more function

8 months agokmod: do not append glob to search for firmware if it is already there
Luca Boccassi [Wed, 20 Nov 2024 01:23:25 +0000 (01:23 +0000)] 
kmod: do not append glob to search for firmware if it is already there

Some kernel modules use globs in their firmware dependencies:

modinfo ath11k_pci
filename:       /lib/modules/6.11.7-amd64/kernel/drivers/net/wireless/ath/ath11k/ath11k_pci.ko.xz
firmware:       ath11k/WCN6855/hw2.1/*
firmware:       ath11k/WCN6855/hw2.0/*
firmware:       ath11k/QCN9074/hw1.0/*
firmware:       ath11k/QCA6390/hw2.0/*

Which means the glob uses a double "**" which breaks it, and the
firmwares are skipped. Do not add a "*" if it is already present in
the search value.

8 months agoPropagate --tools-tree-certificates to initrd build
Martin Hundebøll [Tue, 19 Nov 2024 11:11:25 +0000 (12:11 +0100)] 
Propagate --tools-tree-certificates to initrd build

The initrd build uses a config created from a "hand-crafted" command
line passed to `parse_config()`. This command line includes the relevant
settings (i.e. those deemed relevant for build the initrd) from the
"proper" config object.

Since the --tools-tree-certificates setting wasn't added to that command
line, it defaults to true regardless of any setting configured when
invoking mkosi. When building behind a cooperate (transparent) proxy
using a self-signed certificate, the initrd build fails when trying to
download packages (unless the needed packages happened to be downloaded
as part of a previous image build).

Make sure the --tools-tree-certificates setting applies to the initrd
build also, by explicitly including it in the hand-crafted command line.
The setting can be added unconditionally because of the default value
specified in config.py.

8 months agoMerge pull request #3207 from bluca/mkosi_install
Daan De Meyer [Tue, 19 Nov 2024 11:09:53 +0000 (12:09 +0100)] 
Merge pull request #3207 from bluca/mkosi_install

Assorted fixes for mkosi-initrd and kernel-install

8 months agokernel-install: do not try to remove split artifacts 3207/head
Luca Boccassi [Mon, 18 Nov 2024 22:56:58 +0000 (22:56 +0000)] 
kernel-install: do not try to remove split artifacts

They are no longer built in the staging area

8 months agokernel-install: plumb stdin/stdout
Luca Boccassi [Mon, 18 Nov 2024 22:43:59 +0000 (22:43 +0000)] 
kernel-install: plumb stdin/stdout

Otherwise cannot use pin prompts

8 months agokernel-install: do not remove uki from staging area
Luca Boccassi [Mon, 18 Nov 2024 22:15:36 +0000 (22:15 +0000)] 
kernel-install: do not remove uki from staging area

Needed by following kernel-install hooks

8 months agokernel-install: name uki output with .efi suffix
Luca Boccassi [Mon, 18 Nov 2024 22:14:50 +0000 (22:14 +0000)] 
kernel-install: name uki output with .efi suffix

90-uki-copy.install expects it

8 months agokernel-install: pass --kernel-image to mkosi-initrd if set
Luca Boccassi [Mon, 18 Nov 2024 22:14:17 +0000 (22:14 +0000)] 
kernel-install: pass --kernel-image to mkosi-initrd if set

kernel-install can be called with a path to a kernel file

8 months agomkosi-initrd: add --kernel-image parameter
Luca Boccassi [Mon, 18 Nov 2024 22:13:38 +0000 (22:13 +0000)] 
mkosi-initrd: add --kernel-image parameter

Will be used by kernel-install which can pass a path to a kernel file

8 months agoMerge pull request #3205 from DaanDeMeyer/tools
Jörg Behrmann [Tue, 19 Nov 2024 08:18:05 +0000 (09:18 +0100)] 
Merge pull request #3205 from DaanDeMeyer/tools

Various tools tree fixes

8 months agoRequire that default tools tree exists when mkosi -t none is invoked 3205/head
Daan De Meyer [Mon, 18 Nov 2024 20:16:40 +0000 (21:16 +0100)] 
Require that default tools tree exists when mkosi -t none is invoked

Let's insist on the default tools tree already existing when invoking
mkosi -t none without --force.

8 months agoAlso fail early if default tools tree is out of date without --force
Daan De Meyer [Mon, 18 Nov 2024 20:06:17 +0000 (21:06 +0100)] 
Also fail early if default tools tree is out of date without --force

We fail early if the tools tree does not exist and build or --force
was not specified, let's do the same if the tools tree is incremental
and the cache is out-of-date.

8 months agoRemove distribution from tools tree cache name
Daan De Meyer [Mon, 18 Nov 2024 20:00:10 +0000 (21:00 +0100)] 
Remove distribution from tools tree cache name

We already made the same change for the output, let's make the same
change for the cache name as well.

8 months agoDrop dead code
Daan De Meyer [Mon, 18 Nov 2024 19:59:29 +0000 (20:59 +0100)] 
Drop dead code

We don't use the returned Args object so no point in passing
--force.

8 months agoRename some opts to be more consistent
Michael Ferrari [Mon, 18 Nov 2024 16:48:45 +0000 (17:48 +0100)] 
Rename some opts to be more consistent

8 months agoMerge pull request #3204 from bluca/mkosi_initrd_debian
Daan De Meyer [Mon, 18 Nov 2024 13:07:51 +0000 (14:07 +0100)] 
Merge pull request #3204 from bluca/mkosi_initrd_debian

mkosi-initrd fixes

8 months agoAdd createrepo_c to Arch Linux tools tree
Daan De Meyer [Sun, 17 Nov 2024 18:13:44 +0000 (19:13 +0100)] 
Add createrepo_c to Arch Linux tools tree

8 months agoarchive: pass sandbox to workdir() 3204/head
Luca Boccassi [Mon, 18 Nov 2024 10:41:34 +0000 (10:41 +0000)] 
archive: pass sandbox to workdir()

Otherwise callign from 50-mkosi.install will fail:

‣ Creating cpio archive /tmp/kernel-install.staging.jNm85k/microcode…
cpio: cannot change to directory `/work/tmp/tmpnlxrwb7k/initrd-microcode-root': No such file or directory
‣ "cpio --create --reproducible --renumber-inodes --null --format=newc --quiet --directory /work/tmp/tmpnlxrwb7k/initrd-microcode-root" returned non-zero exit code 2.

8 months agoMark 50-mkosi.install as executable
Luca Boccassi [Sun, 17 Nov 2024 22:35:21 +0000 (22:35 +0000)] 
Mark 50-mkosi.install as executable

Allows it to be symlinked in /etc/kernel/install.d to always use latest
main from a repository

8 months agoMerge pull request #3200 from DaanDeMeyer/passwd-symlink
Daan De Meyer [Sun, 17 Nov 2024 16:31:49 +0000 (17:31 +0100)] 
Merge pull request #3200 from DaanDeMeyer/passwd-symlink

Use passwd symlinks instead of bind mounts

8 months agoAdd packages required for --qemu-gui to Arch tools tree 3200/head
Daan De Meyer [Sat, 16 Nov 2024 16:07:40 +0000 (17:07 +0100)] 
Add packages required for --qemu-gui to Arch tools tree

8 months agoqemu: Use advanced form of specifying display
Daan De Meyer [Sat, 16 Nov 2024 16:07:18 +0000 (17:07 +0100)] 
qemu: Use advanced form of specifying display

8 months agoInstall pkcs11-provider and opensc in tools tree
Daan De Meyer [Sat, 16 Nov 2024 14:50:20 +0000 (15:50 +0100)] 
Install pkcs11-provider and opensc in tools tree

Required for signing with openssl pkcs11 provider.

8 months agoOnly allow certificate files when not using systemd-sbsign
Daan De Meyer [Sat, 16 Nov 2024 14:50:06 +0000 (15:50 +0100)] 
Only allow certificate files when not using systemd-sbsign

8 months agoFix condition to also check the certificate source type
Daan De Meyer [Sat, 16 Nov 2024 14:49:45 +0000 (15:49 +0100)] 
Fix condition to also check the certificate source type

8 months agoDon't require sbsigntools for secure boot auto enroll unless required
Daan De Meyer [Sat, 16 Nov 2024 14:49:03 +0000 (15:49 +0100)] 
Don't require sbsigntools for secure boot auto enroll unless required

If bootctl 257 or newer is installed, we don't use sbsigntools anymore
so don't require it in that case.

8 months agoAdd ToolsTreePackageDirectories=
Daan De Meyer [Sat, 16 Nov 2024 14:47:43 +0000 (15:47 +0100)] 
Add ToolsTreePackageDirectories=

Sometimes, we want to add locally built rpm packages to the default
tools tree. For example, systemd-repart depends on mkfs binaries that
might not be available on the host system, so the only way to run it
is from within the tools tree, which means we need a way to install
systemd-repart built from source within the tools tree.

8 months agoUse passwd symlinks instead of bind mounts
Daan De Meyer [Fri, 15 Nov 2024 15:24:18 +0000 (16:24 +0100)] 
Use passwd symlinks instead of bind mounts

Bind mounts don't reflect changes to the original files if they're
replaced instead of modified. Let's use symlinks instead so that
changes to the original files are always reflected.

Fixes #3189

8 months agosandbox: Make --symlink work on top of existing files and symlinks
Daan De Meyer [Fri, 15 Nov 2024 15:22:59 +0000 (16:22 +0100)] 
sandbox: Make --symlink work on top of existing files and symlinks

With the new mount API, we can mount on top of existing symlinks and
files, so let's make use of that for --symlink.

8 months agosandbox; Only readlink() if the target is a symlink
Daan De Meyer [Fri, 15 Nov 2024 15:18:31 +0000 (16:18 +0100)] 
sandbox; Only readlink() if the target is a symlink

8 months agoCheck against 257~devel instead of 257
Daan De Meyer [Sun, 17 Nov 2024 12:18:42 +0000 (13:18 +0100)] 
Check against 257~devel instead of 257

Otherwise the new --secure-boot-auto-enroll= option isn't used with
devel and rc versions of systemd bootctl.

8 months agoAdd sound device when QemuGui=true
Davide Cavalca [Fri, 15 Nov 2024 04:43:09 +0000 (20:43 -0800)] 
Add sound device when QemuGui=true

8 months agoAdd --debug-sandbox
Daan De Meyer [Fri, 15 Nov 2024 11:51:19 +0000 (12:51 +0100)] 
Add --debug-sandbox

This will help in debugging sandbox related issues. We run the sandbox
with strace and detach on execve() so we don't strace the command that
we're running.

8 months agoMerge pull request #3196 from DaanDeMeyer/excl
Jörg Behrmann [Fri, 15 Nov 2024 12:17:01 +0000 (13:17 +0100)] 
Merge pull request #3196 from DaanDeMeyer/excl

sandbox: Akways use O_EXCL with O_CREAT

8 months agoDetect home directories outside of /home properly
Daan De Meyer [Fri, 15 Nov 2024 10:27:09 +0000 (11:27 +0100)] 
Detect home directories outside of /home properly

Fixes #3191

8 months agoCheck for apt keyring in tools tree
Daan De Meyer [Thu, 14 Nov 2024 16:04:12 +0000 (17:04 +0100)] 
Check for apt keyring in tools tree

8 months agosandbox: Only create parent directories if dst does not exist yet 3196/head
Daan De Meyer [Fri, 15 Nov 2024 11:05:53 +0000 (12:05 +0100)] 
sandbox: Only create parent directories if dst does not exist yet

8 months agosandbox: Akways use O_EXCL with O_CREAT
Daan De Meyer [Fri, 15 Nov 2024 10:52:00 +0000 (11:52 +0100)] 
sandbox: Akways use O_EXCL with O_CREAT

In all cases we want to make sure that we're the ones creating the
file so let's specify O_EXCL.

9 months agoMake Check-Valid-Until=false a default flag for apt-get
Artyom Bakhtin [Thu, 14 Nov 2024 17:18:07 +0000 (17:18 +0000)] 
Make Check-Valid-Until=false a default flag for apt-get

Signed-off-by: Artyom Bakhtin <a@bakhtin.net>
9 months agoCheck that systemd-sbsign is available before using it.
Daan De Meyer [Thu, 14 Nov 2024 13:04:50 +0000 (14:04 +0100)] 
Check that systemd-sbsign is available before using it.

9 months agoFix new mypy error
Daan De Meyer [Thu, 14 Nov 2024 13:10:30 +0000 (14:10 +0100)] 
Fix new mypy error

9 months agoMake sure user provided cmdline is always last
Daan De Meyer [Mon, 11 Nov 2024 15:21:04 +0000 (16:21 +0100)] 
Make sure user provided cmdline is always last

Replaces #3158

9 months agoMerge pull request #3182 from NekkoDroid/image-identifier
Daan De Meyer [Thu, 14 Nov 2024 12:59:21 +0000 (13:59 +0100)] 
Merge pull request #3182 from NekkoDroid/image-identifier

Add %I specifier for subimages

9 months agoCheck that BuildSources= inputs are directories
Daan De Meyer [Tue, 12 Nov 2024 10:16:00 +0000 (11:16 +0100)] 
Check that BuildSources= inputs are directories

Fixes #3181

9 months agofixup: GitHub Action: Install all required mkosi dependencies
Davide Cavalca [Wed, 13 Nov 2024 02:41:12 +0000 (18:41 -0800)] 
fixup: GitHub Action: Install all required mkosi dependencies

8505a5303bb0c65991faf59a45409330e0c16a92 lost the --assume-yes
--no-install-recommends. While the former seems to be implicit in the
GitHub runner environment, the latter isn't, and it seems best to leave
both in place.

9 months agoFix man page reference to --tools-tree-packages
Davide Cavalca [Tue, 12 Nov 2024 04:52:25 +0000 (20:52 -0800)] 
Fix man page reference to --tools-tree-packages

This should be --tools-tree-package.

9 months agoExpose subimage name as envvar in scripts 3182/head
Michael Ferrari [Mon, 11 Nov 2024 12:34:50 +0000 (13:34 +0100)] 
Expose subimage name as envvar in scripts

9 months agoAdd %I specifier for subimages
Michael Ferrari [Mon, 11 Nov 2024 12:30:57 +0000 (13:30 +0100)] 
Add %I specifier for subimages

This expands to the name of the subimage (and an empty string for the
main image) and is the same value that is used for Dependencies=.

Fixes: #2566
9 months agoRefactor resolve_deps and reorder after configure
Michael Ferrari [Mon, 11 Nov 2024 01:18:22 +0000 (02:18 +0100)] 
Refactor resolve_deps and reorder after configure

As a configure script can modify the config in nearly any way it pleases
it is not impossible that dependencies may be resolved at runtime. So
just rerun dependency resolution after all configure scripts have done
their stuff.

9 months agoGitHub Action: Install all required mkosi dependencies
Davide Cavalca [Mon, 11 Nov 2024 14:07:35 +0000 (06:07 -0800)] 
GitHub Action: Install all required mkosi dependencies

9 months agoAdd support for systemd-sbsign and --certificate-source
Daan De Meyer [Tue, 5 Nov 2024 12:56:28 +0000 (13:56 +0100)] 
Add support for systemd-sbsign and --certificate-source

Matching PR for https://github.com/systemd/systemd/pull/35021
and https://github.com/systemd/systemd/pull/35057

9 months agoDon't put /usr/bin and /usr/sbin in front of extra search paths in $PATH
Daan De Meyer [Mon, 4 Nov 2024 11:51:27 +0000 (12:51 +0100)] 
Don't put /usr/bin and /usr/sbin in front of extra search paths in $PATH

Currently extra search paths don't get used because we always add /usr/bin
and /usr/sbin earlier in $PATH.

9 months agoMerge pull request #3166 from DaanDeMeyer/provider
Jörg Behrmann [Mon, 4 Nov 2024 01:19:08 +0000 (02:19 +0100)] 
Merge pull request #3166 from DaanDeMeyer/provider

Add support for openssl providers as key sources

9 months agoAdd support for openssl providers as key sources 3166/head
Daan De Meyer [Sun, 3 Nov 2024 17:08:07 +0000 (18:08 +0100)] 
Add support for openssl providers as key sources

9 months agoMake sure we only parse [Include] and [Host] from builtin configs as well
Daan De Meyer [Sun, 3 Nov 2024 19:31:01 +0000 (20:31 +0100)] 
Make sure we only parse [Include] and [Host] from builtin configs as well

When we're reusing the history, we were still parsing all sections
from builtin configs instead of only the [Include] and [Host] sections.

9 months agoRemove sandbox verb from needs_build()
Daan De Meyer [Sun, 3 Nov 2024 19:18:39 +0000 (20:18 +0100)] 
Remove sandbox verb from needs_build()

It's not a clear cut case whether the sandbox needs a build or not.
The needs_build() method was originally intended for verbs that need
a full image build but the sandbox build only needs the tools tree.
Also, the tools tree is only built if ToolsTree=default and not if
set explicitly.

More practically, we don't want the JSON history from .mkosi-private
to be used when using mkosi sandbox, and that's the only usage of
the needs_build() method, so to fix that problem let's remove the sandbox
verb from needs_build().

9 months agoMerge pull request #3161 from DaanDeMeyer/enroll
Daan De Meyer [Sun, 3 Nov 2024 13:10:24 +0000 (14:10 +0100)] 
Merge pull request #3161 from DaanDeMeyer/enroll

Add support for bootctl secure boot auto enrollment

9 months agoAdd support for bootctl secure boot auto enrollment 3161/head
Daan De Meyer [Fri, 1 Nov 2024 19:00:55 +0000 (20:00 +0100)] 
Add support for bootctl secure boot auto enrollment

Matching PR for https://github.com/systemd/systemd/pull/34948

9 months agoSort package list
Daan De Meyer [Sun, 3 Nov 2024 12:01:10 +0000 (13:01 +0100)] 
Sort package list

9 months agoAdd libseccomp to default tools tree
Daan De Meyer [Sun, 3 Nov 2024 12:00:48 +0000 (13:00 +0100)] 
Add libseccomp to default tools tree

Required by mkosi-sandbox

9 months agoPass configured environment to ukify
Daan De Meyer [Fri, 1 Nov 2024 18:54:32 +0000 (19:54 +0100)] 
Pass configured environment to ukify

9 months agoSet up a private session keyring for engine pin caching
Daan De Meyer [Fri, 1 Nov 2024 18:50:10 +0000 (19:50 +0100)] 
Set up a private session keyring for engine pin caching

If we're using an engine as a key source, let's set up a private
session keyring and configure systemd tooling to store pins in the
session keyring with infinite lifetime. This means systemd will only
prompt for a pin once per key and reuse the cached pin from the session
keyring from that point onwards. The session keyring is automatically
removed when mkosi exits.

9 months agoSet zero owner UUID for secure boot signature databases
Daan De Meyer [Fri, 1 Nov 2024 17:50:44 +0000 (18:50 +0100)] 
Set zero owner UUID for secure boot signature databases

Makes things more reproducible compared to using a random UUID.

9 months agoMerge pull request #3164 from DaanDeMeyer/sandbox
Daan De Meyer [Sun, 3 Nov 2024 09:47:44 +0000 (10:47 +0100)] 
Merge pull request #3164 from DaanDeMeyer/sandbox

Add sandbox verb

9 months agoAdd some extra tools tree packages to the default image 3164/head
Daan De Meyer [Sat, 2 Nov 2024 20:26:56 +0000 (21:26 +0100)] 
Add some extra tools tree packages to the default image

Now that we have mkosi sandbox, let's add ruff, mypy and pytest to
the tools tree so that they can be used with mkosi sandbox.

9 months agoAdd sandbox verb
Daan De Meyer [Sat, 2 Nov 2024 17:57:31 +0000 (18:57 +0100)] 
Add sandbox verb

In systemd, to run the integration tests, we need to run meson on
the host which will itself invoke mkosi to run the integration tests.
This means all the dependencies to run meson need to be installed on
the host. This doesn't just mean meson needs to be installed, but also
a compiler and various required build dependencies of systemd to allow
building tools invoked by mkosi to build the image.

To avoid having to install these dependencies on the host system, let's
introduce a sandbox verb which runs a command in the mkosi sandbox that's
also used by other verbs such as boot, qemu and shell. This then allows
extra required tools to be installed in the tools tree via ToolsTreePackages=
to allow running these commands without having to install them on the host
system.

9 months agoDrop tools tree from cache manifest
Daan De Meyer [Sat, 2 Nov 2024 19:39:53 +0000 (20:39 +0100)] 
Drop tools tree from cache manifest

The existing check is too primitive and actually causes issues when
using the new mkosi sandbox verb we'll add in the next commit so let's
drop it.

9 months agoAlways mount in /usr/share/factory from the host in relaxed sandbox
Daan De Meyer [Sat, 2 Nov 2024 17:55:51 +0000 (18:55 +0100)] 
Always mount in /usr/share/factory from the host in relaxed sandbox

If we're using /etc from the host, also use /usr/share/factory from
the host to account for symlinks from /etc into /usr/share/factory.