]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
12 hours agoMove Incremental= to inherited settings in docs main
Daan De Meyer [Sat, 14 Feb 2026 21:47:49 +0000 (22:47 +0100)] 
Move Incremental= to inherited settings in docs

12 hours agoMake MakeScriptsExecutable= a multiversal setting
Daan De Meyer [Sat, 14 Feb 2026 21:47:36 +0000 (22:47 +0100)] 
Make MakeScriptsExecutable= a multiversal setting

12 hours agoLook at all CacheOnly= settings to determine if we need to sync metadata
Daan De Meyer [Sat, 14 Feb 2026 21:37:43 +0000 (22:37 +0100)] 
Look at all CacheOnly= settings to determine if we need to sync metadata

Instead of only looking at the CacheOnly= setting of the main image,
let's allow subimages to also configure it to instruct whether repository
metadata should be synced for that image or not.

Also, let's change the behavior of "auto". Currently, we don't sync
repository metadata as long as we have a cached image. The idea behind
this was to avoid weird problems when installing packages in postinst
scripts or such that would see newer repository metadata than the repository
metadata that the image was built with.

While this still holds, the problem with the current approach is that
for regular uses, the default initrd will always have a cache and as such,
even when the main image is out-of-date, we still won't sync repository metadata,
eventually resulting in the repository metadata being so out of date that
the packages can't be found in the mirrors anymore.

The latter is much more likely to happen than the former, so let's sync
repository metadata every time we have any image that does not have a cache.
The user now has the option to customize the behavior per image if they don't
like the default behavior.

32 hours agoconfig / qemu: add Console=headless
Gregory Price [Fri, 23 Jan 2026 19:48:09 +0000 (14:48 -0500)] 
config / qemu: add Console=headless

Add a headless option for Console so automation can run the qemu
instance in a background task.  In the current modes, qemu just
exits on boot because the console has nothing to attach to.

vmspawn does not support headless for now, just die if this is set.

Signed-off-by: Gregory Price <gourry@gourry.net>
35 hours agosandbox: Make sure eventfd is CLOEXEC
Daan De Meyer [Sat, 14 Feb 2026 13:40:18 +0000 (14:40 +0100)] 
sandbox: Make sure eventfd is CLOEXEC

35 hours agoMerge pull request #4169 from daandemeyer/python3.9
Daan De Meyer [Sat, 14 Feb 2026 13:47:11 +0000 (14:47 +0100)] 
Merge pull request #4169 from daandemeyer/python3.9

36 hours agoRevert "Bump minimum python version to 3.10" 4169/head
Daan De Meyer [Sat, 14 Feb 2026 13:24:29 +0000 (14:24 +0100)] 
Revert "Bump minimum python version to 3.10"

This reverts commit 22b2f0bf18ac98f62ef92745fde5dd3f8369d4bf.

Turns out using python3.12 on CentOS causes more issues than
we thought it would, so let's revert the move to python 3.9.
Instead, we'll conditionally import Union in sandbox.py only on
python 3.9 and use the Union operator otherwise.

36 hours agoRevert "sandbox: Use os.eventfd()"
Daan De Meyer [Sat, 14 Feb 2026 12:37:08 +0000 (13:37 +0100)] 
Revert "sandbox: Use os.eventfd()"

This reverts commit 1505d67efe3457a041a29e7a6516d1d0173833ef.

36 hours agoRevert "Use python3.12 as interpreter in CentOS Stream 9 zipapp"
Daan De Meyer [Sat, 14 Feb 2026 12:36:48 +0000 (13:36 +0100)] 
Revert "Use python3.12 as interpreter in CentOS Stream 9 zipapp"

This reverts commit d6ddc66acb05d3d761d3f600c6b029319db9ae95.

37 hours agoRework sandbox globbing and exist checks
Daan De Meyer [Fri, 13 Feb 2026 20:34:48 +0000 (21:34 +0100)] 
Rework sandbox globbing and exist checks

Using bash to glob in the sandbox is rather primitive. Let's do better
by taking advantage of the fact that we can run mkosi-sandbox without
executing another binary. We beef up fork_and_wait() to allow passing
in a sandbox and use a pipe to send the pickled result of the target
function back to the parent process so we can return it from
fork_and_wait(). This allows us to rewrite glob_in_sandbox() and
exists_in_sandbox() to be much simpler.

At the same time, make sure we show proper stacktraces when using
uncaught_exception_handler() after fork. To achieve this, we have to
make sure it logs all frames, including the parent's ones, as we have
to log the exception from the forked process as we can't pickle exceptions
and send them to the parent.

Additionally, try to populate the line cache as early as possible as
we might not be able to access source files after sandboxing ourselves.

While we're at it, we switch _preexec() over to using
uncaught_exception_handler() as well.

40 hours agoUse python3.12 as interpreter in CentOS Stream 9 zipapp
Daan De Meyer [Fri, 13 Feb 2026 21:54:35 +0000 (22:54 +0100)] 
Use python3.12 as interpreter in CentOS Stream 9 zipapp

40 hours agotests: fix running pytest on undetected distro
Clayton Craft [Sat, 14 Feb 2026 01:02:47 +0000 (17:02 -0800)] 
tests: fix running pytest on undetected distro

63ae86e changed detect_distribution so that if it can't find the
distribution it now just returns the string instead of returning None.
This breaks conftest.py when trying to run tests on a distribution
that's not detected (e.g. when packaging mkosi for Alpine Linux)

Fixes #4162

2 days agoMerge pull request #4164 from daandemeyer/various
Daan De Meyer [Fri, 13 Feb 2026 21:12:08 +0000 (22:12 +0100)] 
Merge pull request #4164 from daandemeyer/various

Various stuff

2 days agoDon't build default initrd for directory images by default 4164/head
Daan De Meyer [Fri, 13 Feb 2026 16:05:40 +0000 (17:05 +0100)] 
Don't build default initrd for directory images by default

We switched this around a long time ago to accomodate virtiofsd qemu
boots as those needed an initrd without the image necessarily being
bootable. Given Fedora and Arch now allow for direct kernel boot with
virtiofsd without needing an initrd, let's switch back the default to
not building an initrd for directory images, so that the same config
can be used to build disk images for vm boot and directory images for
container boot without having to build the initrd when building directory
images.

2 days agoAdd Incremental=relaxed
Daan De Meyer [Fri, 13 Feb 2026 16:01:44 +0000 (17:01 +0100)] 
Add Incremental=relaxed

In systemd, we have some test subimages that we want to build once
and keep intact instead of constantly rebuilding them. Let's add
Incremental=relaxed which will only remove the outputs from those
images if -ff is used and not a regular -f.

2 days agoOnly copy out initrds if we have any
Daan De Meyer [Fri, 13 Feb 2026 15:56:03 +0000 (16:56 +0100)] 
Only copy out initrds if we have any

Now that we don't build the default initrd on demand anymore, there's
nothing to copy out if no initrds are configured, so don't try to copy
anything out in that case.

2 days agoAdd support for mkosi.initrd.conf to configure the default initrd
Daan De Meyer [Fri, 13 Feb 2026 15:55:08 +0000 (16:55 +0100)] 
Add support for mkosi.initrd.conf to configure the default initrd

We have mkosi.tools.conf, we might as well add mkosi.initrd.conf as
well.

2 days agosandbox: Turn drop_capabilities() into fix_userns_capabilities()
Daan De Meyer [Thu, 5 Feb 2026 15:11:07 +0000 (16:11 +0100)] 
sandbox: Turn drop_capabilities() into fix_userns_capabilities()

2 days agosandbox: Turn mount_rbind() into mount_bind()
Daan De Meyer [Fri, 30 Jan 2026 13:33:56 +0000 (14:33 +0100)] 
sandbox: Turn mount_rbind() into mount_bind()

2 days agoMerge pull request #4163 from daandemeyer/history-fix
Jörg Behrmann [Fri, 13 Feb 2026 15:07:29 +0000 (16:07 +0100)] 
Merge pull request #4163 from daandemeyer/history-fix

History fixes

2 days agotest: Add test covering the history with empty lists 4163/head
Daan De Meyer [Fri, 13 Feb 2026 08:11:52 +0000 (09:11 +0100)] 
test: Add test covering the history with empty lists

2 days agoconfig: Make sure we write finalized values into the history
Daan De Meyer [Fri, 13 Feb 2026 08:02:47 +0000 (09:02 +0100)] 
config: Make sure we write finalized values into the history

Otherwise if we specify e.g. --package-directories= on the command
line it'll get written as None into the history and won't get parsed
properly by Config.from_partial_json().

2 days agoconfig: Make sure we handle empty lists from history properly
Daan De Meyer [Fri, 13 Feb 2026 08:01:03 +0000 (09:01 +0100)] 
config: Make sure we handle empty lists from history properly

If we get an empty list from the history, that means the empty string
was specified on the cli, and hence we should treat it as a reset (by
setting the xxx_was_none field in the dict same as we would when parsing
it from the cli).

Note that we only need to do this for list based settings as regular
values will just have their default value written into the history.

3 days agocentos: Fix EPEL repositories for RHEL 10
Daan De Meyer [Thu, 12 Feb 2026 11:53:10 +0000 (12:53 +0100)] 
centos: Fix EPEL repositories for RHEL 10

Replaces #4108

The previous PR didn't take into account that mirrors were changed
as well. This PR should cover all changes in RHEL 10 to how EPEL is
handled.

3 days agoMerge pull request #4158 from daandemeyer/python3.10
Daan De Meyer [Thu, 12 Feb 2026 09:04:53 +0000 (10:04 +0100)] 
Merge pull request #4158 from daandemeyer/python3.10

4 days agosandbox: Use os.eventfd() 4158/head
Daan De Meyer [Wed, 11 Feb 2026 22:24:12 +0000 (23:24 +0100)] 
sandbox: Use os.eventfd()

Available since Python 3.10.

4 days agosandbox: Use close() for eventfd
Daan De Meyer [Wed, 28 Jan 2026 16:55:54 +0000 (17:55 +0100)] 
sandbox: Use close() for eventfd

4 days agoBump minimum python version to 3.10
Daan De Meyer [Wed, 11 Feb 2026 19:39:33 +0000 (20:39 +0100)] 
Bump minimum python version to 3.10

- CentOS Stream 9 has python 3.9 by default, but python 3.12 is packaged
- Ubuntu Jammy has python 3.10.

So we'll require CentOS Stream 9 users to install the python3.12
package to keep using mkosi, which shouldn't be a problem.

Bumping version allows us to switch to the Union operator among other
improvements. This commit gets rid of Union and Optional, we'll adopt
other 3.10 features later.

4 days agobin/mkosi: Beef up interpreter searching logic
Daan De Meyer [Wed, 11 Feb 2026 19:41:21 +0000 (20:41 +0100)] 
bin/mkosi: Beef up interpreter searching logic

Let's search for any installed interpreter that's sufficiently new.

4 days agooci: allow user defined labels and annotations
Brian Ketelsen [Wed, 11 Feb 2026 02:01:04 +0000 (21:01 -0500)] 
oci: allow user defined labels and annotations

Signed-off-by: Brian Ketelsen <bketelsen@gmail.com>
6 days agoman: be more precise that the tools tree distribution is decided by the host distribution
Jörg Behrmann [Mon, 9 Feb 2026 11:21:48 +0000 (12:21 +0100)] 
man: be more precise that the tools tree distribution is decided by the host distribution

10 days agoSupport resizing output image
Kai Lüke [Fri, 23 Jan 2026 15:12:40 +0000 (16:12 +0100)] 
Support resizing output image

When the final image does not contain the rootfs it must be grown before
being able to boot it. Since the exact size to grow is not easily known
to the user, it's best if the image is already grown to the right size.
Also, when flashing to disk it helps to have the image be the minimum
size needed because otherwise flashing on a too small disk succeeds but
boot will fail. With the right image size it's easier for the user to
know whether the disk is large enough.

10 days agosandbox: Make sure we're dumpable before writing uidmap files
Daan De Meyer [Thu, 5 Feb 2026 11:52:35 +0000 (12:52 +0100)] 
sandbox: Make sure we're dumpable before writing uidmap files

Fixes a permission error when running mkosi as root and changing UID/GID
to non-root, like virtiofsd when running "mkosi vm".

10 days agofedora: Use N-1 key as well when querying rawhide GPG key
Daan De Meyer [Thu, 5 Feb 2026 09:29:38 +0000 (10:29 +0100)] 
fedora: Use N-1 key as well when querying rawhide GPG key

We now run into the opposite problem where distribution-gpg-keys is
updated before rawhide is updated, so query the N-1 key as well to
avoid issues in the other direction.

10 days agoMerge pull request #4151 from daandemeyer/ci
Jörg Behrmann [Thu, 5 Feb 2026 09:27:07 +0000 (10:27 +0100)] 
Merge pull request #4151 from daandemeyer/ci

action: Run apt-get update before installing packages

10 days agoconfig: Fix formatting with newer ruff 4151/head
Daan De Meyer [Thu, 5 Feb 2026 08:53:11 +0000 (09:53 +0100)] 
config: Fix formatting with newer ruff

10 days agoaction: Run apt-get update before installing packages
Daan De Meyer [Thu, 5 Feb 2026 08:31:50 +0000 (09:31 +0100)] 
action: Run apt-get update before installing packages

The repository metadata in the image can get out of date. Let's run
apt-get update to make sure it is fresh.

12 days agoAdd MakeScriptsExecutable= setting to optionally try to make scripts executable befor...
Luca Boccassi [Wed, 28 Jan 2026 22:43:21 +0000 (22:43 +0000)] 
Add MakeScriptsExecutable= setting to optionally try to make scripts executable before bailing out

If it fails, it was going to die() anyway.

OBS sources defined inline (ie, not in a tarball) cannot have the mode preserved,
so it's not possible to have mkosi.build or so as a bare script
in an OBS project, one needs to tar it up and extract it again later,
which means it cannot be edited by the inline editor, which is very
convenient for small and trivial builds like an addon.

13 days agobuild(deps): bump github/codeql-action from 4.31.9 to 4.32.0
dependabot[bot] [Sun, 1 Feb 2026 22:43:27 +0000 (22:43 +0000)] 
build(deps): bump github/codeql-action from 4.31.9 to 4.32.0

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.9 to 4.32.0.
- [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/5d4e8d1aca955e8d8589aabd499c5cae939e33c7...b20883b0cd1f46c72ae0ba6d1090936928f9fa30)

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

Signed-off-by: dependabot[bot] <support@github.com>
13 days agobuild(deps): bump actions/checkout from 6.0.1 to 6.0.2
dependabot[bot] [Sun, 1 Feb 2026 22:43:12 +0000 (22:43 +0000)] 
build(deps): bump actions/checkout from 6.0.1 to 6.0.2

Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/8e8c483db84b4bee98b60c0593521ed34d9990e8...de0fac2e4500dabe0009e67214ff5f5447ce83dd)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
13 days agodocs: remove superfluous definition colon
Jörg Behrmann [Sat, 9 Aug 2025 12:33:30 +0000 (14:33 +0200)] 
docs: remove superfluous definition colon

2 weeks agomkosi-tools: add libarchive-tools package.
Sofiane HAMAM [Tue, 27 Jan 2026 22:29:46 +0000 (23:29 +0100)] 
mkosi-tools: add libarchive-tools package.

Fix Arch image build failure due to missing bsdtar.
Fixes discussions/4135.

2 weeks agoMerge pull request #4143 from behrmann/fedoranpm
Luca Boccassi [Wed, 28 Jan 2026 10:40:16 +0000 (10:40 +0000)] 
Merge pull request #4143 from behrmann/fedoranpm

ci: add nodejs-npm to tools tree packages for Fedora

2 weeks agoci: switch tools tree from Fedira Rawhide to Arch 4143/head
Jörg Behrmann [Wed, 28 Jan 2026 08:25:27 +0000 (09:25 +0100)] 
ci: switch tools tree from Fedira Rawhide to Arch

2 weeks agoci: try multiple npm binaries in prepare script
Jörg Behrmann [Wed, 28 Jan 2026 07:40:05 +0000 (08:40 +0100)] 
ci: try multiple npm binaries in prepare script

2 weeks agoci: add nodejs-npm to tools tree packages for Fedora
Jörg Behrmann [Wed, 28 Jan 2026 07:27:49 +0000 (08:27 +0100)] 
ci: add nodejs-npm to tools tree packages for Fedora

2 weeks agodocs: Add information about gui mkosi-tools profile
Didr [Tue, 27 Jan 2026 20:23:50 +0000 (21:23 +0100)] 
docs: Add information about gui mkosi-tools profile

2 weeks agoAdd missing call to run_locale_gen()
Martin Hundebøll [Mon, 26 Jan 2026 08:19:56 +0000 (09:19 +0100)] 
Add missing call to run_locale_gen()

And mention the new feature in the news file.

3 weeks agorpm: Set pkgverify_level to digest
Daan De Meyer [Wed, 21 Jan 2026 09:05:24 +0000 (10:05 +0100)] 
rpm: Set pkgverify_level to digest

This was changed to all in rpm 6.0.0, which means that rpm is checking
for signatures from dnf/zypper repos that have gpgcheck=0. dnf5 was updated
to deal with this but for some reason the fix isn't working in Arch and zypper
doesn't deal with this at all, so revert back to the previous level until
package managers can actually deal with this.

3 weeks agodnf: Give advanced users some control over plugins
Daan De Meyer [Tue, 20 Jan 2026 18:25:35 +0000 (19:25 +0100)] 
dnf: Give advanced users some control over plugins

Let's add some environment variables to control plugins for cases
where users have some dnf plugin they can't touch on their host system
which doesn't behave properly in mkosi-sandbox and which they can't
remove themselves.

3 weeks agorun: Improve sandbox command logging
Daan De Meyer [Tue, 20 Jan 2026 07:48:15 +0000 (08:48 +0100)] 
run: Improve sandbox command logging

Replaces #4068

3 weeks agoFix environment variable name for systemd-repart
Daan De Meyer [Mon, 19 Jan 2026 08:10:49 +0000 (09:10 +0100)] 
Fix environment variable name for systemd-repart

4 weeks agoAllow specifying "default" value for Initrds=
Daan De Meyer [Sun, 18 Jan 2026 10:53:30 +0000 (11:53 +0100)] 
Allow specifying "default" value for Initrds=

Also use it as the default value for Initrds= when we decide a default
initrd is needed. This allows both using the default initrd alongside
other initrds as well as disabling building the default initrd by assigning
the empty string to Initrds=.

4 weeks agoAllow setting PORTABLE_PREFIXES= via Environment=
Daan De Meyer [Thu, 15 Jan 2026 19:31:23 +0000 (20:31 +0100)] 
Allow setting PORTABLE_PREFIXES= via Environment=

4 weeks agoopensuse: More GPG key handling fixes
Daan De Meyer [Thu, 15 Jan 2026 12:13:04 +0000 (13:13 +0100)] 
opensuse: More GPG key handling fixes

- Pass GPG keys to rpm --import as paths inside the sandbox. This
  makes sure that overrides from mkosi.sandbox are taken into account.
  e.g. atm we pass mkosi.tools/usr/share/distribution-gpg-keys/... whereas
  now we pass /usr/share/distribution-gpg-keys/...
- Make sure we figure out keys once when using zypper. zypper downloads
  GPG keys (when fetching is enabled) when refreshing repositories. These
  keys are stored in the rpm database in the temporary root we use when
  syncing repository metadata. To make sure they are not lost, we extract
  the keys using rpmkeys and store them in the keyring directory which we
  use from then onwards. For all image builds we then simply import the
  keys from the keyring directory.

4 weeks agoMerge pull request #4122 from DaanDeMeyer/opensuse-fixes
Jörg Behrmann [Thu, 15 Jan 2026 08:54:44 +0000 (09:54 +0100)] 
Merge pull request #4122 from DaanDeMeyer/opensuse-fixes

Opensuse fixes

4 weeks agoopensuse: Log when importing GPG keys into RPM database 4122/head
Daan De Meyer [Wed, 14 Jan 2026 19:08:09 +0000 (20:08 +0100)] 
opensuse: Log when importing GPG keys into RPM database

4 weeks agoopensuse: List local GPG keys for Leap as well
Daan De Meyer [Wed, 14 Jan 2026 18:28:13 +0000 (19:28 +0100)] 
opensuse: List local GPG keys for Leap as well

4 weeks agoopensuse: Log when we're potentially going to curl()
Daan De Meyer [Wed, 14 Jan 2026 18:27:12 +0000 (19:27 +0100)] 
opensuse: Log when we're potentially going to curl()

4 weeks agoopensuse: Fix gpgkey URL
Daan De Meyer [Wed, 14 Jan 2026 18:26:39 +0000 (19:26 +0100)] 
opensuse: Fix gpgkey URL

4 weeks agoopensuse: Simplify error messages slightly
Daan De Meyer [Wed, 14 Jan 2026 18:25:08 +0000 (19:25 +0100)] 
opensuse: Simplify error messages slightly

4 weeks agoopensuse: Import GPG keys downloaded by zypper as well
Daan De Meyer [Wed, 14 Jan 2026 18:24:05 +0000 (19:24 +0100)] 
opensuse: Import GPG keys downloaded by zypper as well

When syncing repository metadata, zypper will download keys if
--gpg-auto-import-keys is specified. When installing packages, we need
to make sure these keys are imported into the rpmdb as well.

4 weeks agoopensuse: Simplify GPG logic
Daan De Meyer [Wed, 14 Jan 2026 18:22:41 +0000 (19:22 +0100)] 
opensuse: Simplify GPG logic

No need to check ourselves, we can delegate the check to find_rpm_gpgkey()
instead.

4 weeks agoopensuse: Fetch remote keys as well if RepositoryKeyFetch= is enabled
Daan De Meyer [Tue, 13 Jan 2026 19:55:02 +0000 (20:55 +0100)] 
opensuse: Fetch remote keys as well if RepositoryKeyFetch= is enabled

Also improve error handling for if local keys do not exist.

4 weeks agoci: Use mkosi box for unit test CI as well
Daan De Meyer [Tue, 13 Jan 2026 19:43:38 +0000 (20:43 +0100)] 
ci: Use mkosi box for unit test CI as well

5 weeks agoMerge pull request #4117 from behrmann/tyfixes
Daan De Meyer [Sat, 10 Jan 2026 15:56:12 +0000 (16:56 +0100)] 
Merge pull request #4117 from behrmann/tyfixes

Ty(ping) fixes

5 weeks agoRemove deprecated logging.warn call 4117/head
Jörg Behrmann [Sat, 10 Jan 2026 12:34:05 +0000 (13:34 +0100)] 
Remove deprecated logging.warn call

5 weeks agoRemove unused type ignore statements
Jörg Behrmann [Sat, 10 Jan 2026 12:32:54 +0000 (13:32 +0100)] 
Remove unused type ignore statements

5 weeks agoMake sure we pass the right context to finalize_default_initrd()
DaanDeMeyer [Thu, 8 Jan 2026 17:06:16 +0000 (18:06 +0100)] 
Make sure we pass the right context to finalize_default_initrd()

We mess around with the context object to make it for for use when
reading the subimages. But we need the full context again for parsing
the default initrd later on, so make a copy before we delete stuff and
pass that to finalize_default_initrd()

Fixes #4114

5 weeks agoMerge pull request #4111 from DaanDeMeyer/vsock
Jörg Behrmann [Wed, 7 Jan 2026 09:45:31 +0000 (10:45 +0100)] 
Merge pull request #4111 from DaanDeMeyer/vsock

qemu: Start vsock notify handler thread after starting qemu

5 weeks agoStop running auxiliary programs in systemd scopes 4111/head
DaanDeMeyer [Tue, 6 Jan 2026 20:29:04 +0000 (21:29 +0100)] 
Stop running auxiliary programs in systemd scopes

Similar to the same change made in systemd-vmspawn, let's stop running
virtiofsd, systemd-journal-remote and swtpm in scopes. Nobody ever makes
use of the features this provides and it simplifies our code quite a bit.

This also means we drop the UnitProperties setting, which was effectively
unused anyway.

This allows us to get rid of the --suspend setting in mkosi-sandbox, which
only really existed to allow waiting for systemd-run to finish its setup
before registering the machine. Because registering a machine means it needs
a cgroup, we allow systemd-machined to create the scope itself if needed.

5 weeks agoqemu: Start vsock notify handler thread after starting qemu
DaanDeMeyer [Tue, 6 Jan 2026 19:21:51 +0000 (20:21 +0100)] 
qemu: Start vsock notify handler thread after starting qemu

5 weeks agotools: don't pull in virtiofsd in bookworm tools trees
Jörg Behrmann [Tue, 6 Jan 2026 13:54:40 +0000 (14:54 +0100)] 
tools: don't pull in virtiofsd in bookworm tools trees

6 weeks agobuild(deps): bump github/codeql-action from 4.31.6 to 4.31.9
dependabot[bot] [Fri, 2 Jan 2026 11:50:17 +0000 (11:50 +0000)] 
build(deps): bump github/codeql-action from 4.31.6 to 4.31.9

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.6 to 4.31.9.
- [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/fe4161a26a8629af62121b670040955b330f9af2...5d4e8d1aca955e8d8589aabd499c5cae939e33c7)

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

Signed-off-by: dependabot[bot] <support@github.com>
6 weeks agobuild(deps): bump actions/checkout from 6.0.0 to 6.0.1
dependabot[bot] [Thu, 1 Jan 2026 22:05:12 +0000 (22:05 +0000)] 
build(deps): bump actions/checkout from 6.0.0 to 6.0.1

Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/1af3b93b6815bc44a9784bd300feb67ff0d1eeb3...8e8c483db84b4bee98b60c0593521ed34d9990e8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
6 weeks agoopensuse: Import GPG keys for all repositories
DaanDeMeyer [Tue, 30 Dec 2025 21:56:51 +0000 (22:56 +0100)] 
opensuse: Import GPG keys for all repositories

Let's not just import GPG keys for our own repositories, but for
all repositories.

6 weeks agoAdd support for locale-gen
DaanDeMeyer [Tue, 30 Dec 2025 21:17:56 +0000 (22:17 +0100)] 
Add support for locale-gen

If locales are configured in /etc/locale.gen, let's run locale-gen.

6 weeks agoMerge pull request #4100 from Ma27/systemd-hacking-on-nixos
Daan De Meyer [Tue, 30 Dec 2025 15:15:17 +0000 (16:15 +0100)] 
Merge pull request #4100 from Ma27/systemd-hacking-on-nixos

6 weeks agonixos: Use repository key fetching by default on nixos
DaanDeMeyer [Mon, 29 Dec 2025 18:54:01 +0000 (19:54 +0100)] 
nixos: Use repository key fetching by default on nixos

nixos generally won't have any keys in the expected locations so let's
use repository key fetching by default if we're building from a nixos
host (or tools tree).

6 weeks agomkosi/run: pass through LD_LIBRARY_PATH 4100/head
Maximilian Bosch [Mon, 29 Dec 2025 17:06:18 +0000 (18:06 +0100)] 
mkosi/run: pass through LD_LIBRARY_PATH

The sandbox expects that the host has a `libseccomp.so` in its global
search-path (usually `/usr/lib`). However, that path doesn't exist on
NixOS. Another standard way of passing lookup paths to `dlopen()` is
using LD_LIBRARY_PATH which is now passed through to the sandbox.

6 weeks agotreewide: use `/usr/bin/env bash` instead of `/bin/bash` as shebang
Maximilian Bosch [Mon, 29 Dec 2025 17:04:21 +0000 (18:04 +0100)] 
treewide: use `/usr/bin/env bash` instead of `/bin/bash` as shebang

E.g. NixOS doesn't have a `/bin/bash` and some of the scripts are seemingly
running inside the host's context. Hence, use the more cautious variant of
`/usr/bin/env bash` and just do it everywhere for consistency.

6 weeks agomkosi/run: inherit store paths from nix-shell into sandbox
Maximilian Bosch [Sun, 2 Nov 2025 14:14:09 +0000 (15:14 +0100)] 
mkosi/run: inherit store paths from nix-shell into sandbox

On NixOS most interesting stuff is either in store-paths from $PATH
(e.g. when working in a nix-shell).

Add these PATH entries to the new $PATH and ensure everything
interesting is in the sandbox.

7 weeks agodocs: Reword dependencies vs tools tree requirement a bit
DaanDeMeyer [Sat, 27 Dec 2025 17:57:58 +0000 (18:57 +0100)] 
docs: Reword dependencies vs tools tree requirement a bit

7 weeks agodocs: Minor correction on enabling unprivileged namespaces
ssooffiiaannee [Sat, 27 Dec 2025 16:02:39 +0000 (17:02 +0100)] 
docs: Minor correction on enabling unprivileged namespaces

apparmor_restrict_unprivileged_unconfined should be set to 0 to allow
unprivileged namespaces.

7 weeks agodocs: Update unprivileged user namespace docs
DaanDeMeyer [Sat, 27 Dec 2025 12:00:28 +0000 (13:00 +0100)] 
docs: Update unprivileged user namespace docs

Let's not recommend fiddling around with apparmor profiles, but
instead recommend enabling unprivileged user namespaces unconditionally.
Users that care about security can figure out apparmor profiles on their own.

Also reorder and reword the REQUIREMENTS section in general.

7 weeks agokmod: Only use --modname if available
DaanDeMeyer [Fri, 26 Dec 2025 18:22:05 +0000 (19:22 +0100)] 
kmod: Only use --modname if available

--modname is only available since 2022, and not available in kmod in
CentOS Stream 9, so query if it is available and only use it if it is
available.

Querying --help every time isn't the most efficient but adds negligible
time to the modinfo step in practice.

7 weeks agoarch: Download archlinux-keyring with pacman
DaanDeMeyer [Fri, 26 Dec 2025 09:55:24 +0000 (10:55 +0100)] 
arch: Download archlinux-keyring with pacman

curl-ing the Arch Linux website fails quite often due to connection
issues. Let's try downloading the archlinux-keyring package with
Pacman so we go directly to a mirror and avoid hitting the Arch
Linux website.

7 weeks agoMerge pull request #4092 from DaanDeMeyer/kmod
Daan De Meyer [Fri, 26 Dec 2025 09:41:28 +0000 (10:41 +0100)] 
Merge pull request #4092 from DaanDeMeyer/kmod

kmod: Stop retrieving dependency info of all modules

7 weeks agokmod: Reorder ko extension list 4092/head
DaanDeMeyer [Thu, 25 Dec 2025 20:41:11 +0000 (21:41 +0100)] 
kmod: Reorder ko extension list

It's unsure whether python uses a hash based lookup for this or not,
so let's list the most commonly expected extensions first. Kernel
modules tend to be compressed these days, so those are the ones we
list first, with preference to zstd and xz.

7 weeks agokmod: Use same ko glob everywhere
DaanDeMeyer [Thu, 25 Dec 2025 20:40:06 +0000 (21:40 +0100)] 
kmod: Use same ko glob everywhere

7 weeks agokmod: Stop retrieving dependency info of all modules
DaanDeMeyer [Thu, 25 Dec 2025 19:48:47 +0000 (20:48 +0100)] 
kmod: Stop retrieving dependency info of all modules

Instead of running modinfo once to retrieve the dependency information
of all modules, let's only retrieve the dependency information of the
modules that are to be included in the image and their transitive
dependencies. This means we have to run modinfo multiple times, but with
far fewer modules than before. This ends up being faster than retrieving
the dependency information of all modules, especially after the optimization
from e276dac87a530efac4376a5059b980f2d43460f5.

For the mkosi default image build on Arch Linux this reduces the time for
calculating the required kernel modules and firmware on my laptop from 5s
to 0.5s.

Co-Authored-By: Laurence Kiln <246209442+LaurenceKiln@users.noreply.github.com>
7 weeks agokmod: Use Sequence instead of Reversible/Iterable
DaanDeMeyer [Thu, 25 Dec 2025 20:02:49 +0000 (21:02 +0100)] 
kmod: Use Sequence instead of Reversible/Iterable

We generally use Sequence everywhere else as well and there's no good
reason to use Reversible/Iterable here, so let's switch to Sequence.

7 weeks agokmod: Streamline step logging
DaanDeMeyer [Thu, 25 Dec 2025 19:56:01 +0000 (20:56 +0100)] 
kmod: Streamline step logging

Let's track the full runtime of filter_kernel_modules(), filter_firmware()
and resolve_module_dependencies().

7 weeks agoMerge pull request #4091 from p5/dev/p5/reproducibility-updates
Daan De Meyer [Thu, 25 Dec 2025 19:51:51 +0000 (20:51 +0100)] 
Merge pull request #4091 from p5/dev/p5/reproducibility-updates

Fix reproducibility for microcode initrd and gzip compression

7 weeks agokmod: Move modinfo output parsing into modinfo()
DaanDeMeyer [Thu, 25 Dec 2025 19:18:32 +0000 (20:18 +0100)] 
kmod: Move modinfo output parsing into modinfo()

7 weeks agocompressor_command: Use gzip -n for reproducible output 4091/head
Robert Sturla [Thu, 25 Dec 2025 18:02:13 +0000 (18:02 +0000)] 
compressor_command: Use gzip -n for reproducible output

The gzip format includes an MTIME field in its header that stores the
modification time of the original file. This causes compressed archives
to differ between builds even when the uncompressed content is identical.

Add the --no-name flag to gzip which suppresses storing the original
filename and timestamp, making gzip output reproducible.

Signed-off-by: Robert Sturla <rsturla@redhat.com>
7 weeks agobuild_microcode_initrd: Normalize timestamps for reproducible builds
Robert Sturla [Thu, 25 Dec 2025 18:00:22 +0000 (18:00 +0000)] 
build_microcode_initrd: Normalize timestamps for reproducible builds

When building the microcode initrd, files are created in a temporary
directory with current timestamps. These timestamps are then embedded
in the CPIO archive, causing non-reproducible builds even when
SourceDateEpoch is set.

Fix this by normalizing the modification times of all files in the
microcode root directory to source_date_epoch before creating the
CPIO archive.

Signed-off-by: Robert Sturla <rsturla@redhat.com>
7 weeks agoMerge pull request #4090 from DaanDeMeyer/proc
Jörg Behrmann [Wed, 24 Dec 2025 13:31:04 +0000 (14:31 +0100)] 
Merge pull request #4090 from DaanDeMeyer/proc

sandbox: Drop --proc

7 weeks agoFix --debug-shell 4090/head
DaanDeMeyer [Wed, 24 Dec 2025 10:53:57 +0000 (11:53 +0100)] 
Fix --debug-shell

While we're at it, let's save ourselves from having to reason about
Python's capture rules for nested functions by moving _preexec() out
of spawn() and passing in arguments via functools.partial().

7 weeks agosandbox: Drop --proc
DaanDeMeyer [Wed, 24 Dec 2025 10:35:32 +0000 (11:35 +0100)] 
sandbox: Drop --proc

This is trivially replaced with --bind /proc $DST, so let's drop the
separate option. Maybe in the future we'll add --proc back but have it
actually mount a new procfs instance.