]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
2 years agoDrop unused functions and variables 1434/head
Daan De Meyer [Thu, 13 Apr 2023 20:00:19 +0000 (22:00 +0200)] 
Drop unused functions and variables

2 years agoDrop --hostname and default locale configuration
Daan De Meyer [Thu, 13 Apr 2023 18:43:22 +0000 (20:43 +0200)] 
Drop --hostname and default locale configuration

These are trivial to configure manually and with credentials, so
let's drop the options for them.

2 years agoAdd --needed to pacman invocation
Daan De Meyer [Thu, 13 Apr 2023 08:04:44 +0000 (10:04 +0200)] 
Add --needed to pacman invocation

When installing build packages, we might install packages that were
already installed previously. Let's make sure we don't reinstall
those.

2 years agoMerge pull request #1422 from DaanDeMeyer/packages
Daan De Meyer [Wed, 12 Apr 2023 15:19:47 +0000 (17:19 +0200)] 
Merge pull request #1422 from DaanDeMeyer/packages

Remove --bootable, --base-packages and stop installing packages by default

2 years agoDrop --base-packages option 1422/head
Daan De Meyer [Thu, 6 Apr 2023 11:24:46 +0000 (13:24 +0200)] 
Drop --base-packages option

It's not necessary anymore now that we don't install any packages
by default anymore.

2 years agoStop installing openssh if --ssh is specified
Daan De Meyer [Thu, 6 Apr 2023 11:17:25 +0000 (13:17 +0200)] 
Stop installing openssh if --ssh is specified

This way, we don't install any extra packages by default and the full
list of packages is left entirely up to the user.

2 years agoRemove --bootable option
Daan De Meyer [Thu, 6 Apr 2023 11:11:57 +0000 (13:11 +0200)] 
Remove --bootable option

Instead, we just do the necessary setup for a bootable image if all
the required components are available in the image. In practice, this
means that if a user installs systemd-boot, the kernel, and dracut,
they'll get a bootable image.

2 years agoOnly install basic filesystem package by default
Daan De Meyer [Thu, 6 Apr 2023 09:27:24 +0000 (11:27 +0200)] 
Only install basic filesystem package by default

Let's trim down on the default packages we install, and only install
the most basic filesystem package by default. We'll leave everything
else up to the user.

This change is important when considering mkosi's use to build system
extensions and similar, where even the default packages we have now
are too much.

2 years agoSimplify autologin
Daan De Meyer [Fri, 7 Apr 2023 17:00:07 +0000 (19:00 +0200)] 
Simplify autologin

agetty actually has a -f option to skip pam authentication, so let's
use that instead of all the pam hacks to get autologin.

2 years agoAdd --die-with-parent when invoking bubblewrap
Daan De Meyer [Tue, 11 Apr 2023 12:49:19 +0000 (14:49 +0200)] 
Add --die-with-parent when invoking bubblewrap

rpm blocks most signals when doing a transaction. dnf doesn't block
anything. The end result is that when we do ctrl+c when dnf is running
the rpm transaction, dnf gets interrupted and exits, which means mkosi
exits and tries to remove the workspace directory on which rpm is still
operating, causing all kinds of nastiness.

Because we don't care about transaction safety since we're operating on
a chroot, let's add --die-with-parent when running bubblewrap. This makes
bubblewrap ensure cleanup of all child processes underneath it, and
because rpm can't ignore SIGKILL, it also cleans up rpm properly, fixing
the issue.

2 years agoFix typo
Daan De Meyer [Thu, 6 Apr 2023 12:19:37 +0000 (14:19 +0200)] 
Fix typo

2 years agoMerge pull request #1425 from DaanDeMeyer/stuff
Daan De Meyer [Fri, 7 Apr 2023 16:34:17 +0000 (18:34 +0200)] 
Merge pull request #1425 from DaanDeMeyer/stuff

Move more configuration parsing logic to config.py

2 years agoAdd PathExists= match 1425/head
Daan De Meyer [Fri, 7 Apr 2023 13:32:56 +0000 (15:32 +0200)] 
Add PathExists= match

It's also useful to be able to match against stuff that isn't the
current configuration. Let's add a PathExists= match that is satisfied
when the given path exists.

This will be useful in systemd where we conditionally build a kernel if
mkosi.kernel/ exists in the top level repo directory. With this setting,
we can only install the necessary packages to build the kernel if the
mkosi.kernel/ path actually exists.

2 years agoStop returning namespace in parse_config()
Daan De Meyer [Fri, 7 Apr 2023 13:27:51 +0000 (15:27 +0200)] 
Stop returning namespace in parse_config()

We don't use the return value at all so let's make it None.

2 years agoMove more configuration parsing logic to config.py
Daan De Meyer [Fri, 7 Apr 2023 12:39:37 +0000 (14:39 +0200)] 
Move more configuration parsing logic to config.py

2 years agoMake --repart-dir take a list of paths
Daan De Meyer [Fri, 7 Apr 2023 12:05:44 +0000 (14:05 +0200)] 
Make --repart-dir take a list of paths

systemd-repart supports multiple definition directories so let's
extend that to mkosi as well.

2 years agoIndicate required paths in list path settings
Daan De Meyer [Fri, 7 Apr 2023 12:04:34 +0000 (14:04 +0200)] 
Indicate required paths in list path settings

2 years agoMerge pull request #1424 from DaanDeMeyer/config
Daan De Meyer [Fri, 7 Apr 2023 11:26:04 +0000 (13:26 +0200)] 
Merge pull request #1424 from DaanDeMeyer/config

Rework configuration parsing ordering and overrides

2 years agoRework configuration parsing ordering and overrides 1424/head
Daan De Meyer [Fri, 7 Apr 2023 10:32:58 +0000 (12:32 +0200)] 
Rework configuration parsing ordering and overrides

Currently, aside from list based settings, if a setting is used
multiple times across different configuration files, the later
assignments override earlier assignments. On top of that, the CLI
arguments are parsed last and override everything from config files.

This has worked very well until now, but breaks now that we have
[Match] sections. If we override a setting using the CLI, we want
any configured [Match] sections to compare against the value specified
via the CLI. Because the CLI values are applied last, this currently
isn't the case.

Similarly, if we add 90-local.conf to override the distribution release
used for Debian, all the config files that are processed earlier will
still compare against the default release configured for Debian in
50-debian.conf. If we rename 90-local.conf to 00-local.conf, the default
release in 50-debian.conf will still override that value. Only by putting
the override after the config file that assigns the default release but
before the first config file that matches on that release can we make this
work, but depending on the configuration this might require a lot of
different override files which isn't ideal.

Also, because later values can override earlier ones, it's possible to have
[Match] sections that match against different values of the same setting
both apply, if the setting happens to be reassigned inbetween, which is not
intuitive and error prone. Ideally, [Match] settings only apply to the final
value of a setting.

To fix these problems, this commit reworks the way we order and override
settings. Instead of having later assignments override earlier ones, for
all settings aside from list settings, the first assignment is the one that
is used. All later assignments of the same setting are ignored. Along with, we
switch to parsing CLI arguments first, which means that any settings assigned
in CLI args take precedence over those configured in config files.

Because the first value is immediately the final value, any [Match] sections
will only ever see the final value. One caveat is default values for settings.
We only want to assign these at the end of parsing, if no value has been
explicitly configured, but we also want [Match] sections to apply to default
values if no value is explicitly configured. The solution to this is that if
we encounter a setting in a [Match] section and it has not been explicitly
assigned a value yet, it is assigned its default value.

For list based settings, ! now configures an ignore glob, which means that if any
later assignments try to assign values that match an ignore glob, those values
are ignored. We also prepend list values instead of appending so that list
values that are configured in a preceeding config file appear later in the final
list value than values configured in a later assignment.

Implementation wise, this commit reworks config parser functions to return the
new value that should be assigned instead of assigning it themselves. This makes
the config parsing functions slightly more generic.

2 years agoAdd back AutoBump config setting
Daan De Meyer [Fri, 7 Apr 2023 10:51:17 +0000 (12:51 +0200)] 
Add back AutoBump config setting

This was accidentally removed in an earlier commit.

2 years agoAllow missing secure boot key/cert if running genkey
Daan De Meyer [Thu, 6 Apr 2023 19:53:00 +0000 (21:53 +0200)] 
Allow missing secure boot key/cert if running genkey

2 years agoMerge pull request #1420 from DaanDeMeyer/config
Daan De Meyer [Thu, 6 Apr 2023 18:49:38 +0000 (20:49 +0200)] 
Merge pull request #1420 from DaanDeMeyer/config

Rework configuration parsing

2 years agoRework configuration parsing 1420/head
Daan De Meyer [Mon, 3 Apr 2023 09:51:33 +0000 (11:51 +0200)] 
Rework configuration parsing

Instead of messing with the internals of argparse, let's implement
proper configuration file parsing.

- Parsing classes and functions are located in a new file config.py
- Configuration settings are split up from CLI settings in a list of
the new ConfigSetting dataclass
- The CLI options for configuration settings now share the same
argparse setting which simply delegates parsing to the corresponding
configuration setting parser.
- We add support for [Match] sections to enable conditionally including
configuration files. Currently Match support is implemented for
Distribution= and Release=.
- Configuration file searching is reworked. In mkosi.conf.d/, we parse
all files ending with ".conf" and directories. If a directory is parsed,
we parse mkosi.conf, mkosi.conf.d/ and all mkosi specific paths in it.
All paths are interpreted relative to the directory that we're parsing.

2 years agoPrint cmdline in run() before doing fspath() conversion
Daan De Meyer [Mon, 3 Apr 2023 08:41:47 +0000 (10:41 +0200)] 
Print cmdline in run() before doing fspath() conversion

2 years agoRemove Additional Configuration Options argparse group
Daan De Meyer [Sun, 2 Apr 2023 19:10:15 +0000 (21:10 +0200)] 
Remove Additional Configuration Options argparse group

Let's move these settings to the top level group along with the other
CLI arguments that aren't really config.

2 years agoMove --auto-bump under Content section
Daan De Meyer [Sun, 2 Apr 2023 19:06:07 +0000 (21:06 +0200)] 
Move --auto-bump under Content section

Let's collocate --auto-bump with --image-version which it is closely
related to.

2 years agoDrop [Partition] group
Daan De Meyer [Sun, 2 Apr 2023 15:24:57 +0000 (17:24 +0200)] 
Drop [Partition] group

Only remaining setting in it was BaseImage=, which fits better in
[Content] so let's drop [Partition] and move BaseImage= to [Content].

2 years agoAdd --cache-only option
Daan De Meyer [Sun, 2 Apr 2023 15:15:38 +0000 (17:15 +0200)] 
Add --cache-only option

Instead of having "never" as a special value for --with-network, let's
add a custom option --cache-only to enable/disable this behavior.

2 years agoDrop --qcow2 and --bmap options
Daan De Meyer [Sun, 2 Apr 2023 15:06:31 +0000 (17:06 +0200)] 
Drop --qcow2 and --bmap options

Let's reduce the support surface by removing some fringe options

2 years agoRemove compatibility option names
Daan De Meyer [Sun, 2 Apr 2023 14:37:01 +0000 (16:37 +0200)] 
Remove compatibility option names

2 years agoUpdate outdated documentation
Daan De Meyer [Sun, 2 Apr 2023 14:25:24 +0000 (16:25 +0200)] 
Update outdated documentation

Remove build phases docs as we only have a single phase these days
and update the caching section docs to take the new build overlay
approach into account.

2 years agoName all directory options consistenly
Daan De Meyer [Mon, 3 Apr 2023 09:47:24 +0000 (11:47 +0200)] 
Name all directory options consistenly

Use shorthand for the CLI option and longform for the config file
option.

2 years agoOnly run ssh-add -L if SSH_AUTH_SOCK is found in the environment
Daan De Meyer [Tue, 4 Apr 2023 08:56:05 +0000 (10:56 +0200)] 
Only run ssh-add -L if SSH_AUTH_SOCK is found in the environment

2 years agoMerge pull request #1417 from DaanDeMeyer/virtconsole
Daan De Meyer [Fri, 31 Mar 2023 10:25:44 +0000 (12:25 +0200)] 
Merge pull request #1417 from DaanDeMeyer/virtconsole

qemu: Use virtconsole serial console instead of regular serial console

2 years agoqemu: Don't write any log messages when running qemu 1417/head
Daan De Meyer [Thu, 30 Mar 2023 12:00:34 +0000 (14:00 +0200)] 
qemu: Don't write any log messages when running qemu

The running command message can get huge depending on which credentials
you're using so let's not write it by default (can still get it with
--debug run). And the swtpm message isn't super useful either so let's
drop it as well.

2 years agoqemu: Use virtconsole serial console instead of regular serial console
Daan De Meyer [Thu, 30 Mar 2023 11:56:53 +0000 (13:56 +0200)] 
qemu: Use virtconsole serial console instead of regular serial console

With --qemu-headless, qemu stops working when latest systemd is not
available because smbios provided kernel cmdline arguments are ignored.
This includes "console=ttyS0" meaning we don't get any output on the
serial console when booting in qemu.

As a workaround, let's use qemu's virtconsole instead. This means the
serial console will be available in the VM as /dev/hvc0, on which
systemd will automatically spawn a serial getty. This means we'll
eventually get a login prompt, even if latest systemd is not used.

One caveat is that EDK2 doesn't seem to support virtio-serial with
virtconsole. To get around this limitation, we keep a regular serial
console around as well, which can be used by the bootloader to log
its output.

2 years agoAlways use mkosi.extra/ and mkosi.skeleton/ if they exist
Daan De Meyer [Wed, 29 Mar 2023 10:04:12 +0000 (12:04 +0200)] 
Always use mkosi.extra/ and mkosi.skeleton/ if they exist

These should be additive instead of only being used when no explicit
extra/skeleton trees are configured.

2 years agoDrop --netdev
Daan De Meyer [Wed, 29 Mar 2023 08:50:14 +0000 (10:50 +0200)] 
Drop --netdev

Let's not configure systemd-networkd in mkosi, but leave this up
to users instead. As our SSH support now works on top of vsock, we
don't need this option anymore to make the SSH support work.

When booting, containers are started without a network device (trivial
to add one by adding --network-veth) and VMs are started with a network
device. We don't want one for containers so that they can just reuse the
network namespace of the host instead of having to start networkd to get
internet access within the container. For VMs, there's no disadvantage to
adding a network device, so we add one by default.

2 years agoReplace --qemu-headless with --qemu-gui
Daan De Meyer [Sun, 19 Mar 2023 11:30:45 +0000 (12:30 +0100)] 
Replace --qemu-headless with --qemu-gui

We add extra kernel command line arguments that configure term and
the tty size at runtime. We start qemu in the terminal on a serial tty
by default now as well.

We introduce --qemu-gui to still allow booting qemu in a graphical
interface

We also pass the host environment to qemu and nspawn to mimick what
we do with ssh and because qemu needs the host environment to
initialize gtk properly.

2 years agoAdd --acl option
Daan De Meyer [Mon, 27 Mar 2023 08:55:16 +0000 (10:55 +0200)] 
Add --acl option

Let's make the usage of ACLs opt-in since they leak into the final
image if the directory output is used.

We move the call to print_output_size() so its executed inside the
user namespace, which is required because we might not have permissions
to read some of the image's directories outside the user namespace.

2 years agocentos: Drop c9s epel requirement for systemd-boot
Daan De Meyer [Tue, 28 Mar 2023 11:26:28 +0000 (13:26 +0200)] 
centos: Drop c9s epel requirement for systemd-boot

It's available in the base repositories now. We still need epel on
the redhat derivatives for now.

2 years agoci: run differential shellcheck on push as well
Frantisek Sumsal [Tue, 28 Mar 2023 13:08:33 +0000 (15:08 +0200)] 
ci: run differential shellcheck on push as well

to get rid of the annoying message on new PRs.

Also, update the action to the latest version and drop now unnecessary
permissions.

See: https://github.com/redhat-plumbers-in-action/differential-shellcheck/issues/215
Addresses: https://github.com/systemd/mkosi/pull/1413#issuecomment-1486700752

2 years agoFix check_config_file_age
Daan De Meyer [Mon, 27 Mar 2023 11:17:51 +0000 (13:17 +0200)] 
Fix check_config_file_age

This is actually a main config setting instead of a per repo setting.

2 years agooverlayfs: avoid userxattr if kernel version is < 5.11
Luca Boccassi [Fri, 24 Mar 2023 01:04:05 +0000 (01:04 +0000)] 
overlayfs: avoid userxattr if kernel version is < 5.11

userxattr was added as a mount option for overlayfs only in kernel 5.11,
so avoid it on older versions (like Debian stable):

‣   Running build script…
mount: /home/bluca/git/systemd/.mkosi.tmpzt2q0dyp/root: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
umount: /home/bluca/git/systemd/.mkosi.tmpzt2q0dyp/root: not mounted

2 years agoMerge pull request #1407 from nikandfor/parse-configs-fix
Daan De Meyer [Thu, 23 Mar 2023 15:00:40 +0000 (16:00 +0100)] 
Merge pull request #1407 from nikandfor/parse-configs-fix

Only parse configuration files suffixed with ".conf" in dropin directories

2 years agoupdate NEWS.md 1407/head
nikandfor [Thu, 23 Mar 2023 13:52:00 +0000 (17:52 +0400)] 
update NEWS.md

2 years agoonly parse *.conf files in dropin dirs
nikandfor [Thu, 23 Mar 2023 13:18:39 +0000 (17:18 +0400)] 
only parse *.conf files in dropin dirs

2 years agocentos: Install systemd-boot again on CentOS Stream 9
Daan De Meyer [Tue, 7 Mar 2023 14:13:17 +0000 (15:13 +0100)] 
centos: Install systemd-boot again on CentOS Stream 9

systemd-boot was removed from the systemd package again so let's
start installing it explicitly again on CentOS Stream 9.

2 years agoopensuse: populate the cache dir even when creating a sysext image
Franck Bui [Wed, 8 Mar 2023 10:24:54 +0000 (11:24 +0100)] 
opensuse: populate the cache dir even when creating a sysext image

2 years agoRun ssh-add -L to get the public key if the --ssh option is enabled
Daan De Meyer [Tue, 21 Mar 2023 15:21:08 +0000 (16:21 +0100)] 
Run ssh-add -L to get the public key if the --ssh option is enabled

2 years agoLog main verb output to stdout
Daan De Meyer [Tue, 21 Mar 2023 08:00:31 +0000 (09:00 +0100)] 
Log main verb output to stdout

By default, run() redirects stdout to stderr. Let's override this
for the main output of our other verbs.

2 years agossh: Treat exit status 255 as success
Daan De Meyer [Mon, 20 Mar 2023 20:06:16 +0000 (21:06 +0100)] 
ssh: Treat exit status 255 as success

2 years agoMerge pull request #1401 from DaanDeMeyer/fixes
Daan De Meyer [Mon, 20 Mar 2023 19:33:00 +0000 (20:33 +0100)] 
Merge pull request #1401 from DaanDeMeyer/fixes

Fixes

2 years agoSSH fixes 1401/head
Daan De Meyer [Mon, 20 Mar 2023 16:33:15 +0000 (17:33 +0100)] 
SSH fixes

- Disable UsePAM to avoid a slow reverse DNS lookup
- Pass environ when runnning ssh to pass SSH_AUTH_SOCK
- Don't use a random CID, instead hash the machine name and take
the first 4 bytes as the CID
- Pull in sshd-keygen.target so the ssh key gets generated on boot.

2 years agoRemove unused code
Daan De Meyer [Mon, 20 Mar 2023 16:32:55 +0000 (17:32 +0100)] 
Remove unused code

2 years agoAdd source target support to extra and skeleton trees
Daan De Meyer [Fri, 17 Mar 2023 14:07:06 +0000 (15:07 +0100)] 
Add source target support to extra and skeleton trees

2 years agoFix caching behavior of several functions
Daan De Meyer [Sun, 19 Mar 2023 13:50:18 +0000 (14:50 +0100)] 
Fix caching behavior of several functions

Follow up for cee0b1b. Forgot to add checking of state.for_cache.
Also configure_dracut() needs to stay cached since we have an option
to cache the initrd.

2 years agoReimplement Ssh option on top of VSock and credentials
Daan De Meyer [Fri, 17 Mar 2023 14:45:14 +0000 (15:45 +0100)] 
Reimplement Ssh option on top of VSock and credentials

SSH key generation is currently broken under unprivileged mkosi.
Instead of trying to make this work, let's rework the SSH feature
entirely.

First, we only really need the SSH option for getting additional
login shells in VMs, so if we drop the requirement that this works
for containers (which can already be accessed with machinectl), we
can use VSock instead of TUN/TAP to get rid of a ton of code.

We also have a much better way of provisioning the public key these
days, add a script "ssh.authorized_keys.root" to mkosi.credentials/
with the following contents:

```
\#!/bin/sh
ssh-add -L
```

So we don't need to do SSH key generation ourselves anymore, we can
just let the user provide their own SSH key via a credential.

2 years agocentos: Add missing base features for ext4 on c8s
Daan De Meyer [Fri, 17 Mar 2023 12:46:52 +0000 (13:46 +0100)] 
centos: Add missing base features for ext4 on c8s

Accidentally only added the ext4 specific features and none of the
base features, let's make sure we add the base features as well,
especially sparse_super is important to make repart's minimize
guessing logic work properly.

2 years agofedora: Default to the minimal authselect profile if authselect is installed
Daan De Meyer [Fri, 17 Mar 2023 10:59:04 +0000 (11:59 +0100)] 
fedora: Default to the minimal authselect profile if authselect is installed

2 years agoSet SYSTEMD_LOG_LEVEL=debug when debug is enabled
Daan De Meyer [Fri, 17 Mar 2023 10:06:29 +0000 (11:06 +0100)] 
Set SYSTEMD_LOG_LEVEL=debug when debug is enabled

2 years agoReplace QemuSMBIOS option with KernelCommandLineExtra
Daan De Meyer [Thu, 16 Mar 2023 07:33:15 +0000 (08:33 +0100)] 
Replace QemuSMBIOS option with KernelCommandLineExtra

We only really added the QemuSMBIOS option to be able to set stub
option for adding extra command line options. Let's replace it by
a less generic option to make it less verbose to use and to allow
passing the added kernel command line arguments to systemd running
in nspawn as well.

2 years agoFix typos
Kian-Meng Ang [Thu, 16 Mar 2023 03:59:53 +0000 (11:59 +0800)] 
Fix typos

Found via `typos --format brief`

2 years agoFix documentation for WorkspaceDirectory
Cornelius Hoffmann [Tue, 14 Mar 2023 19:43:55 +0000 (20:43 +0100)] 
Fix documentation for WorkspaceDirectory

OutputDirectory is not actually being considered as an alternative, just the current working directory.

2 years agoMerge pull request #1387 from Cornelicorn/fix-roothash-unexpected
Jörg Behrmann [Mon, 13 Mar 2023 19:22:50 +0000 (20:22 +0100)] 
Merge pull request #1387 from Cornelicorn/fix-roothash-unexpected

Fix roothash property handling

2 years agoFix roothash property handling 1387/head
Cornelius Hoffmann [Mon, 13 Mar 2023 18:29:31 +0000 (19:29 +0100)] 
Fix roothash property handling

2 years agoMerge pull request #1385 from DaanDeMeyer/credentials-dir
Daan De Meyer [Mon, 13 Mar 2023 12:20:15 +0000 (13:20 +0100)] 
Merge pull request #1385 from DaanDeMeyer/credentials-dir

Extend credentials support

2 years agoAlways pass credentials as base64 encoded 1385/head
Daan De Meyer [Mon, 13 Mar 2023 10:30:48 +0000 (11:30 +0100)] 
Always pass credentials as base64 encoded

Avoid qemu command line shenanigans by just always passing base64
encoded binary credentials.

2 years agoAdd --qemu-smbios option
Daan De Meyer [Sun, 12 Mar 2023 18:56:50 +0000 (19:56 +0100)] 
Add --qemu-smbios option

This can be used to set io.systemd.stub.kernel-cmdline-extra to add
extra kernel cmdline arguments at runtime.

2 years agoExtend credentials support
Daan De Meyer [Sun, 12 Mar 2023 17:23:01 +0000 (18:23 +0100)] 
Extend credentials support

We now also read credentials from mkosi.credentials/. If a file in
mkosi.credentials/ is executable, we run the file and use its output
as the credential.

2 years agoMerge pull request #1365 from 257/gentoo
Daan De Meyer [Mon, 13 Mar 2023 12:09:59 +0000 (13:09 +0100)] 
Merge pull request #1365 from 257/gentoo

gentoo: adapt unprivileged image builds

2 years agoStop mounting package caches into images when running scripts
Daan De Meyer [Sun, 12 Mar 2023 15:54:00 +0000 (16:54 +0100)] 
Stop mounting package caches into images when running scripts

The package manager in the container might be a very different
version than the one running on the host which could cause all
sorts of caching issues. Since we don't need the caches in the
image anymore as we run the package managers outside of the image,
let's stop mounting the cache directory into the image when running
scripts as well.

2 years agoMerge pull request #1383 from DaanDeMeyer/drop-remove-locale
Jörg Behrmann [Mon, 13 Mar 2023 11:52:46 +0000 (12:52 +0100)] 
Merge pull request #1383 from DaanDeMeyer/drop-remove-locale

fedora: Don't unconditionally remove /usr/share/locale

2 years agocentos: Only enable supported ext4 filesystem features on C8S
Daan De Meyer [Fri, 10 Mar 2023 15:07:59 +0000 (16:07 +0100)] 
centos: Only enable supported ext4 filesystem features on C8S

Fixes #1378

2 years agogentoo: adapt unprivileged image builds 1365/head
Paymon MARANDI [Sun, 26 Feb 2023 16:04:26 +0000 (11:04 -0500)] 
gentoo: adapt unprivileged image builds

2 years agoavoid mknod by ignoring char/block devices
Paymon MARANDI [Sun, 5 Mar 2023 14:26:07 +0000 (09:26 -0500)] 
avoid mknod by ignoring char/block devices

2 years agoExpand regular user if not running as root 1383/head
Daan De Meyer [Sun, 12 Mar 2023 14:29:57 +0000 (15:29 +0100)] 
Expand regular user if not running as root

2 years agofedora: Don't unconditionally remove /usr/share/locale
Daan De Meyer [Sun, 12 Mar 2023 14:00:44 +0000 (15:00 +0100)] 
fedora: Don't unconditionally remove /usr/share/locale

2 years agoaction: Make sure bootctl is built
Daan De Meyer [Sat, 11 Mar 2023 12:06:19 +0000 (13:06 +0100)] 
action: Make sure bootctl is built

bootctl is now behind the new bootloader meson option, so let's
enable that and install the required python-pyelftools dependency.

2 years agoCache less stuff
Daan De Meyer [Fri, 10 Mar 2023 13:58:54 +0000 (14:58 +0100)] 
Cache less stuff

Let's not cache steps that are instant to run. This way, these settings
can be changed without having to rebuild from scratch.

2 years agoAdd --initrd option
Daan De Meyer [Wed, 15 Feb 2023 17:09:29 +0000 (18:09 +0100)] 
Add --initrd option

--initrd allows users to provide their own initrds. When used, we'll
automatically create another initrd per kernel containing just the
kernel modules and all the initrds to ukify.

We don't compress the kernel modules initrd as the kernel modules
should be compressed themselves already.

2 years agoUse an overlay for the build image instead of a full image
Daan De Meyer [Mon, 6 Mar 2023 10:09:31 +0000 (11:09 +0100)] 
Use an overlay for the build image instead of a full image

Instead of building a second image for the build image, let's just
make it an overlay for the final image since the only difference
between the two is the list of installed packages. This speeds up
image builds and allows us to simplify the internal logic as well.

2 years agoRemove unused functions
Daan De Meyer [Fri, 10 Mar 2023 12:49:21 +0000 (13:49 +0100)] 
Remove unused functions

2 years agodebian: Disable services in preset by default
Daan De Meyer [Tue, 7 Mar 2023 13:47:12 +0000 (14:47 +0100)] 
debian: Disable services in preset by default

Let's not enable services by default unless explicitly enabled by
a previous preset file.

2 years agoLook for dpkg in PATH
Daan De Meyer [Tue, 7 Mar 2023 11:52:45 +0000 (12:52 +0100)] 
Look for dpkg in PATH

2 years agoRebuild man page
Daan De Meyer [Mon, 6 Mar 2023 20:17:13 +0000 (21:17 +0100)] 
Rebuild man page

2 years agoaction: Build nspawn from source
Daan De Meyer [Mon, 6 Mar 2023 15:28:40 +0000 (16:28 +0100)] 
action: Build nspawn from source

Let's try to get rid of the spurious "Connection timed out" errors
from systemd-nspawn by building the latest version from source.

2 years agoMerge pull request #1370 from DaanDeMeyer/packages-stuff
Daan De Meyer [Mon, 6 Mar 2023 14:42:30 +0000 (15:42 +0100)] 
Merge pull request #1370 from DaanDeMeyer/packages-stuff

Packages related refactors

2 years agoPackages related refactors 1370/head
Daan De Meyer [Mon, 6 Mar 2023 09:32:55 +0000 (10:32 +0100)] 
Packages related refactors

- Use Sequence as the type for passing package lists around
- Add install_packages() method to DistributionInstaller
- Remove install_packages_rpm() and use invoke_dnf() directly

2 years agoarch: Use pathlib more
Daan De Meyer [Mon, 6 Mar 2023 12:04:12 +0000 (13:04 +0100)] 
arch: Use pathlib more

2 years agoMerge pull request #1369 from DaanDeMeyer/path
Daan De Meyer [Sun, 5 Mar 2023 08:35:29 +0000 (09:35 +0100)] 
Merge pull request #1369 from DaanDeMeyer/path

Path fixes

2 years agoAdd fallback paths to PATH in run_workspace_command() 1369/head
Daan De Meyer [Fri, 3 Mar 2023 20:10:01 +0000 (21:10 +0100)] 
Add fallback paths to PATH in run_workspace_command()

Some distros don't configure the appropriate default PATH for their
shell when executed non-interactively, so let's add some fallback
entries ourselves to make sure we can always find the executables we
need.

2 years agoFall back to /usr/lib/systemd/ukify if ukify is not found in PATH
Daan De Meyer [Fri, 3 Mar 2023 19:04:22 +0000 (20:04 +0100)] 
Fall back to /usr/lib/systemd/ukify if ukify is not found in PATH

2 years agoUse image default PATH in run_workspace_command()
Daan De Meyer [Fri, 3 Mar 2023 19:00:37 +0000 (20:00 +0100)] 
Use image default PATH in run_workspace_command()

2 years agoUse union operator instead of env unpacking
Daan De Meyer [Fri, 3 Mar 2023 19:22:57 +0000 (20:22 +0100)] 
Use union operator instead of env unpacking

Avoids issues when the same environment variable is specified more
than once.

2 years agodebian: create /efi mountpoint
Luca Boccassi [Mon, 27 Feb 2023 01:32:16 +0000 (01:32 +0000)] 
debian: create /efi mountpoint

Ensure ESP is mounted on /efi rather than /boot so that dpkg doesn't
attempt to install files on vFAT

2 years agoDrop quotes where not needed
Daan De Meyer [Fri, 24 Feb 2023 15:02:57 +0000 (16:02 +0100)] 
Drop quotes where not needed

2 years agoMerge pull request #1363 from DaanDeMeyer/drop-chdir
Daan De Meyer [Fri, 24 Feb 2023 14:49:49 +0000 (15:49 +0100)] 
Merge pull request #1363 from DaanDeMeyer/drop-chdir

Drop unused chdir() context manager

2 years agoRemove unused xescape() function 1363/head
Daan De Meyer [Fri, 24 Feb 2023 12:50:50 +0000 (13:50 +0100)] 
Remove unused xescape() function

2 years agoSimplify --remove-files
Daan De Meyer [Fri, 24 Feb 2023 12:49:48 +0000 (13:49 +0100)] 
Simplify --remove-files