]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
22 months agoDon't store default initrd artifacts in output directory 1995/head
Daan De Meyer [Thu, 19 Oct 2023 10:27:43 +0000 (12:27 +0200)] 
Don't store default initrd artifacts in output directory

We don't use these for anything and the initrd can already be
accessed using the split initrd, so let's not store the default
initrd artifacts in the output directory.

22 months agoPut KernelCommandLine= in the right section
Daan De Meyer [Thu, 19 Oct 2023 10:27:30 +0000 (12:27 +0200)] 
Put KernelCommandLine= in the right section

22 months agoDon't assume FileNotFoundError from run() is about the executable
Daan De Meyer [Thu, 19 Oct 2023 10:26:34 +0000 (12:26 +0200)] 
Don't assume FileNotFoundError from run() is about the executable

It could also be about e.g. the working directory, so let's make sure
we log about it correctly.

22 months agoopenmandriva: Copy kernel image to /usr
Daan De Meyer [Thu, 19 Oct 2023 09:41:40 +0000 (11:41 +0200)] 
openmandriva: Copy kernel image to /usr

Same as for Debian and Mageia, except we have to get rid of a symlink
as well.

22 months agoopenmandriva: Fix mirror
Daan De Meyer [Thu, 19 Oct 2023 09:39:56 +0000 (11:39 +0200)] 
openmandriva: Fix mirror

The mirrorlist is down it seems, let's use baseurl= as is done in
the mandriva repo files.

22 months agoMerge pull request #1991 from DaanDeMeyer/autologin
Jörg Behrmann [Thu, 19 Oct 2023 09:21:55 +0000 (11:21 +0200)] 
Merge pull request #1991 from DaanDeMeyer/autologin

Add shorthand for enabling --autologin

22 months agoFix missing apivfs in openmandriva 1991/head
Daan De Meyer [Wed, 18 Oct 2023 23:32:37 +0000 (01:32 +0200)] 
Fix missing apivfs in openmandriva

22 months agoFix mageia vmlinuz location
Daan De Meyer [Wed, 18 Oct 2023 23:07:17 +0000 (01:07 +0200)] 
Fix mageia vmlinuz location

Same problem as Debian, so let's apply the same fix.

22 months agoAdd ToolsTreeMirror= setting
Daan De Meyer [Wed, 18 Oct 2023 21:28:11 +0000 (23:28 +0200)] 
Add ToolsTreeMirror= setting

Complete the trio of ToolsTreeDistribution=, ToolsTreeRelease= with
ToolsTreeMirror=.

22 months agoCreate output symlink in staging directory
Daan De Meyer [Wed, 18 Oct 2023 21:18:02 +0000 (23:18 +0200)] 
Create output symlink in staging directory

No reason to do it directly in the output directory, let's also do
this in the staging directory.

22 months agoChange ownership of output files in staging directory
Daan De Meyer [Wed, 18 Oct 2023 21:13:59 +0000 (23:13 +0200)] 
Change ownership of output files in staging directory

There might be other files in the output directory. Make sure we
only chown the files we produced by iterating over the staging
directory.

22 months agoAdd shorthand for enabling --autologin
Daan De Meyer [Wed, 18 Oct 2023 21:08:02 +0000 (23:08 +0200)] 
Add shorthand for enabling --autologin

I use this one really often in mkosi one liners so let's add a shorthand
for it.

22 months agoBuild xfsprogs with all available threads
Daan De Meyer [Wed, 18 Oct 2023 20:38:21 +0000 (22:38 +0200)] 
Build xfsprogs with all available threads

22 months agoMerge pull request #1989 from DaanDeMeyer/top
Daan De Meyer [Wed, 18 Oct 2023 20:37:42 +0000 (22:37 +0200)] 
Merge pull request #1989 from DaanDeMeyer/top

Beef up bundled images

22 months agoBeef up bundled images 1989/head
Daan De Meyer [Wed, 18 Oct 2023 10:00:53 +0000 (12:00 +0200)] 
Beef up bundled images

Let's beef up the bundled images with all the packages from the tools
trees where applicable so that we can run easily run mkosi from these
images if needed for testing on different distributions.

22 months agoaction: Build newer xfsprogs
Daan De Meyer [Wed, 18 Oct 2023 13:17:56 +0000 (15:17 +0200)] 
action: Build newer xfsprogs

Support for handling filenames with spaces in mkfs.xfs was only
added in a recent version of xfsprogs so build it from source for
now.

22 months agoAdd yaml to editorconfig
Daan De Meyer [Wed, 18 Oct 2023 13:17:36 +0000 (15:17 +0200)] 
Add yaml to editorconfig

yaml is usually indented with 2 spaces.

22 months agoopensuse: Download packages in advance
Daan De Meyer [Wed, 18 Oct 2023 14:02:32 +0000 (16:02 +0200)] 
opensuse: Download packages in advance

This is how other distributions package managers do it as well, so
let's make opensuse consistent with those.

22 months agoopensuse: Switch to https mirror
Daan De Meyer [Wed, 18 Oct 2023 11:33:28 +0000 (13:33 +0200)] 
opensuse: Switch to https mirror

From the experiment, it seems like the https mirror is reliable now
so let's use it as the default.

22 months agoMove CI configuration to top level
Daan De Meyer [Wed, 18 Oct 2023 09:04:45 +0000 (11:04 +0200)] 
Move CI configuration to top level

Let's make it easier to run the CI stuff locally by moving it to the
top level directory.

22 months agoMerge pull request #1988 from DaanDeMeyer/fix
Jörg Behrmann [Wed, 18 Oct 2023 10:30:33 +0000 (12:30 +0200)] 
Merge pull request #1988 from DaanDeMeyer/fix

Use with in spawn()

22 months agoRemove unnecessary line continuations 1988/head
Daan De Meyer [Wed, 18 Oct 2023 10:03:39 +0000 (12:03 +0200)] 
Remove unnecessary line continuations

22 months agoUse with in spawn()
Daan De Meyer [Wed, 18 Oct 2023 10:01:26 +0000 (12:01 +0200)] 
Use with in spawn()

If we yield the Popen, we yield a context manager from a context
manager, which becomes hard to follow, since we'll only enter the
outer context manager, and not the inner Popen context manager. To
make things simpler, let's enter the Popen context manager in
spawn() itself.

22 months agoFix spawn()
Daan De Meyer [Wed, 18 Oct 2023 09:41:52 +0000 (11:41 +0200)] 
Fix spawn()

The finally statement needs to run after the process finishes, so
we need to make spawn a context manager.

At the same time, let's make it configurable whether the spawn()
subprocess runs in the foreground or not and let's not do it by
default.

22 months agoDrop leftover gentoo config file for CI
Daan De Meyer [Wed, 18 Oct 2023 08:58:05 +0000 (10:58 +0200)] 
Drop leftover gentoo config file for CI

We don't run gentoo in CI anymore, so drop the leftover config file
for it.

22 months agoReword readme
Daan De Meyer [Wed, 18 Oct 2023 07:30:11 +0000 (09:30 +0200)] 
Reword readme

Let's reduce the amount of detail we put in the readme and list the
installation methods in order of how easy-to-use they are. Let's also
only recommend using the distribution's package if it's sufficiently
recent.

22 months agoRework qemu device support checks
Daan De Meyer [Tue, 17 Oct 2023 20:42:20 +0000 (22:42 +0200)] 
Rework qemu device support checks

Let's implement an available() method on the QemuDeviceNode enum
and move the checks from load_config() to run_qemu() so they don't
impede showing the summary or other verbs.

Let's also prefer using the file descriptor as a check whether the
feature is available in run_qemu() instead of calling the available()
method, as by the time we get to run_qemu() the available() method
might return a different result.

22 months agomake_tar: do not emit extended PAX headers for atime, ctime and mtime
Malte Poll [Tue, 17 Oct 2023 08:37:16 +0000 (10:37 +0200)] 
make_tar: do not emit extended PAX headers for atime, ctime and mtime

The use of the --xattrs flag implies PAX headers (--format=pax).
In this mode, the tar will record atime, ctime and mtime as PAX headers (in addition to the usual USTAR header).
Removing the headers makes the output reproducible.
See also: https://www.gnu.org/software/tar/manual/html_node/PAX-keywords.html

22 months agoAdd a FAQ entry about KVM on Debian/Ubuntu
Daan De Meyer [Fri, 13 Oct 2023 12:47:22 +0000 (14:47 +0200)] 
Add a FAQ entry about KVM on Debian/Ubuntu

22 months agoDo not try to copy vmlinuz for non-bootable images
Zbigniew Jędrzejewski-Szmek [Fri, 13 Oct 2023 15:12:25 +0000 (17:12 +0200)] 
Do not try to copy vmlinuz for non-bootable images

When building an initrd, copy_vmlinuz() would fail because there is
no vmlinuz file to copy.

22 months agoMake sure shadow-utils is installed in tools trees
Daan De Meyer [Fri, 13 Oct 2023 12:30:18 +0000 (14:30 +0200)] 
Make sure shadow-utils is installed in tools trees

This provides newuidmap/newgidmap which are used by virtiofsd, so
let's make sure these are available.

22 months agoMerge pull request #1978 from DaanDeMeyer/kvm
Zbigniew Jędrzejewski-Szmek [Fri, 13 Oct 2023 12:34:50 +0000 (14:34 +0200)] 
Merge pull request #1978 from DaanDeMeyer/kvm

Open qemu device nodes before unsharing user namespace

22 months agoRename InvokingUser to INVOKING_USER 1978/head
Daan De Meyer [Fri, 13 Oct 2023 11:28:25 +0000 (13:28 +0200)] 
Rename InvokingUser to INVOKING_USER

This is now a global constant so let's reflect that in the name.

22 months agoOpen qemu device nodes before unsharing user namespace
Daan De Meyer [Fri, 13 Oct 2023 11:24:44 +0000 (13:24 +0200)] 
Open qemu device nodes before unsharing user namespace

Where possible, we should open the qemu device nodes before we unshare
the user namespace as this might not be possible anymore after unsharing
the user namespace because we might lose access to the kvm group.

Currently this is only possible for /dev/vhost-vsock. I've opened
https://gitlab.com/qemu-project/qemu/-/issues/1936 to hopefully make
it work for /dev/kvm as well.

22 months agoUse os.access() in qemu support checks
Daan De Meyer [Fri, 13 Oct 2023 11:13:41 +0000 (13:13 +0200)] 
Use os.access() in qemu support checks

22 months agoExtend spawn() slightly
Daan De Meyer [Fri, 13 Oct 2023 11:13:07 +0000 (13:13 +0200)] 
Extend spawn() slightly

Let's support more of the options we also support in run() and clean
up the function a bit.

22 months agoEnable faulthandler module when in debug mode
Daan De Meyer [Fri, 13 Oct 2023 11:08:52 +0000 (13:08 +0200)] 
Enable faulthandler module when in debug mode

This will have python dump stacktraces on SIGABRT, which is useful
for debugging hangs.

22 months agoMerge pull request #1973 from DaanDeMeyer/user
Daan De Meyer [Fri, 13 Oct 2023 11:17:53 +0000 (13:17 +0200)] 
Merge pull request #1973 from DaanDeMeyer/user

Run qemu as the invoking user again

22 months agoDo not require signatures for local packages
Cornelius Hoffmann [Fri, 13 Oct 2023 10:01:23 +0000 (12:01 +0200)] 
Do not require signatures for local packages

This is the default in the pacman.conf arch ships (https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/blob/main/pacman.conf?ref_type=heads#L42)
and allows to build AUR packages in build scripts and installing them in
the final image.

22 months agoRun qemu as the invoking user again 1973/head
Daan De Meyer [Thu, 12 Oct 2023 12:34:12 +0000 (14:34 +0200)] 
Run qemu as the invoking user again

This commit also reworks InvokingUser to calculate all its members
on module import (when we haven't yet unshared the user namespace).
become_root() is also changed to modify the InvokingUser object
instead of returning the new uid, gid. Finally, we stop passing
around uid, gid everywhere and just use the InvokingUser object
directly as a singleton.

We also stop dropping privileges in mkosi itself. Instead, we prefer
running ssh, qemu and the embedded web server unprivileged. This
allows us to get rid of the logic to not unmount the last tools tree
as we will now always still have enough privileges to do so.

We also start passing file descriptors to swtpm and virtiofsd to avoid
race conditions where the socket hasn't been created yet before we
pass it to qemu or before we try to chown it.

22 months agoDrop logic to add CI user to kvm group
Daan De Meyer [Thu, 12 Oct 2023 17:16:58 +0000 (19:16 +0200)] 
Drop logic to add CI user to kvm group

This doesn't actually work as it doesn't seem a new session is started
for each step so the groups of the runner user are never refreshed.

22 months agoAdd WithRecommends=
Daan De Meyer [Fri, 13 Oct 2023 07:54:39 +0000 (09:54 +0200)] 
Add WithRecommends=

While this can already be configured using dropins. The concept of
recommended packages seems widespread enough that we can provide an
option to enable/disable it via the configuration file.

22 months agoDo not remount build root as ro in build chroot
Cornelius Hoffmann [Fri, 13 Oct 2023 07:10:12 +0000 (09:10 +0200)] 
Do not remount build root as ro in build chroot
The PR #1970 added an additional volatile overlay to the buildroot, which
currently can only be used from the host, i.e. without mkosi-chroot.
Once mkosi-chroot is run, the build overlay is readonly again.
Fixes https://github.com/systemd/mkosi/issues/1974.

22 months agoBeef up GPG key handling
Daan De Meyer [Thu, 12 Oct 2023 10:12:47 +0000 (12:12 +0200)] 
Beef up GPG key handling

Let's look for GPG keys in a few more places. Let's also introduce
a function find_rpm_gpgkey() to avoid duplication.

22 months agoMount volatile overlay when running build scripts
Daan De Meyer [Wed, 11 Oct 2023 11:33:00 +0000 (13:33 +0200)] 
Mount volatile overlay when running build scripts

When building multiple projects, it might be needed to make the
header files produced by an earlier build available to later builds.
Let's make this possible by not making the root directory read-only
but instead mounting a writable overlay on top of it so that all
changes made while running the build scripts are thrown away at the
end.

22 months agoRun scripts with ".chroot" extension inside the image
Daan De Meyer [Wed, 11 Oct 2023 09:27:30 +0000 (11:27 +0200)] 
Run scripts with ".chroot" extension inside the image

Our current approach to running scripts inside the image is only
really applicable to shell scripts. Let's make it easier to run
scripts written in arbitrary languages inside the image by running
scripts with the ".chroot" extension inside the image.

22 months agoMerge pull request #1968 from DaanDeMeyer/rhel
Daan De Meyer [Wed, 11 Oct 2023 09:48:32 +0000 (11:48 +0200)] 
Merge pull request #1968 from DaanDeMeyer/rhel

Add RHEL support

22 months agoUse GenericVersion() for CentOS version comparisons 1968/head
Daan De Meyer [Tue, 10 Oct 2023 12:38:10 +0000 (14:38 +0200)] 
Use GenericVersion() for CentOS version comparisons

This allows using RHEL point releases with --release (e.g. 9.2)

22 months agoAllow comparing GenericVersion() against int and str values
Daan De Meyer [Tue, 10 Oct 2023 12:37:52 +0000 (14:37 +0200)] 
Allow comparing GenericVersion() against int and str values

22 months agoAdd RHEL support
Daan De Meyer [Tue, 10 Oct 2023 09:48:01 +0000 (11:48 +0200)] 
Add RHEL support

To make RHEL work, we have to look up the necessary certificates and
add them to the generated repo files. This requires the image build to
be done from a system with a RHEL subscription.

22 months agoEnable codeready-builder by default on RHEL
Daan De Meyer [Tue, 10 Oct 2023 13:27:41 +0000 (15:27 +0200)] 
Enable codeready-builder by default on RHEL

We enable CRB by default on CentOS as well, so do the same for
codeready-builder on RHEL.

22 months agoGet rid of config_default_mirror()
Daan De Meyer [Tue, 10 Oct 2023 12:02:46 +0000 (14:02 +0200)] 
Get rid of config_default_mirror()

The only advantage of having it in the config object is that we can
show it in the summary. If we're fine with just showing "default"
instead, we can inline the default mirror into the installer classes,
which is important for the next commit.

We also document the default mirrors used.

22 months agoAdd newline between repos in generated mkosi.repo file
Daan De Meyer [Tue, 10 Oct 2023 10:32:41 +0000 (12:32 +0200)] 
Add newline between repos in generated mkosi.repo file

22 months agoPass around MkosiState in centos based distributions
Daan De Meyer [Tue, 10 Oct 2023 09:36:59 +0000 (11:36 +0200)] 
Pass around MkosiState in centos based distributions

We need access to the pkgmngr tree to be able to look for GPG keys
or certificates there, so let's pass around MkosiState everywhere.

22 months agoMention secure boot auto enrollment minimum systemd version
Daan De Meyer [Tue, 10 Oct 2023 06:26:55 +0000 (08:26 +0200)] 
Mention secure boot auto enrollment minimum systemd version

22 months agoMerge pull request #1964 from DaanDeMeyer/testing
Jörg Behrmann [Mon, 9 Oct 2023 17:41:20 +0000 (19:41 +0200)] 
Merge pull request #1964 from DaanDeMeyer/testing

fedora: Add updates-testing repositories

22 months agofedora: Add updates-testing repositories 1964/head
Daan De Meyer [Mon, 9 Oct 2023 12:53:47 +0000 (14:53 +0200)] 
fedora: Add updates-testing repositories

22 months agoAdd extra search paths to $PATH when booting
Daan De Meyer [Mon, 9 Oct 2023 12:41:51 +0000 (14:41 +0200)] 
Add extra search paths to $PATH when booting

22 months agoMerge pull request #1963 from DaanDeMeyer/check
Daan De Meyer [Mon, 9 Oct 2023 09:46:47 +0000 (11:46 +0200)] 
Merge pull request #1963 from DaanDeMeyer/check

Extend tools checks for ukify and systemd-repart

22 months agoExtend tools checks for ukify and systemd-repart 1963/head
Daan De Meyer [Mon, 9 Oct 2023 09:09:46 +0000 (11:09 +0200)] 
Extend tools checks for ukify and systemd-repart

Let's check for systemd-repart and systemd-nspawn as well and make
sure the versions of all are recent enough.

Also make sure we check for tools when booting the image as we don't
always build it first.

22 months agoAdd stringification of GenericVersion()
Daan De Meyer [Mon, 9 Oct 2023 09:07:44 +0000 (11:07 +0200)] 
Add stringification of GenericVersion()

22 months agoRelease 18 v18
Luca Boccassi [Thu, 5 Oct 2023 14:52:38 +0000 (15:52 +0100)] 
Release 18

22 months agoVerify that two instances of MkosiConfig.default() are always equal
Daan De Meyer [Thu, 5 Oct 2023 14:21:57 +0000 (16:21 +0200)] 
Verify that two instances of MkosiConfig.default() are always equal

22 months agoUpdate NEWS.md
Daan De Meyer [Thu, 5 Oct 2023 13:36:29 +0000 (15:36 +0200)] 
Update NEWS.md

22 months agoNote minimum systemd version requirement for RuntimeTrees=
Daan De Meyer [Thu, 5 Oct 2023 13:36:17 +0000 (15:36 +0200)] 
Note minimum systemd version requirement for RuntimeTrees=

22 months agoFix CentOS SIG keys
Daan De Meyer [Thu, 5 Oct 2023 13:45:10 +0000 (15:45 +0200)] 
Fix CentOS SIG keys

22 months agoMerge pull request #1953 from behrmann/pascalcase
Daan De Meyer [Thu, 5 Oct 2023 12:36:39 +0000 (14:36 +0200)] 
Merge pull request #1953 from behrmann/pascalcase

json: move JSON keys to PascalCase

22 months agoeditorconfig: Add global defaults for indent_style and indent_size
Daan De Meyer [Thu, 5 Oct 2023 11:24:36 +0000 (13:24 +0200)] 
editorconfig: Add global defaults for indent_style and indent_size

22 months agojson: fix typos and add missing raise 1953/head
Joerg Behrmann [Thu, 5 Oct 2023 10:45:03 +0000 (12:45 +0200)] 
json: fix typos and add missing raise

22 months agojson: move JSON keys to PascalCase
Joerg Behrmann [Wed, 4 Oct 2023 15:41:46 +0000 (17:41 +0200)] 
json: move JSON keys to PascalCase

22 months agoAdd a policy on adding new distributions
Daan De Meyer [Wed, 4 Oct 2023 19:22:03 +0000 (21:22 +0200)] 
Add a policy on adding new distributions

Fixes #236

22 months agoMention OutputDirectory= when parsing Output= or --output fails
Daan De Meyer [Wed, 4 Oct 2023 19:42:28 +0000 (21:42 +0200)] 
Mention OutputDirectory= when parsing Output= or --output fails

Fixes #1824

22 months agoMerge pull request #1955 from DaanDeMeyer/deterministic
Daan De Meyer [Wed, 4 Oct 2023 19:43:56 +0000 (21:43 +0200)] 
Merge pull request #1955 from DaanDeMeyer/deterministic

Fail when running without configuration

22 months agoFail when running without configuration 1955/head
Daan De Meyer [Wed, 4 Oct 2023 19:07:11 +0000 (21:07 +0200)] 
Fail when running without configuration

Fixes #609

22 months agoDon't leak cwd into MkosiConfig
Daan De Meyer [Wed, 4 Oct 2023 19:02:10 +0000 (21:02 +0200)] 
Don't leak cwd into MkosiConfig

Storing Path.cwd() in MkosiConfig makes it complicated to figure
out if a MkosiConfig instance is equal to MkosiConfig.default() as
that one executes after changing directory to a temporary directory,
so let's remove our default factories for the output and workspace
directory and add two methods on the MkosiConfig class instead that
replicate the functionality.

22 months agoAdd ImageId= and ImageVersion= specifiers
Daan De Meyer [Wed, 4 Oct 2023 16:50:07 +0000 (18:50 +0200)] 
Add ImageId= and ImageVersion= specifiers

Also rework the specifier tests a bit.

22 months agoMerge pull request #1952 from DaanDeMeyer/config
Daan De Meyer [Wed, 4 Oct 2023 16:22:53 +0000 (18:22 +0200)] 
Merge pull request #1952 from DaanDeMeyer/config

Add support for specifiers

22 months agoAdd support for specifiers 1952/head
Daan De Meyer [Wed, 4 Oct 2023 11:52:26 +0000 (13:52 +0200)] 
Add support for specifiers

Let's allow referring to the value of various settings using
specifiers.

Fixes #1664

22 months agoParse setting paths before parsing main config file
Daan De Meyer [Wed, 4 Oct 2023 11:30:19 +0000 (13:30 +0200)] 
Parse setting paths before parsing main config file

Currently, paths either configure default values or append to a
list (When path_default is False, it's always a list based setting).

When paths are configuring default values, it makes more sense for
default values set in the mkosi.conf file to override path based
default values.

When appending to a list, (e.g. ExtraTrees=), it makes more sense
for the trees configured in the mkosi.conf to come after the tree
from the path (mkosi.extra).

Both these goals are achieved by parsing the path based values before
parsing the main mkosi.conf file.

22 months agoMerge pull request #1951 from DaanDeMeyer/custom
Daan De Meyer [Wed, 4 Oct 2023 10:41:53 +0000 (12:41 +0200)] 
Merge pull request #1951 from DaanDeMeyer/custom

Rename "none" distribution to "custom"

22 months agoStop explicitly setting distribution in tests 1951/head
Daan De Meyer [Wed, 4 Oct 2023 08:46:39 +0000 (10:46 +0200)] 
Stop explicitly setting distribution in tests

We now default to "custom" when we can't figure out the host
distribution instead of failing so let's stop explicitly setting
the distribution in tests.

22 months agoRename "none" distribution to "custom"
Daan De Meyer [Wed, 4 Oct 2023 08:41:41 +0000 (10:41 +0200)] 
Rename "none" distribution to "custom"

"custom" seems a better fit than "none" since there likely still
is a distribution, we just don't support it.

22 months agoMerge pull request #1914 from behrmann/json
Daan De Meyer [Wed, 4 Oct 2023 08:17:46 +0000 (10:17 +0200)] 
Merge pull request #1914 from behrmann/json

Make `MkosiArgs` and `MkosiConfig` dumpable to and loadble from JSON

22 months agoconfig: factor out settings_lookup_by* and match_lookup from parse_config 1914/head
Joerg Behrmann [Wed, 4 Oct 2023 07:52:24 +0000 (09:52 +0200)] 
config: factor out settings_lookup_by* and match_lookup from parse_config

All three (settings_lookup_by_name, settings_lookup_by_dest, and match_lookup)
only repackage global variables. Moving them outside makes them usable in other
places and only calculates them once instead of on every invocation of
parse_config.

22 months agojson: produce a known error when parsing JSON
Joerg Behrmann [Wed, 27 Sep 2023 10:46:32 +0000 (12:46 +0200)] 
json: produce a known error when parsing JSON

22 months agojson: add alternative constructor from partial JSON for MkosiArgs and MkosiConfig
Joerg Behrmann [Wed, 27 Sep 2023 09:17:10 +0000 (11:17 +0200)] 
json: add alternative constructor from partial JSON for MkosiArgs and MkosiConfig

22 months agojson: add alternative default constructors to MkosiArgs and MkosiConfig
Joerg Behrmann [Wed, 27 Sep 2023 09:15:52 +0000 (11:15 +0200)] 
json: add alternative default constructors to MkosiArgs and MkosiConfig

These can be used to get a default MkosiArgs/MkosiConfig just have if mkosi had
been called in an empty directory with no cmdline without adding defaults to
the attributes and allowing instances of MkosiArgs/MkosiConfig to be made with
missing keys.

22 months agojson: make JSON readable from dicts and files as well es strings
Joerg Behrmann [Wed, 27 Sep 2023 08:38:49 +0000 (10:38 +0200)] 
json: make JSON readable from dicts and files as well es strings

22 months agotest: add tests for json dumping
Joerg Behrmann [Tue, 19 Sep 2023 20:41:25 +0000 (22:41 +0200)] 
test: add tests for json dumping

22 months agojson: make MkosiArgs and MkosiConfig loadable from json
Joerg Behrmann [Sun, 17 Sep 2023 16:56:21 +0000 (18:56 +0200)] 
json: make MkosiArgs and MkosiConfig loadable from json

22 months agojson: make MkosiArgs and MkosiConfig JSON-dumpable
Joerg Behrmann [Fri, 15 Sep 2023 16:19:35 +0000 (18:19 +0200)] 
json: make MkosiArgs and MkosiConfig JSON-dumpable

22 months agoconfig: fix type of presets and dependencies
Joerg Behrmann [Thu, 21 Sep 2023 10:25:01 +0000 (12:25 +0200)] 
config: fix type of presets and dependencies

tuple[str] is a single element tuple, whereas tuple[str, ...] is a tuple of
arbitrary length (with only str elements)

22 months agoconfig: don't use Sequence in MkosiConfig definition
Joerg Behrmann [Fri, 15 Sep 2023 16:19:01 +0000 (18:19 +0200)] 
config: don't use Sequence in MkosiConfig definition

22 months agoFix ruff warnings
Joerg Behrmann [Thu, 21 Sep 2023 10:54:51 +0000 (12:54 +0200)] 
Fix ruff warnings

- reformat overly long lines
- remove typing.Type in favour of type
- import Iterablefrom collections.abc instead of typing
- compare singletons with is
- don't use "ambiguous variable name: l"

22 months agoMake sure we chdir() to directories when parsing includes
Daan De Meyer [Tue, 3 Oct 2023 13:56:56 +0000 (15:56 +0200)] 
Make sure we chdir() to directories when parsing includes

22 months agoAdd "none" distribution
Stefan Nickl [Wed, 27 Sep 2023 18:31:53 +0000 (20:31 +0200)] 
Add "none" distribution

22 months agoUse local GPG keys from distribution-gpg-keys if available
Daan De Meyer [Tue, 3 Oct 2023 12:42:50 +0000 (14:42 +0200)] 
Use local GPG keys from distribution-gpg-keys if available

Let's prefer using local keys from the distribution-gpg-keys package
if available.

22 months agoAlways set the ttyS0 credentials
Daan De Meyer [Tue, 3 Oct 2023 08:08:41 +0000 (10:08 +0200)] 
Always set the ttyS0 credentials

Even when booting with GUI, we might still have a serial terminal,
so let's always set the serial terminal specific size credentials
as these don't affect the GUI terminals at all.

22 months agoOnly parse each path included with Include= once
Daan De Meyer [Mon, 2 Oct 2023 11:08:30 +0000 (13:08 +0200)] 
Only parse each path included with Include= once

Even if a path is included multiple times using Include=, let's make
sure we only parse it once.

22 months agoOnly add console=ttyS0 and tty sizes when QemuGui= is disabled
Daan De Meyer [Mon, 2 Oct 2023 08:24:19 +0000 (10:24 +0200)] 
Only add console=ttyS0 and tty sizes when QemuGui= is disabled

With console=ttyS0, we don't get any boot logs when running qemu
in GUI mode. The tty sizes don't matter either when booting in GUI
mode as Linux can figure it out itself in that scenario.