]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
2 years agoVerity: rename split files to match what systemd expects 1153/head
Luca Boccassi [Sat, 27 Aug 2022 23:11:13 +0000 (00:11 +0100)] 
Verity: rename split files to match what systemd expects

foo.raw means systemd searches automatically for foo.verity, foo.roothash/usrhash,
foo.roothash/usrhash.p7s so make the output match these existing
expectations

      Output Split Root FS: /home/luca/git/mkosi/mkosi.output/debian~unstable/image.usr.raw.zstd
       Output Split Verity: /home/luca/git/mkosi/mkosi.output/debian~unstable/image.usr.verity.zstd
  Output Split Verity Sig.: /home/luca/git/mkosi/mkosi.output/debian~unstable/image.usr.usrhash.p7s.zstd

2 years agoVerity: signatures should be named .p7s, not .verity-sig
Luca Boccassi [Sat, 27 Aug 2022 23:06:21 +0000 (00:06 +0100)] 
Verity: signatures should be named .p7s, not .verity-sig

This is what systemd and other tools expect.

2 years agoCompression: do not append '.False' as suffix to verity files when compression is...
Luca Boccassi [Sat, 27 Aug 2022 23:05:16 +0000 (00:05 +0100)] 
Compression: do not append '.False' as suffix to verity files when compression is disabled

      Output Split Root FS: /home/luca/git/mkosi/mkosi.output/debian~unstable/image.root.False
       Output Split Verity: /home/luca/git/mkosi/mkosi.output/debian~unstable/image.verity.False
  Output Split Verity Sig.: /home/luca/git/mkosi/mkosi.output/debian~unstable/image.verity-sig.False

2 years agoMerge pull request #1132 from bluca/verbatim_mirror_deb
Frantisek Sumsal [Tue, 30 Aug 2022 07:15:17 +0000 (07:15 +0000)] 
Merge pull request #1132 from bluca/verbatim_mirror_deb

Change --use-mirror-verbatim to --local-mirror, support Debian/Arch/SUSE

2 years agofedora: Automatically pick latest rawhide release
Daan De Meyer [Mon, 29 Aug 2022 19:54:43 +0000 (21:54 +0200)] 
fedora: Automatically pick latest rawhide release

We can automatically get the key for the latest rawhide now as there's
a symlink we can use to get it. For remote GPG keys, the existing
mechanism can be used.

2 years agodebian/ubuntu: actually use args.mirror 1132/head
Luca Boccassi [Tue, 23 Aug 2022 00:08:58 +0000 (01:08 +0100)] 
debian/ubuntu: actually use args.mirror

It was configured but never actually used

2 years agodebian: support separate systemd-resolved package
Luca Boccassi [Sun, 21 Aug 2022 11:23:23 +0000 (12:23 +0100)] 
debian: support separate systemd-resolved package

2 years agoAdd --repository-key-check, enabled by default
Luca Boccassi [Sun, 21 Aug 2022 11:23:14 +0000 (12:23 +0100)] 
Add --repository-key-check, enabled by default

Allows disabling repository key/signatures checks when
building with offline mirrors

2 years agoRename use_mirror_verbatim to local_mirror, support Debian/Arch/SUSE
Luca Boccassi [Sun, 21 Aug 2022 11:20:36 +0000 (12:20 +0100)] 
Rename use_mirror_verbatim to local_mirror, support Debian/Arch/SUSE

With some distros the mirror has to be configured inside the image
(apt, zypper), so having a boolean flag is not enough.
We need to use the local mirror only for the local image build, but
configure the actual remote repositories in the image configuration,
so that it can be used once installed.

2 years agodebian/ubuntu: Ignore apt config from the host system
Daan De Meyer [Mon, 29 Aug 2022 17:19:02 +0000 (19:19 +0200)] 
debian/ubuntu: Ignore apt config from the host system

We only want to consider the apt config from the target system.
Because apt is rather inflexible and only parses the Dir option we
pass via the CLI after parsing all the config files from the host,
we have to resort to bind mounting an empty directory over /etc/apt
on the host to prevent it from reading configuration from there.

2 years agodebian/ubuntu: Run apt/dpkg on the host instead of in the root
Daan De Meyer [Mon, 29 Aug 2022 12:36:26 +0000 (14:36 +0200)] 
debian/ubuntu: Run apt/dpkg on the host instead of in the root

Similar to the other package managers, run apt/dpkg on the host
instead of in the container. This should allow us to implement
--repository-directory for apt as well and brings it more in line
with the other package managers.

2 years agoMerge pull request #1152 from DaanDeMeyer/drop-stuff
Daan De Meyer [Mon, 29 Aug 2022 11:32:27 +0000 (13:32 +0200)] 
Merge pull request #1152 from DaanDeMeyer/drop-stuff

Drop CentOS 7 and BIOS/grub support

2 years agoMerge pull request #1146 from DaanDeMeyer/loop-device-fixes
Daan De Meyer [Mon, 29 Aug 2022 11:31:26 +0000 (13:31 +0200)] 
Merge pull request #1146 from DaanDeMeyer/loop-device-fixes

Loop device fixes

2 years agoLock loop device after acquiring 1146/head
Daan De Meyer [Mon, 29 Aug 2022 10:09:34 +0000 (12:09 +0200)] 
Lock loop device after acquiring

Instructs udevd to not interfere with the device while we're working
on it.

2 years agoRefactor image attaching
Daan De Meyer [Mon, 22 Aug 2022 13:12:53 +0000 (15:12 +0200)] 
Refactor image attaching

Additional ensurance that udev won't try to touch the device while
we're operating on it.

2 years agoAdd syscall machinery to call BLKRRPART and use it
Daan De Meyer [Sun, 21 Aug 2022 10:50:56 +0000 (12:50 +0200)] 
Add syscall machinery to call BLKRRPART and use it

2 years agoRename blkpg functions
Daan De Meyer [Sun, 21 Aug 2022 10:46:31 +0000 (12:46 +0200)] 
Rename blkpg functions

Let's rename these to be named after the operation they execute

2 years agoDrop BIOS/grub support 1152/head
Daan De Meyer [Sat, 27 Aug 2022 09:33:09 +0000 (11:33 +0200)] 
Drop BIOS/grub support

As discussed in the last biweekly, there's no interest in maintaining
BIOS support in mkosi. Given the non-trivial amount of time that has to
be spent to keep BIOS/grub working as we develop new features, we'd rather
drop support than keep maintaining it.

Users that are still interested in BIOS support can fork mkosi at any point
before BIOS/grub support was removed.

2 years agoDrop CentOS 7 support
Daan De Meyer [Sat, 27 Aug 2022 09:03:57 +0000 (11:03 +0200)] 
Drop CentOS 7 support

Dropping CentOS 7 allows us to unify on systemd-boot as the bootloader
for EFI systems. Being able to assume systemd-boot as the bootloader on
EFI simplifies our support matrix and sets the stage for removing grub
support completely when we remove BIOS support in a future commit.

2 years agoarch: Modify SigLevel to pacman default
Daan De Meyer [Tue, 23 Aug 2022 13:04:49 +0000 (15:04 +0200)] 
arch: Modify SigLevel to pacman default

Let's use the same default as pacman uses in Arch

3 years agotar/cpio: fix compression options handling
Luca Boccassi [Wed, 24 Aug 2022 22:34:36 +0000 (23:34 +0100)] 
tar/cpio: fix compression options handling

Let users build uncompressed tarballs. Also take into account the
usual algorithm to determine the compression type for cpio.
Defaults are unchanged.

3 years agomanifest: include metadata about the image itself
Luca Boccassi [Sun, 21 Aug 2022 20:19:09 +0000 (21:19 +0100)] 
manifest: include metadata about the image itself

3 years agoInstall opensuse base locale package
Daan De Meyer [Mon, 22 Aug 2022 13:13:47 +0000 (15:13 +0200)] 
Install opensuse base locale package

This provides C.UTF-8 on opensuse.

3 years agoMake Debian kernel package code more prose-like
Joerg Behrmann [Sun, 21 Aug 2022 10:52:45 +0000 (12:52 +0200)] 
Make Debian kernel package code more prose-like

3 years agoMerge pull request #1142 from DaanDeMeyer/sfdisk-remove-partitions
Jörg Behrmann [Sun, 21 Aug 2022 12:35:56 +0000 (14:35 +0200)] 
Merge pull request #1142 from DaanDeMeyer/sfdisk-remove-partitions

Remove all existing partition devices before running sfdisk

3 years agoDrop --no-tell-kernel from sfdisk command line 1142/head
Daan De Meyer [Sun, 21 Aug 2022 10:02:53 +0000 (12:02 +0200)] 
Drop --no-tell-kernel from sfdisk command line

3 years agoMerge pull request #1140 from bluca/debian_kernel_arch
Daan De Meyer [Sun, 21 Aug 2022 09:48:30 +0000 (11:48 +0200)] 
Merge pull request #1140 from bluca/debian_kernel_arch

Fixes for kernel/efi multi-architecture build/boot

3 years agoRemove all existing partition devices before running sfdisk
Daan De Meyer [Sun, 21 Aug 2022 07:41:22 +0000 (09:41 +0200)] 
Remove all existing partition devices before running sfdisk

Hopefully helps to avoid race conditions in loop device handling.

3 years agoopensuse: Install systemd-network when --netdev is used
Daan De Meyer [Sat, 20 Aug 2022 21:42:05 +0000 (23:42 +0200)] 
opensuse: Install systemd-network when --netdev is used

3 years agoefi: add more arch-specific locations for OVMF firmware files and use args.architecture 1140/head
Luca Boccassi [Sat, 20 Aug 2022 15:47:52 +0000 (16:47 +0100)] 
efi: add more arch-specific locations for OVMF firmware files and use args.architecture

https://packages.debian.org/sid/all/ovmf/filelist
https://packages.debian.org/sid/all/ovmf-ia32/filelist
https://packages.debian.org/sid/all/qemu-efi-aarch64/filelist
https://packages.debian.org/sid/all/qemu-efi-arm/filelist

3 years agoboot: do not hard-code EFI stub architecture
Luca Boccassi [Sat, 20 Aug 2022 15:03:58 +0000 (16:03 +0100)] 
boot: do not hard-code EFI stub architecture

3 years agodebian: do not hard-code kernel architecture
Luca Boccassi [Sat, 20 Aug 2022 01:44:36 +0000 (02:44 +0100)] 
debian: do not hard-code kernel architecture

3 years agoAlways use a pseudo-tty when boot verb is used
Daan De Meyer [Fri, 19 Aug 2022 12:03:35 +0000 (14:03 +0200)] 
Always use a pseudo-tty when boot verb is used

A container where we boot systemd is not useful without /dev/console
in it. If --pipe is used, /dev/console is not available. To make sure
/dev/console is always available when we're booting the container,
only apply the --pipe logic when booting in shell mode.

Fixes missing console output when booting a container image in a
non-interactive shell script.

3 years agocentos: Add check that --netdev is always used with EPEL variants
Daan De Meyer [Fri, 19 Aug 2022 10:37:16 +0000 (12:37 +0200)] 
centos: Add check that --netdev is always used with EPEL variants

3 years agoMerge pull request #1135 from mcassaniti/compression-suffix
Jörg Behrmann [Fri, 19 Aug 2022 08:38:58 +0000 (10:38 +0200)] 
Merge pull request #1135 from mcassaniti/compression-suffix

Fixed compression suffix

3 years agoMerge pull request #1131 from DaanDeMeyer/drop-blkdiscard
Jörg Behrmann [Fri, 19 Aug 2022 07:51:03 +0000 (09:51 +0200)] 
Merge pull request #1131 from DaanDeMeyer/drop-blkdiscard

Drop call to blkdiscard

3 years agoFixed compression suffix 1135/head
Michael A Cassaniti [Fri, 19 Aug 2022 03:24:02 +0000 (13:24 +1000)] 
Fixed compression suffix

3 years agoMerge pull request #1130 from DaanDeMeyer/syscall
Daan De Meyer [Thu, 18 Aug 2022 22:35:42 +0000 (00:35 +0200)] 
Merge pull request #1130 from DaanDeMeyer/syscall

Replace blockdev --reread-pt by manually adding partitions

3 years agoDrop call to blkdiscard 1131/head
Daan De Meyer [Thu, 18 Aug 2022 22:09:12 +0000 (00:09 +0200)] 
Drop call to blkdiscard

This was originally added to make a sparse copy with dd work right
after the discard. Since we don't do the copy with dd anymore,
we shouldn't need to do the blkdiscard anymore either, so let's
drop it.

3 years agoReplace blockdev --reread-pt by manually adding partitions 1130/head
Daan De Meyer [Thu, 18 Aug 2022 20:51:53 +0000 (22:51 +0200)] 
Replace blockdev --reread-pt by manually adding partitions

Instead of relying on blockdev, let's use our own infra to make
sure all partitions have appeared after we modify the partition
table. This should hopefully reduce the number of race conditions
involved with modifying the partition table and loop devices.

3 years agoMove syscall related stuff to syscall.py
Daan De Meyer [Thu, 18 Aug 2022 20:40:06 +0000 (22:40 +0200)] 
Move syscall related stuff to syscall.py

3 years agoDrop time include from backend
Daan De Meyer [Thu, 18 Aug 2022 20:48:07 +0000 (22:48 +0200)] 
Drop time include from backend

3 years agoopensuse: Check for pam files in /usr/lib as well
Daan De Meyer [Thu, 18 Aug 2022 13:15:32 +0000 (15:15 +0200)] 
opensuse: Check for pam files in /usr/lib as well

pam config files in opensuse moved from /usr/etc/pam.d to
/usr/lib/pam.d. Let's reflect that in mkosi as well.

See https://github.com/systemd/mkosi/issues/1128

3 years agoAdded support for generating an XFS UsrOnly root
Michael A Cassaniti [Mon, 18 Jul 2022 04:10:20 +0000 (14:10 +1000)] 
Added support for generating an XFS UsrOnly root

3 years agoMerge pull request #1126 from bluca/plain_mirror
Jörg Behrmann [Thu, 18 Aug 2022 12:23:19 +0000 (14:23 +0200)] 
Merge pull request #1126 from bluca/plain_mirror

Add --use-mirror-verbatim=[bool] option

3 years agoMerge pull request #1127 from bluca/squashfs_raw
Jörg Behrmann [Thu, 18 Aug 2022 12:22:05 +0000 (14:22 +0200)] 
Merge pull request #1127 from bluca/squashfs_raw

name squashfs images as .raw too

3 years agoSupport execution using pkexec instead of sudo
Daan De Meyer [Wed, 17 Aug 2022 15:06:59 +0000 (17:06 +0200)] 
Support execution using pkexec instead of sudo

3 years agoAdd --use-mirror-=verbatim=[bool] option 1126/head
Luca Boccassi [Wed, 17 Aug 2022 23:53:41 +0000 (00:53 +0100)] 
Add --use-mirror-=verbatim=[bool] option

Allows to configure a single plain mirror, without the os/updates/media
repositories for RPM distros. Necessary to be able to perform fully
offline builds when the build system provides the required packages
configured in a local directory.

3 years agoUse chunked reads when inserting partition
Michael A Cassaniti [Wed, 17 Aug 2022 05:52:53 +0000 (15:52 +1000)] 
Use chunked reads when inserting partition

3 years agoname squashfs images as .raw too 1127/head
Luca Boccassi [Thu, 18 Aug 2022 01:03:20 +0000 (02:03 +0100)] 
name squashfs images as .raw too

This is expected by systemd when used with RootImage= and friends

3 years agoMerge pull request #1122 from Foxboron/morten/dpkg-host
Jörg Behrmann [Tue, 16 Aug 2022 19:24:53 +0000 (21:24 +0200)] 
Merge pull request #1122 from Foxboron/morten/dpkg-host

mkosi/manifest: move dpkg-query to run_workspace_command

3 years agoMerge pull request #1119 from Foxboron/morten/pacman-manifest
Jörg Behrmann [Tue, 16 Aug 2022 16:14:42 +0000 (18:14 +0200)] 
Merge pull request #1119 from Foxboron/morten/pacman-manifest

Support manifest files for pacman

3 years agoci(lint): add shell linter - Differential ShellCheck
Jan Macku [Tue, 16 Aug 2022 12:20:25 +0000 (14:20 +0200)] 
ci(lint): add shell linter - Differential ShellCheck

It performs differential ShellCheck scans and report results directly in
pull request.

documentation:
https://github.com/redhat-plumbers-in-action/differential-shellcheck

3 years agomkosi/manifest: move dpkg-query to run_workspace_command 1122/head
Morten Linderud [Tue, 16 Aug 2022 13:52:39 +0000 (15:52 +0200)] 
mkosi/manifest: move dpkg-query to run_workspace_command

Signed-off-by: Morten Linderud <morten.linderud@mullvad.net>
3 years agomkosi/manifest: Implement support for pacman packages 1119/head
Morten Linderud [Mon, 15 Aug 2022 12:39:02 +0000 (14:39 +0200)] 
mkosi/manifest: Implement support for pacman packages

Signed-off-by: Morten Linderud <morten.linderud@mullvad.net>
3 years agoWrite uninitialized to /etc/machine-id when resetting
Daan De Meyer [Mon, 15 Aug 2022 12:07:06 +0000 (14:07 +0200)] 
Write uninitialized to /etc/machine-id when resetting

This makes sure the firstboot logic is triggered when the image is
booted for the first time.

3 years agoMerge pull request #1116 from Foxboron/morten/arch-mirror
Jörg Behrmann [Mon, 15 Aug 2022 11:38:51 +0000 (13:38 +0200)] 
Merge pull request #1116 from Foxboron/morten/arch-mirror

Set default geo mirror for Arch Linux

3 years agoarch: remove mirror selection code 1116/head
Morten Linderud [Mon, 15 Aug 2022 09:39:50 +0000 (11:39 +0200)] 
arch: remove mirror selection code

Signed-off-by: Morten Linderud <morten.linderud@mullvad.net>
3 years agoSet default geo mirror for Arch Linux
Morten Linderud [Fri, 12 Aug 2022 13:08:59 +0000 (15:08 +0200)] 
Set default geo mirror for Arch Linux

Signed-off-by: Morten Linderud <morten.linderud@mullvad.net>
3 years agoAlways use a distro~release subdirectory for output, cache, builddir
Daan De Meyer [Tue, 9 Aug 2022 18:18:12 +0000 (20:18 +0200)] 
Always use a distro~release subdirectory for output, cache, builddir

Let's be consistent and always use a distro~release subdirectory for
these directories, instead of only using these when the correct directory
exists in the directory mkosi is invoked from.

3 years agoSupport ListAction with type=Path
Daan De Meyer [Mon, 8 Aug 2022 13:41:14 +0000 (15:41 +0200)] 
Support ListAction with type=Path

We don't yet properly process multiple values of type Path such
as in --extra-tree. This commit updates ListAction to support such
cases.

3 years agoRefactor mount functions to use context managers
Daan De Meyer [Mon, 18 Jul 2022 20:46:29 +0000 (22:46 +0200)] 
Refactor mount functions to use context managers

Let's have a single mount() function that's a context manager and
build everything else on top of that. To handle the non-fixed amounts
of context managers, we use ExitStack().

3 years agoAdded boot counting to unified kernels if /etc/kernel/tries exists
Michael A Cassaniti [Thu, 28 Jul 2022 07:40:55 +0000 (17:40 +1000)] 
Added boot counting to unified kernels if /etc/kernel/tries exists

See https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/ for details on boot counting

3 years agoFix manifest creation when running on Bionic
Luca Boccassi [Fri, 5 Aug 2022 22:08:14 +0000 (23:08 +0100)] 
Fix manifest creation when running on Bionic

Very old dpkg doesn't have the db-fsys:Last-Modified field
so it errors out. Skip creating manifests for sysext when
building on such old distros. Only affects Bionic right now.

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

3 years agoAdd support for mkosi.conf and mkosi.conf.d configuration files/dirs
Daan De Meyer [Tue, 2 Aug 2022 12:12:37 +0000 (14:12 +0200)] 
Add support for mkosi.conf and mkosi.conf.d configuration files/dirs

"default" is a rather unintuitive file extension for a config file.
Let's prefer the more widespread "conf" file extension instead. We'll
now look for mkosi.conf and mkosi.conf.d in addition to the already
supported mkosi.default and mkosi.default.d.

We also rename the --default option to --config.

All mentions of mkosi.default, mkosi.default.d and --default in the
docs have been replaced with their conf counterpart.

3 years agoSkip setting kernel root cmdline parameter for UsrOnly with ImageID and without verity
Michael A Cassaniti [Wed, 27 Jul 2022 04:22:15 +0000 (14:22 +1000)] 
Skip setting kernel root cmdline parameter for UsrOnly with ImageID and without verity

When an image is built as a /usr only image and does not use verity, the kernel
command line should (and already does) contain the parameter `mount.usr`. It
should not contain a root parameter since `systemd-repart` and
`systemd-gpt-auto-generator` will take care of generating and mounting the root
partition.

Without this change the root partition label used on the kernel command line
will be invalid.

3 years agoAdd compat with older nspawn that doesn't know --rlimit
Daan De Meyer [Thu, 4 Aug 2022 12:54:00 +0000 (14:54 +0200)] 
Add compat with older nspawn that doesn't know --rlimit

Required for compat with Ubuntu 18.04

3 years agoFixed building when skipping final phase
Michael A Cassaniti [Fri, 22 Jul 2022 09:49:06 +0000 (19:49 +1000)] 
Fixed building when skipping final phase

When running using a build script and the option `--skip-final-phase` is given,
no image is generated causing an issue linking the image. This change skips any
attempts to link the image or print the resulting output size.

3 years agocentos: Fix centos mirror
Daan De Meyer [Tue, 2 Aug 2022 18:07:53 +0000 (20:07 +0200)] 
centos: Fix centos mirror

mirrorlist.centos.org/ doesn't do HTTPS yet so let's revert back
to HTTP.

3 years agoaction: Download archlinux-keyring from Michel Salim's kernel-utils PPA
Daan De Meyer [Thu, 28 Jul 2022 16:43:23 +0000 (18:43 +0200)] 
action: Download archlinux-keyring from Michel Salim's kernel-utils PPA

Pending availability in Ubuntu itself, let's download the archlinux-keyring
from the kernel-utils PPA maintained by Michel Salim. This means we can
update the Archlinux keyring without having to commit to mkosi itself
which means that users of the action will pick up the keyring updates
automatically.

3 years agoaction: Drop vm-vt workaround
Daan De Meyer [Mon, 1 Aug 2022 09:23:16 +0000 (11:23 +0200)] 
action: Drop vm-vt workaround

Jammy's systemd version is recent enough that the file is there
already and we don't need to add it ourselves anymore.

3 years agoRevert "action: Pin systemd-container version"
Daan De Meyer [Mon, 1 Aug 2022 09:00:04 +0000 (11:00 +0200)] 
Revert "action: Pin systemd-container version"

This reverts commit fe8f7849ff32956963bc4bb9f7c6d72614b89753.

apt 2.4.6 was released to jammy-updates which carries the necessary
fixes that make this workaround unnecessary.

3 years agoMerge pull request #1080 from jre21/qemu
Daan De Meyer [Mon, 1 Aug 2022 08:12:31 +0000 (10:12 +0200)] 
Merge pull request #1080 from jre21/qemu

Allow running qemu as an unprivileged user

3 years agoCI: Stop on first test failure
Daan De Meyer [Thu, 28 Jul 2022 14:00:26 +0000 (16:00 +0200)] 
CI: Stop on first test failure

When one test fails, usually all of them fail, which makes the
output hard to digest, so let's configure pytest to stop on the
first test failure.

3 years agoMove debian/ubuntu locale symlink logic to install function
Daan De Meyer [Fri, 15 Jul 2022 20:04:36 +0000 (22:04 +0200)] 
Move debian/ubuntu locale symlink logic to install function

Let's get rid of another distribution check by simply creating the
symlink in the install function.

3 years agoOnly check whether a format can be booted if verb == qemu
Daan De Meyer [Wed, 27 Jul 2022 18:02:16 +0000 (20:02 +0200)] 
Only check whether a format can be booted if verb == qemu

We can still build these images without any problems, we just can't
boot them, so let's still allow building the images, just not booting
them.

3 years agoIgnore EBUSY on partition removal
Daan De Meyer [Thu, 28 Jul 2022 10:30:59 +0000 (12:30 +0200)] 
Ignore EBUSY on partition removal

This can happen just after inserting a partition, probably because
udev starts operating on a device which makes us unable to remove
the partition, let's ignore EBUSY as a workaround until we get a
proper fix

3 years agoEmit configfile arguments in key=val format 1080/head
Jacob Emmert-Aronson [Wed, 27 Jul 2022 04:43:32 +0000 (21:43 -0700)] 
Emit configfile arguments in key=val format

This ensures that argparse treats all values read from configfiles as
explicit arguments associated with their respective keys, rather than
attempting to parse them as options in their options in their own right.

3 years agoDon't remove duplicates from QemuArgs
Jacob Emmert-Aronson [Sun, 24 Jul 2022 05:23:21 +0000 (22:23 -0700)] 
Don't remove duplicates from QemuArgs

Repeated arguments are valid in a QEMU command line (for example,
setting multiple `-device` flags to attach several devices to the VM),
and removing these duplicate tokens breaks the QEMU invocation.

3 years agoUse qemu's user-mode networking when not running as root
Jacob Emmert-Aronson [Sun, 24 Jul 2022 03:55:48 +0000 (20:55 -0700)] 
Use qemu's user-mode networking when not running as root

3 years agoAllow running qemu as an unprivileged user
Jacob Emmert-Aronson [Sat, 23 Jul 2022 04:34:58 +0000 (21:34 -0700)] 
Allow running qemu as an unprivileged user

3 years agoInclude any files ending in '.install' in package data
Michael A Cassaniti [Wed, 27 Jul 2022 22:56:57 +0000 (08:56 +1000)] 
Include any files ending in '.install' in package data

This makes sure the new `dpkg-reconfigure-dracut.install` file under resources
gets included as package data.

3 years agoMerge pull request #1060 from DaanDeMeyer/debian-kernel-install-workaround
Jörg Behrmann [Wed, 27 Jul 2022 19:08:20 +0000 (21:08 +0200)] 
Merge pull request #1060 from DaanDeMeyer/debian-kernel-install-workaround

Move debian/ubuntu kernel-install workaround to a kernel-install script

3 years agoOnly pass arguments to build script when verb is "build"
Daan De Meyer [Fri, 15 Jul 2022 00:37:48 +0000 (02:37 +0200)] 
Only pass arguments to build script when verb is "build"

When we're building the image because it's required for another verb,
any passed arguments are most likely intended for the target verb,
and not for "build", so don't add them in that case.

3 years agoMerge pull request #1036 from DaanDeMeyer/no-release
Daan De Meyer [Wed, 27 Jul 2022 17:56:19 +0000 (19:56 +0200)] 
Merge pull request #1036 from DaanDeMeyer/no-release

Centos + variants improvements

3 years agoPass kernel args to systemd when booting in nspawn
Daan De Meyer [Fri, 15 Jul 2022 00:39:12 +0000 (02:39 +0200)] 
Pass kernel args to systemd when booting in nspawn

When booting systemd in systemd-nspawn, additional arguments can
be passed to systemd via nspawn's command line. The arguments get
interpreted by systemd in the container as if they were kernel
command line args.

To take advantage of this, let's pass any configured kernel command
line arguments to systemd running in nspawn as well. For example,
this allows using systemd.setenv to set environment variables as
early as possible for both qemu VMs and nspawn containers.

3 years agoMove debian/ubuntu kernel-install workaround to a kernel-install script 1060/head
Daan De Meyer [Fri, 15 Jul 2022 21:32:16 +0000 (23:32 +0200)] 
Move debian/ubuntu kernel-install workaround to a kernel-install script

Instead of manually running dpkg-reconfigure dracut in mkosi. Let's
drop in a kernel install script that runs dpkg-reconfigure dracut. We
can install this script as part of the install function and get rid
of a distribution specific check.

3 years agoReduce duplication in centos variant repo setup 1036/head
Daan De Meyer [Thu, 7 Jul 2022 23:22:09 +0000 (01:22 +0200)] 
Reduce duplication in centos variant repo setup

3 years agoDrop HighAvailability repo for almalinux
Daan De Meyer [Thu, 7 Jul 2022 22:41:51 +0000 (00:41 +0200)] 
Drop HighAvailability repo for almalinux

Very niche repo for a very specific use case. Let's not enable it
by default for Alma Linux images. It can always be added back via
--repository-directory if needed.

3 years agoDrop centosplus repos and variants
Daan De Meyer [Thu, 7 Jul 2022 22:37:04 +0000 (00:37 +0200)] 
Drop centosplus repos and variants

These are primarily for the plus kernel, which isn't really maintained
so let's drop them from the centos variants repos list.

3 years agoDrop repo name field
Daan De Meyer [Thu, 7 Jul 2022 22:20:51 +0000 (00:20 +0200)] 
Drop repo name field

The configured repos don't end up in the actual image, so we don't
need to bother with a fancy name for the repos, let's just use the
repo ID instead and get rid of a bunch of cruft.

3 years agoUse the same install function for all centos variants
Daan De Meyer [Thu, 7 Jul 2022 22:12:12 +0000 (00:12 +0200)] 
Use the same install function for all centos variants

All the centos variants have different repos but install the
same packages, so let's have them all use the same install
function.

3 years agoIntroduce is_centos_variant() helper
Daan De Meyer [Thu, 7 Jul 2022 21:52:19 +0000 (23:52 +0200)] 
Introduce is_centos_variant() helper

3 years agoStop installing -release packages explicitly
Daan De Meyer [Thu, 7 Jul 2022 12:30:37 +0000 (14:30 +0200)] 
Stop installing -release packages explicitly

These get pulled in as dependencies by default so no need to install
them explicitly.

3 years agoUse distro~release subdirectories under mkosi.output/mkosi.builddir
Daan De Meyer [Tue, 19 Jul 2022 12:11:06 +0000 (14:11 +0200)] 
Use distro~release subdirectories under mkosi.output/mkosi.builddir

Currently, when using incremental mode, building for a different
release or distribution means throwing away the cached images for
the previous distribution or release used unless each distro/release
combo is configured with an explicit output directory. Let's try to
be smarter here, by using the same logic as used for the cache path.
We create distro~release subdirectory under mkosi.output/ and use that
as the output directory. This makes sure cached images stay intact
even if we build for a different distribution. The same reasoning
applies to mkosi.builddir/.

This will end up using slightly more disk space when building for many
different distros when using mkosi.output/, but this should be a good
tradeoff to make regardless. If looking to regain disk space, a user
simply has to remove the output or build subdirectory for the distros
they're not interested in keeping.

3 years agoarch: Move bios kernel-install workaround to install function
Daan De Meyer [Fri, 15 Jul 2022 21:01:46 +0000 (23:01 +0200)] 
arch: Move bios kernel-install workaround to install function

We can already create the symlinks early in the install function.
This removes one more distribution specific check.

3 years agoMake grub/grub2 check distribution independent
Daan De Meyer [Fri, 15 Jul 2022 20:34:06 +0000 (22:34 +0200)] 
Make grub/grub2 check distribution independent

Check if grub-install exists instead of hardcoding distributions

3 years agoMove machine ID directory in /boot workaround to install function
Daan De Meyer [Fri, 15 Jul 2022 20:16:25 +0000 (22:16 +0200)] 
Move machine ID directory in /boot workaround to install function

We can create the directory in the ubuntu/debian install function
and get rid of one more distribution check.

3 years agoMove configure_dracut() call outside of install functions
Daan De Meyer [Fri, 15 Jul 2022 20:12:26 +0000 (22:12 +0200)] 
Move configure_dracut() call outside of install functions

Every distro uses dracut now so let's call configure_dracut()
outside of the install functions.

3 years agoRemove dracut uefi_stub configuration
Daan De Meyer [Fri, 15 Jul 2022 20:03:07 +0000 (22:03 +0200)] 
Remove dracut uefi_stub configuration

We don't use dracut's --uefi option anymore so we don't need this
config anymore either.