]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
5 months agoAdd zypper to the tools image on Arch Linux 3504/head
Christian Heusel [Thu, 13 Feb 2025 15:28:24 +0000 (16:28 +0100)] 
Add zypper to the tools image on Arch Linux

Suggested-by: Jörg Behrmann <behrmann@physik.fu-berlin.de>
Signed-off-by: Christian Heusel <christian@heusel.eu>
5 months agoman: Document zypper being added to Arch Repos
Christian Heusel [Thu, 13 Feb 2025 14:15:40 +0000 (15:15 +0100)] 
man: Document zypper being added to Arch Repos

Signed-off-by: Christian Heusel <christian@heusel.eu>
5 months agoForce ssh to use bash to run the ProxyCommand
Daan De Meyer [Thu, 13 Feb 2025 09:14:32 +0000 (10:14 +0100)] 
Force ssh to use bash to run the ProxyCommand

We only have bash installed in the tools tree and by default ssh
will try to use the user's shell to execute the proxy command which
might not be available so force it use bash.

Fixes #3500

6 months agoMerge pull request #3499 from DaanDeMeyer/netesp
Daan De Meyer [Wed, 12 Feb 2025 20:33:34 +0000 (21:33 +0100)] 
Merge pull request #3499 from DaanDeMeyer/netesp

6 months agoAdd OutputExtension= 3499/head
Daan De Meyer [Wed, 12 Feb 2025 11:00:53 +0000 (12:00 +0100)] 
Add OutputExtension=

6 months agoAllow building esp images without a UKI
Daan De Meyer [Wed, 12 Feb 2025 10:44:25 +0000 (11:44 +0100)] 
Allow building esp images without a UKI

Let's only add a UKI to these if the required components are installed.

6 months agoRequire delimiting extra options for invoked commands with '--'
Daan De Meyer [Wed, 12 Feb 2025 09:49:59 +0000 (10:49 +0100)] 
Require delimiting extra options for invoked commands with '--'

This is one of the biggest footguns when using mkosi so let's break
compat and fix it. Any options that should be passed to the command
invoked by mkosi when using various verbs should be delimited from
regular options now using '--'.

Fixes #3165

6 months agokmod: run proper cmdline in modinfo
Antonio Alvarez Feijoo [Wed, 12 Feb 2025 10:57:26 +0000 (11:57 +0100)] 
kmod: run proper cmdline in modinfo

Fixes a4818d7defc816c0d00322815597524597ed7818

6 months agoMerge pull request #3496 from DaanDeMeyer/sandbox
Daan De Meyer [Tue, 11 Feb 2025 18:57:32 +0000 (19:57 +0100)] 
Merge pull request #3496 from DaanDeMeyer/sandbox

mkosi-sandbox: Implement --pack-fds

6 months agoStrip --suspend from --debug-shell sandbox 3496/head
Daan De Meyer [Tue, 11 Feb 2025 17:01:17 +0000 (18:01 +0100)] 
Strip --suspend from --debug-shell sandbox

6 months agorun: Remove unused user/group arguments from run()
Daan De Meyer [Tue, 11 Feb 2025 15:07:27 +0000 (16:07 +0100)] 
run: Remove unused user/group arguments from run()

6 months agorun: Simplify spawn()
Daan De Meyer [Tue, 11 Feb 2025 14:58:38 +0000 (15:58 +0100)] 
run: Simplify spawn()

Let's reduce the nesting by stopping usage of Popen() as a context
manager. It's __exit__() method doesn't handle anything important that
we don't already handle ourselves. Let's also only handle
FileNotFoundError when spawning the process but not after yielding.
Finally, get rid of the failed() nested function as it only has one
remaining caller.

6 months agomkosi-sandbox: Implement --pack-fds
Daan De Meyer [Tue, 11 Feb 2025 14:48:29 +0000 (15:48 +0100)] 
mkosi-sandbox: Implement --pack-fds

This allows us to move the file descriptor packing logic from spawn()
to mkosi-sandbox. The main advantage here is that we can pass file
descriptors now without necessarily packing them together, which we now
only do for systemd-journal-remote which requires it.

6 months agoMerge pull request #3494 from bluca/obs_repart
Luca Boccassi [Tue, 11 Feb 2025 16:04:13 +0000 (16:04 +0000)] 
Merge pull request #3494 from bluca/obs_repart

Add SplitArtifacts=roothash

6 months agomkosi-obs: split and sign dm-verity roothashes 3494/head
Luca Boccassi [Mon, 10 Feb 2025 22:59:03 +0000 (22:59 +0000)] 
mkosi-obs: split and sign dm-verity roothashes

6 months agoAdd SplitArtifacts=roothash
Luca Boccassi [Mon, 10 Feb 2025 22:17:03 +0000 (22:17 +0000)] 
Add SplitArtifacts=roothash

6 months agopartition: do not return TBD as roothash
Luca Boccassi [Tue, 11 Feb 2025 13:19:15 +0000 (13:19 +0000)] 
partition: do not return TBD as roothash

When a verity partition is skipped/deferred (eg: second run for ESP
partitioning) the JSON output will list the roothash as 'TBD' which
is obviously not valid, so skip it in that case

6 months agoman: document SplitArtifacts=pcrs
Luca Boccassi [Mon, 10 Feb 2025 22:19:48 +0000 (22:19 +0000)] 
man: document SplitArtifacts=pcrs

Follow-up for 393b16cf8410c40695b776e709a4b8029c860c0c

6 months agoman: Remove erroneous FD parameter
Nils K [Tue, 11 Feb 2025 14:03:17 +0000 (15:03 +0100)] 
man: Remove erroneous FD parameter

6 months agoMerge pull request #3493 from DaanDeMeyer/process-group
Daan De Meyer [Tue, 11 Feb 2025 12:50:49 +0000 (13:50 +0100)] 
Merge pull request #3493 from DaanDeMeyer/process-group

serve: Add StorageTargetMode= feature

6 months agoMake various tools more quiet 3493/head
Daan De Meyer [Tue, 11 Feb 2025 10:14:09 +0000 (11:14 +0100)] 
Make various tools more quiet

Let's reduce the noise when booting a vm with mkosi vm by silencing
the output of some tools used during setup that isn't useful.

6 months agoMake VM registration work unprivileged
Daan De Meyer [Mon, 10 Feb 2025 20:24:37 +0000 (21:24 +0100)] 
Make VM registration work unprivileged

Since systemd 257, it's possible for unprivileged users to register
VMs with systemd-machined (gated behind polkit). So let's not require
root privileges to register virtual machines with systemd-machined, but
only do it as an unprivileged user if registration is explicitly requested
to avoid the polkit prompt.

To avoid having to detect which systemd version the system is running,
we skip errors on varlink registration for now when running unprivileged.
https://github.com/systemd/systemd/pull/36344 will allow us to detect if
the machined varlink interface can be accessed as an unprivileged user or
not.

6 months agosandbox: Replace --exec-fd with --suspend
Daan De Meyer [Tue, 11 Feb 2025 09:54:13 +0000 (10:54 +0100)] 
sandbox: Replace --exec-fd with --suspend

Let's change our synchronization mechanism from a file descriptor
to use SIGSTOP instead. This is both simpler and gives us a two way
synchronization mechanism. We can wait in the parent for the initialization
to complete just like before by waiting for the process to go into the
stopped state. But we can also have the subprocess wait indefinitely
until the parent tells it to continue by sending the SIGCONT signal. We make
use of this to register the qemu VM with systemd-machined before actually
starting the qemu process itself.

6 months agoserve: Add StorageTargetMode= feature
Daan De Meyer [Mon, 10 Feb 2025 18:18:46 +0000 (19:18 +0100)] 
serve: Add StorageTargetMode= feature

Let's make it configurable whether we run systemd-storagetm as part
of serve.

6 months agoDrop foreground process logic
Daan De Meyer [Tue, 11 Feb 2025 09:29:37 +0000 (10:29 +0100)] 
Drop foreground process logic

Let's stop messing around with process groups in favor of handling
terminal signals properly ourselves. We had to use process groups in
the past because we still used subprocess.run() which meant that by
the time we had a chance to handle KeyboardInterrupt(), the subprocess
would have already been SIGKILLed by subprocess.run(). Now that we don't
use subprocess.run() anymore, we can catch KeyboardInterrupt() at the
right time and forward it to the child process.

For the mkosi process itself, we have to modify the signal handlers
slightly to make sure we only raise the KeyboardInterrupt() exception
once, as when we're running a forked subprocess, both the parent process
and the forked subprocess will receive SIGINT if Ctrl+C is entered on the
terminal, and the parent process will forward the SIGINT to the child process,
which is already handling its own SIGINT, causing KeyboardInterrupt() to get
raised twice if we don't add an extra check to the signal handler to make sure
it only gets raised once.

6 months agomkosi: support nvme-over-tcp in the initrd + thunderbolt-net
Lennart Poettering [Mon, 10 Feb 2025 15:21:51 +0000 (16:21 +0100)] 
mkosi: support nvme-over-tcp in the initrd + thunderbolt-net

Let's make storage target mode a thing, and support nvme-over-tcp in the
initrd, as well as thunderbolt-net.

nvme-over-tcp probably makes sense anyway for supporting the probbaly
best way to do network booting these days.

6 months agoAdd ToolsTreePrepareScripts=
Daan De Meyer [Sun, 9 Feb 2025 15:04:32 +0000 (16:04 +0100)] 
Add ToolsTreePrepareScripts=

Let's give users a way to make arbitrary modifications to the default
tools tree.

6 months agoShow better error when script fails with exit code 127
Daan De Meyer [Sun, 9 Feb 2025 21:11:44 +0000 (22:11 +0100)] 
Show better error when script fails with exit code 127

Fixes #3481

6 months agoMerge pull request #3377 from bluca/obs
Daan De Meyer [Mon, 10 Feb 2025 08:03:12 +0000 (09:03 +0100)] 
Merge pull request #3377 from bluca/obs

6 months agovmspawn: Pass extra qemu arguments
Daan De Meyer [Sat, 8 Feb 2025 20:46:55 +0000 (21:46 +0100)] 
vmspawn: Pass extra qemu arguments

6 months agoStart systemd-storagetm in mkosi serve as well if available
Daan De Meyer [Sat, 8 Feb 2025 11:25:57 +0000 (12:25 +0100)] 
Start systemd-storagetm in mkosi serve as well if available

Allows accessing a disk image over NVME-TCP instead of having to
download it completely over HTTP.

6 months agoAdd mkosi-obs conf and scripts for multi-stage signing 3377/head
Luca Boccassi [Sat, 18 Jan 2025 19:39:16 +0000 (19:39 +0000)] 
Add mkosi-obs conf and scripts for multi-stage signing

Signs both PCR digests (including multi-profile) and UKIs
themselves. Requires new ukify.

6 months agoAdd support for SplitArtifacts=pcrs
Luca Boccassi [Tue, 28 Jan 2025 16:22:43 +0000 (16:22 +0000)] 
Add support for SplitArtifacts=pcrs

When building a UKI emit a JSON blob containing all the PCR
policy blobs, so that it can be signed offline. A single JSON
file is written out, even if multiple profiles are used, as
ukify can be used to reattach a single blob and will ensure
the right signature is applied to the right PE .pcrsig section
in case of multiple profiles.

6 months agoUse ukify --pcr-certificate= if available
Luca Boccassi [Sat, 8 Feb 2025 18:53:26 +0000 (18:53 +0000)] 
Use ukify --pcr-certificate= if available

6 months agoAdd support for SplitArtifacts=tar
Daan De Meyer [Sat, 8 Feb 2025 09:59:05 +0000 (10:59 +0100)] 
Add support for SplitArtifacts=tar

6 months agoAdd FirmwareInclude= and FirmwareExclude= options
Antonio Alvarez Feijoo [Fri, 7 Feb 2025 10:55:44 +0000 (11:55 +0100)] 
Add FirmwareInclude= and FirmwareExclude= options

Rigth now, firmware added to the image is determined as a dependency of any
added kernel modules. However, a common use case is that a user may need to
force certain firmware to be included or excluded regardless of that dependency.

6 months agodoc: Add a note about dependencies for systemd-boot
9cel [Fri, 7 Feb 2025 04:55:32 +0000 (00:55 -0400)] 
doc: Add a note about dependencies for systemd-boot

6 months agoCheck MinimumVersion= during config parsing
Daan De Meyer [Fri, 7 Feb 2025 09:08:09 +0000 (10:08 +0100)] 
Check MinimumVersion= during config parsing

We fail on unknown settings, so currently if the mkosi version is too
old, we fail during config parsing before we ever get to check if the
current version is older than the minimum version.

Let's fix this by checking the minimum version during config parsing
itself. This means it can't be overridden later on anymore with a lower
version during config parsing but I doubt this will ever happen in the
first place.

6 months agoRework verity setting handling
Daan De Meyer [Thu, 6 Feb 2025 12:43:49 +0000 (13:43 +0100)] 
Rework verity setting handling

Let's get rid of want_verity() and do explicit checks everywhere
instead.

Replaces #3477

6 months agoMerge pull request #3480 from behrmann/fspath
Daan De Meyer [Fri, 7 Feb 2025 09:25:26 +0000 (10:25 +0100)] 
Merge pull request #3480 from behrmann/fspath

Use `os.fspath` in more places

6 months agodocs: add CODING_STYLE.md 3480/head
Jörg Behrmann [Thu, 6 Feb 2025 15:06:23 +0000 (16:06 +0100)] 
docs: add CODING_STYLE.md

6 months agouser: drop unneeded stringification
Jörg Behrmann [Thu, 6 Feb 2025 14:55:23 +0000 (15:55 +0100)] 
user: drop unneeded stringification

6 months agotreewide: exchange str for os.fspath were appropriate
Jörg Behrmann [Thu, 6 Feb 2025 14:49:17 +0000 (15:49 +0100)] 
treewide: exchange str for os.fspath were appropriate

All objects have a __str__ method, but pathlike objects define a protocol
__fspath__, let's use that where we haven't so far.

6 months agoMerge pull request #3479 from DaanDeMeyer/overlayfs
Daan De Meyer [Thu, 6 Feb 2025 15:27:34 +0000 (16:27 +0100)] 
Merge pull request #3479 from DaanDeMeyer/overlayfs

tree: Don't copy xattrs to overlayfs

6 months agoCheck if systemd is actually running before using run0
Daan De Meyer [Thu, 6 Feb 2025 11:49:10 +0000 (12:49 +0100)] 
Check if systemd is actually running before using run0

If we're not running systemd, we can't use run0 either, so use sudo
in that case.

6 months agotree: Don't copy xattrs to overlayfs if security.selinux is one 3479/head
Daan De Meyer [Thu, 6 Feb 2025 13:40:36 +0000 (14:40 +0100)] 
tree: Don't copy xattrs to overlayfs if security.selinux is one

Trying to copy the selinux xattrs to a directory in an overlayfs
filesystem will fail with "Operation not supported". There's no way
to instruct cp to not copy or ignore failures to copy selinux xattrs
so let's instead not try to copy xattrs at all when copying to directories
in overlayfs filesystems and security.selinux is in the list of xattrs.

6 months agotree: Don't try to snapshot subvolume if destination isn't btrfs
Daan De Meyer [Thu, 6 Feb 2025 13:40:14 +0000 (14:40 +0100)] 
tree: Don't try to snapshot subvolume if destination isn't btrfs

6 months agoMerge pull request #3475 from DaanDeMeyer/fedora-key
Jörg Behrmann [Thu, 6 Feb 2025 13:53:26 +0000 (14:53 +0100)] 
Merge pull request #3475 from DaanDeMeyer/fedora-key

Various rpm gpg key lookup fixes

6 months agorpm: Fix root locations for GPG searching 3475/head
Daan De Meyer [Thu, 6 Feb 2025 11:05:05 +0000 (12:05 +0100)] 
rpm: Fix root locations for GPG searching

We should always look in the tools tree for /usr/share/distribution-gpg-keys,
regardless of the value of ToolsTreeCertificates= since the setting has no
impact on which /usr/share/distribution-gpg-keys directory we end up using.

We should look in the host or tools tree for /etc/pki/rpm-gpg, based on the
value of ToolsTreeCertificates=, not in the sandbox tree, because the /etc/pki
directory from the host or tools tree will always be used and mounted over the
directory from the sandbox tree, so there's no point in looking for rpm gpg keys
in the sandbox tree at all.

6 months agofedora: Do GPG key symlink resolution in find_rpm_gpgkey()
Daan De Meyer [Thu, 6 Feb 2025 10:26:48 +0000 (11:26 +0100)] 
fedora: Do GPG key symlink resolution in find_rpm_gpgkey()

We have to resolve the symlink within the tools tree if there is
one, so let's handle this in find_rpm_gpgkey() instead of outside.

6 months agofedora: Don't fail if we can't find N+1 key
Daan De Meyer [Thu, 6 Feb 2025 10:18:45 +0000 (11:18 +0100)] 
fedora: Don't fail if we can't find N+1 key

It might not be there set, so don't fail if it isn't there.

6 months agofedora: Try to load N+1 key from distribution-gpg-keys as well
Daan De Meyer [Thu, 6 Feb 2025 09:54:45 +0000 (10:54 +0100)] 
fedora: Try to load N+1 key from distribution-gpg-keys as well

Fetching the rawhide keys from the distribution-gpg-keys github
repository faces the same problem that we have when using the locally
installed distribution-gpg-keys, the rawhide symlink might not have
been updated yet at branching time, so apply the same solution and
try to load the N+1 key as well.

6 months agoAdd SignExpectedPcr= setting for UKI profiles
Daan De Meyer [Tue, 28 Jan 2025 08:44:23 +0000 (09:44 +0100)] 
Add SignExpectedPcr= setting for UKI profiles

6 months agomkosi-initrd: add option to build generic initrds
Antonio Alvarez Feijoo [Wed, 5 Feb 2025 12:42:55 +0000 (13:42 +0100)] 
mkosi-initrd: add option to build generic initrds

That is, add the default kernel modules defined in the mkosi-initrd
configuration instead of the loaded modules in the host.

6 months agomkosi-tools: Add qemu packages for --console=gui to Fedora
Daan De Meyer [Tue, 4 Feb 2025 20:56:09 +0000 (21:56 +0100)] 
mkosi-tools: Add qemu packages for --console=gui to Fedora

6 months agoMerge pull request #3466 from DaanDeMeyer/extension-repart-definitions
Luca Boccassi [Wed, 5 Feb 2025 13:31:15 +0000 (13:31 +0000)] 
Merge pull request #3466 from DaanDeMeyer/extension-repart-definitions

Extend Verity= to support hash-only verity and deferred verity-sig

6 months agoman: document mkosi-addon in builtin configs
Antonio Alvarez Feijoo [Wed, 5 Feb 2025 13:03:50 +0000 (14:03 +0100)] 
man: document mkosi-addon in builtin configs

6 months agoAdd "defer" setting for Verity 3466/head
Daan De Meyer [Mon, 3 Feb 2025 16:22:30 +0000 (17:22 +0100)] 
Add "defer" setting for Verity

This defers the creation of the verity-sig partition which is useful
when doing offline signing.

6 months ago Support unsigned verity backed extension/portable images
Martin Hundebøll [Tue, 28 Jan 2025 20:35:26 +0000 (21:35 +0100)] 
 Support unsigned verity backed extension/portable images

Building an unsigned extension image with verity hashes provides data
integrity without needing a certificate on the target machine.

Note that systemd-dissect and systemd-sysext doesn't automatically
use the verity data has partition for validation. Both tools enables
validation if the user.verity.roothash xattr is set for the image.
For systemd-dissect, one can use the --root-hash option to enable the
validation.

The root hash can be obtained by concatenating the partition uuid's for
the root and the root-verity partitions.

6 months agoDocumentation fix
Daan De Meyer [Tue, 4 Feb 2025 10:16:01 +0000 (11:16 +0100)] 
Documentation fix

6 months agoarch: Bump initrd size
Daan De Meyer [Tue, 4 Feb 2025 11:18:52 +0000 (12:18 +0100)] 
arch: Bump initrd size

6 months agoDrop two unneeded calls to umask()
Daan De Meyer [Tue, 4 Feb 2025 09:57:04 +0000 (10:57 +0100)] 
Drop two unneeded calls to umask()

Both these commands write temporary files to the workspace which
are not written to the image, so no need to care about the umask.

6 months agocompletion: complete paths after verb for zsh
Jörg Behrmann [Mon, 3 Feb 2025 11:57:05 +0000 (12:57 +0100)] 
completion: complete paths after verb for zsh

6 months agocompletion: complete paths after verb for bash
Jörg Behrmann [Mon, 3 Feb 2025 14:22:19 +0000 (15:22 +0100)] 
completion: complete paths after verb for bash

6 months agoDrop debug message about not including firmware
Daan De Meyer [Tue, 4 Feb 2025 09:44:16 +0000 (10:44 +0100)] 
Drop debug message about not including firmware

Too noisy in CI, especially on Arch where we install all firmware
so let's drop it.

6 months agomkosi-initrd: Add extra kernel modules
Daan De Meyer [Mon, 3 Feb 2025 14:29:58 +0000 (15:29 +0100)] 
mkosi-initrd: Add extra kernel modules

All this stuff gets loaded by udev on my laptop, isn't huge, and
doesn't pull in any firmware, so let's add these to the list of
kernel modules.

6 months agocompletion: complete paths after verb for fish
Jörg Behrmann [Mon, 3 Feb 2025 09:19:44 +0000 (10:19 +0100)] 
completion: complete paths after verb for fish

6 months agobuild(deps): bump redhat-plumbers-in-action/differential-shellcheck
dependabot[bot] [Sat, 1 Feb 2025 22:14:45 +0000 (22:14 +0000)] 
build(deps): bump redhat-plumbers-in-action/differential-shellcheck

Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.4.0 to 5.5.1.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/redhat-plumbers-in-action/differential-shellcheck/compare/cc6721c45a8800cc666de45493545a07a638d121...5fa026e4797665181a0f7c6fa4a73c09348ae78c)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agobuild(deps): bump github/codeql-action from 3.28.0 to 3.28.8
dependabot[bot] [Sat, 1 Feb 2025 22:14:43 +0000 (22:14 +0000)] 
build(deps): bump github/codeql-action from 3.28.0 to 3.28.8

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.0 to 3.28.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/48ab28a6f5dbc2a99bf1e0131198dd8f1df78169...dd746615b3b9d728a6a37ca2045b68ca76d4841a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months agoBump version to 26~devel
Daan De Meyer [Fri, 31 Jan 2025 09:32:22 +0000 (10:32 +0100)] 
Bump version to 26~devel

6 months agoRelease 25.3 v25.3
Daan De Meyer [Fri, 31 Jan 2025 09:32:20 +0000 (10:32 +0100)] 
Release 25.3

6 months agoMerge pull request #3455 from labichn/universal-secure-boot
Daan De Meyer [Thu, 30 Jan 2025 17:04:21 +0000 (18:04 +0100)] 
Merge pull request #3455 from labichn/universal-secure-boot

Make secure boot keys/crts/source config universal

6 months agoUpdate docs for universal secure boot/verity/pcr creds/sources 3455/head
Nick Labich [Thu, 30 Jan 2025 16:06:38 +0000 (11:06 -0500)] 
Update docs for universal secure boot/verity/pcr creds/sources

6 months agoMerge pull request #3451 from DaanDeMeyer/overlay
Jörg Behrmann [Thu, 30 Jan 2025 15:07:47 +0000 (16:07 +0100)] 
Merge pull request #3451 from DaanDeMeyer/overlay

Fix condition when removing duplicate files from the overlay

6 months agoSkip files outside of known paths for extension outputs 3451/head
Daan De Meyer [Thu, 30 Jan 2025 14:24:22 +0000 (15:24 +0100)] 
Skip files outside of known paths for extension outputs

6 months agoUse directory in user's home as output directory if possible
Daan De Meyer [Thu, 30 Jan 2025 12:38:03 +0000 (13:38 +0100)] 
Use directory in user's home as output directory if possible

Otherwise, if the user's home is on a separate partition, we have to
do a very expensive copy to /var/tmp.

6 months agoFix condition when removing duplicate files from the overlay
Daan De Meyer [Wed, 29 Jan 2025 20:37:02 +0000 (21:37 +0100)] 
Fix condition when removing duplicate files from the overlay

6 months agoCalculate PE section size correctly
Daan De Meyer [Wed, 29 Jan 2025 13:38:34 +0000 (14:38 +0100)] 
Calculate PE section size correctly

6 months agoconfig: add mkosi-addon
Luca Boccassi [Wed, 29 Jan 2025 12:42:02 +0000 (12:42 +0000)] 
config: add mkosi-addon

Otherwise it fails:

$ mkosi --include=mkosi-addon
‣ mkosi-addon does not exist

6 months agoMerge pull request #3446 from DaanDeMeyer/have-cache
Jörg Behrmann [Wed, 29 Jan 2025 12:47:50 +0000 (13:47 +0100)] 
Merge pull request #3446 from DaanDeMeyer/have-cache

Various cache fixes

6 months agoDon't call have_cache() in reuse_cache() 3446/head
Daan De Meyer [Tue, 28 Jan 2025 19:47:30 +0000 (20:47 +0100)] 
Don't call have_cache() in reuse_cache()

By the time reuse_cache() is called, we've already cleaned up old
cached images if needed, so just check if they still exist and reuse
them if they do.

6 months agoMake sure previous cache entries are gone in save_cache()
Daan De Meyer [Tue, 28 Jan 2025 19:47:16 +0000 (20:47 +0100)] 
Make sure previous cache entries are gone in save_cache()

6 months agoReplace check_uid with a "tools" image check in have_cache()
Daan De Meyer [Tue, 28 Jan 2025 19:18:36 +0000 (20:18 +0100)] 
Replace check_uid with a "tools" image check in have_cache()

We have access to the config object in have_cache() and this argument
is specifically intended to be used whenever we pass the default tools
tree to have_cache(), so let's just do the check based on config.image
in have_cache() itself.

6 months agoTreat terminal as dumb if either stdout or stderr is not a tty
Daan De Meyer [Tue, 28 Jan 2025 20:09:11 +0000 (21:09 +0100)] 
Treat terminal as dumb if either stdout or stderr is not a tty

Fixes #3445

6 months agoMake secure boot keys/crts/source config universal
Nick Labich [Tue, 28 Jan 2025 20:54:35 +0000 (15:54 -0500)] 
Make secure boot keys/crts/source config universal

6 months agoFix verity signature check in case keys are configured
Martin Hundebøll [Mon, 27 Jan 2025 14:45:01 +0000 (15:45 +0100)] 
Fix verity signature check in case keys are configured

The repart json output includes the architecture in the partiton type
string, so the same must be included when checking for a verity
signature partition.

Example repart output:
{
    "type": "usr-x86-64-verity-sig",
    "label": "image_20250127144324_verity_sig",
    "uuid": "ae4819c0-d8e8-4c11-a140-af81d63db968",
    "partno": 1,
    "file": "/home/mheb/git/os/mkosi.repart/10-usr-verity-sig.conf",
    "node": "/work/var/cache/mkosi/mkosi-workspace-igi4aky0/staging/image_20250127144324.raw2",
    "offset": 537919488,
    "old_size": 16384,
    "raw_size": 16384,
    "old_padding": 0,
    "raw_padding": 0,
    "activity": "unchanged",
    "roothash": "TBD",
    "split_path": "/work/var/cache/mkosi/mkosi-workspace-igi4aky0/staging/image_20250127144324.usr-x86-64-verity-sig.ae4819c0d8e84c11a140af81d63db968.raw"
}

6 months agomkosi-sandbox: Improve formatting of error messages
Daan De Meyer [Tue, 28 Jan 2025 14:29:31 +0000 (15:29 +0100)] 
mkosi-sandbox: Improve formatting of error messages

6 months agoMove want_uki() check out of build_uki_profiles()
Daan De Meyer [Tue, 28 Jan 2025 12:37:54 +0000 (13:37 +0100)] 
Move want_uki() check out of build_uki_profiles()

Otherwise the function is skipped in make_uki() even though it should
never be skipped in that case if there are UKI profiles defined.

6 months agomkosi-initrd: handle PermissionError when reading /etc/crypttab
Antonio Alvarez Feijoo [Tue, 28 Jan 2025 07:25:13 +0000 (08:25 +0100)] 
mkosi-initrd: handle PermissionError when reading /etc/crypttab

Usually /etc/crypttab has 600 permissions, so display a warning to non-root
users rather than unhandling a PermissionError exception.

6 months agoMerge pull request #3436 from DaanDeMeyer/tools
Daan De Meyer [Mon, 27 Jan 2025 18:44:04 +0000 (19:44 +0100)] 
Merge pull request #3436 from DaanDeMeyer/tools

Tools tree improvements

6 months agomkosi-tools: Drop fish and zsh 3436/head
Daan De Meyer [Mon, 27 Jan 2025 14:05:45 +0000 (15:05 +0100)] 
mkosi-tools: Drop fish and zsh

These are a bit too exquisite to have in the default tools tree and
we don't start a shell in mkosi-sandbox by default anymore, so let's
stick to just having bash in the default tools tree.

6 months agomkosi-tools: Stop installing dnf on Azure,OpenSUSE,Fedora
Daan De Meyer [Mon, 27 Jan 2025 14:00:01 +0000 (15:00 +0100)] 
mkosi-tools: Stop installing dnf on Azure,OpenSUSE,Fedora

Let's stop installing dnf on in tools trees of these distributions
and only install dnf5.

Simplify the documentation of installed dnf packages while we're at it.

6 months agozypper: pass --releasever option
Antonio Alvarez Feijoo [Mon, 27 Jan 2025 13:30:31 +0000 (14:30 +0100)] 
zypper: pass --releasever option

zypper allows to use the `$releasever` variable in repo URLs (see zypper(8) man
page). When mkosi uses zypper repos from the host instead of the default ones,
this variable needs to be replaced with the host's `VERSION_ID`, otherwise repo
URLs are incomplete.

6 months agoLog command line for abnormal signals
Daan De Meyer [Mon, 27 Jan 2025 10:10:13 +0000 (11:10 +0100)] 
Log command line for abnormal signals

If we're not killed by SIGINT or SIGTERM, let's log the command line
as in this scenario it's very likely the process we were running crashed
with SIGABRT or SIGSEGV.

6 months agoopensuse: fix package name: btrfs-progs -> btrfsprogs
Antonio Alvarez Feijoo [Mon, 27 Jan 2025 09:20:17 +0000 (10:20 +0100)] 
opensuse: fix package name: btrfs-progs -> btrfsprogs

This error was not visible enough because zypper can find it anyway:

```
'btrfs-progs' not found in package names. Trying capabilities.
```

6 months agoMerge pull request #3429 from DaanDeMeyer/match
Jörg Behrmann [Sat, 25 Jan 2025 23:00:05 +0000 (00:00 +0100)] 
Merge pull request #3429 from DaanDeMeyer/match

Check if list matches are empty if empty string is matched against

6 months agomkosi-initrd: Add two more modules
Daan De Meyer [Sat, 25 Jan 2025 21:28:21 +0000 (22:28 +0100)] 
mkosi-initrd: Add two more modules

Three more generic modules that are needed in the initrd.

- mxm-wmi is a standard for switchable laptop graphics
- usb-storage is obviously for USB storage devices
- partport (https://docs.kernel.org/admin-guide/parport.html)
  seems generic enough that we should include it in the initrd.

6 months agotest_config: Reduce the number of tests 3429/head
Daan De Meyer [Sat, 25 Jan 2025 17:49:20 +0000 (18:49 +0100)] 
test_config: Reduce the number of tests

Let's not run unnecessary tests that don't give any meaningful extra
coverage.

6 months agoCheck if list matches are empty if empty string is matched against
Daan De Meyer [Sat, 25 Jan 2025 17:17:53 +0000 (18:17 +0100)] 
Check if list matches are empty if empty string is matched against

If we do something like

```
[Match]
Profiles=

...
```

It should succeed if the list of profiles is empty, so let's implement that.

6 months agoThe dpkg architecture name for loongarch64 is loong64
Luca Boccassi [Sat, 25 Jan 2025 10:45:17 +0000 (10:45 +0000)] 
The dpkg architecture name for loongarch64 is loong64

Because otherwise it was too loong