]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
4 months agoFormatting correction. 3626/head
Uwe Sauter [Wed, 26 Mar 2025 20:51:55 +0000 (21:51 +0100)] 
Formatting correction.

4 months agomkosi clean will now require --force in order to remove the tools tree.
Uwe Sauter [Wed, 26 Mar 2025 20:49:34 +0000 (21:49 +0100)] 
mkosi clean will now require --force in order to remove the tools tree.

Single source code change. Related documentation updates.
Also unrelated typo fix for ToolsSyncScripts=, --tools-tree-sync-script=.

4 months agocentos: Add hyperscale-packages-kernel repository
Daan De Meyer [Wed, 26 Mar 2025 15:43:12 +0000 (16:43 +0100)] 
centos: Add hyperscale-packages-kernel repository

4 months agoMerge pull request #3622 from DaanDeMeyer/tools
Daan De Meyer [Wed, 26 Mar 2025 09:37:38 +0000 (10:37 +0100)] 
Merge pull request #3622 from DaanDeMeyer/tools

4 months agoqemu: Set device_id for scsi-hd and scsi-cd devices 3622/head
Daan De Meyer [Wed, 26 Mar 2025 09:25:35 +0000 (10:25 +0100)] 
qemu: Set device_id for scsi-hd and scsi-cd devices

When we used -drive this was done automatically but that's not the
case anymore with -blockdev, so do it explicitly ourselves.

4 months agoMake Profiles= an inherited setting
Daan De Meyer [Wed, 26 Mar 2025 08:59:18 +0000 (09:59 +0100)] 
Make Profiles= an inherited setting

4 months agoSkip a few steps when we're building a default tools tree
Daan De Meyer [Wed, 26 Mar 2025 08:27:04 +0000 (09:27 +0100)] 
Skip a few steps when we're building a default tools tree

None of these steps matter for tools trees so let's skip them when
we know we're building a default tools tree.

4 months agoDon't cache the package manager used in the tools tree cache manifest
Daan De Meyer [Tue, 25 Mar 2025 21:13:42 +0000 (22:13 +0100)] 
Don't cache the package manager used in the tools tree cache manifest

Doing this causes issues when using mkosi sandbox as have_cache(tools)
will be different inside and outside of the sandbox when building Fedora
and only dnf is available outside the sandbox but dnf5 is available inside
the sandbox. Since we don't need to cache the package manager used anyway
when building the default tools tree because we don't cache the package
manager metadata either, don't cache it to avoid this problem.

4 months agoImplement ToolsTreeSyncScripts=
Daan De Meyer [Tue, 25 Mar 2025 19:28:51 +0000 (20:28 +0100)] 
Implement ToolsTreeSyncScripts=

In systemd, we have prepare scripts for the build image to install
all the build dependencies of the corresponding distribution's systemd
packaging spec. The distribution packaging spec is checked out by a sync
script.

We also need the systemd build dependencies installed in the default tools
tree in systemd, so that we can build all the systemd tools required to build
the image in the tools tree as well to later be used to build the image. Currently
we list the the required dependencies manually as packages since we can't reuse
the prepare script from the build image as the sync scripts run after the default
tools tree has been built which means we can't depend on the packaging specs
being available when building the default tools tree.

Let's fix the issue by introducing ToolsTreeSyncScripts= to define sync scripts
to run before building the default tools tree.

4 months agoMerge pull request #3618 from DaanDeMeyer/tmpfiles
Daan De Meyer [Tue, 25 Mar 2025 19:16:57 +0000 (20:16 +0100)] 
Merge pull request #3618 from DaanDeMeyer/tmpfiles

4 months agoAdd mkosi init to install a tmpfiles dropin for the cache dir 3618/head
Daan De Meyer [Tue, 25 Mar 2025 15:17:39 +0000 (16:17 +0100)] 
Add mkosi init to install a tmpfiles dropin for the cache dir

Let's clean up packages after they haven't been touched for 90
days.

Note that this has to be explicitly enabled by users by running mkosi
init for now. In the future we can look into automatically enabling
this.

4 months agoman/mkosi-initrd: document "pkcs11" profile
Antonio Alvarez Feijoo [Tue, 25 Mar 2025 15:07:27 +0000 (16:07 +0100)] 
man/mkosi-initrd: document "pkcs11" profile

Follow-up for a63dd993db1dd7e58ff86ac75780fb4ad39a923c

4 months agoDrop logic for using /root/.cache
Daan De Meyer [Tue, 25 Mar 2025 15:42:38 +0000 (16:42 +0100)] 
Drop logic for using /root/.cache

Let's just have root use the cache in /var/cache/mkosi to avoid accidentally
leaking files into /root/.cache accidentally where it's much less likely that
they'll ever get cleaned up.

4 months agoMerge pull request #3616 from DaanDeMeyer/sandbox
Daan De Meyer [Tue, 25 Mar 2025 15:01:11 +0000 (16:01 +0100)] 
Merge pull request #3616 from DaanDeMeyer/sandbox

Make sure tools tree recorded in history doesn't change when in sandbox

4 months agoMake sure tools tree recorded in history doesn't change when in sandbox 3616/head
Daan De Meyer [Tue, 25 Mar 2025 13:41:26 +0000 (14:41 +0100)] 
Make sure tools tree recorded in history doesn't change when in sandbox

Currently, when in the sandbox, the tools tree will always be recorded
as "null" in the history. This causes problems if an image build is done
inside of mkosi sandbox and mkosi is later invoked outside of the sandbox
as the history will say no tools tree was used and so the tools tree won't
be used, even if we're running outside of the sandbox.

To fix the issue, let's make sure we always record the proper tools tree,
but let's not make use of it in the sandbox by moving the sandbox check to
the Config object's tools() method.

We also simplify all the tools tree related checks in run_verb() and add a
check to make sure we don't try to rebuild the default tools tree when in
"mkosi sandbox" as that can't ever work.

4 months agoStore default tools tree outside of output directory
Daan De Meyer [Tue, 25 Mar 2025 14:20:12 +0000 (15:20 +0100)] 
Store default tools tree outside of output directory

A common workflow is to build the same image multiple times with
slightly different settings, using a different output directory for
each build. By storing the default tools tree inside the configured
output directory, we end up rebuilding the tools tree for every single
one of these builds, even though in almost all cases the tools tree for
each image will be identical.

Let's address this issue by not storing the default tools tree in the
configured output directory but instead storing it in the current working
directory.

4 months agoinitrd: Move p11-kit to pksc11 profile
Daan De Meyer [Tue, 25 Mar 2025 12:54:39 +0000 (13:54 +0100)] 
initrd: Move p11-kit to pksc11 profile

This stuff is rather niche, so let's move it to a profile similar to
lvm and raid.

4 months agoMerge pull request #3613 from DaanDeMeyer/build
Daan De Meyer [Mon, 24 Mar 2025 11:15:35 +0000 (12:15 +0100)] 
Merge pull request #3613 from DaanDeMeyer/build

tools: Add "devel" profile

4 months agotools: Add "devel" profile 3613/head
Daan De Meyer [Mon, 24 Mar 2025 10:52:39 +0000 (11:52 +0100)] 
tools: Add "devel" profile

This profile contains tools required to build C/C++ projects. This is
useful to use mkosi sandbox to quickly build one off projects without
having to list a bunch of basic packages over and over again.

4 months agotools: Add 3 more packages to misc profile
Daan De Meyer [Mon, 24 Mar 2025 10:46:22 +0000 (11:46 +0100)] 
tools: Add 3 more packages to misc profile

4 months agoMerge pull request #3612 from DaanDeMeyer/fixes
Daan De Meyer [Mon, 24 Mar 2025 10:32:12 +0000 (11:32 +0100)] 
Merge pull request #3612 from DaanDeMeyer/fixes

4 months agoAlways cache the default tools tree 3612/head
Daan De Meyer [Mon, 24 Mar 2025 09:31:43 +0000 (10:31 +0100)] 
Always cache the default tools tree

For the default tools tree, the cached image and the final image
are the same for all intents and purposes, so let's stop storing both
a cached image and a final image for the default tools tree and instead
only store the final image and use it as the cached image by always
writing a cache manifest next to it.

At the same time always use the name mkosi.tools to reduce the chance
of conflicts as "tools" is an incredibly common directory name.

4 months agouser: Replace INVOKING_USER.name() with getpass.getuser()
Daan De Meyer [Sun, 23 Mar 2025 14:25:25 +0000 (15:25 +0100)] 
user: Replace INVOKING_USER.name() with getpass.getuser()

4 months agorun: Bind mount entire /home into relaxed sandbox
Daan De Meyer [Sat, 22 Mar 2025 12:07:19 +0000 (13:07 +0100)] 
run: Bind mount entire /home into relaxed sandbox

Let's simplify things and make the entirety of /home available. The
relaxed sandbox is not about security, and permissions already make sure
only the user's own home can be accessed.

4 months agouser: Make INVOKING_USER.cache_dir() return the user cache directory
Daan De Meyer [Sat, 22 Mar 2025 11:51:12 +0000 (12:51 +0100)] 
user: Make INVOKING_USER.cache_dir() return the user cache directory

4 months agouser: Replace INVOKING_USER.home() with Path.home()
Daan De Meyer [Sat, 22 Mar 2025 11:49:24 +0000 (12:49 +0100)] 
user: Replace INVOKING_USER.home() with Path.home()

4 months agoMake sync script sandbox more relaxed
Daan De Meyer [Sat, 22 Mar 2025 11:23:37 +0000 (12:23 +0100)] 
Make sync script sandbox more relaxed

Let's simplify and mount in the entirety of /home, /run and the
invoking user's environment to make stuff just work more often than
not and avoid too many implementation details of specific tools leaking
into mkosi itself.

4 months agouser: Make INVOKING_USER.runtime_dir() return the user runtime dir
Daan De Meyer [Sat, 22 Mar 2025 10:51:36 +0000 (11:51 +0100)] 
user: Make INVOKING_USER.runtime_dir() return the user runtime dir

Let's not return the mkosi specific directory, but the wider runtime
directory.

4 months agoFix grub.cfg install path on almalinux
ppira [Fri, 21 Mar 2025 14:41:58 +0000 (15:41 +0100)] 
Fix grub.cfg install path on almalinux

4 months agodocs: Mention mkosi -t none in rpm doc
Daan De Meyer [Fri, 21 Mar 2025 14:19:48 +0000 (15:19 +0100)] 
docs: Mention mkosi -t none in rpm doc

4 months agoImplement linux-noinitrd firmware
Daan De Meyer [Thu, 20 Mar 2025 13:20:50 +0000 (14:20 +0100)] 
Implement linux-noinitrd firmware

Useful for direct kernel booting without an initrd even if one was
built.

4 months agokmod: Include all kernel modules if no include patterns were specified
Daan De Meyer [Thu, 20 Mar 2025 08:49:15 +0000 (09:49 +0100)] 
kmod: Include all kernel modules if no include patterns were specified

Fixes #3603

4 months agoMerge pull request #3601 from DaanDeMeyer/fix
Zbigniew Jędrzejewski-Szmek [Wed, 19 Mar 2025 16:23:40 +0000 (17:23 +0100)] 
Merge pull request #3601 from DaanDeMeyer/fix

Various kmod fixes

4 months agokmod: Fix regex compilation in filter_firmware() 3601/head
Daan De Meyer [Wed, 19 Mar 2025 14:25:04 +0000 (15:25 +0100)] 
kmod: Fix regex compilation in filter_firmware()

4 months agokmod: Fix exclusion via glob in filter_firmware()
Daan De Meyer [Wed, 19 Mar 2025 14:24:31 +0000 (15:24 +0100)] 
kmod: Fix exclusion via glob in filter_firmware()

We have to remove firmware if it "doesn't" match, not if it matches.

4 months agokmod: Only log includes/excludes if there are any
Daan De Meyer [Wed, 19 Mar 2025 14:24:12 +0000 (15:24 +0100)] 
kmod: Only log includes/excludes if there are any

4 months agoFormatting nit
Daan De Meyer [Wed, 19 Mar 2025 14:24:04 +0000 (15:24 +0100)] 
Formatting nit

4 months agomkosi/config: show deprecated *Exlude options only if set
Zbigniew Jędrzejewski-Szmek [Wed, 19 Mar 2025 10:26:00 +0000 (11:26 +0100)] 
mkosi/config: show deprecated *Exlude options only if set

Those settings were deprecated in the docs, so only show them
in the Summary output if they are set to make them less prominent.

4 months agoinitrd: Install gzip in all initrds, not just the Arch one
Daan De Meyer [Wed, 19 Mar 2025 09:17:32 +0000 (10:17 +0100)] 
initrd: Install gzip in all initrds, not just the Arch one

Fedora also has keymaps compressed with gzip and doesn't pull in gzip
by default so let's just install gzip everywhere to make the problem
go away.

4 months agoMerge pull request #3598 from DaanDeMeyer/fix
Daan De Meyer [Tue, 18 Mar 2025 17:18:51 +0000 (18:18 +0100)] 
Merge pull request #3598 from DaanDeMeyer/fix

Fix KernelModulesExclude= settings

4 months agoHave filter_kernel_modules() return a list of module names 3598/head
Daan De Meyer [Tue, 18 Mar 2025 15:00:06 +0000 (16:00 +0100)] 
Have filter_kernel_modules() return a list of module names

The only caller of this function only needs the list of module names,
not the full paths so let's just return the list of module names.

4 months agoFix KernelModulesExclude= settings
Daan De Meyer [Tue, 18 Mar 2025 14:54:27 +0000 (15:54 +0100)] 
Fix KernelModulesExclude= settings

With eecf8b3b5c43e4832a11c8718ae43e559a755829, exclude settings have
started taking priority over include or the new glob settings whereas
they should not. Fix the logic so the globs and include patterns always
take priority over the exclude patterns.

4 months agoMerge pull request #3597 from DaanDeMeyer/bind-user
Daan De Meyer [Tue, 18 Mar 2025 13:00:55 +0000 (14:00 +0100)] 
Merge pull request #3597 from DaanDeMeyer/bind-user

4 months agoSimplify package manager code a little 3597/head
Daan De Meyer [Tue, 18 Mar 2025 12:22:07 +0000 (13:22 +0100)] 
Simplify package manager code a little

4 months agoqemu: Remove unused argument from finalize_drive()
Daan De Meyer [Tue, 18 Mar 2025 10:49:17 +0000 (11:49 +0100)] 
qemu: Remove unused argument from finalize_drive()

4 months agoDrop mkosi-as-caller
Daan De Meyer [Tue, 18 Mar 2025 09:24:59 +0000 (10:24 +0100)] 
Drop mkosi-as-caller

Let's drop this trivial helper as well to clean things up. Migration
is trivial, just drop usage of the helper.

4 months agoDrop git safe.directory="*" environment variables
Daan De Meyer [Tue, 18 Mar 2025 09:24:03 +0000 (10:24 +0100)] 
Drop git safe.directory="*" environment variables

Not required anymore now that we run builds as the user invoking mkosi.

4 months agoDrop expand_specifier()
Daan De Meyer [Tue, 18 Mar 2025 09:20:44 +0000 (10:20 +0100)] 
Drop expand_specifier()

4 months agoman: remove "=" in boolean option
Antonio Alvarez Feijoo [Tue, 18 Mar 2025 09:16:42 +0000 (10:16 +0100)] 
man: remove "=" in boolean option

4 months agoMerge pull request #3531 from keszybz/module-globs
Jörg Behrmann [Tue, 18 Mar 2025 08:55:43 +0000 (09:55 +0100)] 
Merge pull request #3531 from keszybz/module-globs

Add new option syntax with globs

4 months agomkosi-initrd: protect existing initrd image against errors
Antonio Alvarez Feijoo [Sat, 15 Mar 2025 06:21:44 +0000 (07:21 +0100)] 
mkosi-initrd: protect existing initrd image against errors

When `copy_tree()` ends up calling `cp`, if it fails because there is not enough
space, it leaves an incomplete initrd image in the output directory. If we are
writing the initrd image directly where a bootloader entry has an initrd
configured, the system will fail to boot. So, instead of copying the initrd
image directly to the output, copy it next to it in the same output directory,
and if the copy is successful, replace it.

4 months agoMake user provided command line take preference over roothash=
Daan De Meyer [Fri, 14 Mar 2025 16:51:57 +0000 (17:51 +0100)] 
Make user provided command line take preference over roothash=

If the user provides their own root= or mount.usr= configuration,
let's always have that take preference over the partition roothash=
or usrhash=

This is preparation for adding support for root=dissect in which case
we don't need roothash= or usrhash= on the kernel command line.

4 months agoReplace conf tag with ini in markdown
Septatrix [Sat, 15 Mar 2025 14:12:40 +0000 (15:12 +0100)] 
Replace conf tag with ini in markdown

No markdown renderer has any clue which highlighting to use for conf files
whereas INI is well defined and results in proper highlighting.

5 months agomkosi/kmod: add typing info to make mypy happy 3531/head
Zbigniew Jędrzejewski-Szmek [Fri, 14 Mar 2025 10:31:43 +0000 (11:31 +0100)] 
mkosi/kmod: add typing info to make mypy happy

5 months agoci/codespell: add ignore-words-list
Zbigniew Jędrzejewski-Szmek [Fri, 14 Mar 2025 09:58:26 +0000 (10:58 +0100)] 
ci/codespell: add ignore-words-list

5 months agoman: soft-deprecate Firmware{Include,Exclude}
Zbigniew Jędrzejewski-Szmek [Sat, 1 Mar 2025 16:37:31 +0000 (17:37 +0100)] 
man: soft-deprecate Firmware{Include,Exclude}

5 months agoRework firmware-list settings to use globs instead of regexps
Zbigniew Jędrzejewski-Szmek [Sat, 1 Mar 2025 16:13:37 +0000 (17:13 +0100)] 
Rework firmware-list settings to use globs instead of regexps

This mirrors the change to module-list options. The two FirmwareInclude/FirmwareExclude
options are replaced by one FirmwareFiles option that takes positive and negative
globs. (Firmware name is already taken.)

5 months agoman: soft-deprecate KernelModules{Initrd,}{Include,Exclude}
Zbigniew Jędrzejewski-Szmek [Thu, 27 Feb 2025 19:50:33 +0000 (20:50 +0100)] 
man: soft-deprecate KernelModules{Initrd,}{Include,Exclude}

The docs are updated to describe Kernel{Initrd,}Modules. The old settings
continue to work.

5 months agoSwitch over to the new glob syntax
Zbigniew Jędrzejewski-Szmek [Mon, 17 Feb 2025 17:30:23 +0000 (18:30 +0100)] 
Switch over to the new glob syntax

This creates the following difference:
-usr/lib/modules/6.14.0-0.rc1.15.fc42.x86_64/kernel/drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/ch_ipsec.ko.xz
-usr/lib/modules/6.14.0-0.rc1.15.fc42.x86_64/kernel/drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/ch_ktls.ko.xz

In the previous syntax, we included those modules accidentally because
'inline_crypto/' matches 'crypto/'.

5 months agoRework module-list settings to use globs instead of regexps
Zbigniew Jędrzejewski-Szmek [Mon, 17 Feb 2025 17:29:06 +0000 (18:29 +0100)] 
Rework module-list settings to use globs instead of regexps

"If you have a problem, and use a regexp, now you have two problems."
I don't think this quip applies in all cases, but the existing interface with
regexps was problematic for a few reasons:

- users usually want to match at a word boundary, but regexps apply anywhere in
  the string, so to actually match correctly, the regexp has to be carefully
  constructed with word boundary assertions.
  Even our own config for initrds included some modules by mistake,
  e.g. drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/ch_ipsec.ko.xz
  was matched by crypto/.

- once the regexps include the word boundary assertions, they became quite
  complex and hard to read.

- because of the separate evaluation of include and exlude patterns, we
  need to have exclude patterns in the include patterns. The example given
  in the review:
    ^drivers/net/(?!wireless/)
  But this means that we can do exclusions in two places, making the whole
  scheme very complex.

- the default to include all modules by default goes against the general
  design of mkosi, where only things that are explicitly configured are
  put in the image. That default is only useful when trying to build a
  "maximal" image that matches the current machine. In most uses, the
  default of including only requested modules makes more sense (initrd,
  addons, any not-host-only images).

A new setting that takes glob patterns is added. There is only one setting
instead of a pair, exclusion patterns are prefixed by '-'. The last matching
glob wins. The details of how those globs are interpreted is crafted to
match our particular use cases.

For a single glob, the rules are:
- 'foo' matches the basename, /some/path/foo.ko
- 'bar/foo' matches the last component of the path, bar/foo.ko
- '/full/path/bar' only matches /full/path/bar.ko.
- crypto/* or crypto/ match all modules any crypto/ directory.
- /crypto/* matches the modules in the top-level directory.

This might seem complicated at first glance, but apart from the special
handling of the suffix, those rules mostly match how 'ls' would handle
a local path argument.

Suffixes are not specified in the globs. '-' and '_' are treated as equivalent,
except when part of special glob syntax with […].

New settings are added:
KernelModules=GLOB
KernelInitrdModules=GLOB

(KernelModulesInitrd=BOOL already exists and specifies whether to create a
separate initrd.)

I think the new syntax is more pleasant to read and write. Backward
compatibility is maintained by keeping the old options in place. The change to
exclude all modules by default is a breaking change, but in most uses both
options were used in combination anyway, so I think this should be fine.

The example given in the review:
  KernelModulesInclude=
    ^drivers/net/(?!wireless/)
becomes
  KernelModules=
    /drivers/net/
    -/drivers/net/wireless/

5 months agomkosi,addon: print the mkosi cmdline with --debug
Zbigniew Jędrzejewski-Szmek [Fri, 28 Feb 2025 11:50:23 +0000 (12:50 +0100)] 
mkosi,addon: print the mkosi cmdline with --debug

This is very important, without that it's hard to figure out what is actually
hapenning.

5 months agoUse Path more in initrd.py and addon.py
Daan De Meyer [Thu, 13 Mar 2025 20:05:42 +0000 (21:05 +0100)] 
Use Path more in initrd.py and addon.py

5 months agofedora: Change default release to rawhide
Daan De Meyer [Thu, 13 Mar 2025 14:35:49 +0000 (15:35 +0100)] 
fedora: Change default release to rawhide

Fedora releases new versions quite regularly, sometimes more regularly
than we do mkosi releases. This means that users on the latest official
mkosi release can end up building EOL fedora releases because the default
release will be the latest fedora release at the time of the mkosi release
which might be EOL already. Let's switch to rawhide as the default release
so users are guaranteed to get something recent regardless of how old their
mkosi version is.

This matches what we already do for debian, opensuse, arch and other distros.

5 months agoMerge pull request #3543 from keszybz/initrd-version-short-option
Jörg Behrmann [Thu, 13 Mar 2025 14:18:30 +0000 (15:18 +0100)] 
Merge pull request #3543 from keszybz/initrd-version-short-option

Add short option for initrd kernel version

5 months agoinitrd: add -k as shorthand for --kernel-version 3543/head
Zbigniew Jędrzejewski-Szmek [Mon, 17 Feb 2025 09:16:08 +0000 (10:16 +0100)] 
initrd: add -k as shorthand for --kernel-version

--kernel-version is the option that I use the most often. Having a short
option would be nice.

'-v' would another option for the option, but I think it could be confused
with --version.

5 months agoinitrd: split out argument parser creation to helper function
Zbigniew Jędrzejewski-Szmek [Sun, 16 Feb 2025 20:39:19 +0000 (21:39 +0100)] 
initrd: split out argument parser creation to helper function

5 months agomkosi/dependencies: make invocations shorter
Zbigniew Jędrzejewski-Szmek [Fri, 24 Jan 2025 15:42:44 +0000 (16:42 +0100)] 
mkosi/dependencies: make invocations shorter

Both styles were used by the existing code: ['--foo=bar'] and ['--foo', 'bar'].
Switch to the former exclusively. A single arg like '--foo=bar' is easier to
read and/or select&paste in the log output. Also, we avoid explicit str()
wrappers in a bunch of places.

5 months agoMerge pull request #3588 from behrmann/sandboxfix
Daan De Meyer [Wed, 12 Mar 2025 08:03:31 +0000 (09:03 +0100)] 
Merge pull request #3588 from behrmann/sandboxfix

Check for CAP_SYS_ADMIN instead of root

5 months agoTry to find volatile overlay upperdir directory that's not on overlayfs 3588/head
Daan De Meyer [Tue, 11 Mar 2025 20:12:11 +0000 (21:12 +0100)] 
Try to find volatile overlay upperdir directory that's not on overlayfs

Making a directory on overlayfs the upperdir of another overlayfs is
rejected by the kernel. Let's try to find a directory that's not on
overlayfs. The /dev/shm fallback is because on a default podman container
even /tmp is on overlayfs.

5 months agotree: Make security.selinux detection more robust
Daan De Meyer [Tue, 11 Mar 2025 20:13:57 +0000 (21:13 +0100)] 
tree: Make security.selinux detection more robust

5 months agoCheck for CAP_SYS_ADMIN instead of root
Daan De Meyer [Tue, 11 Mar 2025 13:31:13 +0000 (14:31 +0100)] 
Check for CAP_SYS_ADMIN instead of root

Even if we're running as root, we might not have CAP_SYS_ADMIN, so
let's always check for CAP_SYS_ADMIN.

5 months agoAdd option to persist runtime drives
Septatrix [Sat, 8 Mar 2025 13:21:34 +0000 (14:21 +0100)] 
Add option to persist runtime drives

5 months agoMerge pull request #3585 from DaanDeMeyer/doc
Daan De Meyer [Fri, 7 Mar 2025 10:44:43 +0000 (11:44 +0100)] 
Merge pull request #3585 from DaanDeMeyer/doc

5 months agoRework --run-build-scripts 3585/head
Daan De Meyer [Thu, 6 Mar 2025 22:47:33 +0000 (23:47 +0100)] 
Rework --run-build-scripts

Instead of (optionally) building the image when this option is enabled,
let's insist that the image has already been built and cached. This allows
us to reuse the history of the previous build if History= is enabled. At
the same time, rename the option to --rerun-build-scripts to indicate more
clearly that the image needs to have been built once already.

This allows the option to be used in systemd's mkosi.clangd script to replace
"-t none" and "--incremental=strict" there.

5 months agoDon't run configure scripts if we're reusing the history
Daan De Meyer [Thu, 6 Mar 2025 21:55:32 +0000 (22:55 +0100)] 
Don't run configure scripts if we're reusing the history

5 months agoDrop unnecessary condition
Daan De Meyer [Thu, 6 Mar 2025 21:45:31 +0000 (22:45 +0100)] 
Drop unnecessary condition

A few lines earlier, we already short-circuit run_verb() if the verb
does not need a build, so no need to check here again.

5 months agoUse target path as mount tags
Septatrix [Wed, 5 Mar 2025 20:34:09 +0000 (21:34 +0100)] 
Use target path as mount tags

This prevents collisions when mounting something
to directories of the same name or root.

5 months agoRevert 9f4d174daac954aaa9e18ee9bb58c6d7a946ec9d
Daan De Meyer [Thu, 6 Mar 2025 11:18:59 +0000 (12:18 +0100)] 
Revert 9f4d174daac954aaa9e18ee9bb58c6d7a946ec9d

The declarative package pulls in perl which is not ideal, let's
switch back to the previous approach.

5 months agoMerge pull request #3582 from DaanDeMeyer/downgrade
Daan De Meyer [Thu, 6 Mar 2025 10:48:42 +0000 (11:48 +0100)] 
Merge pull request #3582 from DaanDeMeyer/downgrade

5 months agoMove package installation and removal to PackageManager interface 3582/head
Daan De Meyer [Wed, 5 Mar 2025 19:32:58 +0000 (20:32 +0100)] 
Move package installation and removal to PackageManager interface

There's no need for these to be implemented by the Distribution
interface as they don't need distribution specific knowledge so let's
move them to the PackageManager interface instead.

5 months agoapt: Add higher priority for mkosi local repository
Daan De Meyer [Wed, 5 Mar 2025 19:11:58 +0000 (20:11 +0100)] 
apt: Add higher priority for mkosi local repository

Apt actually supports priorities as well, so add a high priority like
we do for the other package managers as well for the local mkosi repository.

5 months agodebian: Install policy-rcd-declarative by default
Daan De Meyer [Wed, 5 Mar 2025 18:59:26 +0000 (19:59 +0100)] 
debian: Install policy-rcd-declarative by default

Debian switched to systemd ages ago, but as we know legacy stuff
tends to linger in Debian for quite a while. Let's standardize on
using systemd presets to enable daemons by installing packages for
a deny-all policy for sysv-init style packages instead of messing
with the script ourselves.

5 months agoSort packages during parsing
Daan De Meyer [Wed, 5 Mar 2025 14:15:07 +0000 (15:15 +0100)] 
Sort packages during parsing

5 months agoFix grammar
Nils K [Tue, 4 Mar 2025 13:50:11 +0000 (14:50 +0100)] 
Fix grammar

Follow up for aa4c8339484363df032ac72d4a739f4bbc16e183

5 months agoMerge pull request #3580 from DaanDeMeyer/rocky
Daan De Meyer [Tue, 4 Mar 2025 10:58:00 +0000 (11:58 +0100)] 
Merge pull request #3580 from DaanDeMeyer/rocky

5 months agocentos: Handle major/minor releases in derivatives properly 3580/head
Daan De Meyer [Tue, 4 Mar 2025 08:21:25 +0000 (09:21 +0100)] 
centos: Handle major/minor releases in derivatives properly

While centos doesn't have major/minor releases, rocky, alma and rhel
do, so let's make sure we handle those cases properly.

Additionally, we also fix EPEL to use the proper major/minor release
when we're doing EPEL 10, as since EPEL 10 there's major/minor releases
for EPEL as well.

5 months agoinitrd: Pass process environment to mkosi as well
Daan De Meyer [Tue, 4 Mar 2025 09:43:28 +0000 (10:43 +0100)] 
initrd: Pass process environment to mkosi as well

5 months agoImprove error message slightly
Daan De Meyer [Tue, 4 Mar 2025 08:01:33 +0000 (09:01 +0100)] 
Improve error message slightly

5 months agoAdd "raid" initrd profile
Antonio Alvarez Feijoo [Tue, 4 Mar 2025 07:37:25 +0000 (08:37 +0100)] 
Add "raid" initrd profile

This initrd profile provides support for assembling RAID arrays.

5 months agoParse both mkosi.local.conf and mkosi.local/
Septatrix [Sun, 2 Mar 2025 20:53:09 +0000 (21:53 +0100)] 
Parse both mkosi.local.conf and mkosi.local/

This aligns more with what the users expects
and allows working around some limitations of the config system
(esp. regarding the interplay of `Include=` and `Profiles=`).

5 months agoAdd --pretty=no to suppress output from systemd-repart when updating
MoltenArmor [Mon, 3 Mar 2025 09:34:08 +0000 (17:34 +0800)] 
Add --pretty=no to suppress output from systemd-repart when updating

5 months agoDon't mount input read-only if it's the same as output in sign_efi_binary()
Daan De Meyer [Sun, 2 Mar 2025 20:57:57 +0000 (21:57 +0100)] 
Don't mount input read-only if it's the same as output in sign_efi_binary()

Otherwise the output file cannot be written.

Replaces #3573

5 months agoFix Drives= documentation
Nils K [Mon, 3 Mar 2025 00:27:46 +0000 (01:27 +0100)] 
Fix Drives= documentation

Follow up for 7ff9a890c1947b4111010e81e0e64e06a0e8d800

5 months agoRevert "Bypass tmpfiles, sysusers and presets as well when running package ma…"
Luca Boccassi [Sun, 2 Mar 2025 10:58:20 +0000 (10:58 +0000)] 
Revert "Bypass tmpfiles, sysusers and presets as well when running package ma…"

This reverts commit 824d63e0d30e56ee34a193f624230c1ae5af0d58.

5 months agobuild(deps): bump redhat-plumbers-in-action/differential-shellcheck
dependabot[bot] [Sat, 1 Mar 2025 22:43:38 +0000 (22:43 +0000)] 
build(deps): bump redhat-plumbers-in-action/differential-shellcheck

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

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

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

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.8 to 3.28.10.
- [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/dd746615b3b9d728a6a37ca2045b68ca76d4841a...b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d)

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

Signed-off-by: dependabot[bot] <support@github.com>
5 months agoBypass tmpfiles, sysusers and presets as well when running package managers
Daan De Meyer [Sat, 1 Mar 2025 15:27:38 +0000 (16:27 +0100)] 
Bypass tmpfiles, sysusers and presets as well when running package managers

We invoke all of these ourselves so there's no need to run them
while invoking package managers.

5 months agoRename "storage" initrd profile to "lvm"
Antonio Alvarez Feijoo [Fri, 28 Feb 2025 21:30:06 +0000 (22:30 +0100)] 
Rename "storage" initrd profile to "lvm"

Since it actually only provides support for LVM, it's best to keep the different
specific functionalities separate.

5 months agoMerge pull request #3561 from aafeijoo-suse/initrd-profiles
Daan De Meyer [Fri, 28 Feb 2025 14:50:35 +0000 (15:50 +0100)] 
Merge pull request #3561 from aafeijoo-suse/initrd-profiles

5 months agomkosi-initrd: add --profile option 3561/head
Antonio Alvarez Feijoo [Fri, 28 Feb 2025 12:16:51 +0000 (13:16 +0100)] 
mkosi-initrd: add --profile option

Enable only the initrd profiles specified with this option, rather than all by
default. This saves space and allows the user to choose only what is needed on
each system.