]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
3 weeks agoAdd new Snapshot= setting 3802/head
DaanDeMeyer [Thu, 10 Jul 2025 10:21:11 +0000 (12:21 +0200)] 
Add new Snapshot= setting

In systemd CI, we often run into issues caused by updates to third-party
components like the kernel package in rolling release distributions
like Arch Linux or Fedora Rawhide. When these happen, the corresponding
CI job starts failing on every PR and bisecting the distribution to figure
out when the breakage was introduced is rather tedious.

To mitigate this problem, we need to be able to pin the rolling release
distributions to a specific snapshot which we control. This allows us to
update the pinned snapshot in a PR created by a bot, so that any failures
introduced by moving to a newer snapshot will be limited to the PR that bumps
the snapshot. Any regressions can then be debugged and fixed before merging
the PR that switches us to the new snapshot.

To make this possible, let's introduce a new Snapshot= setting and implement
it for every distribution that has a snapshot concept or something that maps
to it. Per distribution:

- Debian => snapshot.debian.org (unlimited)
- Ubuntu => snapshot.ubuntu.com (unlimited)
- Arch => archive.archlinux.org (unlimited)
- OpenSUSE => download.opensuse.org/history (limited to a month of snapshots)
- CentOS => composes.stream.centos.org (limited to 3 weeks of snapshots)
- Fedora => https://kojipkgs.fedoraproject.org (limited to 2 weeks of snapshots)

Additionally, for CentOS, we also support using composes from mirror.facebook.net
which keeps them around forever so we get unlimited snapshots there as well for
CentOS Stream.

We also add a latest-snapshot verb to be able to easily figure out the latest
snapshot so it can be bumped regularly via a CI workflow. Because we do not track
sufficient information from config files to be able to insert the updated snapshot
into the right config file ourselves, we output it on stdout instead and leave it to
users to insert it into the right config file.

4 weeks agoci: Put distribution to use in mkosi.local.conf
DaanDeMeyer [Thu, 17 Jul 2025 10:19:14 +0000 (12:19 +0200)] 
ci: Put distribution to use in mkosi.local.conf

4 weeks agoMerge pull request #3890 from DaanDeMeyer/downgrade
Luca Boccassi [Wed, 3 Sep 2025 11:47:14 +0000 (12:47 +0100)] 
Merge pull request #3890 from DaanDeMeyer/downgrade

Add support for downgrading when installing volatile packages

4 weeks agoapt: Fix preferences origin 3890/head
Daan De Meyer [Wed, 3 Sep 2025 10:25:51 +0000 (12:25 +0200)] 
apt: Fix preferences origin

With the switch to apt-ftparchive, we need to switch our origin to
\""\ which is the origin to use for a local packages repo.

Follow up for cdd2d1570e256ef0aa122c079e55f093cc0df453

4 weeks agoAdd support for downgrading when installing volatile packages
Daan De Meyer [Thu, 6 Mar 2025 11:18:20 +0000 (12:18 +0100)] 
Add support for downgrading when installing volatile packages

5 weeks agoReturn false from want_efi() for UKI outputs
DaanDeMeyer [Fri, 22 Aug 2025 14:29:19 +0000 (16:29 +0200)] 
Return false from want_efi() for UKI outputs

This may seem counter intuitive, but we do not want to make UKIs
bootable on EFI firmware. Making stuff bootable on EFI firmware involves
installing systemd-boot and shim and other things which aren't required
when building a UKI, so let's return false for UKIs from want_efi() unless
explicitly requested.

Fixes #3846

5 weeks agomkosi-tools: add qemu/pipewire packages for gui profile for debian
Luca Boccassi [Thu, 28 Aug 2025 16:05:07 +0000 (17:05 +0100)] 
mkosi-tools: add qemu/pipewire packages for gui profile for debian

5 weeks agoAdd ncdu to tools tree packages
DaanDeMeyer [Wed, 27 Aug 2025 12:28:52 +0000 (14:28 +0200)] 
Add ncdu to tools tree packages

Useful for analyzing what's taking up space in an image.

5 weeks agoconfig: Fix type for devicetree setting
DaanDeMeyer [Tue, 26 Aug 2025 18:58:11 +0000 (20:58 +0200)] 
config: Fix type for devicetree setting

5 weeks agoinitrd: Add intel_pmc_ssram_telemetry module by default
DaanDeMeyer [Tue, 26 Aug 2025 14:02:26 +0000 (16:02 +0200)] 
initrd: Add intel_pmc_ssram_telemetry module by default

This was split off from the core driver in
https://lwn.net/Articles/1019075/.

5 weeks agoMerge pull request #3877 from DaanDeMeyer/kmod-symlinks
Daan De Meyer [Tue, 26 Aug 2025 13:51:25 +0000 (15:51 +0200)] 
Merge pull request #3877 from DaanDeMeyer/kmod-symlinks

5 weeks agokmod: Beef up firmware symlink chasing 3877/head
DaanDeMeyer [Mon, 25 Aug 2025 12:23:51 +0000 (14:23 +0200)] 
kmod: Beef up firmware symlink chasing

- It turns out we need to handle absolutely symlinks after all as
  /usr/lib/firmware/regulatory.db is a symlink to /etc/alternatives
  in Debian and derivatives.
- Our previous implementation didn't handle cases where a symlink target
  consisted out of two parts e.g. if C -> A/B then we wouldn't try to resolve
  A.

Fix both issues by switching to a minimal implementation of the chase()
function in systemd.

To avoid having to include /etc stuff in the kernel modules initrd, we resolve
get rid of any intermediate symlinks to /etc/alternatives that we encounter.

Follow up for 221293e33defe30b111bc13957a0d52d2ea1c45b

5 weeks agokmod: Narrow glob used to select firmware
DaanDeMeyer [Mon, 25 Aug 2025 19:55:38 +0000 (21:55 +0200)] 
kmod: Narrow glob used to select firmware

We want to select the firmware regardless of which compression extension
it has, but let's insist on having at least a '.' which indicates what
follows is an extension in the first place.

5 weeks agobox: Only use systemd-pty-forward if stdout is connected to tty
DaanDeMeyer [Mon, 25 Aug 2025 19:55:00 +0000 (21:55 +0200)] 
box: Only use systemd-pty-forward if stdout is connected to tty

Otherwise piping mkosi box output to less will hang on exit.

5 weeks agoInstall wireless-regdb in default image
DaanDeMeyer [Mon, 25 Aug 2025 18:09:36 +0000 (20:09 +0200)] 
Install wireless-regdb in default image

wireless-regdb is managed by alternatives on Debian which exercises
the absolute symlink resolution logic we have now in the kmod logic.

5 weeks agoMerge pull request #3872 from DaanDeMeyer/kmod
Jörg Behrmann [Mon, 25 Aug 2025 08:34:10 +0000 (10:34 +0200)] 
Merge pull request #3872 from DaanDeMeyer/kmod

kmod: Make sure we include all intermediate firmware symlinks as well

5 weeks agoMake Bootable= determine whether we build a UKI for esp images
DaanDeMeyer [Sun, 24 Aug 2025 15:48:39 +0000 (17:48 +0200)] 
Make Bootable= determine whether we build a UKI for esp images

Currently, we build a UKI for ESP images only if a kernel is installed.
Let's make this a bit more flexible by hooking it up to the Bootable=
setting. If Bootable=no, then we won't add a UKI to the esp regardless
if a kernel is installed in the image or not.

6 weeks agokmod: Make sure we include all intermediate firmware symlinks as well 3872/head
DaanDeMeyer [Fri, 22 Aug 2025 19:43:55 +0000 (21:43 +0200)] 
kmod: Make sure we include all intermediate firmware symlinks as well

Replaces #3822

6 weeks agokmod: Make sure FirmwareFiles= only applies to files and symlinks
DaanDeMeyer [Sat, 23 Aug 2025 20:03:46 +0000 (22:03 +0200)] 
kmod: Make sure FirmwareFiles= only applies to files and symlinks

6 weeks agomkosi-obs: use --force also for unzstd
Luca Boccassi [Sun, 17 Aug 2025 18:24:00 +0000 (19:24 +0100)] 
mkosi-obs: use --force also for unzstd

Otherwise it will ask interactively whether to overwrite a file, which doesn't
work for unattended builds and gets them stuck

6 weeks agomkosi-obs: do not fail if there are no bootloaders in the ESP
Luca Boccassi [Sun, 17 Aug 2025 17:00:45 +0000 (18:00 +0100)] 
mkosi-obs: do not fail if there are no bootloaders in the ESP

letfover debug command, can be removed

6 weeks agoAdd kernel-modules-initrd to SplitArtifacts
DaanDeMeyer [Sat, 23 Aug 2025 19:48:51 +0000 (21:48 +0200)] 
Add kernel-modules-initrd to SplitArtifacts

Useful when debugging the contents of the kernel modules initrd.

6 weeks agoAdd mkinitcpio to Arch Linux tools tree packages
DaanDeMeyer [Sat, 23 Aug 2025 19:48:01 +0000 (21:48 +0200)] 
Add mkinitcpio to Arch Linux tools tree packages

Contains lsinitcpio which is useful for debugging initrds.

6 weeks agoMerge pull request #3873 from DaanDeMeyer/snapshot-split 3784/head
Daan De Meyer [Fri, 22 Aug 2025 23:17:31 +0000 (01:17 +0200)] 
Merge pull request #3873 from DaanDeMeyer/snapshot-split

6 weeks agorhel: Look up entitlement keys and certificates in sandbox
DaanDeMeyer [Fri, 22 Aug 2025 14:58:40 +0000 (16:58 +0200)] 
rhel: Look up entitlement keys and certificates in sandbox

Similar to how we handle rpm GPG keys, let's also look up the extra
stuff for RHEL in the sandbox in the same way.

Fixes #3854

6 weeks agoMerge pull request #3869 from DaanDeMeyer/workspace
Jörg Behrmann [Fri, 22 Aug 2025 22:11:34 +0000 (00:11 +0200)] 
Merge pull request #3869 from DaanDeMeyer/workspace

initrd: Stop passing --workspace-dir=

6 weeks agotree-wide: Remove numbered prefixes from config files 3873/head
DaanDeMeyer [Wed, 9 Jul 2025 14:19:29 +0000 (16:19 +0200)] 
tree-wide: Remove numbered prefixes from config files

With the following changes, there's no more need for numbered prefixes
for ordering:

- Assume EPEL is available for CentOS Stream 9/10
- Stop enabling epel-next repository for CentOS Stream 9
- Remove orphan_file hack for ubuntu jammy since we do it internally now

So we make these changes and remove the numbered prefixes throughout the
tree.

6 weeks agoFix deprecation warning
DaanDeMeyer [Mon, 7 Jul 2025 19:02:01 +0000 (21:02 +0200)] 
Fix deprecation warning

6 weeks agofedora: Various ELN fixes
DaanDeMeyer [Mon, 7 Jul 2025 13:21:39 +0000 (15:21 +0200)] 
fedora: Various ELN fixes

The logic for ELN was quite broken in various places, let's fix it
up so it actually builds properly.

6 weeks agocentos: Optimize gpg key lookups
DaanDeMeyer [Mon, 7 Jul 2025 12:42:41 +0000 (14:42 +0200)] 
centos: Optimize gpg key lookups

Currently we end up looking for the same gpg keys over and over again,
which is noticeably expensive as the lookup involves spawning a sandboxed.

Let's optimize by calculating the GPG keys and passing them around as
needed.

6 weeks agoRemove mirror from default package cache directory cache key again
DaanDeMeyer [Sat, 5 Jul 2025 22:19:19 +0000 (00:19 +0200)] 
Remove mirror from default package cache directory cache key again

We added this initially to deal with pacman not having the mirror
in its cache key of repository metadata. The downside of this approach
is that we cannot cache packages across different mirrors. As an
aternative, let's simply not cache repository metadata for pacman in
the package cache directory.

While we're at it, remove the hack we did for zypper to ensure it had
the mirror in its cache key and also don't store its repository metadata
in the package cache directory. The reasoning here is while we can make
sure our own generated repository ids have the hashed mirror in them, we
cannot do so for any repositories added by users, which might end up causing
conflicts.

6 weeks agodnf: Share package cache between repositories with different baseurl=
DaanDeMeyer [Sat, 5 Jul 2025 22:05:05 +0000 (00:05 +0200)] 
dnf: Share package cache between repositories with different baseurl=

Currently, the dnf5 package is not shared between repositories with the
same id but different baseurl=. For building images this is not ideal,
we do not want to have to redownload all packages when switching the
baseurl= or similar for a repository, so let's fix this by having
package_subdirs() return a tuple of source and destination path, and
in dnf's implementation of it, use the same package cache directory
for all repositories with the same id, regardless of the baseurl= used.

Note that this only applies to the package cache directory, the repository
metadata is still cached in the cache directory that is keyed by the baseurl=
or equivalent setting.

6 weeks agoMake package_subdirs() return relative paths
DaanDeMeyer [Sat, 5 Jul 2025 21:47:51 +0000 (23:47 +0200)] 
Make package_subdirs() return relative paths

6 weeks agoStop passing --workspace-dir= in mkosi-initrd and mkosi-addon 3869/head
DaanDeMeyer [Fri, 22 Aug 2025 13:58:18 +0000 (15:58 +0200)] 
Stop passing --workspace-dir= in mkosi-initrd and mkosi-addon

The default value when running as root is /var/tmp now so there's no
need to specify --workspace-dir= explicitly anymore. This allows the
workspace directory to be changed in the configuration file in
/etc/mkosi-initrd and /etc/mkosi-addon.

Fixes #3852

6 weeks agoopensuse: Add support for RISC-V for Tumbleweed
Fredrik Lönnegren [Fri, 22 Aug 2025 12:40:51 +0000 (14:40 +0200)] 
opensuse: Add support for RISC-V for Tumbleweed

Some small changes to enable building RISC-V images for openSUSE
Tumbleweed.

Signed-off-by: Fredrik Lönnegren <fredrik@frelon.se>
6 weeks agoRevert "mkosi-initrd: add --workspace-directory option"
DaanDeMeyer [Fri, 22 Aug 2025 13:56:16 +0000 (15:56 +0200)] 
Revert "mkosi-initrd: add --workspace-directory option"

https://github.com/systemd/mkosi/issues/3852 is better fixed
by not configuring --workspace-dir at all within mkosi-initrd.
This allows it to be changed via the config file as the CLI argument
won't override it anymore and the default value used when running as
root is /var/tmp anyway.

This reverts commit 60ef8b5c7476ea287bb6b78711cf9280011d22f0.

6 weeks agofedora: Rework rawhide GPG key logic
DaanDeMeyer [Thu, 21 Aug 2025 11:47:03 +0000 (13:47 +0200)] 
fedora: Rework rawhide GPG key logic

- Drop secondary key logic as looking at https://github.com/rpm-software-management/distribution-gpg-keys/tree/main/keys/fedora,
  this hasn't been used for a long time.
- If repository key fetching is enabled, always look up the key remotely
  as e.g. on CentOS 9 or so the rawhide symlink might be horribly outdated.
- If not using repository key fetching, Use all local keys newer than the
  rawhide key as well to maximize the chances of including the current rawhide
  key.
- Resolve symlinks within the sandbox in find_rpm_gpgkey() as we might not be
  able to resolve the symlinks outside of the sandbox.

6 weeks agoInclude {sys,conf}ext info in metadata file
Alberto Planas [Fri, 25 Jul 2025 11:40:03 +0000 (13:40 +0200)] 
Include {sys,conf}ext info in metadata file

Signed-off-by: Alberto Planas <aplanas@suse.com>
6 weeks agoSet MakeInitrd=yes in documentation for building custom initrd
Godvin Ouseph [Sun, 17 Aug 2025 09:57:37 +0000 (15:27 +0530)] 
Set MakeInitrd=yes in documentation for building custom initrd

Otherwise /etc/initrd-release won't exist in the initrd and systemd won't do the usual initrd stuff

6 weeks agoMerge pull request #3853 from aafeijoo-suse/initrd-more-options
Jörg Behrmann [Thu, 21 Aug 2025 12:31:34 +0000 (14:31 +0200)] 
Merge pull request #3853 from aafeijoo-suse/initrd-more-options

mkosi-initrd: add --workspace-dir option

6 weeks agoman: clarify that $CACHE_DIRECTORY affects --workspace-directory 3853/head
Antonio Alvarez Feijoo [Thu, 14 Aug 2025 09:47:14 +0000 (11:47 +0200)] 
man: clarify that $CACHE_DIRECTORY affects --workspace-directory

6 weeks agomkosi-initrd: add --workspace-directory option
Antonio Alvarez Feijoo [Thu, 14 Aug 2025 08:33:42 +0000 (10:33 +0200)] 
mkosi-initrd: add --workspace-directory option

Fixes #3852

6 weeks agomkosi-tools: add grub2-common to openSUSE tools tree
Antonio Alvarez Feijoo [Tue, 19 Aug 2025 08:09:10 +0000 (10:09 +0200)] 
mkosi-tools: add grub2-common to openSUSE tools tree

Otherwise, with `BiosBootloader=grub`:

```
A BIOS bootable image with grub was requested but mkimage was not found
```

And with UEFI, an assertion is reached:

```
Traceback (most recent call last):
  File "/home/dev/mkosi/mkosi/run.py", line 51, in uncaught_exception_handler
    yield
  File "/home/dev/mkosi/mkosi/run.py", line 91, in fork_and_wait
    target(*args, **kwargs)
    ~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/dev/mkosi/mkosi/__init__.py", line 4964, in run_build
    build_image(
    ~~~~~~~~~~~^
        Context(
        ^^^^^^^^
    ...<7 lines>...
        )
        ^
    )
    ^
  File "/home/dev/mkosi/mkosi/__init__.py", line 4051, in build_image
    install_grub(context)
    ~~~~~~~~~~~~^^^^^^^^^
  File "/home/dev/mkosi/mkosi/bootloader.py", line 354, in install_grub
    grub_mkimage(
    ~~~~~~~~~~~~^
        context,
        ^^^^^^^^
    ...<3 lines>...
        sbat=sbat,
        ^^^^^^^^^^
    )
    ^
  File "/home/dev/mkosi/mkosi/bootloader.py", line 187, in grub_mkimage
    assert mkimage
           ^^^^^^^
AssertionError
```

6 weeks agomkosi-tools: virtiofsd is only available on a subset of architectures on debian/ubuntu
Luca Boccassi [Mon, 18 Aug 2025 13:04:59 +0000 (14:04 +0100)] 
mkosi-tools: virtiofsd is only available on a subset of architectures on debian/ubuntu

Package virtiofsd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'virtiofsd' has no installation candidate
‣ "/work/prepare final" returned non-zero exit code 123.

7 weeks agofedora: be more persistent when guessing what rawhide could be
Jörg Behrmann [Thu, 14 Aug 2025 19:24:40 +0000 (21:24 +0200)] 
fedora: be more persistent when guessing what rawhide could be

If the key to use is rawhide, let's try and look up the symlink target and also
check the version online to scrounge in our local keys.

7 weeks agoUse apt-ftparchive instead of reprepro
Thomas Mühlbacher [Sat, 9 Aug 2025 22:50:42 +0000 (00:50 +0200)] 
Use apt-ftparchive instead of reprepro

Afaict, this should work quite similar to the previous dpkg-scanpackages but
also doesn't use perl and is part of apt. Certain distros don't have reprepro
packaged, e.g. nixpkgs. It's also a simpler to work with and smaller compared
to reprepro.

7 weeks agofix dead/404 link
Russell Bunch [Tue, 12 Aug 2025 20:46:02 +0000 (15:46 -0500)] 
fix dead/404 link

`mkosi.images` moved under a `mkosi` subdirectory

7 weeks agomkosi-tools: Drop systemd-boot-efi package
DaanDeMeyer [Mon, 11 Aug 2025 13:26:50 +0000 (15:26 +0200)] 
mkosi-tools: Drop systemd-boot-efi package

There's no need to install systemd-boot, systemd-stub, ... in the
tools tree as these are picked up from inside the image so let's stop
installing systemd-boot-efi in the tools tree.

Follow up for 9a0d8a8906695a35011ecfd81b36fe82c1577488

7 weeks agoAdd debug logging for version reported by systemd tools
DaanDeMeyer [Mon, 11 Aug 2025 13:13:47 +0000 (15:13 +0200)] 
Add debug logging for version reported by systemd tools

7 weeks agomkosi-tools: move systemd-boot package to conf file matching older releases
Luca Boccassi [Sat, 9 Aug 2025 14:05:48 +0000 (15:05 +0100)] 
mkosi-tools: move systemd-boot package to conf file matching older releases

Since debian 13/ubuntu 25.04 the tools needed at build time
(bootctl) are in the systemd-boot-tools package, so there's
no need to pull in the systemd-boot package in the tools image,
since it is an integration point that sets up the local ESP and
so on

8 weeks agoREADME: clarify that companion tools can also be enabled from the git repo
Antonio Alvarez Feijoo [Thu, 7 Aug 2025 13:27:03 +0000 (15:27 +0200)] 
README: clarify that companion tools can also be enabled from the git repo

8 weeks agoDrop microsecond resolution for datetime.now()
Alberto Planas [Wed, 6 Aug 2025 10:58:55 +0000 (12:58 +0200)] 
Drop microsecond resolution for datetime.now()

The RPM INSTALLTIME attribute is an integer represetantion of the
installation time of the package, and datetime.now is a date
representation of a float timestamp.  This can produce some rounding
errors is powerful build servers.

For example, if the variable `_init_timestamp` has a value XXXXX.1 but
in the same sub-second the package gets installed, the registered
installation time will be the integer representation (XXXXX), making the
comparison done for exclusion of the package to be `True`.

This patch will remove the microsecond granularity of the datetime,
converting the timestamp on its integer representation, instead of the
default float one.  The comparison is still done in the datetime data
type.

Signed-off-by: Alberto Planas <aplanas@suse.com>
8 weeks agomkosi-initrd: install raid rule with 70 prefix
Jake Helmert [Tue, 5 Aug 2025 20:31:58 +0000 (13:31 -0700)] 
mkosi-initrd: install raid rule with 70 prefix

This aligns better with other common MD device rules installed from
mdadm/multipath/etc.

Closes: #3836
Signed-off-by: Jake Helmert <jhelmert@pacificbiosciences.com>
8 weeks agoci: give a hint about possible fixes for failing reuse lints
Jörg Behrmann [Tue, 5 Aug 2025 21:28:05 +0000 (23:28 +0200)] 
ci: give a hint about possible fixes for failing reuse lints

2 months agobuild(deps): bump github/codeql-action from 3.29.2 to 3.29.5
dependabot[bot] [Fri, 1 Aug 2025 22:09:15 +0000 (22:09 +0000)] 
build(deps): bump github/codeql-action from 3.29.2 to 3.29.5

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.2 to 3.29.5.
- [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/181d5eefc20863364f96762470ba6f862bdef56b...51f77329afa6477de8c49fc9c7046c15b9a4e79d)

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

Signed-off-by: dependabot[bot] <support@github.com>
2 months agomkosi-initrd: move udev rules files for dm and md
Yu Watanabe [Fri, 1 Aug 2025 09:13:24 +0000 (18:13 +0900)] 
mkosi-initrd: move udev rules files for dm and md

10-mkosi-initrd-dm.rules is used not only by LVM, but generic DM
devices. Hence, it must be in the base image.

10-mkosi-initrd-md.rules is used by MD raid, hence it must be in the
raid profile.

Follow-ups for b8bda09866bd64d99157010b4566c9872bb844b6 and
686f57d7f91f1c71bb10a69474e1ca795287bc71.
Fixes https://github.com/systemd/systemd/issues/36162.

2 months agomkosi-vm: Drop tpm_tis change
DaanDeMeyer [Tue, 29 Jul 2025 18:39:56 +0000 (20:39 +0200)] 
mkosi-vm: Drop tpm_tis change

Follow up for 07c24a7d42b20d4fde14e6b0bf4b1d77ac299d13

Setting this for mkosi-vm means only tpm_tis is included and nothing
else is included which is bogus so revert the change.

2 months agoshim: fix log message of installed binary
Jörg Behrmann [Mon, 28 Jul 2025 21:08:57 +0000 (23:08 +0200)] 
shim: fix log message of installed binary

Followup to 10e50f8c55a56fc4260e171239b5fbdbde1b433d

2 months agomkosi-initrd/vm: ensure TPM2 core modules are installed in the initrd
Luca Boccassi [Mon, 28 Jul 2025 23:40:26 +0000 (00:40 +0100)] 
mkosi-initrd/vm: ensure TPM2 core modules are installed in the initrd

On arm64 the tpm_tis modules are not built-in, so /dev/tpmrm0 does
not show up in the initrd and it times out, and unlocking using
the tpm doesn't work.
Ensure the modules are included in the initrd if they are not
built in.

Jul 28 23:19:45 localhost systemd[1]: Expecting device dev-tpmrm0.device - /dev/tpmrm0...
Jul 28 23:19:48 localhost (udev-worker)[212]: ctx=0xaaab038cd650 path=/lib/modules/6.12.33+deb13-cloud-arm64/kernel/drivers/char/tpm/tpm_tis_core.ko.xz error=No such file or directory
Jul 28 23:19:49 localhost (udev-worker)[210]: ctx=0xaaab038cd650 path=/lib/modules/6.12.33+deb13-cloud-arm64/kernel/drivers/char/tpm/tpm_tis_core.ko.xz error=No such file or directory
Jul 28 23:21:11 localhost systemd[1]: dev-tpmrm0.device: Job dev-tpmrm0.device/start timed out.

https://oracle.github.io/kconfigs/?config=UTS_RELEASE&config=TCG_TIS&config=TCG_TIS_CORE

2 months agoFirmwareVariables: allow generating during image build
Luca Boccassi [Sat, 19 Jul 2025 23:20:53 +0000 (00:20 +0100)] 
FirmwareVariables: allow generating during image build

The build immediately fails if FirmwareVariables=%O/somefile is used, as
the config parser won't be able to find it, so it is not possible to
generate it during the image build itself (e.g: mkosi.postoutput)
in order to add generated keys to MOK. Set required=False.

2 months agoenv: export $EFI_ARCHITECTURE in hook scripts on EFI arches
Luca Boccassi [Mon, 28 Jul 2025 11:12:29 +0000 (12:12 +0100)] 
env: export $EFI_ARCHITECTURE in hook scripts on EFI arches

Saves from having to do the translations manually a bunch of times

2 months agomkosi-tools: ukify moved to systemd-ukify in openSUSE
Antonio Alvarez Feijoo [Mon, 28 Jul 2025 12:52:10 +0000 (14:52 +0200)] 
mkosi-tools: ukify moved to systemd-ukify in openSUSE

Since https://build.opensuse.org/request/show/1294979

2 months agoMerge pull request #3826 from bluca/mok_install
Jörg Behrmann [Mon, 28 Jul 2025 13:38:45 +0000 (15:38 +0200)] 
Merge pull request #3826 from bluca/mok_install

shim: ensure binaries do not get installed to ESP with .signed suffix

2 months agoshim: ensure binaries do not get installed to ESP with .signed suffix 3826/head
Luca Boccassi [Sun, 27 Jul 2025 18:28:06 +0000 (19:28 +0100)] 
shim: ensure binaries do not get installed to ESP with .signed suffix

Binaries in the ESP need to be .efi, not .efi.signed,
so truncate the filename if the source has it (like MOK
in Debian).

2 months agoFix new linter warning
Luca Boccassi [Sun, 27 Jul 2025 18:33:08 +0000 (19:33 +0100)] 
Fix new linter warning

2 months agoensure builds with cache over device boundaries
Deniz Adrian [Wed, 23 Jul 2025 20:04:53 +0000 (22:04 +0200)] 
ensure builds with cache over device boundaries

when running mkosi with the default cache dir/XDG_CACHE_HOME on a
different device than the mkosi working directory, mkosi falls back to
trying to copy the cache using `copy_tree` from tree.py.

the cache contains symlinks which are pointing to files on the host:

e.g. `mkosi.cache/debian...cache/usr/bin/mt -> /etc/alternatives/mt`

`os.listxattr()` defaults to `follow_symlinks=True`, which leads to
`FileNotFoundError`s if the files don't exist on the host, which stops
the build.

this patch ignores symlinks, but feels like a workaround, as our
assumption would be that such absolute links should not be traversed
outside the chroot in the first place.

Co-authored-by: ZauberNerd <zaubernerd@zaubernerd.de>
2 months agoChange UnifiedKernelImages to enum and accept signed/unsigned
Luca Boccassi [Thu, 17 Jul 2025 01:16:18 +0000 (02:16 +0100)] 
Change UnifiedKernelImages to enum and accept signed/unsigned

With custom firmware we enroll our keys in db, so local UKIs can be
built and there's no need to fail the build. Many distributions
ship signed bootloaders, but they still don't ship UKIs.
Add an enum and a parser (to keep backward compat), and if set to
unsigned build locally instead of failing when the bootloader is
signed.

2 months agoMerge pull request #3815 from DaanDeMeyer/man
Daan De Meyer [Fri, 18 Jul 2025 11:27:32 +0000 (13:27 +0200)] 
Merge pull request #3815 from DaanDeMeyer/man

2 months agoman: Clarify that apparmor needs resolved path to mkosi 3815/head
DaanDeMeyer [Fri, 18 Jul 2025 08:26:40 +0000 (10:26 +0200)] 
man: Clarify that apparmor needs resolved path to mkosi

2 months agoVarious man page fixes
DaanDeMeyer [Fri, 18 Jul 2025 08:16:37 +0000 (10:16 +0200)] 
Various man page fixes

2 months agomkosi-vm: install systemd-boot-efi-signed where available
Luca Boccassi [Thu, 17 Jul 2025 23:08:26 +0000 (00:08 +0100)] 
mkosi-vm: install systemd-boot-efi-signed where available

Needed for Bootloader=systemd-boot-signed

2 months agoMerge pull request #3813 from behrmann/ruff2
Jörg Behrmann [Thu, 17 Jul 2025 12:32:33 +0000 (14:32 +0200)] 
Merge pull request #3813 from behrmann/ruff2

Change ruff check and ruff format order

2 months agoci: switch ruff check output format to github 3813/head
Jörg Behrmann [Thu, 17 Jul 2025 12:25:21 +0000 (14:25 +0200)] 
ci: switch ruff check output format to github

2 months agoci: switch order of ruff check and ruff format
Jörg Behrmann [Thu, 17 Jul 2025 12:24:56 +0000 (14:24 +0200)] 
ci: switch order of ruff check and ruff format

2 months agoopensuse: Install OpenSUSE-release if another release package is not installed
DaanDeMeyer [Thu, 17 Jul 2025 10:42:37 +0000 (12:42 +0200)] 
opensuse: Install OpenSUSE-release if another release package is not installed

Fixes #3782

2 months agoqemu: Disable hpet for x86 VMs
DaanDeMeyer [Thu, 17 Jul 2025 09:09:28 +0000 (11:09 +0200)] 
qemu: Disable hpet for x86 VMs

hpet is an emulated clocksource that is generally discouraged in favor
of kvm-clock or tsc for virtual machines. While mkosi's virtual machines
already use kvm-clock, leaving hpet enabled causes qemu on the host to
consume a non-trivial amount of cpu, so let's disable the hpet feature since
we're not making use of it anyway.

2 months agomkosi-tools: install systemd-boot-tools for bootctl
Luca Boccassi [Thu, 17 Jul 2025 01:43:02 +0000 (02:43 +0100)] 
mkosi-tools: install systemd-boot-tools for bootctl

2 months agoMerge pull request #3805 from bluca/arm_ppc
Luca Boccassi [Wed, 16 Jul 2025 08:33:56 +0000 (09:33 +0100)] 
Merge pull request #3805 from bluca/arm_ppc

ci: add couple more arm64 builds, add ppc64le builds

2 months agoci: add fedora/debian ppc64le build jobs 3805/head
Luca Boccassi [Tue, 15 Jul 2025 14:17:12 +0000 (15:17 +0100)] 
ci: add fedora/debian ppc64le build jobs

Lower rate limit, and cannot run integration tests as there's no KVM so
it's too slow, so add just two builds to ensure build regressions
don't happen

2 months agoci: add arm64 build jobs to cover fedora/suse/ubuntu as well
Luca Boccassi [Tue, 15 Jul 2025 14:23:21 +0000 (15:23 +0100)] 
ci: add arm64 build jobs to cover fedora/suse/ubuntu as well

Packages are different enough, so cover them all to ensure images
can be built

2 months agoMerge pull request #3803 from bluca/uefi_fixes
Luca Boccassi [Tue, 15 Jul 2025 17:57:31 +0000 (18:57 +0100)] 
Merge pull request #3803 from bluca/uefi_fixes

More non-uefi config fixlets

2 months agoman: remove duplicate 'the' in FirmwareVariables description
Jelle van der Waa [Tue, 15 Jul 2025 13:06:32 +0000 (15:06 +0200)] 
man: remove duplicate 'the' in FirmwareVariables description

Related: #3787

2 months agoconf: pull in shim-signed only on amd64/arm64 on debian/ubuntu/kali 3803/head
Luca Boccassi [Tue, 15 Jul 2025 13:11:05 +0000 (14:11 +0100)] 
conf: pull in shim-signed only on amd64/arm64 on debian/ubuntu/kali

shim-signed only exists on amd64/arm64, not on other architectures,
not even uefi ones

2 months agomkosi-vm: only install systemd-boot on uefi on debian/ubuntu/kali
Luca Boccassi [Tue, 15 Jul 2025 13:20:11 +0000 (14:20 +0100)] 
mkosi-vm: only install systemd-boot on uefi on debian/ubuntu/kali

2 months agomkosi-vm: do not install bootloaders on non-UEFI arches
Luca Boccassi [Thu, 3 Jul 2025 12:50:12 +0000 (13:50 +0100)] 
mkosi-vm: do not install bootloaders on non-UEFI arches

‣ Cannot make image bootable on UEFI on ppc64-le architecture

Can still boot with direct kernel booting on qemu, so disable
for now

2 months agoMerge pull request #3796 from bluca/arm
Luca Boccassi [Sat, 12 Jul 2025 10:25:02 +0000 (11:25 +0100)] 
Merge pull request #3796 from bluca/arm

Fixes for arm64 images, add CI job

2 months agoci: add one arm64 job 3796/head
Luca Boccassi [Sat, 5 Jul 2025 13:39:02 +0000 (14:39 +0100)] 
ci: add one arm64 job

2 months agoci: do not run integration tests if there's no KVM
Luca Boccassi [Sat, 5 Jul 2025 13:39:25 +0000 (14:39 +0100)] 
ci: do not run integration tests if there's no KVM

Without KVM tests are too slow and timeout after an hour

2 months agomkosi-vm: install cloud kernel for debian/arm64 builds
Luca Boccassi [Sat, 5 Jul 2025 11:47:06 +0000 (12:47 +0100)] 
mkosi-vm: install cloud kernel for debian/arm64 builds

The non-cloud arm64 kernel does not enable some configs
that are needed for the qemu runs, like generic TPM support

2 months agoqemu: fix booting aarch64 with TPM2
Luca Boccassi [Fri, 4 Jul 2025 23:29:37 +0000 (00:29 +0100)] 
qemu: fix booting aarch64 with TPM2

EDK2 nowadays does provide secureboot for arm. Not only that, TPM2 support is
only enabled in builds that enable secure boot, probably because it's all
part of the TCG modules.

Default to uefi_secure_boot on arm too, like x86.

Also do not pass qemu x86-only configuration options that break booting
arm.

2 months agoqemu: do not pass -cpu max,pcid=off unless it's for x86_64
Luca Boccassi [Fri, 4 Jul 2025 18:48:13 +0000 (19:48 +0100)] 
qemu: do not pass -cpu max,pcid=off unless it's for x86_64

qemu-system-aarch64: can't apply global max-arm-cpu.pcid=off: Property 'max-arm-cpu.pcid' not found

2 months agoMerge pull request #3766 from aafeijoo-suse/initrd-profiles-network-nfs
Jörg Behrmann [Fri, 11 Jul 2025 04:48:25 +0000 (06:48 +0200)] 
Merge pull request #3766 from aafeijoo-suse/initrd-profiles-network-nfs

Add "nfs" (and "network") initrd profiles

2 months agoAdd "nfs" initrd profile 3766/head
Antonio Alvarez Feijoo [Thu, 10 Jul 2025 12:29:54 +0000 (14:29 +0200)] 
Add "nfs" initrd profile

nfs-utils-2.8.4 will provide its own nfsroot-generator [1] to allow mounting the
real rootfs via NFSv4, so this initrd profile will enable this feature.

[1] http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=ed86ea08dadafbac948c6a45629a6f3282a77233

2 months agoAdd "network" initrd profile
Antonio Alvarez Feijoo [Thu, 10 Jul 2025 12:48:42 +0000 (14:48 +0200)] 
Add "network" initrd profile

This profile provides networking in the initrd using systemd-networkd.

2 months agomkosi-initrd: install procps
Antonio Alvarez Feijoo [Thu, 10 Jul 2025 12:26:15 +0000 (14:26 +0200)] 
mkosi-initrd: install procps

This package contains some useful system utilities: sysctl, pidof, free, top...

2 months agomkosi-tools: make sure p11-kit dir exists when configuring module
Clayton Craft [Sun, 6 Jul 2025 07:44:15 +0000 (00:44 -0700)] 
mkosi-tools: make sure p11-kit dir exists when configuring module

Fixes this failure, since I guess the dir may not exist:

‣  Running prepare script /tmp/tmphh1uwz2a/resources/mkosi-tools/mkosi.prepare…
/work/prepare: line 4: /buildroot/usr/share/p11-kit/modules/opensc.module: No such file or directory

2 months agomkosi-tools: Explicitly install p11-kit
DaanDeMeyer [Mon, 7 Jul 2025 10:04:26 +0000 (12:04 +0200)] 
mkosi-tools: Explicitly install p11-kit

3 months agoMerge pull request #3797 from DaanDeMeyer/remove-packages-optimization
Daan De Meyer [Sat, 5 Jul 2025 22:18:22 +0000 (00:18 +0200)] 
Merge pull request #3797 from DaanDeMeyer/remove-packages-optimization

3 months agoDo not try to install packages that are listed in RemovePackages= 3797/head
DaanDeMeyer [Sat, 5 Jul 2025 14:09:38 +0000 (16:09 +0200)] 
Do not try to install packages that are listed in RemovePackages=

This allows using RemovePackages= in mkosi.local.conf to prevent
certain packages listed in the regular configuration from being
installed in the first place.

We also add RemovePackages= to the cache manifest because it now
affects the cached images.

3 months agopacman: Don't fail if packages to remove aren't installed
DaanDeMeyer [Sat, 5 Jul 2025 19:08:32 +0000 (21:08 +0200)] 
pacman: Don't fail if packages to remove aren't installed

We already do this for other package managers, let's do it for pacman
as well.