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

2 years 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.

2 years 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.

2 years 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.

2 years 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

2 years 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

2 years 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.

2 years 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)

2 years 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.

2 years 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.

2 years 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.

2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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.

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

2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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.

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

2 years 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

2 years 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

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

2 years 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.

2 years agoMerge pull request #2171 from DaanDeMeyer/kernel-install
Daan De Meyer [Wed, 13 Dec 2023 11:59:48 +0000 (12:59 +0100)] 
Merge pull request #2171 from DaanDeMeyer/kernel-install

kernel-install: Use host's package manager configuration and repos

2 years agokernel-install: Use host's package manager configuration and repos 2171/head
Daan De Meyer [Wed, 13 Dec 2023 09:14:25 +0000 (10:14 +0100)] 
kernel-install: Use host's package manager configuration and repos

Let's make sure we use the host's package manager configuration and
repositories in the kernel-install plugin. The initrd we produce
should be as compatible with the host as we can make it and making
sure we use the same packages that the host uses is a good step in
achieving that.

2 years agoAdd dereference argument to copy_tree()
Daan De Meyer [Wed, 13 Dec 2023 09:10:55 +0000 (10:10 +0100)] 
Add dereference argument to copy_tree()

Let's allow configuring whether symlinks should be followed or not.

2 years agoHave WithRecommends= override package manager trees
Daan De Meyer [Wed, 13 Dec 2023 09:03:03 +0000 (10:03 +0100)] 
Have WithRecommends= override package manager trees

Now that we have an explicit setting for this, let's have it override
any configuration from the package manager config file.

Let's also make sure that WithDocs= overrides package manager trees
when using zypper.

2 years agoAllow building CentOS/Fedora default images for arm64 architecture
Daan De Meyer [Wed, 13 Dec 2023 09:34:27 +0000 (10:34 +0100)] 
Allow building CentOS/Fedora default images for arm64 architecture

Let's introduce a little conditionalization to allow building the
CentOS/Fedora default images for arm64.

2 years agoMerge pull request #2164 from DaanDeMeyer/kernel-install
Daan De Meyer [Wed, 13 Dec 2023 09:00:45 +0000 (10:00 +0100)] 
Merge pull request #2164 from DaanDeMeyer/kernel-install

mkosi-initrd: Rewrite kernel-install plugin in python and support UKIs

2 years agomkosi-initrd: Rewrite kernel-install plugin in python and support UKIs 2164/head
Daan De Meyer [Tue, 12 Dec 2023 11:26:45 +0000 (12:26 +0100)] 
mkosi-initrd: Rewrite kernel-install plugin in python and support UKIs

There's really no point for the kernel-install plugin to be in bash,
so let's rewrite it in python. While we're at it, let's also support
running as a UKI generator.

2 years agoAdd SecureBootAutoEnroll= option
Cornelius Hoffmann [Wed, 13 Dec 2023 00:22:17 +0000 (01:22 +0100)] 
Add SecureBootAutoEnroll= option

Closes https://github.com/systemd/mkosi/issues/2169

2 years agoMerge pull request #2166 from DaanDeMeyer/vmlinuz
Daan De Meyer [Tue, 12 Dec 2023 17:51:07 +0000 (18:51 +0100)] 
Merge pull request #2166 from DaanDeMeyer/vmlinuz

Make kernel image lookup logic more robust

2 years agodocs: Mention OVMF files with MS certs enrolled
Septatrix [Tue, 12 Dec 2023 17:21:56 +0000 (18:21 +0100)] 
docs: Mention OVMF files with MS certs enrolled

2 years agoMake kernel image lookup logic more robust 2166/head
Daan De Meyer [Tue, 12 Dec 2023 14:39:54 +0000 (15:39 +0100)] 
Make kernel image lookup logic more robust

2 years agoAdd InitrdInclude= option
Daan De Meyer [Tue, 12 Dec 2023 12:29:28 +0000 (13:29 +0100)] 
Add InitrdInclude= option

Same as Include=, but for the default initrd. This is a more
generic version of InitrdPackages=.

2 years agoRevert "Look for vmlinuz.efi as well"
Daan De Meyer [Tue, 12 Dec 2023 14:32:47 +0000 (15:32 +0100)] 
Revert "Look for vmlinuz.efi as well"

The kernel install target will install vmlinuz.efi as vmlinuz,
so no need to look for vmlinuz.efi after all.

This reverts commit f3871e3e843cbe28a03175aa14dc060e0ce06897.

2 years agomake_cpio: sort files used as cpio input
Malte Poll [Mon, 11 Dec 2023 10:40:18 +0000 (11:40 +0100)] 
make_cpio: sort files used as cpio input

Pathlib's glob functions return files in the order used by the filesystem.
This may differ between implementations and configuration (file system, locale).
For better reproducibility, the file list should be sorted.

2 years agoSimplify log_setup() a bit
Daan De Meyer [Tue, 12 Dec 2023 11:25:50 +0000 (12:25 +0100)] 
Simplify log_setup() a bit

2 years agoDefault to sys.exit() in uncaught_exception_handler()
Daan De Meyer [Tue, 12 Dec 2023 11:25:24 +0000 (12:25 +0100)] 
Default to sys.exit() in uncaught_exception_handler()

2 years agoSave kernel image and stub when building UKI/ESP images
Daan De Meyer [Tue, 12 Dec 2023 11:22:44 +0000 (12:22 +0100)] 
Save kernel image and stub when building UKI/ESP images

When building a UKI image, it's not unreasonable for users to not
want to ship the large vmlinuz kernel image file inside their UKI
initrd. However, because we process remove_files() before we build
the UKI, the kernel image might already have been removed by the
time we build the UKI. To avoid this problem, let's save the UKI
(and the stub while we're at it) in the workspace directory before
we process file removals.

Let's also only process cmdline files from the rootfs when we're
building a bootable image and ignore them if we're building a UKI.

2 years agomkosi-initrd: Pass image ID to initrd build
Daan De Meyer [Tue, 12 Dec 2023 11:21:23 +0000 (12:21 +0100)] 
mkosi-initrd: Pass image ID to initrd build

Let's allow passing in an image ID and use no image ID by default.
Let's also allow overriding the output

2 years agoLook for vmlinuz.efi as well
Daan De Meyer [Mon, 11 Dec 2023 22:53:43 +0000 (23:53 +0100)] 
Look for vmlinuz.efi as well

On aarch64, vmlinuz.efi is installed instead of vmlinuz so let's
make sure we look for both.

2 years agotests: Test "none" output format as well
Daan De Meyer [Mon, 11 Dec 2023 17:51:28 +0000 (18:51 +0100)] 
tests: Test "none" output format as well

Let's build an image with "none" as well. There won't be any output,
but we can at least test that nothing breaks when specifying "none"
as the output format.

Also apply the "integration" marker to the entire file while we're
at it.

2 years agoMinor fix: remove duplicate shim-signed package
Renjaya Raga Zenta [Mon, 11 Dec 2023 14:03:12 +0000 (21:03 +0700)] 
Minor fix: remove duplicate shim-signed package

2 years agoman: fix name of option RepartOffline
Joerg Behrmann [Mon, 11 Dec 2023 11:21:13 +0000 (12:21 +0100)] 
man: fix name of option RepartOffline

2 years agoAdd RepartOffline= option
Daan De Meyer [Mon, 11 Dec 2023 09:17:19 +0000 (10:17 +0100)] 
Add RepartOffline= option

Instead of auto-detecting all cases where --offline=no has to be
used with systemd-repart, let's allow configuring it via an option
so that if we discover any new cases, users can easily disable
offline mode themselves.

2 years agoqemu: Remove --posix-acl and add --no-announce-submounts to virtiofsd
Daan De Meyer [Sun, 10 Dec 2023 21:09:55 +0000 (22:09 +0100)] 
qemu: Remove --posix-acl and add --no-announce-submounts to virtiofsd

--posix-acl causes an error from virtiofsd saying the client doesn't
support this feature. We also get a warning about announcing submounts
not being supported so let's make sure we disable both features to
avoid these warnings/errors.

2 years agoUpdate NEWS.md
Daan De Meyer [Sun, 10 Dec 2023 22:47:47 +0000 (23:47 +0100)] 
Update NEWS.md

2 years agoMerge pull request #2155 from DaanDeMeyer/grub
Daan De Meyer [Sun, 10 Dec 2023 20:53:30 +0000 (21:53 +0100)] 
Merge pull request #2155 from DaanDeMeyer/grub

undefined

2 years agoWrite grub BIOS partition definition after ESP definition 2155/head
Daan De Meyer [Sun, 10 Dec 2023 18:40:41 +0000 (19:40 +0100)] 
Write grub BIOS partition definition after ESP definition

The BIOS partition is ordered after the ESP so let's write their
config file in the same order for clarity.

2 years agoMake sure grub fonts directory exists
Daan De Meyer [Sun, 10 Dec 2023 18:40:24 +0000 (19:40 +0100)] 
Make sure grub fonts directory exists

2 years agoUse grub's search.file module instead of hardcoding partition numbers
Daan De Meyer [Sun, 10 Dec 2023 18:39:05 +0000 (19:39 +0100)] 
Use grub's search.file module instead of hardcoding partition numbers

We can tell grub to search for the first partition containing a
/grub/grub.cfg file. This still isn't ideal, but it's better than
hardcoding partition numbers.

2 years agoMove ESP grub shim configuration to prepare_grub_efi()
Daan De Meyer [Sun, 10 Dec 2023 18:37:23 +0000 (19:37 +0100)] 
Move ESP grub shim configuration to prepare_grub_efi()

2 years agoMerge pull request #2154 from DaanDeMeyer/kernel-install
Jörg Behrmann [Sun, 10 Dec 2023 18:48:28 +0000 (19:48 +0100)] 
Merge pull request #2154 from DaanDeMeyer/kernel-install

Use kernel-install entry token if available

2 years agoInstall kernels to /boot 2154/head
Daan De Meyer [Sun, 10 Dec 2023 16:06:51 +0000 (17:06 +0100)] 
Install kernels to /boot

If users want to use XBOOTLDR partitions, then we have to put the
kernels in a separate location from the ESP stuff. Currently we put
everything in /efi when building the image, which means that users
don't have a way to specify that the kernels should be put in an
XBOOTLDR partition.

Let's fix this by installing kernels to /boot so that users can
populate an XBOOTLDR partition by simply using CopyFiles=/boot:/
in a repart xbootldr partition definition.

2 years agoUse kernel-install entry token if available
Daan De Meyer [Sun, 10 Dec 2023 13:24:04 +0000 (14:24 +0100)] 
Use kernel-install entry token if available

Let's try and look for the kernel-install entry token if
kernel-install v255 or newer is available. This makes us more
compatible with package manager upgrades as we'll use the same
directory that kernel-install will look for when invoked by a
package manager.

2 years agoFix tool display in check_systemd_tool()
Daan De Meyer [Sun, 10 Dec 2023 16:14:05 +0000 (17:14 +0100)] 
Fix tool display in check_systemd_tool()

2 years agoReturn full version from systemd_tool_version()
Daan De Meyer [Sun, 10 Dec 2023 16:10:33 +0000 (17:10 +0100)] 
Return full version from systemd_tool_version()

Let's allow comparing against stable releases as well by returning
the full version.

2 years agoaction: Switch to systemd v255 stable branch
Daan De Meyer [Sun, 10 Dec 2023 15:30:43 +0000 (16:30 +0100)] 
action: Switch to systemd v255 stable branch

Let's stop tracking systemd's latest commit on main and switch to
the v255 stable branch instead.

2 years agoAdd QemuFirmwareVariables=
Daan De Meyer [Sun, 10 Dec 2023 11:48:15 +0000 (12:48 +0100)] 
Add QemuFirmwareVariables=

This allows configuring the path to the qemu firmware variables to
use. This allows users to configure their own variables using
https://pypi.org/project/virt-firmware/ before passing it to mkosi.

This also fixes a bug where we didn't pass the variables file to
qemu if the firmware doesn't support secure boot.

2 years agoLook for /usr/lib/kernel/uki.conf as well
Daan De Meyer [Sun, 10 Dec 2023 13:23:37 +0000 (14:23 +0100)] 
Look for /usr/lib/kernel/uki.conf as well

2 years agoMerge pull request #2153 from DaanDeMeyer/min-version
Jörg Behrmann [Sun, 10 Dec 2023 13:18:47 +0000 (14:18 +0100)] 
Merge pull request #2153 from DaanDeMeyer/min-version

Allow specifying minimum mkosi version

2 years agoAllow specifying minimum mkosi version 2153/head
Daan De Meyer [Sun, 10 Dec 2023 12:17:45 +0000 (13:17 +0100)] 
Allow specifying minimum mkosi version

Currently, users often get a confusing message about some property
not existing when they try to use an older version of mkosi to build
a configuration that requires a newer version. Let's improve on this
by allowing configurations to declare the minimum version required to
build the configuration.

2 years agoClean up load_config() a little
Daan De Meyer [Sun, 10 Dec 2023 12:06:28 +0000 (13:06 +0100)] 
Clean up load_config() a little

2 years agoMerge pull request #2151 from DaanDeMeyer/pacman
Daan De Meyer [Sun, 10 Dec 2023 11:21:02 +0000 (12:21 +0100)] 
Merge pull request #2151 from DaanDeMeyer/pacman

arch: Move arch specific configuration out of setup_pacman()

2 years agotests: Use temporary mount point
Daan De Meyer [Sun, 10 Dec 2023 09:54:31 +0000 (10:54 +0100)] 
tests: Use temporary mount point

Instead of creating a directory owned by root in the cwd, let's just
use a temporary directory that we remove again afterwards.

2 years agoarch: Unconditionally assume initramfs package is installed 2151/head
Daan De Meyer [Sun, 10 Dec 2023 10:31:23 +0000 (11:31 +0100)] 
arch: Unconditionally assume initramfs package is installed

This doesn't prevent installing individual initramfs generators so
let's always set it and require users to specify mkinitcpio or dracut
if they really need one of these.

2 years agoarch: Move arch specific configuration out of setup_pacman()
Daan De Meyer [Sun, 10 Dec 2023 10:20:56 +0000 (11:20 +0100)] 
arch: Move arch specific configuration out of setup_pacman()

Let's make setup_pacman() about pacman and not about Arch.

2 years agodnf: Rename Repo to RpmRepository
Daan De Meyer [Sun, 10 Dec 2023 10:10:15 +0000 (11:10 +0100)] 
dnf: Rename Repo to RpmRepository

2 years agomkosi-initrd: Make locale configurable
Daan De Meyer [Sun, 10 Dec 2023 08:33:39 +0000 (09:33 +0100)] 
mkosi-initrd: Make locale configurable

Now that we use it as the default initrd, let's make the locale
configurable so we can override it when building an image.

2 years agoMerge pull request #2147 from DaanDeMeyer/gdb
Daan De Meyer [Sat, 9 Dec 2023 15:46:37 +0000 (16:46 +0100)] 
Merge pull request #2147 from DaanDeMeyer/gdb

Add gdb to default image

2 years agoAdd gdb to default image 2147/head
Daan De Meyer [Sat, 9 Dec 2023 13:57:28 +0000 (14:57 +0100)] 
Add gdb to default image

2 years agoFix ruff error
Daan De Meyer [Sat, 9 Dec 2023 14:57:34 +0000 (15:57 +0100)] 
Fix ruff error

2 years agoMerge pull request #2137 from DaanDeMeyer/shim
Daan De Meyer [Sat, 9 Dec 2023 13:57:00 +0000 (14:57 +0100)] 
Merge pull request #2137 from DaanDeMeyer/shim

Add support for installing shim

2 years agoMerge pull request #2142 from DaanDeMeyer/tests
Daan De Meyer [Sat, 9 Dec 2023 13:52:12 +0000 (14:52 +0100)] 
Merge pull request #2142 from DaanDeMeyer/tests

tests: Make more robust on distros with recent systemd

2 years agoMerge pull request #2145 from DaanDeMeyer/uname
Daan De Meyer [Sat, 9 Dec 2023 13:51:20 +0000 (14:51 +0100)] 
Merge pull request #2145 from DaanDeMeyer/uname

Pass uname to ukify

2 years agoarch: Add debug repositories
Daan De Meyer [Sat, 9 Dec 2023 12:10:46 +0000 (13:10 +0100)] 
arch: Add debug repositories

2 years agoRelax qemu check in uncaught_exception_handler() 2142/head
Daan De Meyer [Sat, 9 Dec 2023 11:51:46 +0000 (12:51 +0100)] 
Relax qemu check in uncaught_exception_handler()

qemu binaries can have many different names (qemu, qemu-kvm,
qemu-system-xxx, ...) so let's not log a stacktrace for any binary
that starts with "qemu".

2 years agotests: Make more robust on distros with recent systemd
Daan De Meyer [Fri, 8 Dec 2023 15:53:51 +0000 (16:53 +0100)] 
tests: Make more robust on distros with recent systemd

Let's make use of the fact that we can communicate the exit status
from VMs on recent versions of systemd. Even when it fails to run
qemu will often exit with exit status 0 so let's make our successful
exit status 123 and check for that instead of 0.

Let's also rework how we have systemd log. Instead of using
default_standard_output, let's have journald forward all logs to the
console. While we're at, let's also add some general useful debugging
kernel command line arguments that we also use in the systemd repository.

2 years agoMerge pull request #2144 from behrmann/ruffga
Daan De Meyer [Sat, 9 Dec 2023 12:05:17 +0000 (13:05 +0100)] 
Merge pull request #2144 from behrmann/ruffga

Use ruff in CI

2 years agoRevert "mkosi: include binutils in the packages for building" 2145/head
Daan De Meyer [Sat, 9 Dec 2023 11:59:16 +0000 (12:59 +0100)] 
Revert "mkosi: include binutils in the packages for building"

Now that we pass the kernel version explicitly to ukify, we
don't need to have binutils installed anymore as ukify only uses
readelf to autodetect the kernel version if it wasn't supplied
explicitly by the user.

This reverts commit 4953e2cb66f0713dc302d089e92894e852e5a045.

2 years agoPass uname to ukify
Daan De Meyer [Sat, 9 Dec 2023 11:58:33 +0000 (12:58 +0100)] 
Pass uname to ukify

Let's avoid triggering ukify's autodetect logic by passing in the
kernel version ourselves.

2 years agoUse mkosi-initrd to build the default initrd
Daan De Meyer [Fri, 8 Dec 2023 12:52:01 +0000 (13:52 +0100)] 
Use mkosi-initrd to build the default initrd

Instead of maintaining a separate default initrd, let's use
mkosi-initrd for the default initrd. This provides users with a more
batteries included initrd by default and saves us from having to
maintain two separate initrd definitions.

2 years agoci: print version of used tools 2144/head
Joerg Behrmann [Sat, 9 Dec 2023 11:26:02 +0000 (12:26 +0100)] 
ci: print version of used tools

2 years agoci: exchange isort and pyflakes for ruff
Joerg Behrmann [Sat, 9 Dec 2023 11:23:41 +0000 (12:23 +0100)] 
ci: exchange isort and pyflakes for ruff

2 years agofix ruff warnings
Joerg Behrmann [Sat, 9 Dec 2023 11:17:32 +0000 (12:17 +0100)] 
fix ruff warnings

2 years agoAdd support for installing shim 2137/head
Daan De Meyer [Thu, 7 Dec 2023 22:11:19 +0000 (23:11 +0100)] 
Add support for installing shim

Unfortunately shim is a necessary evil that we have to support. We
add a new option that allows choosing either a signed version, an
unsigned version or none at all (the default).

We also stop redirecting /boot/efi to /efi so that /efi is our pristine
directory for populating the ESP whereas /boot is unclaimed wasteland
free for package managers to write all kinds of stuff to.

2 years agomkosi: include binutils in the packages for building
Josef Bacik [Fri, 8 Dec 2023 22:28:21 +0000 (22:28 +0000)] 
mkosi: include binutils in the packages for building

On aarch64 the dependencies are different than x86 and we don't end up
with binutils getting picked up, which means readelf isn't available for
systemd-ukify when using mkosi-kernel on aarch64.  Explicitly add
bintuils to the list of packages, this allows mkosi-kernel to work
properly on an aarch64 machine.

2 years agomkosi-initrd: Fix typo
Daan De Meyer [Fri, 8 Dec 2023 13:01:16 +0000 (14:01 +0100)] 
mkosi-initrd: Fix typo

Fixes #2138

2 years agoqemu: Become root when copying for Ephemeral=
Daan De Meyer [Thu, 7 Dec 2023 21:49:16 +0000 (22:49 +0100)] 
qemu: Become root when copying for Ephemeral=

To copy the directory, we need to be root (either real or in the
user namespace), so let's do just that.

2 years agoShare default image configuration between debian and ubuntu
Daan De Meyer [Fri, 8 Dec 2023 09:13:26 +0000 (10:13 +0100)] 
Share default image configuration between debian and ubuntu

2 years agoRemove no longer necessary __init__.py from mkosi.resources
Joerg Behrmann [Thu, 7 Dec 2023 19:13:35 +0000 (20:13 +0100)] 
Remove no longer necessary __init__.py from mkosi.resources

2 years agoMove off of the deprecated importlib.resources API
Joerg Behrmann [Thu, 7 Dec 2023 18:09:34 +0000 (19:09 +0100)] 
Move off of the deprecated importlib.resources API

Python 3.9 brought a new importlib.resources API and deprecated the old
one. This introduces a small shim to use the part of the APi that guarantees a
Path object, thus making our usage of this just pathlike.

2 years agoMerge pull request #2131 from DaanDeMeyer/fork
Daan De Meyer [Thu, 7 Dec 2023 18:26:15 +0000 (19:26 +0100)] 
Merge pull request #2131 from DaanDeMeyer/fork

Run image builds in a fork again

2 years agoHandle SIGTERM like a keyboard interrupt 2131/head
Daan De Meyer [Thu, 7 Dec 2023 11:51:13 +0000 (12:51 +0100)] 
Handle SIGTERM like a keyboard interrupt

Let's make sure we do proper cleanup on SIGTERM as well.