]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
8 days agoapk: Always operate on package cache directory 3918/head
Daan De Meyer [Fri, 26 Sep 2025 13:46:22 +0000 (15:46 +0200)] 
apk: Always operate on package cache directory

apk does not use any subdirectories under /var/cache/apk to store
packages, which means that our usual tricks to mount package cache
directories from the package cache directory and repository metadata
from the metadata cache directory into the expected locations don't work.

There might be a way to get this to work with overlayfs but this would
be a very complex change. Instead, let's just disable repository metadata
caching for apk and always use the package cache directory for everything.

8 days agoStop doing shared repository metadata completely
Daan De Meyer [Fri, 26 Sep 2025 20:04:28 +0000 (22:04 +0200)] 
Stop doing shared repository metadata completely

Let's simplify things by always caching repository metadata per image
instead of sharing repository metadata for some scenarios. We already
stopped sharing repository metadata for pacman and zypper due to these
package managers not being able to handle this use case. For dnf and apt,
while they can handle the use case, the repository metadata isn't so big
that sharing it across multiple mkosi projects saves a lot.

On the other hand, we can drastically reduce complexity by not sharing
repository metadata and reduce the number of copies as well. Instead of
always copying repository metadata to a temporary directory, we now have
package managers read it directly from the metadata cache directory if one
is configured and a temporary directory otherwise. This avoids having to copy
the repository metadata around completely which means we can remove
copy_repository_metadata() completely.

To avoid introducing a requirement on Incremental=yes to have cached repository
metadata, we simply always create a repository metadata (and keyring) cache if
a cache directory is configured. The usage of repository metadata and keyring
caching is now fully independent of Incremental=. Only CacheOnly= will affect
whether we sync repository metadata or use the already cached repository metadata.

When cleaning, we stop cleaning repository metadata and keyring caches with -ff
and move this to -fff. Additionally, we stop making -fff clean up the package cache
as I doubt users will ever want to clean up the shared package cache with mkosi clean
and are mostly interested in cleaning up their project directory of mkosi files.

8 days agoapk: Drop uninmplemented keyring() method
Daan De Meyer [Fri, 26 Sep 2025 19:48:08 +0000 (21:48 +0200)] 
apk: Drop uninmplemented keyring() method

9 days agopostmarketos: Install full util-linux package in initrds
Daan De Meyer [Fri, 26 Sep 2025 08:53:32 +0000 (10:53 +0200)] 
postmarketos: Install full util-linux package in initrds

Otherwise we get busybox mount instead of util-linux mount and systemd
only supports util-linux mount.

9 days agoapk: Download packages before installing
Daan De Meyer [Fri, 26 Sep 2025 08:45:17 +0000 (10:45 +0200)] 
apk: Download packages before installing

We do this for all other package managers, let's make apk consistent
and do it there as well.

9 days agomkosi-initrd: Install libseccomp explicitly
Daan De Meyer [Wed, 24 Sep 2025 14:03:06 +0000 (16:03 +0200)] 
mkosi-initrd: Install libseccomp explicitly

It might become a Recommends of systemd in the future in distribution
packages but we should make sure it is available in the initrd regardless.

10 days agoMerge pull request #3913 from DaanDeMeyer/postmarketos-fixes
Daan De Meyer [Thu, 25 Sep 2025 08:06:39 +0000 (10:06 +0200)] 
Merge pull request #3913 from DaanDeMeyer/postmarketos-fixes

Various postmarketos fixes

11 days agoMerge pull request #3914 from behrmann/relocale
Daan De Meyer [Wed, 24 Sep 2025 14:00:40 +0000 (16:00 +0200)] 
Merge pull request #3914 from behrmann/relocale

11 days agoutil: widen allowed characters in read_env_file 3914/head
Jörg Behrmann [Wed, 24 Sep 2025 10:07:00 +0000 (12:07 +0200)] 
util: widen allowed characters in read_env_file

Currently we only read uppercase variables starting with a letter, but shell
variables only restriction is not starting with a number, so lowercase names
and names starting with an underscore are allowed.

11 days agoAdd ASCII flag to regexes using backslash character classes
Jörg Behrmann [Wed, 24 Sep 2025 10:04:03 +0000 (12:04 +0200)] 
Add ASCII flag to regexes using backslash character classes

By default Python regexes like strings are unicode meaning that they match
anything unicode consides, e.g. a number in the case of \d, which is more than
the usually expected [0-9]. Tighten this in the places where these classes are
used for better readability.

Also reorder the character classes for KERNEL_VERSION_PATTERN and the
systemd-stub version to be the same order for clarity and escape the dash in
the latter, since the need to escape a dash in a character range is position
dependent.

11 days agoCompile kernel version regex pattern
Jörg Behrmann [Wed, 24 Sep 2025 09:43:45 +0000 (11:43 +0200)] 
Compile kernel version regex pattern

11 days agoopensuse: repository non-oss-debug is invalid
val4oss [Wed, 24 Sep 2025 08:04:56 +0000 (10:04 +0200)] 
opensuse: repository non-oss-debug is invalid

* non-oss-debug is not a valid repository. Better to remove it, otherwise
  command like `zypper refresh` fails.

Signed-off-by: val4oss <val4oss@pm.me>
11 days agopostmarketos: Use sandbox everywhere in createrepo() 3913/head
Daan De Meyer [Wed, 24 Sep 2025 08:44:38 +0000 (10:44 +0200)] 
postmarketos: Use sandbox everywhere in createrepo()

Half of the commands in createrepo() are run without a sandbox at
the moment, let's fix that. This also contains various coding style
fixes.

11 days agopostmarketos: Coding style fixes
Daan De Meyer [Wed, 24 Sep 2025 08:44:08 +0000 (10:44 +0200)] 
postmarketos: Coding style fixes

Use similar variable names as we use elsewhere instead of the verbose
variable names that stick out like a sore thumb.

11 days agopostmarketos: Set up usrmerge in install() instead of setup()
Daan De Meyer [Wed, 24 Sep 2025 08:41:59 +0000 (10:41 +0200)] 
postmarketos: Set up usrmerge in install() instead of setup()

We try to not touch the rootfs directory in setup() at all, so set
up merged /usr in install() instead like we do for debian. Additionally,
we also make sync() does not touch the rootfs either by having it operate
on a temporary directory instead of the real rootfs.

11 days agopostmarketos: Don't make image BIOS bootable
Daan De Meyer [Wed, 24 Sep 2025 08:39:59 +0000 (10:39 +0200)] 
postmarketos: Don't make image BIOS bootable

grub cannot be installed on postmarketos yet so don't try to make
the default image bios bootable.

11 days agopostmarketos: Move more packages to mkosi-vm
Daan De Meyer [Wed, 24 Sep 2025 08:39:41 +0000 (10:39 +0200)] 
postmarketos: Move more packages to mkosi-vm

11 days agoMerge pull request #3781 from craftyguy/alpine-support
Daan De Meyer [Wed, 24 Sep 2025 07:33:33 +0000 (09:33 +0200)] 
Merge pull request #3781 from craftyguy/alpine-support

Add support for postmarketOS

11 days agoMerge pull request #3910 from gourryinverse/cxl_support
Daan De Meyer [Wed, 24 Sep 2025 07:26:17 +0000 (09:26 +0200)] 
Merge pull request #3910 from gourryinverse/cxl_support

Add cxl config option support

11 days agoAdd postmarketOS support 3781/head
Clayton Craft [Sun, 10 Mar 2024 15:31:06 +0000 (15:31 +0000)] 
Add postmarketOS support

Co-authored-by: Casey Connolly <kcxt@postmarketos.org>
Co-authored-by: Septatrix <24257556+Septatrix@users.noreply.github.com>
12 days agoconfig / qemu: add cxl config option 3910/head
Gregory Price [Tue, 23 Sep 2025 12:30:44 +0000 (08:30 -0400)] 
config / qemu: add cxl config option

Add machine `cxl=on` option for x86 and arm machines.

Signed-off-by: Gregory Price <gourry@gourry.net>
12 days agoconfig / qemu: support maxmem argument
Gregory Price [Tue, 23 Sep 2025 12:19:48 +0000 (08:19 -0400)] 
config / qemu: support maxmem argument

Add maxmem=X support for the `-m` option.  This is needed for
hotplug memory regions added at runtime by emulated CXL devices.

Signed-off-by: Gregory Price <gourry@gourry.net>
12 days agoDetect kernel ver from modules sub dir if unable to extract from filename
Clayton Craft [Wed, 4 Jun 2025 22:44:50 +0000 (15:44 -0700)] 
Detect kernel ver from modules sub dir if unable to extract from filename

postmarketOS doesn't include the kernel version in the filename of the
kernel image. It would be cleaner to update kernel packages to make a
symlink for the kernel under /usr/lib/modules/<ver>, but this would be
difficult to implement in postmarketOS where we ship something like >400
kernel packages for a huge array of different devices / kernel versions.

Currently Alpine/pmOS only support having 1 kernel / version installed
at one time, so this fails if, for some reason, multiple kernel dirs
are found since there's no way to determine which one maps to the kernel
binary mkosi is using.

12 days agomkosi-tools: move 'man' pkg from generic list to distro-specific lists
Clayton Craft [Wed, 4 Jun 2025 20:24:50 +0000 (13:24 -0700)] 
mkosi-tools: move 'man' pkg from generic list to distro-specific lists

Follow up to 94cc136fbe, this moves the man pkg to distro-specific pkg
lists to support distros that use a different name for this package.

12 days agoci: add an s390x build job for additional coverage
Luca Boccassi [Wed, 16 Jul 2025 09:40:48 +0000 (10:40 +0100)] 
ci: add an s390x build job for additional coverage

2 weeks agomailmap: deduplicate Daan
Jörg Behrmann [Wed, 17 Sep 2025 14:08:59 +0000 (16:08 +0200)] 
mailmap: deduplicate Daan

2 weeks agoMerge pull request #3903 from DaanDeMeyer/fix
Jörg Behrmann [Mon, 15 Sep 2025 13:31:23 +0000 (15:31 +0200)] 
Merge pull request #3903 from DaanDeMeyer/fix

Fix if check in install_systemd_boot()

2 weeks agoRevert "ci: Disable PPC jobs temporarily"
Luca Boccassi [Fri, 12 Sep 2025 08:35:35 +0000 (09:35 +0100)] 
Revert "ci: Disable PPC jobs temporarily"

The issue with the ppc64el job cancelling other jobs has been resolved:
https://github.com/IBM/actionspz/issues/32#issuecomment-3291873411

This reverts commit e019d2d2a646c2ce391b365eb61d1bde7001010e.

2 weeks agoImprove error message 3903/head
Daan De Meyer [Mon, 15 Sep 2025 11:56:17 +0000 (13:56 +0200)] 
Improve error message

2 weeks agoFix if check in install_systemd_boot()
Daan De Meyer [Mon, 15 Sep 2025 11:55:42 +0000 (13:55 +0200)] 
Fix if check in install_systemd_boot()

A generator object always evaluates to True, we have to wrap it with
any() to check if it contains anything.

3 weeks agodnf: Always specify --best again
Daan De Meyer [Fri, 12 Sep 2025 21:28:10 +0000 (23:28 +0200)] 
dnf: Always specify --best again

dnf install will not upgrade packages unless --best is specified.
While this might also break downgrades, not upgrading is worse than
not downgrading, so let's specify --best unconditionally again so we
make sure we always upgrade if a newer version is available.

3 weeks agoMerge pull request #3899 from DaanDeMeyer/cloexec
Daan De Meyer [Fri, 12 Sep 2025 13:39:22 +0000 (15:39 +0200)] 
Merge pull request #3899 from DaanDeMeyer/cloexec

sandbox: Rework ctypes hack

3 weeks agoMerge pull request #3879 from DaanDeMeyer/bind-user
Daan De Meyer [Fri, 12 Sep 2025 12:43:01 +0000 (14:43 +0200)] 
Merge pull request #3879 from DaanDeMeyer/bind-user

3 weeks agosandbox: Rework ctypes hack 3899/head
Daan De Meyer [Fri, 12 Sep 2025 10:59:34 +0000 (12:59 +0200)] 
sandbox: Rework ctypes hack

Now that libffi marks the trampoline file descriptor opened by ctypes
as O_CLOEXEC, we can move file descriptor packing to the very end of
setting up the sandbox and close all file descriptors marked with
O_CLOEXEC already which will also close the libffi trampoline file
descriptor.

3 weeks agoReplace RuntimeHome= with BindUser= 3879/head
DaanDeMeyer [Mon, 25 Aug 2025 09:27:44 +0000 (11:27 +0200)] 
Replace RuntimeHome= with BindUser=

Let's replace our home grown RuntimeHome= option with BindUser= to
mimick systemd-nspawn's --bind-user= option. systemd-vmspawn will soon
learn to support --bind-user= as well and we'll enable the option for
it when that happens as well.

3 weeks agoPass credentials as files where applicable
Daan De Meyer [Sun, 23 Mar 2025 18:36:49 +0000 (19:36 +0100)] 
Pass credentials as files where applicable

- Credentials can be rather large, which leads to huge command lines
  if we pass them as a (encoded) string
- Credentials can be security sensitive, and passing them as a string
  makes it very easy to discover them via `ps` or similar.

Let's solve both issues by always passing credentials as files.

Fixes #3856

3 weeks agoAdd missing uidmap options for --bind= nspawn arguments
DaanDeMeyer [Mon, 25 Aug 2025 09:46:17 +0000 (11:46 +0200)] 
Add missing uidmap options for --bind= nspawn arguments

3 weeks agosandbox: Make all relative paths absolute during argparsing
Daan De Meyer [Fri, 12 Sep 2025 09:26:13 +0000 (11:26 +0200)] 
sandbox: Make all relative paths absolute during argparsing

We change the current working directory during processing in
mkosi-sandbox so let's make sure that we don't have any relative paths
leftover by that point that would become invalid.

3 weeks agodnf: Fix /var package cache directory check in package_subdirs()
Daan De Meyer [Fri, 12 Sep 2025 08:53:52 +0000 (10:53 +0200)] 
dnf: Fix /var package cache directory check in package_subdirs()

package_subdirs() receives the full cache directory path, not the
configured package cache directory (something like /var/cache/libdnf5),
so we fix the check to check if the parent directory of the given
cache directory is /var/cache so we don't have to know whether the
last component is dnf or libdnf5.

3 weeks agoRevert "sandbox: Work around extra file descriptor opened by importing ctypes since...
Daan De Meyer [Fri, 12 Sep 2025 09:57:42 +0000 (11:57 +0200)] 
Revert "sandbox: Work around extra file descriptor opened by importing ctypes since python 3.14"

This reverts commit 694c8d2721cd6d1081caf39641f615aa81d5f8a0.

3 weeks agoAlways use repository metadata from /var package cache directory
Daan De Meyer [Fri, 12 Sep 2025 07:40:55 +0000 (09:40 +0200)] 
Always use repository metadata from /var package cache directory

Fixes #3883

3 weeks agoAdd note on Encrypt=yes to Passphrase= docs
Daan De Meyer [Fri, 12 Sep 2025 07:05:21 +0000 (09:05 +0200)] 
Add note on Encrypt=yes to Passphrase= docs

Fixes #3886

3 weeks agoDrop BuildSourcesEphemeral=yes from default image config
Daan De Meyer [Fri, 12 Sep 2025 07:21:12 +0000 (09:21 +0200)] 
Drop BuildSourcesEphemeral=yes from default image config

I'm making sure the mkosi rpm spec build cleans up after itself in
https://src.fedoraproject.org/rpms/mkosi/pull-request/24# so we don't
need this anymore

Fixes #3808

3 weeks agoAdd devicetree-auto support for UKI
Clayton Craft [Tue, 26 Aug 2025 18:21:50 +0000 (11:21 -0700)] 
Add devicetree-auto support for UKI

This renames Devicetree --> Devicetrees, and adds support for listing
globs and files as currently supported for KernelModule* options.
When multiple devicetrees are found, they are added to dtbauto sections
when building a UKI.
Multiple dtbs are not supported for type 1 booting.

Fixes #3827

3 weeks agoMerge pull request #3802 from DaanDeMeyer/snapshot
Daan De Meyer [Thu, 11 Sep 2025 12:26:01 +0000 (14:26 +0200)] 
Merge pull request #3802 from DaanDeMeyer/snapshot

Add new Snapshot= setting

3 weeks agoMerge pull request #3887 from DaanDeMeyer/mkosi-vm-util-linux
Daan De Meyer [Thu, 11 Sep 2025 10:09:26 +0000 (12:09 +0200)] 
Merge pull request #3887 from DaanDeMeyer/mkosi-vm-util-linux

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.

3 weeks agomkosi-tools: Move opensuse.conf into opensuse/ directory 3887/head
DaanDeMeyer [Sat, 30 Aug 2025 15:18:49 +0000 (17:18 +0200)] 
mkosi-tools: Move opensuse.conf into opensuse/ directory

3 weeks agomkosi-tools: Explicitly install python
DaanDeMeyer [Sat, 30 Aug 2025 15:18:21 +0000 (17:18 +0200)] 
mkosi-tools: Explicitly install python

3 weeks agomkosi-tools: Explicitly install bash
DaanDeMeyer [Sat, 30 Aug 2025 15:15:58 +0000 (17:15 +0200)] 
mkosi-tools: Explicitly install bash

3 weeks agomkosi-vm: Explicitly install kmod
DaanDeMeyer [Sat, 30 Aug 2025 15:11:58 +0000 (17:11 +0200)] 
mkosi-vm: Explicitly install kmod

3 weeks agomkosi-vm: Explicitly install util-linux
DaanDeMeyer [Sat, 30 Aug 2025 15:11:03 +0000 (17:11 +0200)] 
mkosi-vm: Explicitly install util-linux

3 weeks agoDon't add ncdu for ppc64-le on Fedora
Jörg Behrmann [Mon, 8 Sep 2025 12:01:01 +0000 (14:01 +0200)] 
Don't add ncdu for ppc64-le on Fedora

3 weeks agoci: Disable PPC jobs temporarily
Daan De Meyer [Thu, 11 Sep 2025 08:07:49 +0000 (10:07 +0200)] 
ci: Disable PPC jobs temporarily

Something in the PPC runners is broken causing all CI jobs to get
cancelled when trying to rerun CI jobs. Let's disable the PPC jobs
temporarily until the issues with the underlying runners are fixed
so the rest of CI can run again and we can merge PRs again.

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