]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
6 months agocentos: Enable EPEL for c10s tools tree as well 3368/head
Daan De Meyer [Thu, 16 Jan 2025 13:53:16 +0000 (14:53 +0100)] 
centos: Enable EPEL for c10s tools tree as well

Now that EPEL exists for c10s, let's enable it for the c10s tools
tree as EPEL has distribution-gpg-keys which is crucial to be able
to use c10s as a tools tree.

6 months agoLook for the CentOS Stream official GPG in /etc/pki/rpm-gpg as well
Daan De Meyer [Thu, 16 Jan 2025 14:31:10 +0000 (15:31 +0100)] 
Look for the CentOS Stream official GPG in /etc/pki/rpm-gpg as well

Turns out the key names in /etc/pki/rpm-gpg are slightly different
so let's update the logic to search properly for both.

6 months agoOnly use a fallback in find_rpm_gpgkey() if one is defined
Daan De Meyer [Thu, 16 Jan 2025 14:30:54 +0000 (15:30 +0100)] 
Only use a fallback in find_rpm_gpgkey() if one is defined

6 months agoImprove find_rpm_gpgkey() declaration formatting
Daan De Meyer [Thu, 16 Jan 2025 14:30:37 +0000 (15:30 +0100)] 
Improve find_rpm_gpgkey() declaration formatting

6 months agoFix type of second overload of find_rpm_gpgkey()
Daan De Meyer [Thu, 16 Jan 2025 14:29:44 +0000 (15:29 +0100)] 
Fix type of second overload of find_rpm_gpgkey()

The return type is optional when we get any boolean that's not a
literal True, so widen the type to bool to fix that.

6 months agoaction: Stop populating pacman keyring
Daan De Meyer [Thu, 16 Jan 2025 09:30:19 +0000 (10:30 +0100)] 
action: Stop populating pacman keyring

Not required anymore now that mkosi does this itself.

6 months agoMerge pull request #3366 from DaanDeMeyer/keyring
Daan De Meyer [Thu, 16 Jan 2025 09:28:07 +0000 (10:28 +0100)] 
Merge pull request #3366 from DaanDeMeyer/keyring

Add a keyring cache and use it for Arch Linux

6 months agoAdd a keyring cache and use it for Arch Linux 3366/head
Daan De Meyer [Wed, 15 Jan 2025 22:07:07 +0000 (23:07 +0100)] 
Add a keyring cache and use it for Arch Linux

Currently, the Arch keyring from the host or tools tree is always
used directly without any option to modify it (except by modifying
it directly on the host or in the tools tree). We also don't support
RepositoryKeyFetch= for the Arch Linux keyring and it's one of the
sources of annoying mounts outside of /usr which complicates
"mkosi sandbox".

Let's improve the situation by switching to our own pacman keyring
instead of using the one from the tools tree or host. Instead, we'll
only use /usr/share/pacman/keyrings from the host or tools tree to
populate the keyring we maintain ourselves. Users can extend the
keyring created by mkosi with their own keys via sandbox trees. If
RepositoryKeyFetch= is enabled, we'll download the archlinux-keyring
package and extract the keyring from there into the sandbox.

The keyring cache is maintained together with the repository metadata
cache. The only difference is that sync_repository_metadata() will
update the global package cache whereas the keyring directory is always
maintained per cache directory instead of globally.

We take the opportunity to stop using Michel's kernel-utils ppa with a
more recent archlinux-keyring package in favor of enabling
RepositoryKeyFetch= by default for Arch builds on Ubuntu.

6 months agosandbox: Use dict to store bind mounts instead of set
Daan De Meyer [Wed, 15 Jan 2025 21:59:59 +0000 (22:59 +0100)] 
sandbox: Use dict to store bind mounts instead of set

dict guarantee iteration in insertion order, set does not which matters
in this specific case.

6 months agoIntroduce support for overriding system's DeviceTree
Bjorn Andersson [Thu, 29 Feb 2024 15:00:13 +0000 (16:00 +0100)] 
Introduce support for overriding system's DeviceTree

While experimenting with OS images on development boards where either
the bootloader doesn't load a Flattened DeviceTree Blob, or if one wants
to replace the one provided by the bootloader with a specific/new one
for development/experimentation/testing purposes, it's convenient to use
the OS-loaders ability to load a specific DeviceTree blob.

Add a new option to mkosi, to cause a specified DeviceTree blob to be
baked into the UKI, or copied into /boot and added to the systemd loader
entry.

As different distributions store the dtb files in different locations
the requested file is searched for in the locations spotted in Debian,
Fedora, Arch Linux packages (both from distro and kernel build system -
as these differs as well).

Resolves #2439
Based on initial effort by Manuel Traut.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
6 months agoAdd support for machined registration using varlink
Daan De Meyer [Wed, 15 Jan 2025 13:49:05 +0000 (14:49 +0100)] 
Add support for machined registration using varlink

6 months agoAdd missing parentheses to make sure we don't throw away scope for virtiofsd
Daan De Meyer [Wed, 15 Jan 2025 13:26:23 +0000 (14:26 +0100)] 
Add missing parentheses to make sure we don't throw away scope for virtiofsd

7 months agoMerge pull request #3363 from DaanDeMeyer/sandbox
Jörg Behrmann [Wed, 15 Jan 2025 18:32:46 +0000 (19:32 +0100)] 
Merge pull request #3363 from DaanDeMeyer/sandbox

sandbox: Make terminal background color cyan if on tty

7 months agosandbox: Don't allow nested mkosi sandbox invocations 3363/head
Daan De Meyer [Wed, 15 Jan 2025 11:06:53 +0000 (12:06 +0100)] 
sandbox: Don't allow nested mkosi sandbox invocations

Until a good usecase pops up it's probably best to disallow this since
when it happens it's most likely a user error rather than intended.

7 months agosandbox: Drop tools tree in run_verb() instead of when parsing config
Daan De Meyer [Wed, 15 Jan 2025 11:14:01 +0000 (12:14 +0100)] 
sandbox: Drop tools tree in run_verb() instead of when parsing config

Another change to make mkosi sandbox in and outside the sandbox identical.

7 months agosandbox: Make terminal background color cyan if on tty
Daan De Meyer [Wed, 15 Jan 2025 11:01:09 +0000 (12:01 +0100)] 
sandbox: Make terminal background color cyan if on tty

Let's make the sandbox more recognizable by turning the terminal
background cyan if on a tty.

7 months agoUse MKOSI_HOST_DISTRIBUTION in config_default_tools_tree_distribution()
Daan De Meyer [Wed, 15 Jan 2025 08:48:21 +0000 (09:48 +0100)] 
Use MKOSI_HOST_DISTRIBUTION in config_default_tools_tree_distribution()

It doesn't really matter since we won't use the tools tree in the
sandbox anyway but this reduces the diff between mkosi summary outside
and inside the sandbox.

7 months agocentos: Bump default release to 10
Daan De Meyer [Wed, 15 Jan 2025 08:49:31 +0000 (09:49 +0100)] 
centos: Bump default release to 10

7 months agoMake sure we use the same host distribution/release in sandbox
Daan De Meyer [Tue, 14 Jan 2025 14:32:20 +0000 (15:32 +0100)] 
Make sure we use the same host distribution/release in sandbox

If the distribution is not explicitly specified in the config file
and the host distribution does not match the tools tree distribution,
then currently mkosi -f sandbox mkosi -f and mkosi -f will build images
for different distributions.

Let's make sure these commands use the same default distribution by
communicating the host distribution and release to the sandbox via
environment variables and using them to determine the default values to
use if available.

7 months agoOnly add keylayouts to grub image on x86
Daan De Meyer [Tue, 14 Jan 2025 12:22:00 +0000 (13:22 +0100)] 
Only add keylayouts to grub image on x86

7 months agoUpdate NEWS
Daan De Meyer [Tue, 14 Jan 2025 11:57:54 +0000 (12:57 +0100)] 
Update NEWS

7 months agoMake grub EFI logic architecture independent
Daan De Meyer [Tue, 14 Jan 2025 09:18:48 +0000 (10:18 +0100)] 
Make grub EFI logic architecture independent

Fixes #3352

7 months agosandbox: Slight optimization
Daan De Meyer [Tue, 14 Jan 2025 11:22:02 +0000 (12:22 +0100)] 
sandbox: Slight optimization

7 months agoBind mount /dev/fuse in sandbox
Martin Hundebøll [Tue, 14 Jan 2025 07:09:22 +0000 (08:09 +0100)] 
Bind mount /dev/fuse in sandbox

/dev/fuse is needed to support building container images from within the
mkosi.build scripts. Make it avaiable in the sandbox just like /dev/null
and its friends.

Since not all mkosi builds runs in host contexts where /dev/fuse is
actually available, update the logic to skip the /dev/fuse node if it is
not present.

7 months agoOnly use extra search paths when running in sandbox
Daan De Meyer [Mon, 13 Jan 2025 11:10:29 +0000 (12:10 +0100)] 
Only use extra search paths when running in sandbox

Since ExtraSearchPaths= might be built within the sandbox, we have
to make sure that we're in the sandbox when potentially executing
binaries from ExtraSearchPaths=. This was almost always the case,
except when setup= was used when constructing the sandbox, as the
command in setup= is executed outside of the sandbox.

To fix this we also had the option to remove the setup= argument
from sandbox_cmd() and execute the command from setup= within the
sandbox as well, but this would mean the synchronization mechanism
we added in https://github.com/systemd/mkosi/pull/3298 to make sure
we don't register vms with machined before the scope is started would
stop working, so for now we keep setup= and instead make sure we don't
use paths from ExtraSearchPaths= when executing the commands in setup=.

Implementation wise, we get rid of modifying mkosi's own $PATH to append
the extra search paths, and instead construct the proper $PATH in
sandbox_cmd().

Because we get rid of prepend_to_environ_path(), we also get rid of
the logic to construct a separate directory for any files listed in
ExtraSearchPaths=, but this logic turned out to be undocumented and
broken because the separate directory we add to $PATH wasn't mounted
into the sandbox so since this logic was always broken and nobody ever
complained we opt to remove it here to keep the implementation simple.

7 months agoapt: avoid ?exact-name for systemd packages
Luca Boccassi [Sat, 11 Jan 2025 01:48:47 +0000 (01:48 +0000)] 
apt: avoid ?exact-name for systemd packages

There is a strange interaction between ?exact-name, apt repositories
generated by OBS and multiple architectures, that breaks installing
packages:

$ apt install --dry-run '?exact-name(systemd-cryptsetup)'
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!

systemd-cryptsetup is already the newest version (257.999+731+g8c5b35957-0).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

Unsatisfied dependencies:
 systemd-cryptsetup : Conflicts: systemd-cryptsetup:i386 but 257.999+731+g8c5b35957-0 is to be installed
                      Conflicts: systemd-cryptsetup:arm64 but 257.999+731+g8c5b35957-0 is to be installed
 systemd-cryptsetup:i386 : Conflicts: systemd-cryptsetup but 257.999+731+g8c5b35957-0 is to be installed
                           Conflicts: systemd-cryptsetup:arm64 but 257.999+731+g8c5b35957-0 is to be installed
 systemd-cryptsetup:arm64 : Depends: libc6:arm64 (>= 2.38) but it is not installable
                            Depends: libcryptsetup12:arm64 (>= 2:2.7) but it is not installable
                            Depends: libssl3t64:arm64 (>= 3.0.0) but it is not installable
                            Depends: libsystemd-shared:arm64 (= 257.999+731+g8c5b35957-0) but it is not going to be installed
                            Conflicts: systemd-cryptsetup but 257.999+731+g8c5b35957-0 is to be installed
                            Conflicts: systemd-cryptsetup:i386 but 257.999+731+g8c5b35957-0 is to be installed
Error: Unable to correct problems, you have held broken packages.

It seems ?exact-name selects _all_ available packages, unless an architecture
is specified:

$ apt install --dry-run '?exact-name(systemd-cryptsetup:amd64)'
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!

Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0

But this only happens with the repository metadata format generated
on OBS. There are multiple formats, apparently.

https://download.opensuse.org/repositories/home:/bluca:/systemd/Debian_Testing/

So either we set the specific architecture in the common mkosi.conf,
or we need a separate mkosi.conf with a trigger to filter out releases
where the packages are not available.
I chose the latter as it the filters are fixed, while adding by architecture
means every time a new arch is added, it needs to be duplicated.

This is only necessary for packages that are hosted on OBS, ie: the
systemd ones.

7 months agoci: Don't run on push to main
Daan De Meyer [Mon, 13 Jan 2025 14:44:54 +0000 (15:44 +0100)] 
ci: Don't run on push to main

We're not exactly swimming in capacity, and this hasn't ever caught
anything, so let's stop running CI on pushes to main.

7 months agoMerge pull request #3344 from DaanDeMeyer/focal
Daan De Meyer [Mon, 13 Jan 2025 14:04:20 +0000 (15:04 +0100)] 
Merge pull request #3344 from DaanDeMeyer/focal

Drop support for Focal

7 months agoDrop support for Focal 3344/head
Daan De Meyer [Sat, 11 Jan 2025 10:00:26 +0000 (11:00 +0100)] 
Drop support for Focal

It's going EOL in April, so I think it's fine if we drop support for
it.

7 months agotests: Install lsof instead of dnsmasq
Daan De Meyer [Mon, 13 Jan 2025 10:25:08 +0000 (11:25 +0100)] 
tests: Install lsof instead of dnsmasq

lsof is available in Ubuntu's main repository, dnsmasq isn't.

7 months agoOnly mount /usr/share/factory if mount point exists in tools tree
Daan De Meyer [Sun, 12 Jan 2025 11:33:30 +0000 (12:33 +0100)] 
Only mount /usr/share/factory if mount point exists in tools tree

Otherwise the bind mount fails as the mount point cannot be created
since we mount /usr from the tools tree read-only.

7 months agoFix passing repositories and sandbox trees to default initrd/tools
Daan De Meyer [Sun, 12 Jan 2025 11:29:57 +0000 (12:29 +0100)] 
Fix passing repositories and sandbox trees to default initrd/tools

Currently if none are specified we end up passing the empty string
which overrides any repositories or sandbox trees specified in the
default initrd/tools configs themselves.

7 months agoBump Arch initrd size
Daan De Meyer [Mon, 13 Jan 2025 10:16:00 +0000 (11:16 +0100)] 
Bump Arch initrd size

7 months agoci: Disable Azure
Daan De Meyer [Mon, 13 Jan 2025 10:27:04 +0000 (11:27 +0100)] 
ci: Disable Azure

They're so flaky that I don't even look at them anymore, so let's
disable them until they do a new systemd stable release which
includes the required vsock fix.

7 months agoSpecify --install-source=image when installing systemd-boot
Daan De Meyer [Mon, 13 Jan 2025 09:28:14 +0000 (10:28 +0100)] 
Specify --install-source=image when installing systemd-boot

Let's make sure we don't try to pick up EFI binaries from the host.

7 months agoAdd perf to tools tree
Daan De Meyer [Fri, 10 Jan 2025 12:48:59 +0000 (13:48 +0100)] 
Add perf to tools tree

We don't add it to Ubuntu as perf is very tightly coupled to the
kernel package there which makes installing it a royal pain.

7 months agomkosi-initrd: Add two more CPU modules
Daan De Meyer [Fri, 10 Jan 2025 12:33:41 +0000 (13:33 +0100)] 
mkosi-initrd: Add two more CPU modules

7 months agodoc: add missing continue if pandoc is not available
Jörg Behrmann [Thu, 9 Jan 2025 21:59:58 +0000 (22:59 +0100)] 
doc: add missing continue if pandoc is not available

Without the continue, the run on the next line will call die if pandoc is not
available, thus breaking the fallback for subsequent formats.

7 months agoApply new ruff 0.9 formatting
Daan De Meyer [Thu, 9 Jan 2025 15:26:49 +0000 (16:26 +0100)] 
Apply new ruff 0.9 formatting

7 months agoMerge pull request #3323 from septatrix/initrd-dnf-choice
Daan De Meyer [Thu, 9 Jan 2025 08:19:15 +0000 (09:19 +0100)] 
Merge pull request #3323 from septatrix/initrd-dnf-choice

Remove preference for dnf4 in mkosi-initrd

7 months agoUse hosts preferred dnf version in mkosi-initrd 3323/head
Septatrix [Wed, 8 Jan 2025 21:20:14 +0000 (22:20 +0100)] 
Use hosts preferred dnf version in mkosi-initrd

7 months agoaction: Show CPU and memory
Daan De Meyer [Wed, 8 Jan 2025 15:43:20 +0000 (16:43 +0100)] 
action: Show CPU and memory

7 months agoMake dnf version checks consistent
Septatrix [Wed, 8 Jan 2025 21:19:05 +0000 (22:19 +0100)] 
Make dnf version checks consistent

As the executable method returns the name an equality check is enough

7 months agoMerge pull request #3333 from behrmann/manfixes
Daan De Meyer [Wed, 8 Jan 2025 15:46:29 +0000 (16:46 +0100)] 
Merge pull request #3333 from behrmann/manfixes

Various man page fixes

7 months agoman: Reformulate triggering match sections a bit 3333/head
Jörg Behrmann [Tue, 7 Jan 2025 14:57:43 +0000 (15:57 +0100)] 
man: Reformulate triggering match sections a bit

7 months agoman: Implement various stye fixes
Jörg Behrmann [Tue, 7 Jan 2025 14:54:18 +0000 (15:54 +0100)] 
man: Implement various stye fixes

- Highlight command-names in text in bold instead of code style
- Consistent highlighting of command names
- Consistent hyphenation
- Removal of superfluous periods
- Addition of missing periods and colons
- Consistent capitalisation of RPM when not a command

Fixes: #3330
7 months agomkosi-initrd: Remove /var/cache and /var/log from the initrd
Daan De Meyer [Tue, 7 Jan 2025 09:29:38 +0000 (10:29 +0100)] 
mkosi-initrd: Remove /var/cache and /var/log from the initrd

Fixes #3331

7 months agoMerge pull request #3329 from DaanDeMeyer/fixes
Jörg Behrmann [Mon, 6 Jan 2025 14:44:40 +0000 (15:44 +0100)] 
Merge pull request #3329 from DaanDeMeyer/fixes

Fixes

7 months agoapt: drop usr-is-merged from essential list
Luca Boccassi [Mon, 6 Jan 2025 01:05:55 +0000 (01:05 +0000)] 
apt: drop usr-is-merged from essential list

It is no longer required, base-files now does the work, drop it

7 months agomkosi-vm: Drop duplicate systemd-boot 3329/head
Daan De Meyer [Mon, 6 Jan 2025 13:44:09 +0000 (14:44 +0100)] 
mkosi-vm: Drop duplicate systemd-boot

7 months agoDrop which from mkosi-vm
Daan De Meyer [Mon, 6 Jan 2025 13:43:26 +0000 (14:43 +0100)] 
Drop which from mkosi-vm

Not available in Jammy.

7 months agoFix section
Daan De Meyer [Mon, 6 Jan 2025 13:41:45 +0000 (14:41 +0100)] 
Fix section

7 months agoMerge pull request #3312 from hundeboll/modules-and-firmware-includes
Daan De Meyer [Mon, 6 Jan 2025 10:53:54 +0000 (11:53 +0100)] 
Merge pull request #3312 from hundeboll/modules-and-firmware-includes

Modules and firmware includes

7 months agoInclude linked firmware files 3312/head
Martin Hundebøll [Fri, 3 Jan 2025 11:00:31 +0000 (12:00 +0100)] 
Include linked firmware files

Some modules reference a firmware file that is just a link to a "real"
file. Make sure those files are also included when needed by resolving
those referenced symlinks and including their target files in the set of
required firmware files.

7 months agoBe less explicit about module matching sub directories
Martin Hundebøll [Fri, 3 Jan 2025 11:05:08 +0000 (12:05 +0100)] 
Be less explicit about module matching sub directories

The kernel module include/exclude logic matches against paths below any
folder in /usr/lib/modules/$(uname -r)/*/, and not just the `kernel`
folder. Replace the explicitly mentioned `kernel` folder from the
example path with an asterisk to make it clear the folders like `extra`
and `updates` are searched too.

7 months agoImplement pretty_name() for custom distribution
Daan De Meyer [Sun, 5 Jan 2025 19:30:43 +0000 (20:30 +0100)] 
Implement pretty_name() for custom distribution

7 months agoCopy /etc/hosts into sandbox as well if it exists
Daan De Meyer [Sat, 4 Jan 2025 13:37:54 +0000 (14:37 +0100)] 
Copy /etc/hosts into sandbox as well if it exists

7 months agoMerge pull request #3321 from DaanDeMeyer/resolve
Jörg Behrmann [Sat, 4 Jan 2025 10:40:24 +0000 (11:40 +0100)] 
Merge pull request #3321 from DaanDeMeyer/resolve

Beef up DNS resolution a little

7 months agoBeef up DNS resolution a little 3321/head
Daan De Meyer [Fri, 3 Jan 2025 23:22:55 +0000 (00:22 +0100)] 
Beef up DNS resolution a little

Let's write a basic nsswitch.conf that makes use of libnss-resolve
and bind mount the systemd-resolved socket into the sandbox if
available.

7 months agoAdd missing sandbox for rmtree()
Daan De Meyer [Fri, 3 Jan 2025 23:44:59 +0000 (00:44 +0100)] 
Add missing sandbox for rmtree()

7 months agoBump debian initrd size
Daan De Meyer [Fri, 3 Jan 2025 22:02:42 +0000 (23:02 +0100)] 
Bump debian initrd size

Fixes CI failure

7 months agoAdd --console=interactive|read-only support for qemu vmm
Daan De Meyer [Fri, 3 Jan 2025 20:56:01 +0000 (21:56 +0100)] 
Add --console=interactive|read-only support for qemu vmm

7 months agoDon't try to remove cache entries of custom distro default initrd
Daan De Meyer [Fri, 3 Jan 2025 20:10:25 +0000 (21:10 +0100)] 
Don't try to remove cache entries of custom distro default initrd

7 months agoKeep more entries from $PATH in the sandbox
Daan De Meyer [Fri, 3 Jan 2025 19:59:09 +0000 (20:59 +0100)] 
Keep more entries from $PATH in the sandbox

In the relaxed sandbox, we want to run executables frome everywhere
that isn't /usr. We make the implicit assumption that anything from
outside /usr doesn't depend (heavily) on what's in /usr and if it does
and a tools tree is used it should match the host sufficiently.

7 months agoUpdate comment
Daan De Meyer [Fri, 3 Jan 2025 19:32:22 +0000 (20:32 +0100)] 
Update comment

7 months agoMerge pull request #3314 from DaanDeMeyer/centos
Daan De Meyer [Fri, 3 Jan 2025 18:30:51 +0000 (19:30 +0100)] 
Merge pull request #3314 from DaanDeMeyer/centos

Centos tools tree fixes

7 months agoInstall btrfs-progs in CentOS Stream EPEL tools tree 3314/head
Daan De Meyer [Fri, 3 Jan 2025 13:39:28 +0000 (14:39 +0100)] 
Install btrfs-progs in CentOS Stream EPEL tools tree

7 months agoman: fix remaining mention of mkosi.pkgmngr
Jörg Behrmann [Fri, 3 Jan 2025 18:04:45 +0000 (19:04 +0100)] 
man: fix remaining mention of mkosi.pkgmngr

7 months agoMake CentOS Stream 10 + EPEL tools tree work
Daan De Meyer [Fri, 3 Jan 2025 13:37:30 +0000 (14:37 +0100)] 
Make CentOS Stream 10 + EPEL tools tree work

Let's not try to install packages not available in EPEL 10.

7 months agoTools fixes
Daan De Meyer [Fri, 3 Jan 2025 13:36:18 +0000 (14:36 +0100)] 
Tools fixes

7 months agoMerge pull request #3311 from DaanDeMeyer/cdrom
Daan De Meyer [Fri, 3 Jan 2025 07:54:27 +0000 (08:54 +0100)] 
Merge pull request #3311 from DaanDeMeyer/cdrom

Make CDROM an upper case option

7 months agoRename vsock config settings 3311/head
Daan De Meyer [Thu, 2 Jan 2025 13:21:41 +0000 (14:21 +0100)] 
Rename vsock config settings

Let's use the same names used by systemd.

7 months agoMake CDROM an upper case option
Daan De Meyer [Thu, 2 Jan 2025 11:39:05 +0000 (12:39 +0100)] 
Make CDROM an upper case option

It's an abbrevation so let's make it upper case similar to TPM and
KVM.

7 months agobuild(deps): bump github/codeql-action from 3.27.5 to 3.28.0
dependabot[bot] [Wed, 1 Jan 2025 22:20:18 +0000 (22:20 +0000)] 
build(deps): bump github/codeql-action from 3.27.5 to 3.28.0

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.5 to 3.28.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/f09c1c0a94de965c15400f5634aa42fac8fb8f88...48ab28a6f5dbc2a99bf1e0131198dd8f1df78169)

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

Signed-off-by: dependabot[bot] <support@github.com>
7 months agoParse profiles in subimages as well
Daan De Meyer [Mon, 30 Dec 2024 16:10:53 +0000 (17:10 +0100)] 
Parse profiles in subimages as well

Let's parse from mkosi.profiles in subimages as well. We'll still insist
that the profiles used are set in the main image though. To make this work
we have to remove the check to see if a profile exists or not, since it might
not exist in every mkosi.profiles/ directory that we parse. At the same time
we remove the restriction that profiles are set before we parse mkosi.conf.d/
since this isn't really useful anymore now that we parse profiles last and not
first anymore. This allows us to get rid of the concept of immutable settings.

Fixes #3307

7 months agoRename various [Runtime] options and rename mkosi qemu to mkosi vm
Daan De Meyer [Fri, 27 Dec 2024 11:07:56 +0000 (12:07 +0100)] 
Rename various [Runtime] options and rename mkosi qemu to mkosi vm

- Let's get rid of the "Qemu" prefix for runtime options as they apply
  both to the qemu and vmspawn verbs.
- Let's rename QemuGui= to Console= and make it take all the options
  that are accepted by vmspawn's --console= option.
- Let's rename the various runtime options to the corresponding vmspawn
  option where applicable.
- Let's rename mkosi qemu to mkosi vm as well while we're at it.

7 months agoAdd option to control whether to register with machined
Luca Boccassi [Thu, 26 Dec 2024 15:05:45 +0000 (15:05 +0000)] 
Add option to control whether to register with machined

On an ephemeral test runner it is useless churn to register the
guest, and can trigger nasty bugs like the one where machined
kills the user session. Add a config knob, enabled by default,
so that it can be disabled where it's not useful.

This also allows running nspawn where machined is not available,
as currently it just fails since the default is that it tries to
register and fails if it can't.

7 months agoDrop support for pesign secure boot signtool
Daan De Meyer [Mon, 23 Dec 2024 09:19:56 +0000 (10:19 +0100)] 
Drop support for pesign secure boot signtool

sbsigntools is packaged in EPEL now and in the future we're looking
to standardize solely on systemd-sbsign so let's already drop support
for pesign which was only really useful on CentOS Stream because it
didn't have sbsigntools which it does have now.

7 months agoAlways check tools for build at the same place
Daan De Meyer [Sun, 22 Dec 2024 23:02:00 +0000 (00:02 +0100)] 
Always check tools for build at the same place

Let's only check non-build verb tools early and check build verb
tools at the same place regardless of whether the verb is build or
not to keep things more consistent.

As a side effect this allows building tools from source to do the
build in sync scripts which is done in
https://github.com/davide125/arcadeos/blob/main/mkosi.sync.

7 months agoMerge pull request #3298 from DaanDeMeyer/exec
Daan De Meyer [Sun, 22 Dec 2024 22:51:04 +0000 (23:51 +0100)] 
Merge pull request #3298 from DaanDeMeyer/exec

Wait until sandbox exec()'s specified command before continuing

7 months agoburn: Fail if no arguments are provided
Daan De Meyer [Fri, 20 Dec 2024 14:12:06 +0000 (15:12 +0100)] 
burn: Fail if no arguments are provided

If no arguments are provided systemd-repart will operate on the
device backing the rootfs which in the case of burn we definitely
don't want to do most of the time so let's fail unless a device is
explicitly provided.

7 months agoWait until sandbox exec()'s specified command before continuing 3298/head
Daan De Meyer [Sun, 22 Dec 2024 11:47:06 +0000 (12:47 +0100)] 
Wait until sandbox exec()'s specified command before continuing

Let's wait in spawn() until all setup logic has completed before
continuing if a sandbox is used. When using spawn() without run(),
this helps us fail early if the setup logic fails instead of later
on if we're not checking the result of the spawn() command immediately
afterwards.

As a side effect, this also acts as a synchronization point when using
systemd-run --scope where when spawn() returns, we can be 100% sure that
the scope has been created, which is important when calling RegisterMachine
from systemd-machined which does the wrong thing if the scope for the specified
machine does not yet exist and ends up killing the parent unit (often the user
session) instead of just the virtual machine.

7 months agoMove adding "--" to spawn()
Daan De Meyer [Sun, 22 Dec 2024 20:03:40 +0000 (21:03 +0100)] 
Move adding "--" to spawn()

7 months agoMove preexec() out of spawn()
Daan De Meyer [Sun, 22 Dec 2024 20:21:46 +0000 (21:21 +0100)] 
Move preexec() out of spawn()

Let's make use of functools.partial() to apply the arguments so we
can pass the function to subprocess.Popen().

7 months agoMerge pull request #3296 from DaanDeMeyer/kmod
Jörg Behrmann [Sun, 22 Dec 2024 13:44:37 +0000 (14:44 +0100)] 
Merge pull request #3296 from DaanDeMeyer/kmod

mkosi-initrd: Two fixes

7 months agomkosi-initrd: Match both intel_vsec.ko and intel-vsec.ko 3296/head
Daan De Meyer [Sat, 21 Dec 2024 20:20:05 +0000 (21:20 +0100)] 
mkosi-initrd: Match both intel_vsec.ko and intel-vsec.ko

It seems that in 6.13 it went from intel_vsec.ko to intel-vsec.ko.

7 months agomkosi-initrd: Add virtio_dma_buf kernel module
Daan De Meyer [Sat, 21 Dec 2024 20:19:51 +0000 (21:19 +0100)] 
mkosi-initrd: Add virtio_dma_buf kernel module

7 months agoDon't spawn a shell in sandbox if no command is provided
Daan De Meyer [Fri, 20 Dec 2024 14:10:31 +0000 (15:10 +0100)] 
Don't spawn a shell in sandbox if no command is provided

We need https://github.com/systemd/systemd/issues/35000 to make this
not confusing. Currently there's zero feedback that a user is in a sandbox
shell.

7 months agoPass -cpu host when using KVM
Daan De Meyer [Fri, 20 Dec 2024 12:32:35 +0000 (13:32 +0100)] 
Pass -cpu host when using KVM

Turns out it is not the default, so pass it explicitly when using
KVM.

7 months agoMerge pull request #3291 from DaanDeMeyer/sandbox
Daan De Meyer [Fri, 20 Dec 2024 12:32:11 +0000 (13:32 +0100)] 
Merge pull request #3291 from DaanDeMeyer/sandbox

sandbox: Make sure we use pacman keyring and crypto policies from tools tree

7 months agoRun ssh and ssh-keygen as fake root 3291/head
Daan De Meyer [Fri, 20 Dec 2024 11:35:06 +0000 (12:35 +0100)] 
Run ssh and ssh-keygen as fake root

We can't always resolve the current user in the sandbox which ssh
insists on being able to do so let's become root which is always
resolvable.

7 months agoUse sandbox in finalize_credentials()
Daan De Meyer [Fri, 20 Dec 2024 11:17:47 +0000 (12:17 +0100)] 
Use sandbox in finalize_credentials()

7 months agosandbox: Make sure we use pacman keyring and crypto policies from tools tree
Daan De Meyer [Fri, 20 Dec 2024 10:39:37 +0000 (11:39 +0100)] 
sandbox: Make sure we use pacman keyring and crypto policies from tools tree

If ToolsTreeCertificates=yes, we still need to make sure we use the
crypto policies and pacman keyring from the tools tree if one is used.

7 months agoDon't use ExtraSearchPaths= when building default tools tree
Daan De Meyer [Fri, 20 Dec 2024 10:20:54 +0000 (11:20 +0100)] 
Don't use ExtraSearchPaths= when building default tools tree

Since eba43f034c5c19a478249ba50fc1b97faffda75c, we always run binaries
from ExtraSearchPaths= within the tools tree if one is used. This generally
implies the binaries have to be built against the tools tree to be able to
run within it. This means that the binaries won't necessarily work when
executed on the host, which is the case when building the default tools tree.

To avoid failures when building the default tools tree and using ExtraSearchPaths=,
don't use binaries from ExtraSearchPaths= when building the default tools tree.

7 months agoLower log level of messages about cache entries not existing
Daan De Meyer [Fri, 20 Dec 2024 10:02:59 +0000 (11:02 +0100)] 
Lower log level of messages about cache entries not existing

7 months agoUse "tools" as the cache key for the default tools tree
Daan De Meyer [Fri, 20 Dec 2024 08:56:48 +0000 (09:56 +0100)] 
Use "tools" as the cache key for the default tools tree

Currently we still use "distribution~release~architecture", which
breaks checking if the cache is out of date, since we'll always check
against the cache of the currently configured tools tree distribution,
even if we used a different tools tree distribution to build the tools
tree. Let's fix this by using the same cache key for all default tools
trees.

This shouldn't introduce any performance regression as users are not
expected to change the default tools tree distribution all the time
unlike the target image distribution.

7 months agoRun binaries from ExtraSearchPaths= within tools tree
Daan De Meyer [Thu, 19 Dec 2024 11:35:47 +0000 (12:35 +0100)] 
Run binaries from ExtraSearchPaths= within tools tree

Until now, there was always the implicit assumption that any paths
configured with ExtraSearchPaths= contained binaries built against
the host's /usr. With that assumption, it made sense to execute binaries
found in these paths outside of the tools tree as otherwise you might
end up with missing or out of date libraries if these are not available
within the tools tree.

However, with the introduction of "mkosi sandbox", what I want to do
in systemd is to have contributors build systemd within the sandbox and
then use those binaries in mkosi to build the image. This means that the
build directory configured with ExtrasSearchPaths= suddenly contains
binaries built against the tools tree's /usr (if one is configured) instead
of the host's /usr.

Given this new use case, let's get rid of the logic to not use the tools
tree for binaries in ExtraSearchPaths=, instead, users of ExtraSearchPaths=
using a tools tree will have to make sure to use a tools tree that mostly
matches their host's /usr.

7 months agoMake --debug-workspace work even if mkosi doesn't fail
Daan De Meyer [Thu, 19 Dec 2024 15:30:18 +0000 (16:30 +0100)] 
Make --debug-workspace work even if mkosi doesn't fail

Fixes #3283

7 months agoDrop PEAddons=
Daan De Meyer [Wed, 18 Dec 2024 13:00:49 +0000 (14:00 +0100)] 
Drop PEAddons=

Putting these inside the image isn't very useful except for the very
specific use case of being able to skip copying the addon when copying
the ESP to another disk to implement a "live" installer mode. For all
other use cases, PE addons are either supposed to be generated locally
or optionally downloaded alongside the image. For these use cases it
makes much more sense to output the addons alongside the image, but not
in it.

But if it makes more sense to output the addons alongside the image, then
it becomes unclear whether this is something that should be implemented inside
mkosi in the first place. Until we figure whether this makes sense and how
to implement it, let's remove the functionality.

Addons can still be added to the image or generated alongside it by running
ukify in a postinst script. The secure boot signing options will have to be
passed manually but this isn't an unsolvable problem.

7 months agoMerge pull request #3285 from DaanDeMeyer/settings
Jörg Behrmann [Thu, 19 Dec 2024 11:48:06 +0000 (12:48 +0100)] 
Merge pull request #3285 from DaanDeMeyer/settings

Move more settings from [Host] to [Build]