]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
23 months agoAdd QemuFirmware=auto 1876/head
Daan De Meyer [Thu, 7 Sep 2023 11:56:44 +0000 (13:56 +0200)] 
Add QemuFirmware=auto

Let's introduce a new "auto" mode where we decide the firmware
based on whether we built a cpio image or a disk image. Let's also
use this as the new default.

23 months agoqemu: Rename fw variables to ovmf
Daan De Meyer [Thu, 7 Sep 2023 11:46:28 +0000 (13:46 +0200)] 
qemu: Rename fw variables to ovmf

These specifically indicate the ovmf firmware so let's make that
more clear.

23 months agoMerge pull request #1874 from DaanDeMeyer/etc
Jörg Behrmann [Wed, 6 Sep 2023 16:31:48 +0000 (18:31 +0200)] 
Merge pull request #1874 from DaanDeMeyer/etc

Install ca-certificates in tools tree and make sure it's used

23 months agoInstall ca-certificates in tools tree and make sure it's used 1874/head
Daan De Meyer [Wed, 6 Sep 2023 13:11:19 +0000 (15:11 +0200)] 
Install ca-certificates in tools tree and make sure it's used

Too old ca-certificates on the host can cause package manager failures
when using a tools tree, so let's install ca-certificates into the
tools tree and make sure it is used.

23 months agoPass environment to initrd and tools tree builds
Daan De Meyer [Wed, 6 Sep 2023 14:33:07 +0000 (16:33 +0200)] 
Pass environment to initrd and tools tree builds

The environment might contain http_proxy and https_proxy which
need to be passed on to child builds to make things work correctly.

23 months agoRemove package manager generated hwdb from /etc
Daan De Meyer [Wed, 6 Sep 2023 11:57:58 +0000 (13:57 +0200)] 
Remove package manager generated hwdb from /etc

We generate the hwdb in /usr, so remove any existing one that is
leftover in /etc.

23 months agoIgnore ConnectionResetError in vsock notify handler
Daan De Meyer [Wed, 6 Sep 2023 09:58:57 +0000 (11:58 +0200)] 
Ignore ConnectionResetError in vsock notify handler

Let's handle this one gracefully but still debug log about it when
it happens.

23 months agoci: use https for OpenSUSE again
Luca Boccassi [Wed, 6 Sep 2023 11:00:39 +0000 (12:00 +0100)] 
ci: use https for OpenSUSE again

The CI is now running a version of libzypp that should improve the https
situation, let's test it for a while

23 months agoFollow up for 5462f5e31c4223a001c2ed5aa8d44177fb8454fc
Daan De Meyer [Wed, 6 Sep 2023 09:31:26 +0000 (11:31 +0200)] 
Follow up for 5462f5e31c4223a001c2ed5aa8d44177fb8454fc

The value can't be None anymore so remove redundant check.

23 months agoMerge pull request #1869 from DaanDeMeyer/reset
Jörg Behrmann [Wed, 6 Sep 2023 09:23:43 +0000 (11:23 +0200)] 
Merge pull request #1869 from DaanDeMeyer/reset

Make the empty string reset settings to their default value

23 months agoMake the empty string reset settings to their default value 1869/head
Daan De Meyer [Wed, 6 Sep 2023 07:14:10 +0000 (09:14 +0200)] 
Make the empty string reset settings to their default value

If the empty string is assigned, we should make sure the setting
is assigned its default value so let's make sure we return None in
that case after all

We also simplify the match callbacks to not take optional values
anymore. If the value is set to None, then we automatically fail
the match.

23 months agoUse array destructuring more
Daan De Meyer [Wed, 6 Sep 2023 08:45:22 +0000 (10:45 +0200)] 
Use array destructuring more

23 months agoUpdate NEWS
Daan De Meyer [Tue, 5 Sep 2023 13:47:33 +0000 (15:47 +0200)] 
Update NEWS

23 months agoDo not run modinfo on builtin modules
Daan De Meyer [Tue, 5 Sep 2023 12:58:05 +0000 (14:58 +0200)] 
Do not run modinfo on builtin modules

This causes issues on CentOS Stream 8 with errors about not being
able to find builtin modules.

Aside from the issues, running modinfo on builtin modules also does
not make a lot of sense. We run modinfo to fetch module and firmware
dependencies, but a builtin module that has non-builtin module
dependencies is not really valuable because the dependent module has
to be loaded from disk then. The same goes for firmware dependencies.

23 months agoCheck for None explicitly more when parsing config
Daan De Meyer [Tue, 5 Sep 2023 11:08:59 +0000 (13:08 +0200)] 
Check for None explicitly more when parsing config

Empty values are now possible, so let's explicitly check for None
when determining if we should return the default value.

23 months agoUse yes_no() in one more place
Daan De Meyer [Mon, 4 Sep 2023 12:56:23 +0000 (14:56 +0200)] 
Use yes_no() in one more place

23 months agoMerge pull request #1858 from DaanDeMeyer/tools
Daan De Meyer [Mon, 4 Sep 2023 12:40:29 +0000 (14:40 +0200)] 
Merge pull request #1858 from DaanDeMeyer/tools

Allow using a default tools tree

23 months agoAdd missing Preset section to parse_ini() call
Daan De Meyer [Mon, 4 Sep 2023 11:57:45 +0000 (13:57 +0200)] 
Add missing Preset section to parse_ini() call

23 months agoAllow using a default tools tree 1858/head
Daan De Meyer [Sun, 3 Sep 2023 11:55:00 +0000 (13:55 +0200)] 
Allow using a default tools tree

Instead of requiring users to always set up a tools tree preset, let's
allow specifying "default" as the tools tree to have mkosi build a default
tools tree itself. This default tools tree includes all the software that
might be necessary to build an image (excluding software that might be
required by various user scripts).

For distributions that do not have a rolling release variant, we use the
closest matching distribution. e.g. for CentOS, we use Fedora and for
Ubuntu we use Debian.

23 months agoDrop absolute= argument from parse_path
Daan De Meyer [Mon, 4 Sep 2023 09:35:10 +0000 (11:35 +0200)] 
Drop absolute= argument from parse_path

resolve does more or less the same thing already, so let's drop
absolute=

23 months agoDrop unnecessary long= for ToolsTree=
Daan De Meyer [Mon, 4 Sep 2023 09:16:00 +0000 (11:16 +0200)] 
Drop unnecessary long= for ToolsTree=

23 months agoUse logging more
Daan De Meyer [Sun, 3 Sep 2023 12:29:57 +0000 (14:29 +0200)] 
Use logging more

23 months agoOnly pass extra tools to ukify when not using tools tree
Daan De Meyer [Sun, 3 Sep 2023 11:54:01 +0000 (13:54 +0200)] 
Only pass extra tools to ukify when not using tools tree

If we're using a tools tree, we don't want to use any binaries
specifed in extra search paths as they will very likely be incompatible
with the tools tree being used.

23 months agorun openssl with empty configuration file
Daan De Meyer [Sun, 3 Sep 2023 11:52:31 +0000 (13:52 +0200)] 
run openssl with empty configuration file

We generally don't want host configuration to influence the image build,
so let's make sure we override whatever distro shipped configuration file
with an empty one to avoid the host system interfering with the image build.

23 months agoStop installing makepkg in github action
Daan De Meyer [Sun, 3 Sep 2023 11:38:00 +0000 (13:38 +0200)] 
Stop installing makepkg in github action

23 months agoStop passing tools tree to default initrd build
Daan De Meyer [Sat, 2 Sep 2023 16:37:34 +0000 (18:37 +0200)] 
Stop passing tools tree to default initrd build

It's already mounted if needed so no need to pass it to the initrd
build.

23 months agoUse array destructuring more
Daan De Meyer [Sat, 2 Sep 2023 16:18:13 +0000 (18:18 +0200)] 
Use array destructuring more

23 months agoMake fedora 39 the default fedora release
Daan De Meyer [Sat, 2 Sep 2023 12:15:50 +0000 (14:15 +0200)] 
Make fedora 39 the default fedora release

Fedora 39 will release soon so let's go ahead and make it the new
default release.

23 months agoMove default release logic to per distribution installer class
Daan De Meyer [Sat, 2 Sep 2023 12:10:26 +0000 (14:10 +0200)] 
Move default release logic to per distribution installer class

23 months agoTemporarily disable keyring checking for Arch
Daan De Meyer [Mon, 4 Sep 2023 11:17:24 +0000 (13:17 +0200)] 
Temporarily disable keyring checking for Arch

Until the archlinux-keyring package is updated, let's disable
keyring checking for Arch.

23 months agoCI: pin CentOS 9 kernel to workaround panic on shutdown
Luca Boccassi [Sun, 3 Sep 2023 13:14:52 +0000 (14:14 +0100)] 
CI: pin CentOS 9 kernel to workaround panic on shutdown

Newer kernels are affected by a regression that causes a kernel panic
on shutdown, so pin them for now. Can be reverted once that problem is
fixed.

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

23 months agoci: enable jammy-proposed-updates to test new libzypp
Luca Boccassi [Sat, 2 Sep 2023 11:35:46 +0000 (12:35 +0100)] 
ci: enable jammy-proposed-updates to test new libzypp

I got some patches backported to jammy to try and fix https issues,
enable proposed-updates so that it can be tested before moving to
the release stage

23 months agoMerge pull request #1855 from DaanDeMeyer/qemu-firmware
Daan De Meyer [Fri, 1 Sep 2023 14:29:40 +0000 (16:29 +0200)] 
Merge pull request #1855 from DaanDeMeyer/qemu-firmware

QemuFirmware= and QemuKernel=

23 months agoDon't run depmod unless needed 1855/head
Daan De Meyer [Fri, 1 Sep 2023 12:32:29 +0000 (14:32 +0200)] 
Don't run depmod unless needed

For distro kernels, depmod is already executed by the package
manager, so let's make sure we don't rerun it unless needed.

To make this work, we have to run depmod and modinfo from inside the
image, as running modinfo from the host on files generated by depmod
from the image can lead to all sorts of compatibility issues so we opt
to run both depmod and modinfo from inside the image.

23 months agoAdd QemuKernel= option
Daan De Meyer [Fri, 1 Sep 2023 12:51:15 +0000 (14:51 +0200)] 
Add QemuKernel= option

This allows specifying the kernel to use for direct kernel boot
via an explicit option instead of having to rely on the QemuArgs=
option.

23 months agoPrefer kernel specified via -kernel over kernel installed in the image
Daan De Meyer [Fri, 1 Sep 2023 12:42:51 +0000 (14:42 +0200)] 
Prefer kernel specified via -kernel over kernel installed in the image

23 months agoGeneralize QemuBios to QemuFirmware
Daan De Meyer [Fri, 1 Sep 2023 12:33:09 +0000 (14:33 +0200)] 
Generalize QemuBios to QemuFirmware

We also add a third option "none", in which case we'll use direct
kernel boot.

23 months agoMerge pull request #1854 from DaanDeMeyer/empty-list
Jörg Behrmann [Fri, 1 Sep 2023 12:21:36 +0000 (14:21 +0200)] 
Merge pull request #1854 from DaanDeMeyer/empty-list

Replace ! operator for lists with empty string assignment

23 months agoMove test_parse_load_args.py tests into test_config.py 1854/head
Daan De Meyer [Fri, 1 Sep 2023 10:24:32 +0000 (12:24 +0200)] 
Move test_parse_load_args.py tests into test_config.py

23 months agoGet rid of textwrap in test_parse_load_args.py
Daan De Meyer [Fri, 1 Sep 2023 10:21:35 +0000 (12:21 +0200)] 
Get rid of textwrap in test_parse_load_args.py

parse_config() already dedents internally so no need to do it in
the tests.

23 months agoUse tmp_path in test_parse_load_args.py
Daan De Meyer [Fri, 1 Sep 2023 10:18:20 +0000 (12:18 +0200)] 
Use tmp_path in test_parse_load_args.py

23 months agoAdd config parsing test
Daan De Meyer [Fri, 1 Sep 2023 10:14:00 +0000 (12:14 +0200)] 
Add config parsing test

23 months agoDrop asyncio_mode from pyproject.toml
Daan De Meyer [Fri, 1 Sep 2023 09:58:33 +0000 (11:58 +0200)] 
Drop asyncio_mode from pyproject.toml

pytest complains this option is unknown so let's drop it.

23 months agoMake argv default to an empty tuple in parse_config()
Daan De Meyer [Fri, 1 Sep 2023 09:51:21 +0000 (11:51 +0200)] 
Make argv default to an empty tuple in parse_config()

Makes it easier to use parse_config() from tests.

23 months agoUse tmp_path fixture in test_parse_ini()
Daan De Meyer [Fri, 1 Sep 2023 09:43:57 +0000 (11:43 +0200)] 
Use tmp_path fixture in test_parse_ini()

23 months agoReplace MkosiConfigParser with parse_config()
Daan De Meyer [Fri, 1 Sep 2023 09:41:29 +0000 (11:41 +0200)] 
Replace MkosiConfigParser with parse_config()

The only reason that MkosiConfigParser is a class is to store the
lookup hashmaps required for configuration parsing. Yet we can
easily do that as well by just declaring the functions that need
those inline in a function. So let's simplify the configuration
parsing interface by replacing MkosiConfigParser with a function
parse_config().

23 months agoRevert "config: Test last assignment wins with defaults"
Daan De Meyer [Fri, 1 Sep 2023 09:32:54 +0000 (11:32 +0200)] 
Revert "config: Test last assignment wins with defaults"

This reverts commit 2fe014bc643dcc1442d0b057e20451f46345be9d.

23 months agoGet rid of cd_temp_dir()
Daan De Meyer [Fri, 1 Sep 2023 09:02:16 +0000 (11:02 +0200)] 
Get rid of cd_temp_dir()

Let's opt to just use the chdir() helper we have already instead.

23 months agoReplace `!` operator for lists with empty string assignment
Daan De Meyer [Fri, 1 Sep 2023 08:57:34 +0000 (10:57 +0200)] 
Replace `!` operator for lists with empty string assignment

Let's behave more like systemd and replace the `!` operator for
removing values from lists with assigning the empty string to remove
all values instead.

23 months agoSourceDateEpoch followups
Daan De Meyer [Fri, 1 Sep 2023 08:44:25 +0000 (10:44 +0200)] 
SourceDateEpoch followups

- Move normalize_mtime() a little close to where its used
- Put the --source-date-epoch argument on one line like the others

23 months agoMerge pull request #1845 from DaanDeMeyer/ini
Daan De Meyer [Fri, 1 Sep 2023 08:48:01 +0000 (10:48 +0200)] 
Merge pull request #1845 from DaanDeMeyer/ini

Rework ini file parsing

23 months agoRework ini file parsing 1845/head
Daan De Meyer [Mon, 28 Aug 2023 11:24:59 +0000 (13:24 +0200)] 
Rework ini file parsing

Python's configparser module is rather inadequate for our purposes.
Specifically, it's built around every setting only being specified once
in a config file and even though we got it to kind of parse more than
one of the same setting with our own custom dict type, there's a lot of
limitations involved. Specifically, assigning the empty value is
impossible with the current approach. To avoid all these issues, let's
introduce our own ini parser.

This also splits off the matching logic into a new method match_config()
and moves setting the debugging level just after we've parsed CLI options
so we get debug messages from the parser as well.

23 months agoRead paths after parsing configuration files
Daan De Meyer [Mon, 28 Aug 2023 09:35:23 +0000 (11:35 +0200)] 
Read paths after parsing configuration files

Let's first take into account the main configuration file before parsing
any configured paths. This allow the main configuration files to reset
any configured settings without resetting its own defaults configured via
paths.

23 months agoIgnore ssh configuration files when running ssh
Daan De Meyer [Thu, 31 Aug 2023 09:37:55 +0000 (11:37 +0200)] 
Ignore ssh configuration files when running ssh

When in a user namespace, the ssh config files from /etc/ will be
owned by nobody which makes ssh fail. Let's ignore these configuration
files when running ssh to avoid such failures.

Fixes #1848

23 months agoUse shlex.join in more places
Joerg Behrmann [Thu, 31 Aug 2023 07:53:13 +0000 (09:53 +0200)] 
Use shlex.join in more places

23 months agonormalize mtime
Paul Meyer [Fri, 25 Aug 2023 14:53:08 +0000 (16:53 +0200)] 
normalize mtime

If set, the time stamp from SOURCE_DATE_EPOCH is used to normalize
mtime of files. We also need to pass the environment trough when
mkosi is invoking itself.

Co-authored-by: Malte Poll <mp@edgeless.systems>
23 months agoDon't fail if tput commands fail
Daan De Meyer [Wed, 30 Aug 2023 10:05:37 +0000 (12:05 +0200)] 
Don't fail if tput commands fail

Let's consider these best effort, no need to fail mkosi if we can't
fix the terminal.

Fixes #1846

23 months agoconfig: Test last assignment wins with defaults
Michael A Cassaniti [Mon, 28 Aug 2023 01:19:28 +0000 (11:19 +1000)] 
config: Test last assignment wins with defaults

23 months agoMerge pull request #1844 from bcbnz/overlay-options
Jörg Behrmann [Tue, 29 Aug 2023 13:41:36 +0000 (15:41 +0200)] 
Merge pull request #1844 from bcbnz/overlay-options

Disable index and metacopy options of overlayfs

23 months agoMove mount options into original declaration. 1844/head
Blair Bonnett [Tue, 29 Aug 2023 13:22:19 +0000 (15:22 +0200)] 
Move mount options into original declaration.

23 months agoDisable index and metacopy options of overlayfs.
Blair Bonnett [Tue, 29 Aug 2023 12:43:52 +0000 (14:43 +0200)] 
Disable index and metacopy options of overlayfs.

If these are enabled (e.g., if the kernel enables them by default), the
mount will fail if the upper directory has been earlier used with a
different lower directory, such as with a build overlay that was
generated on top of a different temporary root.

Closes #1841.

23 months agoFix passwd check
Daan De Meyer [Tue, 29 Aug 2023 09:50:49 +0000 (11:50 +0200)] 
Fix passwd check

Fixes #1842

23 months agoMerge pull request #1836 from DaanDeMeyer/defaults
Daan De Meyer [Mon, 28 Aug 2023 08:52:39 +0000 (10:52 +0200)] 
Merge pull request #1836 from DaanDeMeyer/defaults

Support configuring default values for settings

23 months agoadd config setting seed to set systemd-repart --seed
Malte Poll [Fri, 25 Aug 2023 09:30:04 +0000 (11:30 +0200)] 
add config setting seed to set systemd-repart --seed

Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
23 months agoIntroduce config_default_compression() default factory 1836/head
Daan De Meyer [Fri, 25 Aug 2023 09:41:15 +0000 (11:41 +0200)] 
Introduce config_default_compression() default factory

23 months agoMove all environment handling into load_environment()
Daan De Meyer [Fri, 25 Aug 2023 09:33:12 +0000 (11:33 +0200)] 
Move all environment handling into load_environment()

23 months agoSupport configuring default values for settings
Daan De Meyer [Fri, 25 Aug 2023 07:27:53 +0000 (09:27 +0200)] 
Support configuring default values for settings

This allows configuring the default value for a setting. This is
useful to set a custom default value for a setting while still
allowing an explicit value from the CLI to take precedence.

To make this work properly in combination with default_factory, we
also introduce a new default_factory_depends field that lists all
the other settings that a setting's default_factory implementation
depends on. Then, when we finalize a setting's default value, we also
finalize the default value of settings it depends on so that its
default_factory function can do the right thing.

We also integrate the "paths" field from MkosiConfigSetting in this.
By default, paths will modify the defaults namespace instead of the
regular namespace, meaning their values will only be used if the
setting is not explicitly configured. The only exception to this are
mkosi.extra/, mkosi.skeleton/ and mkosi.repart/, whose values are just
merged with any explicitly specified directories.

23 months agodoc: make formatting more uniform
Joerg Behrmann [Fri, 25 Aug 2023 12:30:19 +0000 (14:30 +0200)] 
doc: make formatting more uniform

- Quotes are exchanged in favour of emphasis markers. Emphasis for terms,
  strong emphasis section names.
- Section names formatted as truetype/monospace are exchanged from strong
  emphasis.
- Section names are written consistently.
- Literals for settings, setting snippets and paths are formatted as
  monospace.
- Paragraphs that are formmated incorrectly in the markdown extensions for
  definition lists (using :) are moved such, that generate a single visual
  block in the pandoc generated man page.
- Superfluous quotes are removed.
- A numbered list is used for the execution flow to make it easier to follow
  and to visually seperate it from the list of mounted directories.
- URLs are formatted as links with adjacent text, since this formats them
  less bare in the generated man page.
- The remaning http URL is moved to https

23 months agopropagate SOURCE_DATE_EPOCH when calling systemd-repart
Malte Poll [Thu, 24 Aug 2023 14:50:00 +0000 (16:50 +0200)] 
propagate SOURCE_DATE_EPOCH when calling systemd-repart

23 months agoFix globbing
Daan De Meyer [Thu, 24 Aug 2023 14:46:16 +0000 (16:46 +0200)] 
Fix globbing

23 months agoDrop list reset on empty value
Daan De Meyer [Thu, 24 Aug 2023 14:19:41 +0000 (16:19 +0200)] 
Drop list reset on empty value

This does not work properly with python's configparser, which will
insert empty lines when doing something like the following:

```
Packages=
       abc
```

Instead, we restore the "!" operator for lists to remove values from
the list as it did originally instead of preventing values from being
added.

23 months agoMention backward compat break regarding overrides in man page
Daan De Meyer [Thu, 24 Aug 2023 11:37:20 +0000 (13:37 +0200)] 
Mention backward compat break regarding overrides in man page

23 months agoMerge pull request #1830 from DaanDeMeyer/config
Daan De Meyer [Thu, 24 Aug 2023 11:35:09 +0000 (13:35 +0200)] 
Merge pull request #1830 from DaanDeMeyer/config

Drop "first assignment wins" logic

23 months agoDrop "first assignment wins" logic 1830/head
Daan De Meyer [Thu, 24 Aug 2023 10:25:47 +0000 (12:25 +0200)] 
Drop "first assignment wins" logic

From experience in the systemd repository's usage of presets, we've
learned that we want to have fixed values for certain settings for
presets that cannot be overridden by either the CLI options or by
global config. Good examples are that the Format= of a base image
should always be "directory" and the Format= of an initrd image
should always be "cpio" or that Bootable= should always be "no" for
both the base image and the initrd image and their list of packages
should not be affected by any packages specified on the CLI.

The issue is that with "first assignment wins" logic, we need to add
an explicit "override" mechanism which almost all settings in these
presets would then use to make sure they can't be changed by CLI
options. This seems rather backwards, and is a good indication that
any settings configured in config should not be overridden by settings
set on the CLI.

Even disregarding usage of presets, any existing mkosi config will almost
certainly not be written to expect arbitrary changes in the config due
to options set on the CLI.

Also, it's currently not entirely trivial to set default values for
presets from the global config, because any values set in the global
config cannot be overridden anymore by presets. By not doing "first
assignment wins" logic, this becomes trivial as the global config can
simply set a default value and it can be overridden by presets.

Of course by removing "first assignment wins" logic, we do introduce
the issue again that "first assignment wins" solves in the first place,
which is that it becomes possible to assign a value to a setting, match
on that value and then change the setting later. We acknowledge this by
documenting it in the manual. Also, in some cases, this is exactly what
you want. For example, if you want to use a Fedora rawhide tools tree to
build CentOS 8 images, you have to first match on distribution == centos
and then set Distribution=fedora afterwards for the tools tree preset, so
this actually makes perfect sense in some cases.

While this is technically a compat break, it will only be noticed by users
doing advanced stuff with mkosi, which AFAIK does not exist yet outside of
the systemd repo. In fact even the systemd repo was not broken by this change,
so we should be OK with making it, given the large benefits we get out of it.

This commit also simplifies the interfaces of the parser and matching callbacks
to not take the namespace as an argument anymore, but to simply take the existing
value as an argument instead.

23 months agoUse logging instead of print()
Daan De Meyer [Thu, 24 Aug 2023 10:22:42 +0000 (12:22 +0200)] 
Use logging instead of print()

23 months agoReword output docs a bit
Daan De Meyer [Thu, 24 Aug 2023 07:07:22 +0000 (09:07 +0200)] 
Reword output docs a bit

23 months agoMerge pull request #1827 from DaanDeMeyer/manifest
Jörg Behrmann [Thu, 24 Aug 2023 07:04:52 +0000 (09:04 +0200)] 
Merge pull request #1827 from DaanDeMeyer/manifest

Manifest fixes

23 months agoDo not generate manifest if it is not enabled 1827/head
Daan De Meyer [Thu, 24 Aug 2023 06:46:09 +0000 (08:46 +0200)] 
Do not generate manifest if it is not enabled

23 months agoDo not generate manifest by default
Daan De Meyer [Thu, 24 Aug 2023 06:43:27 +0000 (08:43 +0200)] 
Do not generate manifest by default

Generally users are not going to be interested in the manifest so
let's not generate it by default to avoid cluttering the output
directory.

23 months agodoc: Suggest using a reflink supported FS
Michael A Cassaniti [Thu, 24 Aug 2023 05:14:42 +0000 (15:14 +1000)] 
doc: Suggest using a reflink supported FS

2 years agoMerge pull request #1822 from DaanDeMeyer/fix-archive
Daan De Meyer [Wed, 23 Aug 2023 12:21:24 +0000 (14:21 +0200)] 
Merge pull request #1822 from DaanDeMeyer/fix-archive

Archive fixes

2 years agoMake's bwrap() read-only logic optional 1822/head
Daan De Meyer [Wed, 23 Aug 2023 11:16:44 +0000 (13:16 +0200)] 
Make's bwrap() read-only logic optional

We only really need this when running scripts, so let's make it
configurable and only enable it when running scripts.

2 years agoUse default_factory to evaluate Path.cwd() later
Daan De Meyer [Wed, 23 Aug 2023 10:58:36 +0000 (12:58 +0200)] 
Use default_factory to evaluate Path.cwd() later

Otherwise, we don't take --directory into account as Path.cwd() is
evaluated on module import.

2 years agoDocument our default systemd-repart definition files
Daan De Meyer [Tue, 22 Aug 2023 17:50:50 +0000 (19:50 +0200)] 
Document our default systemd-repart definition files

2 years agoMake sure we remove /var/lib/dbus/machine-id from the image
Daan De Meyer [Tue, 22 Aug 2023 19:26:14 +0000 (21:26 +0200)] 
Make sure we remove /var/lib/dbus/machine-id from the image

Fixes #1818

2 years agomkosi: adjust messages about missing cert+key
Zbigniew Jędrzejewski-Szmek [Tue, 22 Aug 2023 11:38:03 +0000 (13:38 +0200)] 
mkosi: adjust messages about missing cert+key

2 years agoRename mount_image() to mount_base_trees()
Daan De Meyer [Tue, 22 Aug 2023 10:26:07 +0000 (12:26 +0200)] 
Rename mount_image() to mount_base_trees()

Also don't log about mounting the base trees if we're not actually
going to mount them.

2 years agoMerge pull request #1814 from DaanDeMeyer/uki-name
Daan De Meyer [Tue, 22 Aug 2023 10:41:40 +0000 (12:41 +0200)] 
Merge pull request #1814 from DaanDeMeyer/uki-name

Drop "mkosi" from UKI names

2 years agoDrop outdated comment 1814/head
Daan De Meyer [Tue, 22 Aug 2023 10:09:21 +0000 (12:09 +0200)] 
Drop outdated comment

2 years agoDrop "mkosi" from UKI names
Daan De Meyer [Tue, 22 Aug 2023 10:05:45 +0000 (12:05 +0200)] 
Drop "mkosi" from UKI names

Let's not leak that the image was generated by mkosi into the image
via the UKI name.

2 years agoFix bootloader path
Daan De Meyer [Tue, 22 Aug 2023 09:13:12 +0000 (11:13 +0200)] 
Fix bootloader path

2 years agoMake sure unit and preset directories exist in configure_ssh()
Daan De Meyer [Tue, 22 Aug 2023 07:08:18 +0000 (09:08 +0200)] 
Make sure unit and preset directories exist in configure_ssh()

Fixes #1811

2 years agoMerge pull request #1797 from DaanDeMeyer/grub
Daan De Meyer [Mon, 21 Aug 2023 15:56:57 +0000 (17:56 +0200)] 
Merge pull request #1797 from DaanDeMeyer/grub

Add back BIOS support using grub

2 years agoAdd mention of BuildSources= change to NEWS.
Daan De Meyer [Mon, 21 Aug 2023 14:56:45 +0000 (16:56 +0200)] 
Add mention of BuildSources= change to NEWS.

2 years agoAdd grub EFI support 1797/head
Daan De Meyer [Fri, 18 Aug 2023 11:58:08 +0000 (13:58 +0200)] 
Add grub EFI support

Note that we only generate the necessary menu entries for the grub
configuration to chainload into our generated UKIs, we do not yet
install grub for EFI ourselves as this is a distribution specific
mess that we still need to figure out. On Fedora, because the
shim and grub2-efi packages install directly to /boot which we
redirect to /efi, this is sufficient to boot with grub on EFI by
simply installing the shim and grub2-efi packages.

For other distributions, a post install or finalize script will be
necessary that installs grub (and optionally shim) to the correct
locations in the ESP.

2 years agoAdd back BIOS support using grub
Daan De Meyer [Mon, 14 Aug 2023 11:52:29 +0000 (13:52 +0200)] 
Add back BIOS support using grub

Let's add back support for booting on BIOS using grub. This comes
with the following limitations:

- grub does not support UKIs on BIOS, so we set up the individual
components instead
- grub cannot search partitions by PARTUUID, so we're forced to have
it find the ESP by partition number instead.

We opt to generate grub.cfg ourselves instead of relying on grub-mkconfig.
grub-mkconfig is basically like kernel-install but for grub configuration,
it has a ton of distro specific cruft that we want to ignore, so we simply
don't use it and generate the grub configuration ourselves.

To allow for unprivileged installation of grub, we can't use grub-install
as it insists on opening the root device and probing its filesystem, which
isn't possible unprivileged. Instead, we run grub-mkimage and grub-bios-setup
ourselves, and manually copy the required files to the ESP.

We use the ESP to store the kernels, initrds and grub config. In the event
that grub adds support for UKIs on BIOS in the future, we can simply modify
the generated grub configuration to use our generated UKIs instead.

2 years agoAdd QemuBios= option
Daan De Meyer [Sun, 13 Aug 2023 22:16:37 +0000 (00:16 +0200)] 
Add QemuBios= option

2 years agoMake ESP logic bootloader independent
Daan De Meyer [Mon, 21 Aug 2023 10:13:04 +0000 (12:13 +0200)] 
Make ESP logic bootloader independent

Let's simply check if a bootloader was placed in the right location
instead of having systemd-boot specific checks.

2 years agoAdd none Bootloader option
Daan De Meyer [Fri, 18 Aug 2023 11:23:52 +0000 (13:23 +0200)] 
Add none Bootloader option

This disables adding any EFI bootloader altogether. Preparation
for adding BIOS support.

2 years agoRun tput smam to make sure line wrapping is reenabled
Daan De Meyer [Fri, 18 Aug 2023 19:11:34 +0000 (21:11 +0200)] 
Run tput smam to make sure line wrapping is reenabled

When running seabios, it disables line wrapping for some weird
reason, so let's make sure we reenable it before we exit.