]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
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

15 months agofedora: Bump default release to 40
Daan De Meyer [Fri, 26 Apr 2024 10:38:32 +0000 (12:38 +0200)] 
fedora: Bump default release to 40

15 months agopacman: Drop unnecessary exclude
Daan De Meyer [Fri, 26 Apr 2024 06:25:58 +0000 (08:25 +0200)] 
pacman: Drop unnecessary exclude

15 months agoMerge pull request #2661 from DaanDeMeyer/fix
Daan De Meyer [Fri, 26 Apr 2024 09:07:31 +0000 (11:07 +0200)] 
Merge pull request #2661 from DaanDeMeyer/fix

qemu: Always how many notify messages we received

15 months agopacman: Implement support for WithDocs=
Daan De Meyer [Fri, 26 Apr 2024 06:25:58 +0000 (08:25 +0200)] 
pacman: Implement support for WithDocs=

Same list as we use for apt, using pacman's NoExtract= option.

15 months agoAdd missing newline 2661/head
Daan De Meyer [Fri, 26 Apr 2024 08:39:30 +0000 (10:39 +0200)] 
Add missing newline

15 months agoRemove unneeded exist_ok from install_dir.mkdir()
Daan De Meyer [Fri, 26 Apr 2024 08:38:54 +0000 (10:38 +0200)] 
Remove unneeded exist_ok from install_dir.mkdir()

This cannot be provided by users anymore and is always created in
the workspace so it will never exist already.

15 months agoqemu: Always how many notify messages we received
Daan De Meyer [Thu, 25 Apr 2024 18:57:11 +0000 (20:57 +0200)] 
qemu: Always how many notify messages we received

15 months agoClarify BuildSourcesEphemeral=
Daan De Meyer [Thu, 25 Apr 2024 11:00:54 +0000 (13:00 +0200)] 
Clarify BuildSourcesEphemeral=

Fixes #2656

15 months agoDrop redundant ukify lookup
Daan De Meyer [Wed, 24 Apr 2024 20:39:26 +0000 (22:39 +0200)] 
Drop redundant ukify lookup

15 months agoci: remove packages.microsoft.com
Luca Boccassi [Wed, 24 Apr 2024 14:43:23 +0000 (15:43 +0100)] 
ci: remove packages.microsoft.com

It is not needed, it publishes things like dotnet, and it is often
broken, so just remove the sources

15 months agoCall ukify with --ucode if supported
Tobias Fleig [Tue, 26 Mar 2024 12:46:00 +0000 (05:46 -0700)] 
Call ukify with --ucode if supported

This is the companion change to https://github.com/systemd/systemd/pull/31872.

If both systemd-stub and ukify are version `256~devel` or greater, mkosi
will put the microcode initrd in the new `.ucode` UKI section by using
the `--ucode` flag in ukify. Otherwise it will put the microcode initrd
as first regular initrd (same as before).

15 months agoSupport SplitArtifacts= for extension images
Daan De Meyer [Tue, 23 Apr 2024 12:49:19 +0000 (14:49 +0200)] 
Support SplitArtifacts= for extension images

15 months agomkosi-tools: Add qemu-img to Fedora tools tree
Daan De Meyer [Tue, 23 Apr 2024 11:18:57 +0000 (13:18 +0200)] 
mkosi-tools: Add qemu-img to Fedora tools tree

Required by virt-fw-vars but not explicitly declared as a dependency
yet.

See https://bugzilla.redhat.com/show_bug.cgi?id=2276629

15 months agoAvoid TOCTOU issue in start_journal_remote()
Daan De Meyer [Tue, 23 Apr 2024 08:19:38 +0000 (10:19 +0200)] 
Avoid TOCTOU issue in start_journal_remote()

15 months agoMake sure "mkosi -C build" works
Daan De Meyer [Tue, 23 Apr 2024 07:48:07 +0000 (09:48 +0200)] 
Make sure "mkosi -C build" works

In systemd we want to (optionally) make sure all mkosi output is
written to the meson build directory. To make this work, we want to
write a mkosi.conf to the meson build directory so that developers
can do "mkosi -C build". Currently this doesn't work because "build"
is interpreted as a verb. Let's make sure that doesn't happen.

We need a better solution for this hack but for now this is the best
I can come up with.

15 months agoapt: Pick up ddeb packages as well
Daan De Meyer [Tue, 23 Apr 2024 07:08:53 +0000 (09:08 +0200)] 
apt: Pick up ddeb packages as well

Ubuntu spits out .ddeb extensions for debug packages, so let's make
sure we take that into account.

15 months agoDon't build the image automatically for boot/qemu verbs without --force
Daan De Meyer [Mon, 22 Apr 2024 12:37:30 +0000 (14:37 +0200)] 
Don't build the image automatically for boot/qemu verbs without --force

Let's insist on --force to build the image if boot/qemu are used to
give users an easy way to insist that an image has already been built
when booting it.

15 months agoMerge pull request #2647 from DaanDeMeyer/basesystem
Zbigniew Jędrzejewski-Szmek [Mon, 22 Apr 2024 07:04:33 +0000 (09:04 +0200)] 
Merge pull request #2647 from DaanDeMeyer/basesystem

fedora: Install basesystem package instead of filesystem

15 months agocentos: Drop glibc-minimal-langpack workaround 2647/head
Daan De Meyer [Sun, 21 Apr 2024 18:40:40 +0000 (20:40 +0200)] 
centos: Drop glibc-minimal-langpack workaround

This workaround was in place for CentOS 8 Stream, for which support
will be dropped in May, so let's drop the workaround already.

15 months agofedora: Install basesystem package instead of filesystem
Daan De Meyer [Sun, 21 Apr 2024 18:20:58 +0000 (20:20 +0200)] 
fedora: Install basesystem package instead of filesystem

basesystem pulls in filesystem and setup. The latter defines some
common groups and directories that are expected to be available
on every system.

Fedora/CentOS also define basesystem as a package that's expected
to be installed everywhere, so let's make sure our images satisfy
that requirement.

15 months agoMerge pull request #2646 from DaanDeMeyer/journal-remote
Daan De Meyer [Sun, 21 Apr 2024 10:04:03 +0000 (12:04 +0200)] 
Merge pull request #2646 from DaanDeMeyer/journal-remote

Configure journal-remote limits properly

15 months agoAlways use TERM=dumb if not connected to a tty 2646/head
Daan De Meyer [Sun, 21 Apr 2024 09:20:09 +0000 (11:20 +0200)] 
Always use TERM=dumb if not connected to a tty

mkosi might be invoked from a terminal but redirected to a file, in
that case we should ignore $TERM from the environment, so let's make
sure we handle that properly.

15 months agoConfigure journal-remote limits properly
Daan De Meyer [Sat, 20 Apr 2024 20:33:01 +0000 (22:33 +0200)] 
Configure journal-remote limits properly

Let's make sure the limits are configured so we can always write at
least 4G of logs. We also enable compact mode again in all cases to
reduce the size used by journal files as for example Github Actions
machines aren't exactly swimming in free space.

(We pick 4G because that's the max journal file size when the compact
mode is used)

(We'll probably have to revisit this again at some point but for now
this should do the trick)

15 months agoqemu: give qemu a private copy of stdin, stdout and stderr
Jörg Behrmann [Fri, 19 Apr 2024 18:48:42 +0000 (20:48 +0200)] 
qemu: give qemu a private copy of stdin, stdout and stderr

15 months agoRemove vmspawn from --help
Daan De Meyer [Fri, 19 Apr 2024 11:19:10 +0000 (13:19 +0200)] 
Remove vmspawn from --help

It was replaced with VirtualMachineMonitor=

16 months agoMerge pull request #2639 from behrmann/artifactory
Daan De Meyer [Thu, 18 Apr 2024 09:19:18 +0000 (11:19 +0200)] 
Merge pull request #2639 from behrmann/artifactory

Add artifact directories

16 months agoAdd Environment= match
Daan De Meyer [Thu, 18 Apr 2024 08:10:25 +0000 (10:10 +0200)] 
Add Environment= match

16 months agoAdd artifacts directories to pass around build artifacts 2639/head
Jörg Behrmann [Wed, 17 Apr 2024 13:42:19 +0000 (15:42 +0200)] 
Add artifacts directories to pass around build artifacts

Also pick up microcode and initrds from the artifact directory

16 months agoDrop --cache=always for virtiofsd
Daan De Meyer [Wed, 17 Apr 2024 13:37:04 +0000 (15:37 +0200)] 
Drop --cache=always for virtiofsd

We want to support users writing to these directories from the host
so --cache=always is not an option as that assumes virtiofsd has
exclusive write access.

16 months agoman: add PACKAGEDIR to environment variable table
Jörg Behrmann [Wed, 17 Apr 2024 12:28:43 +0000 (14:28 +0200)] 
man: add PACKAGEDIR to environment variable table

16 months agoFix documentatio mkosi.md mispelling
Thales Antunes de Oliveira Barretto [Tue, 16 Apr 2024 20:16:57 +0000 (17:16 -0300)] 
Fix documentatio mkosi.md mispelling

Fixes mispelled 'thel.' to 'them.' in mkosi.md.

16 months agoSkip dict as well in cli settings check
Daan De Meyer [Tue, 16 Apr 2024 13:02:17 +0000 (15:02 +0200)] 
Skip dict as well in cli settings check

16 months agoMerge pull request #2634 from DaanDeMeyer/tools
Daan De Meyer [Mon, 15 Apr 2024 12:25:29 +0000 (14:25 +0200)] 
Merge pull request #2634 from DaanDeMeyer/tools

Allow using ExtraSearchPaths= with ToolsTree=

16 months agoAllow using ExtraSearchPaths= with ToolsTree= 2634/head
Daan De Meyer [Mon, 15 Apr 2024 11:13:17 +0000 (13:13 +0200)] 
Allow using ExtraSearchPaths= with ToolsTree=

If we find a binary in any path configured with ExtraSearchPaths=,
we prefer using it over the tools tree.

This commit also gets rid of all the find_binary() for "btrfs" in
tree.py and stops passing in the tools tree to those functions.
Instead, we rely on the new behavior of run() to not fail hard
when check=False and the btrfs binary is not found.

16 months agoMake check argument apply to whether the command exists
Daan De Meyer [Mon, 15 Apr 2024 10:39:57 +0000 (12:39 +0200)] 
Make check argument apply to whether the command exists

Let's not fail hard when check=False and the command is not found.
This will allow us to avoid having to pass the tools tree path around
in various places.

16 months agoDrop support for BSD tar/cpio
Daan De Meyer [Mon, 15 Apr 2024 09:53:13 +0000 (11:53 +0200)] 
Drop support for BSD tar/cpio

Let's drop this compat kludge for OpenMandriva. No other distro
does this and we should just assume gnu tar/cpio as the official
API of the tar/cpio binaries.

16 months agoMake tools a boolean argument
Daan De Meyer [Mon, 15 Apr 2024 09:22:15 +0000 (11:22 +0200)] 
Make tools a boolean argument

16 months agoUpdate NEWS
Jörg Behrmann [Mon, 15 Apr 2024 07:42:26 +0000 (09:42 +0200)] 
Update NEWS

16 months agoRemove output symlink target as well when cleaning
Daan De Meyer [Sun, 14 Apr 2024 21:27:19 +0000 (23:27 +0200)] 
Remove output symlink target as well when cleaning

16 months agoSwitch to reprepro for generating local apt repositories
Daan De Meyer [Sun, 14 Apr 2024 20:27:13 +0000 (22:27 +0200)] 
Switch to reprepro for generating local apt repositories

We don't install dpkg-dev in tools trees anymore to avoid pulling
in perl, which means we don't have access to dpkg-scanpackages in
tools trees anymore.

Instead of adding back dpkg-dev, let's instead switch to reprepro
for generating our local apt repository. It's written in C, packaged
everywhere and has hardly any dependencies.

16 months agoMake mkosi.packages a non-default path setting
Daan De Meyer [Mon, 15 Apr 2024 06:00:35 +0000 (08:00 +0200)] 
Make mkosi.packages a non-default path setting

If the setting is configured in the config file as well, we want it
to append to mkosi.packages, not override it.

16 months agoAdd `mkosi.packages/` for `PackageDirectories=`
Michael Ferrari [Sun, 14 Apr 2024 22:30:47 +0000 (00:30 +0200)] 
Add `mkosi.packages/` for `PackageDirectories=`

16 months agoMerge pull request #2628 from DaanDeMeyer/news
Daan De Meyer [Sun, 14 Apr 2024 17:50:52 +0000 (19:50 +0200)] 
Merge pull request #2628 from DaanDeMeyer/news

Update NEWS

16 months agoStart using ~devel versions 2628/head
Daan De Meyer [Sun, 14 Apr 2024 17:24:32 +0000 (19:24 +0200)] 
Start using ~devel versions

Same as systemd. While in development we suffix with ~devel. Also
update the do-a-release script to add a second commit to switch back
to ~devel when we do a release.

We keep the old version in pyproject.toml because suffixing with
~devel conflicts with PEP 440 and python tools complain about that.

16 months agoUpdate NEWS
Daan De Meyer [Sun, 14 Apr 2024 17:03:24 +0000 (19:03 +0200)] 
Update NEWS

16 months agoMerge pull request #2627 from DaanDeMeyer/metavar
Daan De Meyer [Sun, 14 Apr 2024 16:49:42 +0000 (18:49 +0200)] 
Merge pull request #2627 from DaanDeMeyer/metavar

Various fixes

16 months agoFix formatting 2627/head
Daan De Meyer [Sun, 14 Apr 2024 15:14:03 +0000 (17:14 +0200)] 
Fix formatting

We don't put whitespace between function keyword arguments and their
values.

16 months agoAdd VolatilePackages= and InitrdVolatilePackages= settings
Daan De Meyer [Sun, 14 Apr 2024 14:40:56 +0000 (16:40 +0200)] 
Add VolatilePackages= and InitrdVolatilePackages= settings

Let's allow configuring packages which should be installed after
running build scripts and which are not cached. This is useful for
installing packages which are built in a build script or which change
often and shouldn't invalidate the cache.

16 months agoPrefer choices over metavar where applicable
Daan De Meyer [Sun, 14 Apr 2024 14:04:39 +0000 (16:04 +0200)] 
Prefer choices over metavar where applicable

If metavar is set, the choices aren't shown in the help output, so
whenever we're parsing an enum, prefer choices over setting a metavar.

16 months agoMerge pull request #2625 from DaanDeMeyer/news
Daan De Meyer [Sun, 14 Apr 2024 13:48:26 +0000 (15:48 +0200)] 
Merge pull request #2625 from DaanDeMeyer/news

Various fixes

16 months agomkosi-initrd: Remove all vmlinux images as well 2625/head
Daan De Meyer [Sun, 14 Apr 2024 06:54:22 +0000 (08:54 +0200)] 
mkosi-initrd: Remove all vmlinux images as well

16 months agoReuse tools tree on incremental builds
Daan De Meyer [Sat, 13 Apr 2024 19:42:44 +0000 (21:42 +0200)] 
Reuse tools tree on incremental builds

Every part of the default tools tree is cached. Thus, we can check
if the cache is out of date on incremental builds and if it isn't,
just reuse the previous tools tree instead of doing unnecessary work.

16 months agoOnly force repository metadata refresh if -ff was specified
Daan De Meyer [Sat, 13 Apr 2024 18:59:43 +0000 (20:59 +0200)] 
Only force repository metadata refresh if -ff was specified

Let's make sure we use the default metadata expiration checks unless
-ff was specified. Apt doesn't support anything like this so we don't
change anything there.

16 months agoRemove 'v' prefix from systemd tool versions
Daan De Meyer [Sat, 13 Apr 2024 18:31:32 +0000 (20:31 +0200)] 
Remove 'v' prefix from systemd tool versions

Some older systemd versions still have a 'v' prefix in them, let's
make sure we take that into account.

16 months agoLog bootctl version when it's out of date
Daan De Meyer [Sat, 13 Apr 2024 18:28:55 +0000 (20:28 +0200)] 
Log bootctl version when it's out of date

16 months agoDisable SELinux relabeling for tools tree
Daan De Meyer [Sat, 13 Apr 2024 18:23:33 +0000 (20:23 +0200)] 
Disable SELinux relabeling for tools tree

policycoreutils in centos pulls in the policy as a dependency, so
we end up doing the relabel. Let's make sure we don't by explicitly
disabling it.

16 months agoAdd ProxyExclude= setting
Daan De Meyer [Sat, 13 Apr 2024 17:15:56 +0000 (19:15 +0200)] 
Add ProxyExclude= setting

Allow configuring hostnames which should not go through the proxy.

16 months agoAdd Cacheonly.never and rename Cacheonly.none to Cacheonly.auto
Daan De Meyer [Sat, 13 Apr 2024 16:03:41 +0000 (18:03 +0200)] 
Add Cacheonly.never and rename Cacheonly.none to Cacheonly.auto

When set to "never", we'll always sync repository metadata.

16 months agoMake sure we use the enum members to generate values()
Daan De Meyer [Sat, 13 Apr 2024 16:02:06 +0000 (18:02 +0200)] 
Make sure we use the enum members to generate values()

Otherwise if we add backwards compat members they won't be taken
into account.

16 months agoDon't use strings in compression enum
Daan De Meyer [Sat, 13 Apr 2024 16:01:50 +0000 (18:01 +0200)] 
Don't use strings in compression enum

16 months agoCentralize vmlinuz fixup logic
Daan De Meyer [Sat, 13 Apr 2024 14:40:45 +0000 (16:40 +0200)] 
Centralize vmlinuz fixup logic

Let's run this logic for all distributions, and also run it after
running postinst scripts, to deal with kernel packages that are
installed in a postinst script.

16 months agoAdd ToolsTreeCertificates= option
Daan De Meyer [Sat, 13 Apr 2024 14:18:03 +0000 (16:18 +0200)] 
Add ToolsTreeCertificates= option

When building an image using internal repositories, often various
internal certificates are required to be able to access these. These
are of course not going to be available in any default tools tree, so
let's add an option to use certificates and keys from the host with a
tools tree.

16 months agoUpdate NEWS
Daan De Meyer [Fri, 12 Apr 2024 07:50:56 +0000 (09:50 +0200)] 
Update NEWS

16 months agoStop installing createrepo-c on Debian Testing
Daan De Meyer [Sat, 13 Apr 2024 11:37:25 +0000 (13:37 +0200)] 
Stop installing createrepo-c on Debian Testing

createrepo-c was removed from Debian testing, see
https://tracker.debian.org/pkg/createrepo-c.

16 months agoDrop /etc/makepkg.conf logic from pacman mounts
Daan De Meyer [Sat, 13 Apr 2024 11:35:27 +0000 (13:35 +0200)] 
Drop /etc/makepkg.conf logic from pacman mounts

makepkg is always invoked in the image itself to build a package,
so there's no point in mounting over the makepkg.conf from the tools
tree into the sandbox.

16 months agoAdd comment to re-enable pacman-package-manager and makepkg when back in testing
Daan De Meyer [Sat, 13 Apr 2024 11:34:07 +0000 (13:34 +0200)] 
Add comment to re-enable pacman-package-manager and makepkg when back in testing

16 months agoOptionally return the inner pid from spawn()
Daan De Meyer [Fri, 12 Apr 2024 14:21:27 +0000 (16:21 +0200)] 
Optionally return the inner pid from spawn()

bubblewrap does not support forwarding signals yet,
see https://github.com/containers/bubblewrap/pull/586. As a workaround,
we need to make sure we send our signals to the inner process. To
make this work, we create a pipe, pass it through to the subprocess,
and prefix with a bash command that writes its pid to the pipe before
exec-ing the actual command.

The other thing we get from this is that we can register the inner pid
as a scope which makes the systemctl status output for the scopes we
create a lot more useful.

16 months agoMake sandbox_cmd() return a context manager
Daan De Meyer [Sat, 13 Apr 2024 08:50:58 +0000 (10:50 +0200)] 
Make sandbox_cmd() return a context manager

This allows us to get rid of the shell hack to create and clean up
a subdirectory of /var/tmp. To avoid having to change every callsite
to use with(), we pass in a context manager directly into run() and
spawn().

Because we don't return a list anymore from sandbox_cmd(), we add an
extra "extra" argument to allow appending extra commands to the sandbox.

16 months agoMove foreground argument
Daan De Meyer [Sat, 13 Apr 2024 08:46:44 +0000 (10:46 +0200)] 
Move foreground argument

Make sure the argument list has the same order as spawn().

16 months agoIntroduce success_exit_status argument for run() and spawn()
Daan De Meyer [Sat, 13 Apr 2024 08:45:48 +0000 (10:45 +0200)] 
Introduce success_exit_status argument for run() and spawn()

16 months agoMake sure systemd-journal-remote runs in background
Daan De Meyer [Fri, 12 Apr 2024 12:53:56 +0000 (14:53 +0200)] 
Make sure systemd-journal-remote runs in background

16 months agoOnly run systemd-journal-remote as owner of target dir if running as root
Daan De Meyer [Fri, 12 Apr 2024 09:31:51 +0000 (11:31 +0200)] 
Only run systemd-journal-remote as owner of target dir if running as root

If we're not running as root, we're not allowed to run as a different
user than ourselves, so don't try to do so.

16 months agoAllocate scope for systemd-journal-remote as well
Daan De Meyer [Fri, 12 Apr 2024 07:56:34 +0000 (09:56 +0200)] 
Allocate scope for systemd-journal-remote as well

16 months agoDon't fail if we can't register machine
Daan De Meyer [Fri, 12 Apr 2024 07:50:22 +0000 (09:50 +0200)] 
Don't fail if we can't register machine

systemd-machined might not be running.

16 months agoqemu: Escape commas in kernel command line SMBIOS value
Daan De Meyer [Thu, 11 Apr 2024 20:05:22 +0000 (22:05 +0200)] 
qemu: Escape commas in kernel command line SMBIOS value

Commas in the command line have to be escaped by doubling them, so
let's do that.

16 months agoStop installing dpkg-dev explicitly in tools trees
Daan De Meyer [Thu, 11 Apr 2024 14:47:17 +0000 (16:47 +0200)] 
Stop installing dpkg-dev explicitly in tools trees

apt will pull in dpkg as a dependency. dpkg-dev specifically only
includes stuff required to build packages, which you generally only
want to install in the image itself as the dpkg build tooling does
not support operating on a chroot.

This gets rid of perl in tools trees as dpkg-dev depends on a bunch
of perl scripts but dpkg doesn't.

16 months agoqemu: Enable discard/trim processing in qemu
Daan De Meyer [Thu, 11 Apr 2024 13:18:10 +0000 (15:18 +0200)] 
qemu: Enable discard/trim processing in qemu

16 months agoqemu: Enable free page reporting
Daan De Meyer [Thu, 11 Apr 2024 13:14:15 +0000 (15:14 +0200)] 
qemu: Enable free page reporting

See https://github.com/systemd/systemd/pull/32227/

16 months agoqemu: Make sure qemu/VM exit status take priority
Daan De Meyer [Thu, 11 Apr 2024 08:11:51 +0000 (10:11 +0200)] 
qemu: Make sure qemu/VM exit status take priority

In spawn(), if an exception is raised by the context manager block,
we'll let it take priority over any exception we raise in spawn()
itself. Let's make use of this to make sure the qemu/VM exit code
always takes priority by raising the CalledProcessError from within
the qemu spawn() block.

We also let any qemu error take precedence over any EXIT_STATUS error.