]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
14 months agoGive local repositories a higher priority 2450/head
Daan De Meyer [Sat, 2 Mar 2024 18:39:44 +0000 (19:39 +0100)] 
Give local repositories a higher priority

14 months agoImplement Repositories= for zypper
Daan De Meyer [Sat, 2 Mar 2024 17:21:29 +0000 (18:21 +0100)] 
Implement Repositories= for zypper

14 months agodnf: Enable versionlock plugin by default
Daan De Meyer [Wed, 5 Jun 2024 07:29:50 +0000 (09:29 +0200)] 
dnf: Enable versionlock plugin by default

Let's allow users to make use of the versionlock plugin by enabling
it by default. To make sure it doesn't fail, we write a noop
configuration that makes the plugin do nothing at all which users
can then override using PackageManagerTrees=.

14 months agoMerge pull request #2733 from NekkoDroid/bootloader-entry-format
Daan De Meyer [Tue, 4 Jun 2024 13:40:38 +0000 (15:40 +0200)] 
Merge pull request #2733 from NekkoDroid/bootloader-entry-format

Add `UnifiedKernelImageFormat=` (attempt 2)

14 months agoAdd `UnifiedKernelImageFormat=` with specifiers 2733/head
Michael Ferrari [Tue, 4 Jun 2024 11:26:00 +0000 (13:26 +0200)] 
Add `UnifiedKernelImageFormat=` with specifiers

This can be used to control the name to use for the UKI during image
generation. Special `&` specifiers can be used to include kernel
specific information in the filename.

This is useful for the `systemd-sysupdate` case, as you can set this to
`%i_%v` to use a format that can be parse by its configuration. The
current format used includes both a roothash as well as the kernel
version which both can't be matched by sysupdate.

14 months agoUnify roothash handling for the UKI name
Michael Ferrari [Thu, 30 May 2024 14:26:25 +0000 (16:26 +0200)] 
Unify roothash handling for the UKI name

14 months agoAdd `UnifiedKernelImages=` to summary
Michael Ferrari [Tue, 4 Jun 2024 11:04:52 +0000 (13:04 +0200)] 
Add `UnifiedKernelImages=` to summary

14 months agoci: Switch to Ubuntu Noble
Daan De Meyer [Sun, 2 Jun 2024 16:09:55 +0000 (18:09 +0200)] 
ci: Switch to Ubuntu Noble

14 months agoSet --pretty=no in run_shell() when calling repart
Daan De Meyer [Sun, 2 Jun 2024 15:56:15 +0000 (17:56 +0200)] 
Set --pretty=no in run_shell() when calling repart

We do the same in apply_runtime_size() as it makes repart output a
lot less noisy.

14 months agoHave coredumpctl and journalctl operate on forwarded journal if available
Daan De Meyer [Sun, 2 Jun 2024 09:37:16 +0000 (11:37 +0200)] 
Have coredumpctl and journalctl operate on forwarded journal if available

If ForwardJournal= is configured, have coredumpctl and journalctl operate
on it instead of on the image itself. While this doesn't handle the edge
case where the journal is forwarded but the coredumps are stored in the image,
let's assume that users that enable ForwardJournal= will also configure coredumps
to be stored in the journal.

14 months agobuild(deps): bump redhat-plumbers-in-action/differential-shellcheck
dependabot[bot] [Sat, 1 Jun 2024 22:44:27 +0000 (22:44 +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.1.1 to 5.3.0.
- [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/c15070885a82a2c93db8a765d332c38c50dde8b3...60c9f2b924a9c5a2ddbb25e7b23e8e11b56faab9)

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

Signed-off-by: dependabot[bot] <support@github.com>
14 months agobuild(deps): bump actions/checkout from 4.1.4 to 4.1.6
dependabot[bot] [Sat, 1 Jun 2024 22:44:30 +0000 (22:44 +0000)] 
build(deps): bump actions/checkout from 4.1.4 to 4.1.6

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.6.
- [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/0ad4b8fadaa221de15dcec353f45205ec38ea70b...a5ac7e51b41094c92402da3b24376905380afc29)

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

Signed-off-by: dependabot[bot] <support@github.com>
14 months agofedora: do not install dnf-3
Zbigniew Jędrzejewski-Szmek [Fri, 31 May 2024 12:09:21 +0000 (14:09 +0200)] 
fedora: do not install dnf-3

We get both dnf5 and dnf, which doesn't seem necessary.
Also, in F41 dnf is Provided by dnf5, so that'd install dnf5 anyway.

14 months agodnf: drop metadata_expire=never in metadata syncs
Zbigniew Jędrzejewski-Szmek [Fri, 31 May 2024 12:02:09 +0000 (14:02 +0200)] 
dnf: drop metadata_expire=never in metadata syncs

With this option on, builds that have an existing cache directory will
generally fail. Fedora doesn't keep old packages on mirrors, and metadata
refers to specific package versions, so stale metadata will cause dnf to fail.

This fixes mkosi test image builds in systemd for me.

14 months agofedora: use F40
Zbigniew Jędrzejewski-Szmek [Fri, 31 May 2024 11:48:48 +0000 (13:48 +0200)] 
fedora: use F40

14 months agoMerge pull request #2730 from DaanDeMeyer/fix
Daan De Meyer [Wed, 29 May 2024 12:10:08 +0000 (14:10 +0200)] 
Merge pull request #2730 from DaanDeMeyer/fix

Fix invoked_as_root initialization

14 months agoRelax permissions on systemd-journal-remote configuration 2730/head
Daan De Meyer [Wed, 29 May 2024 12:03:08 +0000 (14:03 +0200)] 
Relax permissions on systemd-journal-remote configuration

Let's make sure the systemd-journal-remote process we start can always
read the configuration, even if it's running as a less privileged user.

14 months agoFix invoked_as_root initialization
Daan De Meyer [Wed, 29 May 2024 11:17:25 +0000 (13:17 +0200)] 
Fix invoked_as_root initialization

14 months agoDrop unnecessary escaping
Daan De Meyer [Wed, 29 May 2024 09:26:53 +0000 (11:26 +0200)] 
Drop unnecessary escaping

14 months agoRemove support for CentOS Stream 8
Daan De Meyer [Tue, 28 May 2024 19:14:56 +0000 (21:14 +0200)] 
Remove support for CentOS Stream 8

Going EOL next week so let's drop support

14 months agoMerge pull request #2728 from DaanDeMeyer/fix
Daan De Meyer [Wed, 29 May 2024 09:17:46 +0000 (11:17 +0200)] 
Merge pull request #2728 from DaanDeMeyer/fix

Run systemd-journal-remote as correct user if scope is not available

14 months agoRun systemd-journal-remote as correct user if scope is not available 2728/head
Daan De Meyer [Wed, 29 May 2024 08:21:10 +0000 (10:21 +0200)] 
Run systemd-journal-remote as correct user if scope is not available

14 months agoAllow '+' in systemd-stub version
Daan De Meyer [Wed, 29 May 2024 08:20:22 +0000 (10:20 +0200)] 
Allow '+' in systemd-stub version

The suse version has a '+' in it.

14 months agoMerge pull request #2711 from behrmann/docimprov
Jörg Behrmann [Tue, 28 May 2024 16:08:18 +0000 (18:08 +0200)] 
Merge pull request #2711 from behrmann/docimprov

Doc improvements

14 months agodoc: add a paragraph before the matcher table 2711/head
Jörg Behrmann [Tue, 28 May 2024 15:55:00 +0000 (17:55 +0200)] 
doc: add a paragraph before the matcher table

The table directly follows the definitions, which makes it difficult to tell
apart from the previous definition.

14 months agonspawn Environment variable passing fixes
Daan De Meyer [Tue, 28 May 2024 15:01:11 +0000 (17:01 +0200)] 
nspawn Environment variable passing fixes

- Translate '-' to '_'
- Ignore names with dot in them
- Pass lowercase as environment variable as well if it has a '=' in it

14 months agodoc: add missing language specification to code blocks
Jörg Behrmann [Tue, 28 May 2024 15:22:29 +0000 (17:22 +0200)] 
doc: add missing language specification to code blocks

14 months agodoc: change X in tables to checkmark
Jörg Behrmann [Tue, 28 May 2024 15:08:01 +0000 (17:08 +0200)] 
doc: change X in tables to checkmark

We already have two different X in there, X and x, which are hard to tell
apart, and since we want to say something positive, let's make it a checkmark.

14 months agodoc: change conf to ini for source blocks
Jörg Behrmann [Wed, 22 May 2024 13:40:21 +0000 (15:40 +0200)] 
doc: change conf to ini for source blocks

14 months agodoc: remove "mkosi." prefix from environment variable table
Jörg Behrmann [Wed, 15 May 2024 07:36:01 +0000 (09:36 +0200)] 
doc: remove "mkosi." prefix from environment variable table

pandoc has a weird algorithm to define the width of tables in markdown. The
width cannot be specified absolutely, but is made relative to the text width by
how many dashes are in the horizontal line under the header in each
column. This can lead to spurious word breaks even on wide displays where the
whole table would fit. Removing the prefix should somewhat ameliorate the
problem until a better solution is found.

14 months agodoc: center checkbox tables
Jörg Behrmann [Wed, 15 May 2024 07:35:33 +0000 (09:35 +0200)] 
doc: center checkbox tables

14 months agodoc: make standalone example bold
Jörg Behrmann [Wed, 15 May 2024 07:33:19 +0000 (09:33 +0200)] 
doc: make standalone example bold

14 months agodoc: fix rendering of definition lists
Jörg Behrmann [Wed, 15 May 2024 07:28:49 +0000 (09:28 +0200)] 
doc: fix rendering of definition lists

The way we formatted definitions

term
: paragraph1

: paragraph2

gets clobbered into single text blocks by pandoc. The thing it can actually
parse is

term
:   paragraph1

    paragraph2

This (mostly) whitespace-only change unclobbers the text.

14 months agoMerge pull request #2724 from DaanDeMeyer/fix
Daan De Meyer [Tue, 28 May 2024 13:53:21 +0000 (15:53 +0200)] 
Merge pull request #2724 from DaanDeMeyer/fix

Various fixes

14 months agoPass arguments that look like env variables as env to systemd-nspawn 2724/head
Daan De Meyer [Tue, 28 May 2024 13:21:55 +0000 (15:21 +0200)] 
Pass arguments that look like env variables as env to systemd-nspawn

The kernel passes unknown parameters as environment variables to pid1.
Let's do the same for systemd-nspawn. Of course we don't know what is
known and unknown so let's take advantage of the fact that kernel cmdline
arguments are (usually) lower case and environment variables are (usually)
upper case and use that to determine whether to pass something as an argument
or an environment variable.

14 months agoOnly call become_root() if we need a full uid map
Daan De Meyer [Tue, 28 May 2024 12:51:32 +0000 (14:51 +0200)] 
Only call become_root() if we need a full uid map

If we only need to map the current user to root, bubblewrap will do
that for us and we don't need to call become_root() after forking.

14 months agoFix scope_env()
Daan De Meyer [Tue, 28 May 2024 12:37:59 +0000 (14:37 +0200)] 
Fix scope_env()

DBUS_SYSTEM_ADDRESS isn't always set so make sure to check for the
canonical location of the system bus socket as well.

14 months agoFix typo
Daan De Meyer [Tue, 28 May 2024 12:37:52 +0000 (14:37 +0200)] 
Fix typo

14 months agosandbox: check if bwrap is installed
Zbigniew Jędrzejewski-Szmek [Wed, 22 May 2024 12:24:12 +0000 (14:24 +0200)] 
sandbox: check if bwrap is installed

bwrap is used for many many different things, so I just added a blanket
check that requires is to be always required if use any of the verbs that
call check_tools().

Fixes https://github.com/systemd/mkosi/issues/2719.

14 months agoadd dashes to temporary directories for readability
Jörg Behrmann [Wed, 22 May 2024 13:45:52 +0000 (15:45 +0200)] 
add dashes to temporary directories for readability

14 months agoClamp mtimes instead of always resetting them
Zbigniew Jędrzejewski-Szmek [Wed, 22 May 2024 13:16:14 +0000 (15:16 +0200)] 
Clamp mtimes instead of always resetting them

Closes https://github.com/systemd/mkosi/issues/2635.

14 months agomkosi-initrd: Don't remove sanitizer libraries from initrd
Daan De Meyer [Fri, 17 May 2024 11:32:54 +0000 (13:32 +0200)] 
mkosi-initrd: Don't remove sanitizer libraries from initrd

Let's not unconditionally remove sanitizer libraries and their
dependencies from the initrd as it turns out running software with
sanitizers in the initrd isn't that far fetched.

15 months agoMake Environment= match without value check if given key is in env
Daan De Meyer [Thu, 16 May 2024 14:53:36 +0000 (16:53 +0200)] 
Make Environment= match without value check if given key is in env

15 months agoPass WITH_NETWORK to build and finalize scripts
Jörg Behrmann [Thu, 16 May 2024 12:55:58 +0000 (14:55 +0200)] 
Pass WITH_NETWORK to build and finalize scripts

15 months agoAdd -I shorthand for --include
Daan De Meyer [Wed, 15 May 2024 19:14:07 +0000 (21:14 +0200)] 
Add -I shorthand for --include

15 months agoPrefer `config.image` over `config.image_id`
Michael Ferrari [Wed, 15 May 2024 08:02:18 +0000 (10:02 +0200)] 
Prefer `config.image` over `config.image_id`

When using `mkosi.images` it makes more sense to use the `image` name,
as that is what identifies the different images.

15 months agoAlways refresh repository metadata if CacheOnly=never
Daan De Meyer [Wed, 15 May 2024 05:39:21 +0000 (07:39 +0200)] 
Always refresh repository metadata if CacheOnly=never

Fixes #2707

15 months agoDon't die when images already exist
Jörg Behrmann [Tue, 14 May 2024 13:20:35 +0000 (15:20 +0200)] 
Don't die when images already exist

We already check whether outputs exist when looping over all image configs and
skip the build if the output exists. This way one can just "mkosi build" after
adding a new image and the missing ones will be built.

15 months agoMerge pull request #2708 from DaanDeMeyer/workspace
Jörg Behrmann [Tue, 14 May 2024 11:21:56 +0000 (13:21 +0200)] 
Merge pull request #2708 from DaanDeMeyer/workspace

Two workspace fixes

15 months agoSet BuildSources= for default initrd and default tools tree. 2708/head
Daan De Meyer [Tue, 14 May 2024 10:37:49 +0000 (12:37 +0200)] 
Set BuildSources= for default initrd and default tools tree.

This allows these to be built from any working directory, including
'/'.

Fixes #2705.

15 months agoDrop check for workspace directory relative to cwd
Daan De Meyer [Tue, 14 May 2024 10:36:38 +0000 (12:36 +0200)] 
Drop check for workspace directory relative to cwd

The current working directory check is only relevant if the current
working directory is used as a build source, which means it's also
handled by the second check so let's drop it.

15 months agoqemu: Use different ID for scsi PCI device
Daan De Meyer [Mon, 13 May 2024 11:41:01 +0000 (13:41 +0200)] 
qemu: Use different ID for scsi PCI device

Let's make sure we don't conflict with stuff added by users.

15 months agoAdd optional file ID for qemu drives
Daan De Meyer [Sun, 12 May 2024 14:01:06 +0000 (16:01 +0200)] 
Add optional file ID for qemu drives

For testing multipath in systemd's integration tests, we need multiple
qemu drives backed by the same file. Let's allow specifying an additional
file ID to make this possible with QemuDrive=.

15 months agoSet $QEMU_ARCHITECTURE for configure scripts
Daan De Meyer [Sun, 12 May 2024 09:54:18 +0000 (11:54 +0200)] 
Set $QEMU_ARCHITECTURE for configure scripts

Allows trivial access to the qemu binary that mkosi will use to run
qemu.

15 months agoMerge pull request #2699 from DaanDeMeyer/depmod
Daan De Meyer [Fri, 10 May 2024 12:12:30 +0000 (14:12 +0200)] 
Merge pull request #2699 from DaanDeMeyer/depmod

Chroot for depmod and modinfo

15 months agoci: Drop arch tools + centos image exclude
Daan De Meyer [Fri, 10 May 2024 11:21:22 +0000 (13:21 +0200)] 
ci: Drop arch tools + centos image exclude

Arch got a new version of rpm so let's see if the SIGPIPE bug has
been fixed.

15 months agoChroot for depmod and modinfo 2699/head
Daan De Meyer [Fri, 10 May 2024 10:55:23 +0000 (12:55 +0200)] 
Chroot for depmod and modinfo

modinfo cannot always work with output from newer or different depmod.

Specifically, this fixes the case where modinfo sch_fq_codel fails with
"module not found" on CentOS Stream 9 images built from Fedora 40. When
depmod from Fedora 40 is used, modinfo in the image fails with "module
not found". When depmod from inside the image is used, modinfo succeeds
as expected.

We'd rather not do this but in this case there's no other option.

15 months agoAdd extra argument to SandboxProtocol
Daan De Meyer [Fri, 10 May 2024 10:55:03 +0000 (12:55 +0200)] 
Add extra argument to SandboxProtocol

15 months agoMake /work related stuff of chroot_cmd() optional
Daan De Meyer [Fri, 10 May 2024 10:54:29 +0000 (12:54 +0200)] 
Make /work related stuff of chroot_cmd() optional

15 months agoMerge pull request #2698 from DaanDeMeyer/configure
Daan De Meyer [Fri, 10 May 2024 10:36:40 +0000 (12:36 +0200)] 
Merge pull request #2698 from DaanDeMeyer/configure

Only run configure scripts for verbs that need a build

15 months agoOnly run configure scripts for verbs that need a build 2698/head
Daan De Meyer [Fri, 10 May 2024 09:27:50 +0000 (11:27 +0200)] 
Only run configure scripts for verbs that need a build

In systemd, we want to use configure scripts to determine whether
qemu was built with support for specific devices and skip running
a test if it wasn't, or otherwise add the device to the qemu arguments.

To make this work, we need to run the configure scripts with the
default tools tree available if one is configured.

Let's change the behavior of configure scripts to only run for verbs
that need a build and run them after building the default tools tree
so that they can be run with the tools tree mounted.

15 months agoSurround --force with quotes
Daan De Meyer [Fri, 10 May 2024 10:04:36 +0000 (12:04 +0200)] 
Surround --force with quotes

15 months agoFix typo
Daan De Meyer [Fri, 10 May 2024 10:03:58 +0000 (12:03 +0200)] 
Fix typo

15 months agoopensuse: Install dnf5 in OpenSUSE tools tree
Daan De Meyer [Thu, 9 May 2024 09:14:13 +0000 (11:14 +0200)] 
opensuse: Install dnf5 in OpenSUSE tools tree

15 months agoOnly use a single default tools tree per build
Daan De Meyer [Wed, 8 May 2024 12:41:06 +0000 (14:41 +0200)] 
Only use a single default tools tree per build

Currently, if multiple images are defined, each with a default tools
tree, if they use the same distribution, all the various ToolsTreeXXX=
settings for the later images will be ignored since we'll only build
one tools tree.

Also, if any of the images set Incremental=no, we will remove the default
tools tree outputs even if Incremental=yes is enabled for other images.

To keep ourselves sane, let's avoid dealing with multiple defaults tools
trees and only look at the last image to figure out whether we should
build a default tools tree and what to put in it.

15 months agoapt: Allow release info change
Renjaya Raga Zenta [Wed, 8 May 2024 02:45:04 +0000 (09:45 +0700)] 
apt: Allow release info change

Allow the update command to continue downloading data from a repository which changed its information of the release contained in the repository indicating e.g a new major release. APT will fail at the update command for such repositories until the change is confirmed to ensure the user is prepared for the change.

15 months agoDrop workaround
Daan De Meyer [Tue, 7 May 2024 18:46:47 +0000 (20:46 +0200)] 
Drop workaround

15 months agoCheck if modules.builtin exists before reading it
Daan De Meyer [Tue, 7 May 2024 17:16:17 +0000 (19:16 +0200)] 
Check if modules.builtin exists before reading it

15 months agodoc: move [Match] and [Config] section further down
Jörg Behrmann [Tue, 7 May 2024 15:24:52 +0000 (17:24 +0200)] 
doc: move [Match] and [Config] section further down

Both topics are more advanced and since the entries in the [Match] section have
the same names as the the things they match, they are the first hit when
searching the document.

15 months agoTighten rpm glob
Daan De Meyer [Tue, 7 May 2024 08:28:37 +0000 (10:28 +0200)] 
Tighten rpm glob

rpm's are compressed on the inside, not on the outside, so "*.rpm"
is sufficient and we don't need the trailing '*'.

15 months agoBe more conservative in what we copy from package directories
Daan De Meyer [Mon, 6 May 2024 15:11:21 +0000 (17:11 +0200)] 
Be more conservative in what we copy from package directories

Let's make sure we only copy packages from package directories so
that PackageDirectories= can be pointed at a directory containing
more than just packages without copying everything.

15 months agoAllow booting ESP images in vmspawn
Daan De Meyer [Mon, 6 May 2024 15:17:25 +0000 (17:17 +0200)] 
Allow booting ESP images in vmspawn

15 months agoMerge pull request #2685 from DaanDeMeyer/selinux
Jörg Behrmann [Mon, 6 May 2024 14:53:15 +0000 (16:53 +0200)] 
Merge pull request #2685 from DaanDeMeyer/selinux

Pass --selinux-relabel to default initrd configuration

15 months agoPass --selinux-relabel to default initrd configuration 2685/head
Daan De Meyer [Mon, 6 May 2024 13:59:50 +0000 (15:59 +0200)] 
Pass --selinux-relabel to default initrd configuration

15 months agoAllow "enabled" and "disabled" for features
Daan De Meyer [Mon, 6 May 2024 14:12:04 +0000 (16:12 +0200)] 
Allow "enabled" and "disabled" for features

15 months agoDon't use scopes for virtiofs when using older unshare
Daan De Meyer [Mon, 6 May 2024 07:05:40 +0000 (09:05 +0200)] 
Don't use scopes for virtiofs when using older unshare

unshare 2.37 is still shipped in Ubuntu Jammy and CentOS Stream 9
which doesn't have --map-users= and --map-groups=. In this case, let's
not use scopes for virtiofsd to make sure that booting using virtiofsd
still works.

Also add a missing preexec_fn to become root if we're not using a scope.

To make this work we have to move all the logic to decide whether we use
a scope or not outside of run() as we need to conditionalize other arguments
we provide to run() based on whether we use a scope or not.

15 months agoRevert "Use become_root_cmd() in copy_ephemeral()"
Daan De Meyer [Sun, 5 May 2024 21:44:03 +0000 (23:44 +0200)] 
Revert "Use become_root_cmd() in copy_ephemeral()"

This reverts commit 0e3b85fec7c5bbabf0430fab088a3f2e8615afb4.

--map-users= and --map-groups= were added in util-linux 2.38 but
Ubuntu 22.04 and CentOS Stream 9 only ships util-linux 2.37 so
let's at least make sure --ephemeral keeps working on those
distributions.

15 months agoFix optional enum deserialization
Daan De Meyer [Sun, 5 May 2024 21:17:20 +0000 (23:17 +0200)] 
Fix optional enum deserialization

15 months agoMerge pull request #2680 from DaanDeMeyer/properties
Daan De Meyer [Sat, 4 May 2024 12:58:21 +0000 (14:58 +0200)] 
Merge pull request #2680 from DaanDeMeyer/properties

Add UnitProperties= setting

15 months agoAdd UnitProperties= setting 2680/head
Daan De Meyer [Fri, 3 May 2024 22:04:57 +0000 (00:04 +0200)] 
Add UnitProperties= setting

This allows configuring properties on the scopes spawned by
systemd-nspawn or systemd-run.

15 months agoUse become_root_cmd() in copy_ephemeral()
Daan De Meyer [Fri, 3 May 2024 22:44:57 +0000 (00:44 +0200)] 
Use become_root_cmd() in copy_ephemeral()

15 months agoqemu: Use systemd-run to allocate scopes
Daan De Meyer [Fri, 3 May 2024 21:33:58 +0000 (23:33 +0200)] 
qemu: Use systemd-run to allocate scopes

This doesn't drastically change behavior, but will open the way for
adding a RuntimeProperties= setting to allow configuring various
properties of the scope unit.

Since allocating a scope with systemd-run involves communicating with
a daemon running on the host, there's no point in running it from the
sandbox so we run it from the host instead.

Because systemd-run needs to run as the uid that started mkosi, we can't
use preexec_fn anymore to allocate the user namespace for virtiofsd.
Instead, we reimplement what become_root() does on top of unshare and
chain execute into that which then itself chain executes virtiofsd.

15 months agoMerge pull request #2679 from DaanDeMeyer/cache
Daan De Meyer [Fri, 3 May 2024 15:23:18 +0000 (17:23 +0200)] 
Merge pull request #2679 from DaanDeMeyer/cache

qemu: Configure caching properly

15 months agoqemu: Use io_uring async I/O backend 2679/head
Daan De Meyer [Fri, 3 May 2024 14:50:08 +0000 (16:50 +0200)] 
qemu: Use io_uring async I/O backend

15 months agoqemu: Configure caching properly
Daan De Meyer [Fri, 3 May 2024 14:24:50 +0000 (16:24 +0200)] 
qemu: Configure caching properly

For the scratch device, we can use unsafe caching as it's thrown
away immediately after the machine shuts down. For the root disk,
we can use unsafe caching only if --ephemeral is enabled.

15 months agodebian: Reinstall various packages again
Daan De Meyer [Fri, 3 May 2024 10:33:09 +0000 (12:33 +0200)] 
debian: Reinstall various packages again

These packages have been added back to testing so let's install them
again.

15 months agoqemu: Allow adding a TPM without using UEFI
Daan De Meyer [Fri, 3 May 2024 08:21:45 +0000 (10:21 +0200)] 
qemu: Allow adding a TPM without using UEFI

Let's instead just default to not using a TPM when not using UEFI.

15 months agoBump actions/checkout from 4.1.2 to 4.1.4
dependabot[bot] [Wed, 1 May 2024 22:26:36 +0000 (22:26 +0000)] 
Bump actions/checkout from 4.1.2 to 4.1.4

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.4.
- [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/9bb56186c3b09b4f86b1c65136769dd318469633...0ad4b8fadaa221de15dcec353f45205ec38ea70b)

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

Signed-off-by: dependabot[bot] <support@github.com>
15 months agoBump github/codeql-action from 3.24.9 to 3.25.3
dependabot[bot] [Wed, 1 May 2024 22:26:43 +0000 (22:26 +0000)] 
Bump github/codeql-action from 3.24.9 to 3.25.3

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.9 to 3.25.3.
- [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/1b1aada464948af03b950897e5eb522f92603cc2...d39d31e687223d841ef683f52467bd88e9b21c14)

---
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>
15 months agoDo not mount home to sandbox if it's /
Cornelius Hoffmann [Tue, 30 Apr 2024 15:56:21 +0000 (17:56 +0200)] 
Do not mount home to sandbox if it's /

The default home directory for system users created with sysusers.d is /.
Which will automatically be mounted inside sync scripts, causing a lot of
headaches, since we're essentially trying to run on the host then.
E.g. /proxy.cacert cannot be created.

15 months agoMerge pull request #2671 from DaanDeMeyer/fix
Jörg Behrmann [Tue, 30 Apr 2024 14:40:46 +0000 (16:40 +0200)] 
Merge pull request #2671 from DaanDeMeyer/fix

Various fixes

15 months agovmspawn: Run with sandbox 2671/head
Daan De Meyer [Tue, 30 Apr 2024 13:32:11 +0000 (15:32 +0200)] 
vmspawn: Run with sandbox

Now that we can look up binaries in --extra-search-paths=, we can run
vmspawn with a sandbox as well.

15 months agovmspawn: Have vmspawn look for firmware itself
Daan De Meyer [Tue, 30 Apr 2024 13:30:29 +0000 (15:30 +0200)] 
vmspawn: Have vmspawn look for firmware itself

vmspawn was recently fixed to look for firmware itself properly so
let's have it do its own lookup again.

15 months agoDon't look in --extra-search-paths for qemu and virt-fw-vars
Daan De Meyer [Tue, 30 Apr 2024 13:27:01 +0000 (15:27 +0200)] 
Don't look in --extra-search-paths for qemu and virt-fw-vars

These take as input a file that might be in or out of the tools tree.
Because find_ovmf_firmware() will return a file in the tools tree
regardless of whether virt-fw-vars and qemu will be executed on the
host or not, let's disable the --extra-search-paths= integration for
these two for now.

15 months agoDon't look for firmware in /etc/qemu/firmware if we're using a tools tree
Daan De Meyer [Tue, 30 Apr 2024 13:25:34 +0000 (15:25 +0200)] 
Don't look for firmware in /etc/qemu/firmware if we're using a tools tree

This is unlikely to work properly since the description in /etc/qemu/firmware
will assume the host's /usr is in place and not the tools tree's /usr.

15 months agoselinux: Fix using setfiles from tools tree
Richard Maw [Mon, 29 Apr 2024 16:28:37 +0000 (17:28 +0100)] 
selinux: Fix using setfiles from tools tree

After the change to support tools from ExtraSearchPaths or the ToolsTree
the sandbox needs the found file path to be passed in.

The setfiles command needed to relabel trees was missed in this change.

15 months agomkosi-initrd: Drop some RemoveFiles= from Arch config
Daan De Meyer [Sun, 28 Apr 2024 13:23:58 +0000 (15:23 +0200)] 
mkosi-initrd: Drop some RemoveFiles= from Arch config

These are now handles by WithDocs=no.

15 months agoExclude `/usr/share/gtk-doc/*` with `WithDocs=no`
Michael Ferrari [Sat, 27 Apr 2024 05:50:44 +0000 (07:50 +0200)] 
Exclude `/usr/share/gtk-doc/*` with `WithDocs=no`

15 months agoMention repart artifacts in clean script section
Nils K [Fri, 26 Apr 2024 19:38:02 +0000 (21:38 +0200)] 
Mention repart artifacts in clean script section

15 months agoman: fix typo
Jörg Behrmann [Fri, 26 Apr 2024 15:00:02 +0000 (17:00 +0200)] 
man: fix typo