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

3 years agoDrop Photon support
Daan De Meyer [Sun, 10 Jul 2022 19:03:55 +0000 (21:03 +0200)] 
Drop Photon support

Booting a systemd-nspawn container with a Photon image produced by
mkosi without --netdev waits for 2 minutes until "wait for network
to come online" times out. After logging in there's 3 failed services
in systemctl status. This is without trying to use any of mkosi's
more advanced features.

Bootable images are not supported at all on Photon. Given this and
the broken container support, it's clear that Photon support isn't
really usable at the moment and probably hasn't been for quite a
while (see #664).

Given that Photon has been broken for multiple releases and that
aside form #664, no one has bothered to report concrete issues or
make an attempt to fix the issues aside from a mirror update, this
gives us a pretty clear indication that no one is using or trying
to use mkosi to build Photon images.

Given that none of the existing maintainers are familiar with Photon
(and are likely not interested in doing the effort needed to support
it), let's drop the Photon support from mkosi.

3 years agoForce initializing the partition table every time create_image is called
Michael A Cassaniti [Thu, 21 Jul 2022 08:11:28 +0000 (18:11 +1000)] 
Force initializing the partition table every time create_image is called

When creating the build and final images `args.partition_table` is not
re-initialized which results in a mismatch between the on disk partition
layout and the records in memory.

Also added is some testing for UsrOnly.

3 years agoaction: Install dependencies in action repo checkout
Daan De Meyer [Tue, 26 Jul 2022 20:36:00 +0000 (22:36 +0200)] 
action: Install dependencies in action repo checkout

Since we symlink systemd-nspawn from the build directory to /usr/bin,
if the directory that nspawn was built in is cleaned up (e.g. via
git clean), systemd-nspawn is gone as well. To make it harder to
accidentally delete systemd-nspawn, let's clone and build all the
dependencies we compile from source in the repo checkout of the
action instead of in the repo of the project that's using the mkosi
action.

3 years agoci: Disable gentoo until upstream issue is fixed
Daan De Meyer [Tue, 26 Jul 2022 11:57:41 +0000 (13:57 +0200)] 
ci: Disable gentoo until upstream issue is fixed

3 years agoaction: bump archlinux-keyring to 20220713
Frantisek Sumsal [Tue, 26 Jul 2022 17:36:01 +0000 (19:36 +0200)] 
action: bump archlinux-keyring to 20220713

3 years agoFix debian releases w/o updates and security fixes
Rémi Palancher [Mon, 25 Jul 2022 13:00:55 +0000 (15:00 +0200)] 
Fix debian releases w/o updates and security fixes

Actually Debian testing release has security updates available, metadata
are available at these URL:

http://ftp.debian.org/debian/dists/testing-updates/
http://security.debian.org/debian-security/dists/testing-security/

However, sid (the other name of unstable) does not have additional
security updates repositories, as fixes land in sid main repository
directly.

3 years agoActually apply --source-file-transfer=mount when booting with nspawn
Daan De Meyer [Thu, 21 Jul 2022 10:51:08 +0000 (12:51 +0200)] 
Actually apply --source-file-transfer=mount when booting with nspawn

3 years agoAllow --source-file-transfer-final=mount when booting in nspawn
Daan De Meyer [Fri, 15 Jul 2022 00:36:00 +0000 (02:36 +0200)] 
Allow --source-file-transfer-final=mount when booting in nspawn

3 years agoFixed regression when using UsrOnly during initial install
Michael A Cassaniti [Thu, 21 Jul 2022 01:39:44 +0000 (11:39 +1000)] 
Fixed regression when using UsrOnly during initial install

Several distributions call `run_workspace_command()` during installation and
this now requires the root directory that gets bind mounted in to exist. The
created directory will be removed anyway since it exists under a temporary
workspace.

As an example, the documentation removal when installing a Debian derivative
will fail without this change.

3 years agoMerge pull request #1071 from behrmann/always-arch
Jörg Behrmann [Tue, 19 Jul 2022 14:31:46 +0000 (16:31 +0200)] 
Merge pull request #1071 from behrmann/always-arch

Always define args.architecture and add args.architecture_is_native

3 years agoAlways define args.architecture and add args.architecture_is_native() 1071/head
Joerg Behrmann [Tue, 19 Jul 2022 11:43:31 +0000 (13:43 +0200)] 
Always define args.architecture and add args.architecture_is_native()

3 years agoRemove mkosi.files/ directory
Daan De Meyer [Mon, 18 Jul 2022 16:59:00 +0000 (18:59 +0200)] 
Remove mkosi.files/ directory

These configs are just bitrotting and we don't use them for anything.
Let's drop the directory.

3 years agoFixed running prepare and post-install scripts when UsrOnly is in use
Michael A Cassaniti [Mon, 18 Jul 2022 01:26:28 +0000 (11:26 +1000)] 
Fixed running prepare and post-install scripts when UsrOnly is in use

Includes moving root_home() to backend

3 years agoExplicitly adding partition after creating
Michael A Cassaniti [Mon, 18 Jul 2022 03:55:12 +0000 (13:55 +1000)] 
Explicitly adding partition after creating

This resolves an exception when the partition is explicitly removed later

3 years agoCopy systemd manager conf to initrd if set
Daan De Meyer [Sat, 16 Jul 2022 09:23:59 +0000 (11:23 +0200)] 
Copy systemd manager conf to initrd if set

3 years agoMerge pull request #1063 from DaanDeMeyer/copy-git-dir
Daan De Meyer [Mon, 18 Jul 2022 08:50:50 +0000 (10:50 +0200)] 
Merge pull request #1063 from DaanDeMeyer/copy-git-dir

Handle directories when copying untracked git files

3 years agoPass environment when running kernel-install as well
Daan De Meyer [Sat, 16 Jul 2022 09:26:03 +0000 (11:26 +0200)] 
Pass environment when running kernel-install as well

3 years agoHandle directories when copying untracked git files 1063/head
Daan De Meyer [Sun, 17 Jul 2022 20:13:19 +0000 (22:13 +0200)] 
Handle directories when copying untracked git files

3 years agoUse Path() a bit more in copy_git_files
Daan De Meyer [Sun, 17 Jul 2022 20:07:46 +0000 (22:07 +0200)] 
Use Path() a bit more in copy_git_files

3 years agoDrop bundle package type
Daan De Meyer [Wed, 13 Jul 2022 09:03:33 +0000 (11:03 +0200)] 
Drop bundle package type

Unused now that Clear Linux isn't supported anymore

3 years agoci: pin pyright version
Joerg Behrmann [Wed, 13 Jul 2022 09:02:46 +0000 (11:02 +0200)] 
ci: pin pyright version

3 years agoMerge pull request #1038 from DaanDeMeyer/drop-arch-hooks
Jörg Behrmann [Wed, 13 Jul 2022 09:12:27 +0000 (11:12 +0200)] 
Merge pull request #1038 from DaanDeMeyer/drop-arch-hooks

arch: Drop pacman kernel install hooks

3 years agoMerge pull request #1043 from DaanDeMeyer/fedora-fixes
Jörg Behrmann [Wed, 13 Jul 2022 08:05:01 +0000 (10:05 +0200)] 
Merge pull request #1043 from DaanDeMeyer/fedora-fixes

Fedora fixes

3 years agoarch: Add symlinks to /boot for kernel and initrd when using bios 1038/head
Daan De Meyer [Thu, 7 Jul 2022 18:12:47 +0000 (20:12 +0200)] 
arch: Add symlinks to /boot for kernel and initrd when using bios

Grub doesn't support the boot loader spec on Arch so we have to
symlink vmlinuz and the initrd to some place where grub can find
them.

3 years agoIntroduce boot_directory() function
Daan De Meyer [Thu, 7 Jul 2022 18:12:24 +0000 (20:12 +0200)] 
Introduce boot_directory() function

Deduplicates some repeated logic

3 years agoExplicitly configure kernel-install layout as "bls"
Daan De Meyer [Thu, 7 Jul 2022 18:11:14 +0000 (20:11 +0200)] 
Explicitly configure kernel-install layout as "bls"

3 years agoarch: Drop pacman kernel install hooks
Daan De Meyer [Thu, 7 Jul 2022 13:34:53 +0000 (15:34 +0200)] 
arch: Drop pacman kernel install hooks

We shouldn't special case updates Arch if we don't do so on other
distros either. We don't guarantee availability of a package
manager in generated images, and the only reason Arch images ship
with pacman is because it's part of the base group. This might
change in the future and as such, there's no guarantee that Arch
images will always have pacman. Hence, let's remove the pacman hooks
we install for Arch to bring it more in line with the other distros.

3 years agofedora: Don't modify args.release in install_fedora() 1043/head
Daan De Meyer [Sat, 9 Jul 2022 16:14:28 +0000 (18:14 +0200)] 
fedora: Don't modify args.release in install_fedora()

Causes failures when building incremental images because we change
rawhide-f37 to rawhide which means f36 is picked when building the
final images.

3 years agoAdd Fedora 37 GPG key
Daan De Meyer [Sat, 9 Jul 2022 15:48:05 +0000 (17:48 +0200)] 
Add Fedora 37 GPG key

3 years agoMerge pull request #1046 from DaanDeMeyer/clear-linux-docs
Jörg Behrmann [Tue, 12 Jul 2022 12:55:44 +0000 (14:55 +0200)] 
Merge pull request #1046 from DaanDeMeyer/clear-linux-docs

Add NEWS entry for Clear Linux removal

3 years agoAdd NEWS entry for Clear Linux removal 1046/head
Daan De Meyer [Tue, 12 Jul 2022 12:53:13 +0000 (14:53 +0200)] 
Add NEWS entry for Clear Linux removal

3 years agoMerge pull request #1037 from DaanDeMeyer/drop-clear
Jörg Behrmann [Tue, 12 Jul 2022 12:45:18 +0000 (14:45 +0200)] 
Merge pull request #1037 from DaanDeMeyer/drop-clear

Drop Clear Linux support

3 years agoopensuse: do not attempt to overwrite pam.d/common-auth
Luca Boccassi [Sun, 10 Jul 2022 23:06:50 +0000 (00:06 +0100)] 
opensuse: do not attempt to overwrite pam.d/common-auth

Tumbleweed builds started to fail:

  File /usr/local/lib/python3.10/dist-packages/mkosi/__init__.py, line 3225, in install_opensuse
    shutil.copy2(root / usr/etc/pam.d/common-auth, root / etc/pam.d/common-auth)
  File /usr/lib/python3.10/shutil.py, line 434, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File /usr/lib/python3.10/shutil.py, line 254, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/var/tmp/mkosi-vb08b_gb/root/usr/etc/pam.d/common-auth'

/etc/pam.d/common-auth is already installed now. Do not attempt to
overwrite it if it already exists.

3 years agoMerge pull request #1039 from DaanDeMeyer/fix-docs
Jörg Behrmann [Fri, 8 Jul 2022 09:17:13 +0000 (11:17 +0200)] 
Merge pull request #1039 from DaanDeMeyer/fix-docs

Fix --release docs

3 years agoFix --release docs 1039/head
Daan De Meyer [Thu, 7 Jul 2022 13:40:36 +0000 (15:40 +0200)] 
Fix --release docs

3 years agoDrop Clear Linux support 1037/head
Daan De Meyer [Thu, 7 Jul 2022 12:49:04 +0000 (14:49 +0200)] 
Drop Clear Linux support

Due to lack of a maintainer, and deviating from established practices
almost universally (custom bootloader, custom package manager, ...),
it's not productive to keep support for Clear Linux in mkosi. We have
no idea if it works at all, no idea if something we do is going to
break it, and haven't received any feedback from Clear Linux users
for multiple years. Hence let's drop support for Clear Linux from
mkosi to reduce maintenance costs.

3 years agoaction: Update systemd-container workaround point release
Daan De Meyer [Wed, 6 Jul 2022 10:33:48 +0000 (12:33 +0200)] 
action: Update systemd-container workaround point release

The previous one isn't available anymore but the issue isn't fixed
yet so let's update the pinned version to fix the issue for now.

3 years agoAdd --cache-initrd option
Daan De Meyer [Tue, 5 Jul 2022 13:44:01 +0000 (15:44 +0200)] 
Add --cache-initrd option

Building initrds is slow, let's add an option that allows building
the initrd as part of a cached image so that's it's only built once
and reused in any final images.

3 years agoMake sure we extend the parent env instead of overriding it in run()
Daan De Meyer [Tue, 5 Jul 2022 09:48:39 +0000 (11:48 +0200)] 
Make sure we extend the parent env instead of overriding it in run()

This makes sure any environment variables set in the parent env
don't suddenly stop working when we set our own (e.g. proxy env
variables).

3 years agoMerge pull request #1027 from DaanDeMeyer/enotty
Jörg Behrmann [Mon, 27 Jun 2022 12:47:47 +0000 (14:47 +0200)] 
Merge pull request #1027 from DaanDeMeyer/enotty

Ignore ENOTTY in copy_file_object() and copy_fd()

3 years agoIgnore ENOTTY in copy_file_object() and copy_fd() 1027/head
Daan De Meyer [Mon, 27 Jun 2022 12:29:27 +0000 (14:29 +0200)] 
Ignore ENOTTY in copy_file_object() and copy_fd()

This is another possible error that can be returned when FICLONE is
not supported.

3 years agoaction: Pin systemd-container version
Daan De Meyer [Fri, 24 Jun 2022 10:04:35 +0000 (12:04 +0200)] 
action: Pin systemd-container version

A faulty metadata update in Github Actions azure mirror for Ubuntu
is causing issues with unmet systemd-container versions. Let's pin
the systemd-container version as a workaround until the issue is
fixed.

3 years agoVersion 13 v13
Zbigniew Jędrzejewski-Szmek [Tue, 21 Jun 2022 17:26:46 +0000 (19:26 +0200)] 
Version 13

3 years agoNEWS: reformat
Zbigniew Jędrzejewski-Szmek [Tue, 21 Jun 2022 17:25:12 +0000 (19:25 +0200)] 
NEWS: reformat

3 years agoUpdate NEWS
Daan De Meyer [Tue, 21 Jun 2022 13:34:21 +0000 (15:34 +0200)] 
Update NEWS

3 years agoaction: Add stanzas to copy sources to action mkosi config
Daan De Meyer [Mon, 20 Jun 2022 19:21:20 +0000 (21:21 +0200)] 
action: Add stanzas to copy sources to action mkosi config

To be able to run the development version of mkosi in a ubuntu VM,
let's copy the sources into the mkosi config we use to test the
action setup logic.

3 years agoAdd support for qemu's direct Linux boot
Daan De Meyer [Mon, 7 Mar 2022 16:10:41 +0000 (16:10 +0000)] 
Add support for qemu's direct Linux boot

We add a "linux" boot protocol that, when enabled, instructs mkosi
to extract the kernel image, initrd and kernel cmdline out of the
image when building it.

On top, we add a --qemu-boot option that takes one of the possible
values from --boot-protocols and instructs qemu to use that boot
protocol. In case of the new "linux" boot protocol, we use qemu's
-kernel, -initrd and -append options to do a direct Linux kernel
boot.

Being able to do direct Linux boots with qemu is a prerequisite for
booting images of architectures that don't support UEFI in qemu. It's
also faster than booting in UEFI mode which is useful when iterating
and not working on the bootloader.

3 years agoMerge pull request #1004 from keszybz/handle-rpmdb-move
Daan De Meyer [Mon, 20 Jun 2022 21:08:32 +0000 (23:08 +0200)] 
Merge pull request #1004 from keszybz/handle-rpmdb-move

Handle rpmdb move

3 years agomkosi/manifest: allow errors from rpm/dpkg 1004/head
Zbigniew Jędrzejewski-Szmek [Mon, 20 Jun 2022 19:10:13 +0000 (21:10 +0200)] 
mkosi/manifest: allow errors from rpm/dpkg