]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
19 months agoMake sure we cache state from package managers as well 2212/head
Daan De Meyer [Fri, 22 Dec 2023 14:39:44 +0000 (15:39 +0100)] 
Make sure we cache state from package managers as well

To do this we start using cache/ and lib/ directories underneath
the cache directory.

We also fix our cleanup logic to only remove the relevant directories
in case the cache directory is configured to be /var or similar.

19 months agoMount entire /etc from package manager tree into sandbox
Daan De Meyer [Fri, 22 Dec 2023 14:29:06 +0000 (15:29 +0100)] 
Mount entire /etc from package manager tree into sandbox

Instead of mounting individual directories, let's just mount the
entire /etc into the sandbox. This allows any tool we run through
the sandbox to pick up configuration from the package manager tree
without having to add explicit support for it in mkosi.

This also removes our special casing for uki.conf. ukify will now
pick up its configuration from its canonical location just like all
the other tools.

19 months agoOverlay /usr from package manager trees on top of /usr in bwrap()
Daan De Meyer [Fri, 22 Dec 2023 13:30:50 +0000 (14:30 +0100)] 
Overlay /usr from package manager trees on top of /usr in bwrap()

Let's allow package manager configuration to be put in /usr as well
by simply overlaying /usr from the package manager tree on top of
/usr.

19 months agoMerge pull request #2211 from malt3/fix/bwrap/mount-readonly-nix-store
Daan De Meyer [Fri, 22 Dec 2023 13:39:55 +0000 (14:39 +0100)] 
Merge pull request #2211 from malt3/fix/bwrap/mount-readonly-nix-store

bwrap: mount readonly nix store

19 months agobubblewrap: add /etc/static symlink 2211/head
Malte Poll [Fri, 22 Dec 2023 12:06:11 +0000 (13:06 +0100)] 
bubblewrap: add /etc/static symlink

On NixOS, ssl certificates are stored as follows:

/etc/ssl/certs/ca-bundle.crt -> /etc/static/ssl/certs/ca-bundle.crt
/etc/static -> /nix/store/<HASH>-etc/etc

Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
19 months agoMount package manager trees
Daan De Meyer [Fri, 22 Dec 2023 11:18:40 +0000 (12:18 +0100)] 
Mount package manager trees

Now that /etc and /var are free game when running within bwrap()
because we don't mount in the directories from the host anymore,
let's take advantage of that by mounting all our package manager
configuration to the canonical location in /etc instead of configuring
the package managers via their CLI or config file to look in the
right directory.

This also makes us look for rpm configuration in /etc/rpm instead
of /usr/lib/rpm as that's now possible.

19 months agobubblewrap: try to mount /nix/store readonly
Malte Poll [Fri, 22 Dec 2023 11:41:10 +0000 (12:41 +0100)] 
bubblewrap: try to mount /nix/store readonly

Similar to most usrmerged systems, NixOS stores all installed
binaries and libraries in /nix/store.
To make mkosi work on NixOS, the nix store should be mounted by default.

Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
19 months agoMake sure we mount in extra search paths
Daan De Meyer [Fri, 22 Dec 2023 09:33:52 +0000 (10:33 +0100)] 
Make sure we mount in extra search paths

19 months agoInstall centos/fedora packaging tools in default images
Daan De Meyer [Thu, 21 Dec 2023 20:15:23 +0000 (21:15 +0100)] 
Install centos/fedora packaging tools in default images

Useful for doing Fedora/CentOS packaging work.

20 months agoFail when trying to inspect ephemeral images
Daan De Meyer [Thu, 21 Dec 2023 19:57:29 +0000 (20:57 +0100)] 
Fail when trying to inspect ephemeral images

Any changes to these are thrown away after exit so can't inspect
them.

20 months agoUpdate NEWS
Daan De Meyer [Thu, 21 Dec 2023 18:02:55 +0000 (19:02 +0100)] 
Update NEWS

20 months agoMerge pull request #2201 from DaanDeMeyer/sandbox
Daan De Meyer [Thu, 21 Dec 2023 17:31:08 +0000 (18:31 +0100)] 
Merge pull request #2201 from DaanDeMeyer/sandbox

Sandbox more in bwrap()

20 months agoRun more binaries with bwrap() 2201/head
Daan De Meyer [Thu, 21 Dec 2023 15:00:44 +0000 (16:00 +0100)] 
Run more binaries with bwrap()

Let's sandbox more of the image build. This isolates more of the
build from the host which reduces the chance of leaking in host
specific details into the image.

20 months agoSandbox more in bwrap()
Daan De Meyer [Wed, 20 Dec 2023 20:31:56 +0000 (21:31 +0100)] 
Sandbox more in bwrap()

Let's not make the full root filesystem available to commands
running in bwrap(). Instead, limit it to some select directories.

- /usr
- Various directories from /etc. Note that this also means we can
  get rid of mount_tools() as all these directories are now mounted
  in bwrap() instead. This also allows us to get rid of the overlay
  hack in mount_tools() to create the necessary mount points. The
  goal is to get rid of as many of these as possible over time.
- /var/tmp
- /tmp

Because to make this work we have to pass MkosiConfig into bwrap(),
we split off a new file bubblewrap.py with all the bubblewrap stuff.

To avoid having to import MkosiState and bwrap() into tree.py,
install_tree() is moved __init__.py

20 months agoMake RepartOffline= apply to extension images as well
Daan De Meyer [Thu, 21 Dec 2023 12:44:14 +0000 (13:44 +0100)] 
Make RepartOffline= apply to extension images as well

20 months agoRun depmod and modinfo on host again
Daan De Meyer [Thu, 21 Dec 2023 10:07:36 +0000 (11:07 +0100)] 
Run depmod and modinfo on host again

Running these in the chroot is much slower when building images for
another architecture. Also, we might soon have a way to prevent dnf
from running depmod (see
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2743), so
let's adopt that when it is merged.

20 months agoInstall kmod in default tools tree
Daan De Meyer [Thu, 21 Dec 2023 11:36:01 +0000 (12:36 +0100)] 
Install kmod in default tools tree

20 months agoAdd ubu-keyring to CentOS/Fedora default tools trees
Daan De Meyer [Thu, 21 Dec 2023 15:22:25 +0000 (16:22 +0100)] 
Add ubu-keyring to CentOS/Fedora default tools trees

And remove the CI exclusions related to missing ubuntu keyring in
CentOS/Fedora.

20 months agoMerge pull request #2199 from DaanDeMeyer/selinux
Jörg Behrmann [Thu, 21 Dec 2023 15:44:03 +0000 (16:44 +0100)] 
Merge pull request #2199 from DaanDeMeyer/selinux

Add SelinuxRelabel= setting

20 months agoMerge pull request #2196 from DaanDeMeyer/opensuse
Daan De Meyer [Thu, 21 Dec 2023 14:05:28 +0000 (15:05 +0100)] 
Merge pull request #2196 from DaanDeMeyer/opensuse

ci: Build dnf based distros with opensuse tools tree

20 months agoAdd opensuse paths to qemu search locations 2196/head
Daan De Meyer [Thu, 21 Dec 2023 13:21:52 +0000 (14:21 +0100)] 
Add opensuse paths to qemu search locations

20 months agoci: Build dnf based distros with opensuse tools tree
Daan De Meyer [Wed, 20 Dec 2023 09:48:14 +0000 (10:48 +0100)] 
ci: Build dnf based distros with opensuse tools tree

dnf-data on opensuse had the missing dependency on ln added so we
can now use opensuse tools trees to build dnf based distro images.

20 months agoAdd SelinuxRelabel= setting 2199/head
Daan De Meyer [Wed, 20 Dec 2023 20:57:37 +0000 (21:57 +0100)] 
Add SelinuxRelabel= setting

Let's give users some more control over selinux relabeling.

20 months agoRemove yes_no_auto()
Daan De Meyer [Wed, 20 Dec 2023 20:37:29 +0000 (21:37 +0100)] 
Remove yes_no_auto()

All features will already stringify to "enabled", "disabled" or
"auto" which is just as good as yes/no/auto so let's get rid of
the function.

20 months agofedora: Drop unsupported architectures
Daan De Meyer [Wed, 20 Dec 2023 11:45:02 +0000 (12:45 +0100)] 
fedora: Drop unsupported architectures

20 months agoMerge pull request #2197 from DaanDeMeyer/qemu
Daan De Meyer [Wed, 20 Dec 2023 12:19:40 +0000 (13:19 +0100)] 
Merge pull request #2197 from DaanDeMeyer/qemu

Use virtio nic model on s390x

20 months agoInstall dnf plugins in default images 2197/head
Daan De Meyer [Wed, 20 Dec 2023 10:46:19 +0000 (11:46 +0100)] 
Install dnf plugins in default images

We can't install them on Debian/Ubuntu because trying to install
them conflicts with zypper.

20 months agoUse virtio nic model on s390x
Daan De Meyer [Wed, 20 Dec 2023 10:33:24 +0000 (11:33 +0100)] 
Use virtio nic model on s390x

Also refactor things a bit to move more into the Architecture enum.

Also make sure the default network interface on s390x is configured
properly.

We also fail earlier now if an architecture is specified for which
we haven't defined a machine yet.

20 months agoInstall perf in the default images
Daan De Meyer [Wed, 20 Dec 2023 10:32:59 +0000 (11:32 +0100)] 
Install perf in the default images

20 months agoInstall two more qemu system binaries in fedora tools tree
Daan De Meyer [Wed, 20 Dec 2023 09:43:38 +0000 (10:43 +0100)] 
Install two more qemu system binaries in fedora tools tree

20 months agoPass in credentials via kernel command line as well
Daan De Meyer [Wed, 20 Dec 2023 08:57:42 +0000 (09:57 +0100)] 
Pass in credentials via kernel command line as well

If we can't do smbios or fw_cfg, let's fall back to kernel command
line if possible.

20 months agoMerge pull request #2186 from NekkoDroid/unlink-output-name-version
Daan De Meyer [Wed, 20 Dec 2023 07:57:52 +0000 (08:57 +0100)] 
Merge pull request #2186 from NekkoDroid/unlink-output-name-version

Output file names now use `Output=` without version appended

20 months agoInstall network tools in default images
Daan De Meyer [Tue, 19 Dec 2023 16:54:11 +0000 (17:54 +0100)] 
Install network tools in default images

Useful for debugging network stuff.

20 months agoAdd a test for the output 2186/head
Michael Ferrari [Wed, 20 Dec 2023 01:35:36 +0000 (02:35 +0100)] 
Add a test for the output

20 months agoUpdate NEWS.md
Michael Ferrari [Wed, 20 Dec 2023 01:30:32 +0000 (02:30 +0100)] 
Update NEWS.md

20 months agoRemove `config.output_with_version`
Michael Ferrari [Wed, 20 Dec 2023 01:19:07 +0000 (02:19 +0100)] 
Remove `config.output_with_version`

And replace all its usages with `config.output` since this now has the
version appended to it if needed/wanted.

20 months ago`Output=` now has the version appended if unset
Michael Ferrari [Wed, 20 Dec 2023 01:12:07 +0000 (02:12 +0100)] 
`Output=` now has the version appended if unset

Previously `Output=` would only default to `ImageId=` if unset, but the
output files would have the version appended, resulting in `%o` not
returning the actual name of the output files.

This also moves the default handling to a `default_factory`

20 months agoOutput files starting with `Output=` are removed
Michael Ferrari [Wed, 20 Dec 2023 01:10:53 +0000 (02:10 +0100)] 
Output files starting with `Output=` are removed

As preparation for the removal of `config.output_with_version` the
removal of output files now only factors in `config.output` as prefix
and no longer removes based on version suffix, due to that being added
to `config.output` in a following commit.

20 months agoStop bind mounting /sys in chroot environments
Daan De Meyer [Tue, 19 Dec 2023 15:29:02 +0000 (16:29 +0100)] 
Stop bind mounting /sys in chroot environments

The only reason we do this is to make systemd's unit test suite
pass. https://github.com/systemd/systemd/pull/30527 fixes systemd's
test suite to not fail when /sys is not mounted, so let's drop this
bit.

20 months agoMerge pull request #2189 from DaanDeMeyer/arch
Daan De Meyer [Tue, 19 Dec 2023 09:01:40 +0000 (10:01 +0100)] 
Merge pull request #2189 from DaanDeMeyer/arch

Add support for booting powerpc images

20 months agoAdd aarch64 support to Debian default images 2189/head
Daan De Meyer [Mon, 18 Dec 2023 22:47:54 +0000 (23:47 +0100)] 
Add aarch64 support to Debian default images

20 months agoAdd support for booting powerpc images
Daan De Meyer [Mon, 18 Dec 2023 22:06:55 +0000 (23:06 +0100)] 
Add support for booting powerpc images

20 months agoMerge pull request #2188 from DaanDeMeyer/fix-tools
Daan De Meyer [Mon, 18 Dec 2023 21:23:04 +0000 (22:23 +0100)] 
Merge pull request #2188 from DaanDeMeyer/fix-tools

Process all overlays before we do any bind mounts

20 months agoProcess all overlays before we do any bind mounts 2188/head
Daan De Meyer [Mon, 18 Dec 2023 20:13:18 +0000 (21:13 +0100)] 
Process all overlays before we do any bind mounts

Otherwise, later overlays will hide earlier bind mounts.

20 months agoDrop empty directories
Daan De Meyer [Mon, 18 Dec 2023 20:26:36 +0000 (21:26 +0100)] 
Drop empty directories

Instead, let's declare them in the config and they'll get created
as needed.

20 months agoMerge pull request #2185 from DaanDeMeyer/tools
Daan De Meyer [Mon, 18 Dec 2023 18:39:31 +0000 (19:39 +0100)] 
Merge pull request #2185 from DaanDeMeyer/tools

Move default tools tree configuration to mkosi/resources/mkosi-tools

20 months agoci: Add tools trees to integration test matrix 2185/head
Daan De Meyer [Sat, 16 Dec 2023 19:28:35 +0000 (20:28 +0100)] 
ci: Add tools trees to integration test matrix

Let's make sure our tools trees actually work as intended by
introducing a second axis to our test matrix.

20 months agoci: Drop rocky, alma and rhel-ubi
Daan De Meyer [Sat, 16 Dec 2023 19:31:01 +0000 (20:31 +0100)] 
ci: Drop rocky, alma and rhel-ubi

The next commit is going to add a second dimension to the test
matrix which will dramatically introduce the number of CI jobs.
Let's keep things manageable by dropping rhel-ubi, alma and rocky
which should be covered by the centos job already.

20 months agoci: Drop unused matrix.format
Daan De Meyer [Sat, 16 Dec 2023 19:51:29 +0000 (20:51 +0100)] 
ci: Drop unused matrix.format

20 months agotests: Only log warning level and up to console by default
Daan De Meyer [Sun, 17 Dec 2023 16:56:33 +0000 (17:56 +0100)] 
tests: Only log warning level and up to console by default

The debug logs are too noisy to forward them to the console by
default. Let's stick to warning and up only.

20 months agotests: Use default release from config file
Daan De Meyer [Sun, 17 Dec 2023 16:55:43 +0000 (17:55 +0100)] 
tests: Use default release from config file

Let's allow setting the default release in the mkosi.conf files
instead which is much more flexible.

20 months agotests: Use cryptsetup.passphrase for test_initrd_luks_lvm() as well
Daan De Meyer [Mon, 18 Dec 2023 11:39:59 +0000 (12:39 +0100)] 
tests: Use cryptsetup.passphrase for test_initrd_luks_lvm() as well

The credential now applies to all instances of systemd-crypsetup@,
so let's use it for the LUKS+LVM test as well.

20 months agomkosi-initrd: Add comment on initrd always being compressed
Daan De Meyer [Mon, 18 Dec 2023 13:46:36 +0000 (14:46 +0100)] 
mkosi-initrd: Add comment on initrd always being compressed

20 months agomkosi-initrd: Don't remove perl-base on Debian/Ubuntu
Daan De Meyer [Mon, 18 Dec 2023 13:33:51 +0000 (14:33 +0100)] 
mkosi-initrd: Don't remove perl-base on Debian/Ubuntu

This doesn't work on older stable releases, so let's keep it in.

20 months agomkosi-initrd: Drop explicit CompressOutput=yes
Daan De Meyer [Mon, 18 Dec 2023 13:32:31 +0000 (14:32 +0100)] 
mkosi-initrd: Drop explicit CompressOutput=yes

This allows the compression passed by mkosi or the default compression
to be used instead. Note that the default is to compress the initrd, so
this doesn't change anything.

20 months agoLog with which compression algorithm we're compressing
Daan De Meyer [Mon, 18 Dec 2023 13:33:34 +0000 (14:33 +0100)] 
Log with which compression algorithm we're compressing

20 months agoFix remove packages log message
Daan De Meyer [Mon, 18 Dec 2023 08:09:54 +0000 (09:09 +0100)] 
Fix remove packages log message

20 months agoInstall archlinux-keyring and makepkg in default debian/ubuntu image
Daan De Meyer [Sun, 17 Dec 2023 20:01:35 +0000 (21:01 +0100)] 
Install archlinux-keyring and makepkg in default debian/ubuntu image

Also run pacman-key --init and pacman-key --populate in a prepare
script.

20 months agoAdd more vsock debug logging
Daan De Meyer [Sun, 17 Dec 2023 16:54:31 +0000 (17:54 +0100)] 
Add more vsock debug logging

20 months agoqemu: Always use smbios on x86
Daan De Meyer [Sun, 17 Dec 2023 16:53:54 +0000 (17:53 +0100)] 
qemu: Always use smbios on x86

On x86, smbios is always there even if we're not booting from UEFI
so let's make sure we make use of it.

20 months agoMake sure systemd-coredump is installed in default images
Daan De Meyer [Sun, 17 Dec 2023 15:29:02 +0000 (16:29 +0100)] 
Make sure systemd-coredump is installed in default images

This isn't installed by default on Debian/Ubuntu/OpenSUSE so let's
install it manually there.

20 months agoLook for shimx64.efi.signed.latest first
Daan De Meyer [Sat, 16 Dec 2023 23:21:09 +0000 (00:21 +0100)] 
Look for shimx64.efi.signed.latest first

shimx64.efi.signed is an absolute symlink on Ubuntu to some path
in /etc so let's make sure we try shimx64.efi.signed.latest first.

Also, for safety, let's ignore any absolute symlinks while traversing
shim binaries.

20 months agoopensuse: Use curl to fetch repomd.xml
Daan De Meyer [Sat, 16 Dec 2023 23:01:56 +0000 (00:01 +0100)] 
opensuse: Use curl to fetch repomd.xml

urllib.request.urlopen() means we're responsible for catching all
the exceptions and showing a proper error message to the user.
Instead, let's just shell out to curl to fetch the file which can
translate any errors into user friendly error messages for us.

20 months agorpm: Disable plugins
Daan De Meyer [Sat, 16 Dec 2023 21:59:46 +0000 (22:59 +0100)] 
rpm: Disable plugins

Just like we disable all dnf plugins, let's also disable all rpm plugins.

20 months agoSplit out rpm.py and hook up rpm logic with zypper as well
Daan De Meyer [Sat, 16 Dec 2023 21:58:21 +0000 (22:58 +0100)] 
Split out rpm.py and hook up rpm logic with zypper as well

We have a bunch of rpm related logic that's required when using
dnf and zypper so let's split out rpm.py and hook up everything in
both dnf and zypper.

20 months agoMove default tools tree configuration to mkosi/resources/mkosi-tools
Daan De Meyer [Sat, 16 Dec 2023 19:27:16 +0000 (20:27 +0100)] 
Move default tools tree configuration to mkosi/resources/mkosi-tools

Our default initrd configuration already lives in
mkosi/resources/mkosi-initrd, let's do the same for our tools tree
configuration.

20 months agoMove Architecture enum to config.py
Daan De Meyer [Sun, 17 Dec 2023 17:16:54 +0000 (18:16 +0100)] 
Move Architecture enum to config.py

All our other config enums live there as well so let's colocate
the Architecture enum with them. It also makes the next commit
easier.

20 months agoMount over various other directories as well if needed
Daan De Meyer [Sat, 16 Dec 2023 21:35:53 +0000 (22:35 +0100)] 
Mount over various other directories as well if needed

On Opensuse the openssl certificates are stored in
/var/lib/ca-certificates so let's make sure we mount this directory
from the tools tree into the host as well.

The pacman keyring is stored in /etc/pacman.d/gnupg so we mount over
/etc/pacman.d as well if needed.

20 months agoAdd tools tree settings to cache manifest
Daan De Meyer [Sat, 16 Dec 2023 19:43:42 +0000 (20:43 +0100)] 
Add tools tree settings to cache manifest

All of these might affect the cached image so let's make sure
they're in the cache manifest.

20 months agoAdd HostArchitecture= match
Daan De Meyer [Sat, 16 Dec 2023 19:19:37 +0000 (20:19 +0100)] 
Add HostArchitecture= match

20 months agotests: add pytest CLI args for distribution and release
Joerg Behrmann [Fri, 1 Dec 2023 13:30:05 +0000 (14:30 +0100)] 
tests: add pytest CLI args for distribution and release

Pass them to test functions via a fixture and the new Config subclass
of Image.

Also move pytest.ini into pyproject.toml while we're at it.

20 months agoMerge pull request #2182 from DaanDeMeyer/ssh
Daan De Meyer [Sun, 17 Dec 2023 21:10:00 +0000 (22:10 +0100)] 
Merge pull request #2182 from DaanDeMeyer/ssh

Use mkosi.key/mkosi.crt for SSH authentication

20 months agoUse mkosi.key/mkosi.crt for SSH authentication 2182/head
Daan De Meyer [Fri, 15 Dec 2023 09:55:23 +0000 (10:55 +0100)] 
Use mkosi.key/mkosi.crt for SSH authentication

Instead of using the user's SSH certificate and key, let's use the
X509 certificate and private key generated by 'mkosi genkey' instead.

This saves us from having to rely on ssh-agent to get the public key
or doing otherwise complicated logic to try and find the public and
private key. We also avoid always needing a separate public/private
key just for SSH by automatically converting the X509 certificate to
a SSH public key.

20 months agoMark private keys as secrets
Daan De Meyer [Fri, 15 Dec 2023 09:54:42 +0000 (10:54 +0100)] 
Mark private keys as secrets

Let's ensure that these have a strict access mode.

20 months agoOnly query credentials when they're needed
Daan De Meyer [Fri, 15 Dec 2023 09:53:11 +0000 (10:53 +0100)] 
Only query credentials when they're needed

We might run commands that potentially need some time to complete so
let's only run them when needed.

20 months agoFix config settings ordering
Daan De Meyer [Fri, 15 Dec 2023 09:39:38 +0000 (10:39 +0100)] 
Fix config settings ordering

Let's make sure this matches the order in the summary and MkosiConfig
class.

20 months agoMerge pull request #2183 from DaanDeMeyer/s390
Daan De Meyer [Sat, 16 Dec 2023 17:54:08 +0000 (18:54 +0100)] 
Merge pull request #2183 from DaanDeMeyer/s390

Support booting Fedora default image on s390x

20 months agoSupport booting Fedora default image on s390x 2183/head
Daan De Meyer [Fri, 15 Dec 2023 13:32:21 +0000 (14:32 +0100)] 
Support booting Fedora default image on s390x

20 months agoSet defaults for bootloaders
Daan De Meyer [Fri, 15 Dec 2023 14:38:41 +0000 (15:38 +0100)] 
Set defaults for bootloaders

For testing purposes we might want to override these.

20 months agoAdd default serial tty for s390(x)
Daan De Meyer [Fri, 15 Dec 2023 14:22:41 +0000 (15:22 +0100)] 
Add default serial tty for s390(x)

20 months agoTerminate virtiofsd when shutting down
Daan De Meyer [Fri, 15 Dec 2023 13:33:35 +0000 (14:33 +0100)] 
Terminate virtiofsd when shutting down

If qemu fails to start then virtiofsd won't shut down on its own
so let's explicitly send it a signal to shut down.

20 months agoSupport multiple [Match] sections
Daan De Meyer [Fri, 15 Dec 2023 13:23:22 +0000 (14:23 +0100)] 
Support multiple [Match] sections

Instead of considering all match sections part of the same match,
let's consider each [Match] section on its own. This allows doing
multiple independent triggers, such as:

"""
[Match]
Format=|disk
Format=|directory

[Match]
Architecture=|x86-64
Architecture=|arm64
"""

Which now means to match if the format is one of disk or directory
and the architecture is one of x86-64 or arm64.

20 months agoBuild initrd if Bootable=auto
Daan De Meyer [Fri, 15 Dec 2023 13:20:49 +0000 (14:20 +0100)] 
Build initrd if Bootable=auto

If building a bootable image is not explicitly disabled and we
don't split out an initrd from a UKI because the dependencies are
not installed or we're on the wrong architecture, let's still build
an initrd so that booting with qemu direct kernel boot still works.

20 months agoAdd support for loading environment files
Kuntal Majumder [Sat, 16 Dec 2023 17:02:56 +0000 (18:02 +0100)] 
Add support for loading environment files

Fixes #738

20 months agoOnly check tools for current verb
Daan De Meyer [Fri, 15 Dec 2023 16:20:40 +0000 (17:20 +0100)] 
Only check tools for current verb

20 months agoMount over /etc/passwd again for virtiofsd
Daan De Meyer [Thu, 14 Dec 2023 21:43:25 +0000 (22:43 +0100)] 
Mount over /etc/passwd again for virtiofsd

When running unprivileged with a tools tree and runtime trees we
still have to mount over /etc/passwd to keep things working.

20 months agoFix install_tree()
Daan De Meyer [Thu, 14 Dec 2023 15:30:02 +0000 (16:30 +0100)] 
Fix install_tree()

Let's make sure that all the skeleton, extra and package manager
trees we get have absolute targets. That allows us to stop using
with_prefix() when installing these trees, which means we pass
target=None instead of target="/" which makes install_tree do the
right thing.

20 months agoMerge pull request #2179 from DaanDeMeyer/dnf5-plugins
Daan De Meyer [Thu, 14 Dec 2023 21:44:54 +0000 (22:44 +0100)] 
Merge pull request #2179 from DaanDeMeyer/dnf5-plugins

Install dnf5-plugins in fedora tools tree

20 months agozypper: Enable autorefresh with refresh delay of 48h 2179/head
Daan De Meyer [Thu, 14 Dec 2023 18:15:21 +0000 (19:15 +0100)] 
zypper: Enable autorefresh with refresh delay of 48h

Instead of never refreshing repository metadata, let's refresh
every 48h, which is the same default that dnf uses.

20 months agoFix fedora mirror source path
Daan De Meyer [Thu, 14 Dec 2023 16:17:39 +0000 (17:17 +0100)] 
Fix fedora mirror source path

20 months agoInstall dnf plugins in tools trees
Daan De Meyer [Thu, 14 Dec 2023 16:08:08 +0000 (17:08 +0100)] 
Install dnf plugins in tools trees

For running dnf builddep

20 months agoMerge pull request #2177 from DaanDeMeyer/ssh
Daan De Meyer [Thu, 14 Dec 2023 16:07:48 +0000 (17:07 +0100)] 
Merge pull request #2177 from DaanDeMeyer/ssh

Stop using the tools tree for the ssh verb

20 months agoSet SYSTEMD_UPDATE_HWDB_BYPASS=1
Daan De Meyer [Thu, 14 Dec 2023 10:08:44 +0000 (11:08 +0100)] 
Set SYSTEMD_UPDATE_HWDB_BYPASS=1

We run systemd-hwdb ourselves, so let's set this new environment
variable to skip its execution by package managers.

20 months agoDon't unmount final tools tree 2177/head
Daan De Meyer [Thu, 14 Dec 2023 15:01:22 +0000 (16:01 +0100)] 
Don't unmount final tools tree

Let's instead just rely on it getting unmounted by the mkosi process
exiting and its mount namespace getting deleted.

20 months agoStop using the tools tree for the ssh verb
Daan De Meyer [Thu, 14 Dec 2023 14:54:27 +0000 (15:54 +0100)] 
Stop using the tools tree for the ssh verb

This allows us to run ssh out of the user namespace which means we
can get rid of the passwd hack to make ssh work. ssh is widespread
enough that we can require users to install it on the host machine
instead of using the tools tree.

20 months agoUse RuntimeTrees= instead of RuntimeMounts=
Daan De Meyer [Thu, 14 Dec 2023 12:50:59 +0000 (13:50 +0100)] 
Use RuntimeTrees= instead of RuntimeMounts=

20 months agoMerge pull request #2174 from DaanDeMeyer/aarch64
Daan De Meyer [Thu, 14 Dec 2023 10:05:34 +0000 (11:05 +0100)] 
Merge pull request #2174 from DaanDeMeyer/aarch64

Two more aarch64 improvements

20 months agoFall back to fw_cfg if SMBIOS is not available 2174/head
Daan De Meyer [Thu, 14 Dec 2023 08:57:12 +0000 (09:57 +0100)] 
Fall back to fw_cfg if SMBIOS is not available

20 months agoSet $ARCHITECTURE when running scripts
Daan De Meyer [Thu, 14 Dec 2023 08:44:11 +0000 (09:44 +0100)] 
Set $ARCHITECTURE when running scripts

20 months agoDefault to ttyAMA0 when building/booting arm images
Daan De Meyer [Wed, 13 Dec 2023 13:23:54 +0000 (14:23 +0100)] 
Default to ttyAMA0 when building/booting arm images

On ARM, the first serial console is generally called ttyAMA0, so let's
configure that as the console instead of ttyS0.