]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
4 months agoSimplify package manager code a little 3597/head
Daan De Meyer [Tue, 18 Mar 2025 12:22:07 +0000 (13:22 +0100)] 
Simplify package manager code a little

4 months agoqemu: Remove unused argument from finalize_drive()
Daan De Meyer [Tue, 18 Mar 2025 10:49:17 +0000 (11:49 +0100)] 
qemu: Remove unused argument from finalize_drive()

4 months agoDrop mkosi-as-caller
Daan De Meyer [Tue, 18 Mar 2025 09:24:59 +0000 (10:24 +0100)] 
Drop mkosi-as-caller

Let's drop this trivial helper as well to clean things up. Migration
is trivial, just drop usage of the helper.

4 months agoDrop git safe.directory="*" environment variables
Daan De Meyer [Tue, 18 Mar 2025 09:24:03 +0000 (10:24 +0100)] 
Drop git safe.directory="*" environment variables

Not required anymore now that we run builds as the user invoking mkosi.

4 months agoDrop expand_specifier()
Daan De Meyer [Tue, 18 Mar 2025 09:20:44 +0000 (10:20 +0100)] 
Drop expand_specifier()

4 months agoMake user provided command line take preference over roothash=
Daan De Meyer [Fri, 14 Mar 2025 16:51:57 +0000 (17:51 +0100)] 
Make user provided command line take preference over roothash=

If the user provides their own root= or mount.usr= configuration,
let's always have that take preference over the partition roothash=
or usrhash=

This is preparation for adding support for root=dissect in which case
we don't need roothash= or usrhash= on the kernel command line.

4 months agoReplace conf tag with ini in markdown
Septatrix [Sat, 15 Mar 2025 14:12:40 +0000 (15:12 +0100)] 
Replace conf tag with ini in markdown

No markdown renderer has any clue which highlighting to use for conf files
whereas INI is well defined and results in proper highlighting.

5 months agoUse Path more in initrd.py and addon.py
Daan De Meyer [Thu, 13 Mar 2025 20:05:42 +0000 (21:05 +0100)] 
Use Path more in initrd.py and addon.py

5 months agofedora: Change default release to rawhide
Daan De Meyer [Thu, 13 Mar 2025 14:35:49 +0000 (15:35 +0100)] 
fedora: Change default release to rawhide

Fedora releases new versions quite regularly, sometimes more regularly
than we do mkosi releases. This means that users on the latest official
mkosi release can end up building EOL fedora releases because the default
release will be the latest fedora release at the time of the mkosi release
which might be EOL already. Let's switch to rawhide as the default release
so users are guaranteed to get something recent regardless of how old their
mkosi version is.

This matches what we already do for debian, opensuse, arch and other distros.

5 months agoMerge pull request #3543 from keszybz/initrd-version-short-option
Jörg Behrmann [Thu, 13 Mar 2025 14:18:30 +0000 (15:18 +0100)] 
Merge pull request #3543 from keszybz/initrd-version-short-option

Add short option for initrd kernel version

5 months agoinitrd: add -k as shorthand for --kernel-version 3543/head
Zbigniew Jędrzejewski-Szmek [Mon, 17 Feb 2025 09:16:08 +0000 (10:16 +0100)] 
initrd: add -k as shorthand for --kernel-version

--kernel-version is the option that I use the most often. Having a short
option would be nice.

'-v' would another option for the option, but I think it could be confused
with --version.

5 months agoinitrd: split out argument parser creation to helper function
Zbigniew Jędrzejewski-Szmek [Sun, 16 Feb 2025 20:39:19 +0000 (21:39 +0100)] 
initrd: split out argument parser creation to helper function

5 months agomkosi/dependencies: make invocations shorter
Zbigniew Jędrzejewski-Szmek [Fri, 24 Jan 2025 15:42:44 +0000 (16:42 +0100)] 
mkosi/dependencies: make invocations shorter

Both styles were used by the existing code: ['--foo=bar'] and ['--foo', 'bar'].
Switch to the former exclusively. A single arg like '--foo=bar' is easier to
read and/or select&paste in the log output. Also, we avoid explicit str()
wrappers in a bunch of places.

5 months agoMerge pull request #3588 from behrmann/sandboxfix
Daan De Meyer [Wed, 12 Mar 2025 08:03:31 +0000 (09:03 +0100)] 
Merge pull request #3588 from behrmann/sandboxfix

Check for CAP_SYS_ADMIN instead of root

5 months agoTry to find volatile overlay upperdir directory that's not on overlayfs 3588/head
Daan De Meyer [Tue, 11 Mar 2025 20:12:11 +0000 (21:12 +0100)] 
Try to find volatile overlay upperdir directory that's not on overlayfs

Making a directory on overlayfs the upperdir of another overlayfs is
rejected by the kernel. Let's try to find a directory that's not on
overlayfs. The /dev/shm fallback is because on a default podman container
even /tmp is on overlayfs.

5 months agotree: Make security.selinux detection more robust
Daan De Meyer [Tue, 11 Mar 2025 20:13:57 +0000 (21:13 +0100)] 
tree: Make security.selinux detection more robust

5 months agoCheck for CAP_SYS_ADMIN instead of root
Daan De Meyer [Tue, 11 Mar 2025 13:31:13 +0000 (14:31 +0100)] 
Check for CAP_SYS_ADMIN instead of root

Even if we're running as root, we might not have CAP_SYS_ADMIN, so
let's always check for CAP_SYS_ADMIN.

5 months agoAdd option to persist runtime drives
Septatrix [Sat, 8 Mar 2025 13:21:34 +0000 (14:21 +0100)] 
Add option to persist runtime drives

5 months agoMerge pull request #3585 from DaanDeMeyer/doc
Daan De Meyer [Fri, 7 Mar 2025 10:44:43 +0000 (11:44 +0100)] 
Merge pull request #3585 from DaanDeMeyer/doc

5 months agoRework --run-build-scripts 3585/head
Daan De Meyer [Thu, 6 Mar 2025 22:47:33 +0000 (23:47 +0100)] 
Rework --run-build-scripts

Instead of (optionally) building the image when this option is enabled,
let's insist that the image has already been built and cached. This allows
us to reuse the history of the previous build if History= is enabled. At
the same time, rename the option to --rerun-build-scripts to indicate more
clearly that the image needs to have been built once already.

This allows the option to be used in systemd's mkosi.clangd script to replace
"-t none" and "--incremental=strict" there.

5 months agoDon't run configure scripts if we're reusing the history
Daan De Meyer [Thu, 6 Mar 2025 21:55:32 +0000 (22:55 +0100)] 
Don't run configure scripts if we're reusing the history

5 months agoDrop unnecessary condition
Daan De Meyer [Thu, 6 Mar 2025 21:45:31 +0000 (22:45 +0100)] 
Drop unnecessary condition

A few lines earlier, we already short-circuit run_verb() if the verb
does not need a build, so no need to check here again.

5 months agoUse target path as mount tags
Septatrix [Wed, 5 Mar 2025 20:34:09 +0000 (21:34 +0100)] 
Use target path as mount tags

This prevents collisions when mounting something
to directories of the same name or root.

5 months agoRevert 9f4d174daac954aaa9e18ee9bb58c6d7a946ec9d
Daan De Meyer [Thu, 6 Mar 2025 11:18:59 +0000 (12:18 +0100)] 
Revert 9f4d174daac954aaa9e18ee9bb58c6d7a946ec9d

The declarative package pulls in perl which is not ideal, let's
switch back to the previous approach.

5 months agoMerge pull request #3582 from DaanDeMeyer/downgrade
Daan De Meyer [Thu, 6 Mar 2025 10:48:42 +0000 (11:48 +0100)] 
Merge pull request #3582 from DaanDeMeyer/downgrade

5 months agoMove package installation and removal to PackageManager interface 3582/head
Daan De Meyer [Wed, 5 Mar 2025 19:32:58 +0000 (20:32 +0100)] 
Move package installation and removal to PackageManager interface

There's no need for these to be implemented by the Distribution
interface as they don't need distribution specific knowledge so let's
move them to the PackageManager interface instead.

5 months agoapt: Add higher priority for mkosi local repository
Daan De Meyer [Wed, 5 Mar 2025 19:11:58 +0000 (20:11 +0100)] 
apt: Add higher priority for mkosi local repository

Apt actually supports priorities as well, so add a high priority like
we do for the other package managers as well for the local mkosi repository.

5 months agodebian: Install policy-rcd-declarative by default
Daan De Meyer [Wed, 5 Mar 2025 18:59:26 +0000 (19:59 +0100)] 
debian: Install policy-rcd-declarative by default

Debian switched to systemd ages ago, but as we know legacy stuff
tends to linger in Debian for quite a while. Let's standardize on
using systemd presets to enable daemons by installing packages for
a deny-all policy for sysv-init style packages instead of messing
with the script ourselves.

5 months agoSort packages during parsing
Daan De Meyer [Wed, 5 Mar 2025 14:15:07 +0000 (15:15 +0100)] 
Sort packages during parsing

5 months agoFix grammar
Nils K [Tue, 4 Mar 2025 13:50:11 +0000 (14:50 +0100)] 
Fix grammar

Follow up for aa4c8339484363df032ac72d4a739f4bbc16e183

5 months agoMerge pull request #3580 from DaanDeMeyer/rocky
Daan De Meyer [Tue, 4 Mar 2025 10:58:00 +0000 (11:58 +0100)] 
Merge pull request #3580 from DaanDeMeyer/rocky

5 months agocentos: Handle major/minor releases in derivatives properly 3580/head
Daan De Meyer [Tue, 4 Mar 2025 08:21:25 +0000 (09:21 +0100)] 
centos: Handle major/minor releases in derivatives properly

While centos doesn't have major/minor releases, rocky, alma and rhel
do, so let's make sure we handle those cases properly.

Additionally, we also fix EPEL to use the proper major/minor release
when we're doing EPEL 10, as since EPEL 10 there's major/minor releases
for EPEL as well.

5 months agoinitrd: Pass process environment to mkosi as well
Daan De Meyer [Tue, 4 Mar 2025 09:43:28 +0000 (10:43 +0100)] 
initrd: Pass process environment to mkosi as well

5 months agoImprove error message slightly
Daan De Meyer [Tue, 4 Mar 2025 08:01:33 +0000 (09:01 +0100)] 
Improve error message slightly

5 months agoAdd "raid" initrd profile
Antonio Alvarez Feijoo [Tue, 4 Mar 2025 07:37:25 +0000 (08:37 +0100)] 
Add "raid" initrd profile

This initrd profile provides support for assembling RAID arrays.

5 months agoParse both mkosi.local.conf and mkosi.local/
Septatrix [Sun, 2 Mar 2025 20:53:09 +0000 (21:53 +0100)] 
Parse both mkosi.local.conf and mkosi.local/

This aligns more with what the users expects
and allows working around some limitations of the config system
(esp. regarding the interplay of `Include=` and `Profiles=`).

5 months agoAdd --pretty=no to suppress output from systemd-repart when updating
MoltenArmor [Mon, 3 Mar 2025 09:34:08 +0000 (17:34 +0800)] 
Add --pretty=no to suppress output from systemd-repart when updating

5 months agoDon't mount input read-only if it's the same as output in sign_efi_binary()
Daan De Meyer [Sun, 2 Mar 2025 20:57:57 +0000 (21:57 +0100)] 
Don't mount input read-only if it's the same as output in sign_efi_binary()

Otherwise the output file cannot be written.

Replaces #3573

5 months agoFix Drives= documentation
Nils K [Mon, 3 Mar 2025 00:27:46 +0000 (01:27 +0100)] 
Fix Drives= documentation

Follow up for 7ff9a890c1947b4111010e81e0e64e06a0e8d800

5 months agoRevert "Bypass tmpfiles, sysusers and presets as well when running package ma…"
Luca Boccassi [Sun, 2 Mar 2025 10:58:20 +0000 (10:58 +0000)] 
Revert "Bypass tmpfiles, sysusers and presets as well when running package ma…"

This reverts commit 824d63e0d30e56ee34a193f624230c1ae5af0d58.

5 months agobuild(deps): bump redhat-plumbers-in-action/differential-shellcheck
dependabot[bot] [Sat, 1 Mar 2025 22:43:38 +0000 (22:43 +0000)] 
build(deps): bump redhat-plumbers-in-action/differential-shellcheck

Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.5.1 to 5.5.3.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/redhat-plumbers-in-action/differential-shellcheck/compare/5fa026e4797665181a0f7c6fa4a73c09348ae78c...dd551ce780d8af741f8cd8bab6982667b906b457)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agobuild(deps): bump github/codeql-action from 3.28.8 to 3.28.10
dependabot[bot] [Sat, 1 Mar 2025 22:43:35 +0000 (22:43 +0000)] 
build(deps): bump github/codeql-action from 3.28.8 to 3.28.10

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.8 to 3.28.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/dd746615b3b9d728a6a37ca2045b68ca76d4841a...b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agoBypass tmpfiles, sysusers and presets as well when running package managers
Daan De Meyer [Sat, 1 Mar 2025 15:27:38 +0000 (16:27 +0100)] 
Bypass tmpfiles, sysusers and presets as well when running package managers

We invoke all of these ourselves so there's no need to run them
while invoking package managers.

5 months agoRename "storage" initrd profile to "lvm"
Antonio Alvarez Feijoo [Fri, 28 Feb 2025 21:30:06 +0000 (22:30 +0100)] 
Rename "storage" initrd profile to "lvm"

Since it actually only provides support for LVM, it's best to keep the different
specific functionalities separate.

5 months agoMerge pull request #3561 from aafeijoo-suse/initrd-profiles
Daan De Meyer [Fri, 28 Feb 2025 14:50:35 +0000 (15:50 +0100)] 
Merge pull request #3561 from aafeijoo-suse/initrd-profiles

5 months agomkosi-initrd: add --profile option 3561/head
Antonio Alvarez Feijoo [Fri, 28 Feb 2025 12:16:51 +0000 (13:16 +0100)] 
mkosi-initrd: add --profile option

Enable only the initrd profiles specified with this option, rather than all by
default. This saves space and allows the user to choose only what is needed on
each system.

5 months agoSkip createrepo() for apt if there are no debs
Daan De Meyer [Fri, 28 Feb 2025 10:49:41 +0000 (11:49 +0100)] 
Skip createrepo() for apt if there are no debs

reprepro fails if there are no packages passed to it so skip it if
there are no packages.

5 months agoman: remove "=" in boolean options
Antonio Alvarez Feijoo [Fri, 28 Feb 2025 08:30:49 +0000 (09:30 +0100)] 
man: remove "=" in boolean options

5 months agoEnsure environment GNUGPHOME is an absolute path
Nick Labich [Thu, 27 Feb 2025 20:53:50 +0000 (15:53 -0500)] 
Ensure environment GNUGPHOME is an absolute path

5 months agoAdd InitrdProfiles= with initial storage profile
Daan De Meyer [Thu, 27 Feb 2025 15:16:21 +0000 (16:16 +0100)] 
Add InitrdProfiles= with initial storage profile

Let's allow not installing lvm2 in the initrd by introducing a
storage profile which users can disable.

5 months agoqemu: Switch to -blockdev instead of -drive where possible
Daan De Meyer [Wed, 26 Feb 2025 15:42:16 +0000 (16:42 +0100)] 
qemu: Switch to -blockdev instead of -drive where possible

-drive is considered legacy whereas -blockdev is the new interface.
It's slightly more verbose but not incredibly so, let's switch to it.

5 months agoMerge pull request #3556 from DaanDeMeyer/build-overlay
Daan De Meyer [Wed, 26 Feb 2025 14:43:06 +0000 (15:43 +0100)] 
Merge pull request #3556 from DaanDeMeyer/build-overlay

Implement build overlay mounting with mkosi-sandbox

5 months agoMerge pull request #3555 from DaanDeMeyer/history
Daan De Meyer [Wed, 26 Feb 2025 13:55:31 +0000 (14:55 +0100)] 
Merge pull request #3555 from DaanDeMeyer/history

Introduce --run-build-scripts (-R) to always run build scripts

5 months agoImplement build overlay mounting with mkosi-sandbox 3556/head
Daan De Meyer [Wed, 26 Feb 2025 13:42:12 +0000 (14:42 +0100)] 
Implement build overlay mounting with mkosi-sandbox

Now that we have Context.rootoptions(), we can switch out how we set
up the root mount without having to modify code all over the place.

Let's use this to get rid of mount_build_overlay() and instead replace
it with setup_build_overlay(), which simply configures a bunch of
fields on Context that make rootoptions() set up the root mount as an
overlay instead of a bind mount.

5 months agoIntroduce Context.rootoptions()
Daan De Meyer [Wed, 26 Feb 2025 13:24:29 +0000 (14:24 +0100)] 
Introduce Context.rootoptions()

5 months agoIntroduce --run-build-scripts (-R) to always run build scripts 3555/head
Daan De Meyer [Wed, 26 Feb 2025 11:14:38 +0000 (12:14 +0100)] 
Introduce --run-build-scripts (-R) to always run build scripts

Currently we run "mkosi -t none" in systemd and mkosi-kernel to run
the build script(s) without rebuilding the entire image. Using the
"none" output format for this purpose is a hack. It also breaks when
using History=yes as running mkosi -t none will change the output
format in the history after which running mkosi qemu will fail saying
it can't boot the "none" output format.

Let's introduce a --run-build-scripts argument which will make us always
run the build scripts regardless of whether the image has already been
built or not. At the same time, remove various behaviors from the "none"
format that were solely added to enable the hack of using it to run build
scripts without rebuilding the image:

- Clean up outputs from the previous build when the "none" output format
  is used

5 months agotree: Ignore symlinks when checking for subvolumes in rmtree()
Daan De Meyer [Wed, 26 Feb 2025 12:35:04 +0000 (13:35 +0100)] 
tree: Ignore symlinks when checking for subvolumes in rmtree()

5 months agoinstaller: Do not modify buildroot in setup() methods
Daan De Meyer [Wed, 26 Feb 2025 12:25:29 +0000 (13:25 +0100)] 
installer: Do not modify buildroot in setup() methods

5 months agoRemove outputs as well if we don't have a cached image
Daan De Meyer [Wed, 26 Feb 2025 11:31:26 +0000 (12:31 +0100)] 
Remove outputs as well if we don't have a cached image

5 months agoIntroduce Config.is_incremental()
Daan De Meyer [Wed, 26 Feb 2025 11:41:00 +0000 (12:41 +0100)] 
Introduce Config.is_incremental()

5 months agoRename remove_output_dir to remove_outputs in run_clean()
Daan De Meyer [Wed, 26 Feb 2025 11:23:25 +0000 (12:23 +0100)] 
Rename remove_output_dir to remove_outputs in run_clean()

5 months agoDrop rmtree(context.root) in "none" return path as well
Daan De Meyer [Wed, 26 Feb 2025 11:10:55 +0000 (12:10 +0100)] 
Drop rmtree(context.root) in "none" return path as well

Follow up for c71c7d933bbad8851a80d1db83ddc1d8a8b362e1

5 months agoDon't call finalize_staging() for "none" output format
Daan De Meyer [Wed, 26 Feb 2025 11:10:17 +0000 (12:10 +0100)] 
Don't call finalize_staging() for "none" output format

The none output format generates no outputs so there's no need to
call finalize_staging().

5 months agoSave all images to history JSON
Daan De Meyer [Wed, 26 Feb 2025 11:08:55 +0000 (12:08 +0100)] 
Save all images to history JSON

Preparation for the upcoming commit where we'll need all the images
instead of just the main one when reading the history.

5 months agoMerge pull request #3554 from bluca/netesp
Luca Boccassi [Wed, 26 Feb 2025 10:44:13 +0000 (10:44 +0000)] 
Merge pull request #3554 from bluca/netesp

mkosi-obs: assorted fixes for netesp

5 months agomkosi-obs: rearrange settings into a subfile that is only for Profile=main 3554/head
Luca Boccassi [Tue, 25 Feb 2025 14:10:31 +0000 (14:10 +0000)] 
mkosi-obs: rearrange settings into a subfile that is only for Profile=main

These cannot be used with subimages, so move them down one level

5 months agomkosi-obs: support multiple mkosi.postoutput invocations
Luca Boccassi [Tue, 25 Feb 2025 14:05:33 +0000 (14:05 +0000)] 
mkosi-obs: support multiple mkosi.postoutput invocations

When multiple images are built mkosi.postoutput runs once
per image, so add access to output directory and ensure
the hashes.cpio.rsasign archive accumulates the hashes for
all images before proceeding to the next stage

5 months agomkosi-obs: rearrange second stage so that only unsigned hashes are staged for third
Luca Boccassi [Tue, 25 Feb 2025 14:04:22 +0000 (14:04 +0000)] 
mkosi-obs: rearrange second stage so that only unsigned hashes are staged for third

Create cpio for next stage at the very end, after all
signed hashes have been handled and removed, to avoid
resigning already signed files

5 months agomkosi-obs: drop leftover debug env
Luca Boccassi [Tue, 25 Feb 2025 11:42:31 +0000 (11:42 +0000)] 
mkosi-obs: drop leftover debug env

5 months agomkosi-obs: fix compression detection
Luca Boccassi [Tue, 25 Feb 2025 11:40:02 +0000 (11:40 +0000)] 
mkosi-obs: fix compression detection

The recompress variable is not reset in the loop, so if
there is a compressed ddi and an uncompressed one, the
variable will be true for the second one. Reset it.

5 months agomkosi-obs: carry over all raw and efi files, not just those that match IMAGE_ID
Luca Boccassi [Tue, 25 Feb 2025 10:34:12 +0000 (10:34 +0000)] 
mkosi-obs: carry over all raw and efi files, not just those that match IMAGE_ID

e.g.: netesp in particleos

5 months agoMerge pull request #3553 from DaanDeMeyer/cow
Daan De Meyer [Tue, 25 Feb 2025 19:08:51 +0000 (20:08 +0100)] 
Merge pull request #3553 from DaanDeMeyer/cow

Enable Hyperscale rpm COW plugin

5 months agoEnable Hyperscale rpm COW plugin 3553/head
Daan De Meyer [Tue, 25 Feb 2025 17:46:16 +0000 (18:46 +0100)] 
Enable Hyperscale rpm COW plugin

The CentOS Hyperscale SIG provides rpm/dnf plugins to enable rpm
COW which drastically speeds up image builds so let's ship the
necessary logic to make use of it when building images with the
Hyperscale experimental repositories.

5 months agorpm: Enable plugins again
Daan De Meyer [Tue, 25 Feb 2025 17:51:18 +0000 (18:51 +0100)] 
rpm: Enable plugins again

We disabled this a long time ago, likely when we were still using
/etc from the host, let's try enabling the plugins again and see
what happens in CI.

5 months agoAdd Image= match
Daan De Meyer [Tue, 25 Feb 2025 13:35:09 +0000 (14:35 +0100)] 
Add Image= match

5 months agoMove /work directory cleanup out of remove_files()
Daan De Meyer [Tue, 25 Feb 2025 10:50:21 +0000 (11:50 +0100)] 
Move /work directory cleanup out of remove_files()

This has to be done after running the finalize scripts as a
mkosi.finalize.chroot might recreate the /work directory.

5 months agoMerge pull request #3550 from bluca/authvars
Daan De Meyer [Tue, 25 Feb 2025 07:16:01 +0000 (08:16 +0100)] 
Merge pull request #3550 from bluca/authvars

mkosi-obs: fixes, secureboot self-enroll, sign bootloaders

5 months agomkosi-obs: add support for UEFI SecureBoot self enrollment 3550/head
Luca Boccassi [Tue, 25 Feb 2025 00:12:36 +0000 (00:12 +0000)] 
mkosi-obs: add support for UEFI SecureBoot self enrollment

Create authvars and store them in the ESP with the project cert
used as PK/KEK/db

5 months agomkosi-obs: sign bootloaders in ESPs
Luca Boccassi [Tue, 25 Feb 2025 00:11:46 +0000 (00:11 +0000)] 
mkosi-obs: sign bootloaders in ESPs

If there are bootloaders in the ESP(s), sign them too. Useful to
ensure everything is signed also with the certificate in the project
where the image is built.

5 months agomkosi-obs: add support for .raw.img
Luca Boccassi [Tue, 25 Feb 2025 00:09:51 +0000 (00:09 +0000)] 
mkosi-obs: add support for .raw.img

Needed for netesp

5 months agomkosi-obs: create directories in ESP before calling mcopy
Luca Boccassi [Tue, 25 Feb 2025 00:08:38 +0000 (00:08 +0000)] 
mkosi-obs: create directories in ESP before calling mcopy

It does not create leading directories. Set -D s to skip when
they already exist.

5 months agomkosi-obs: also check that ESP offset is not an empty string
Luca Boccassi [Tue, 25 Feb 2025 00:06:52 +0000 (00:06 +0000)] 
mkosi-obs: also check that ESP offset is not an empty string

Can also happen, not just 'null'

5 months agoFix parse_drive()
Daan De Meyer [Mon, 24 Feb 2025 14:58:58 +0000 (15:58 +0100)] 
Fix parse_drive()

5 months agodocs: Update building-rpms-from-source.md
Daan De Meyer [Sun, 23 Feb 2025 15:40:27 +0000 (16:40 +0100)] 
docs: Update building-rpms-from-source.md

5 months agoMerge pull request #3545 from DaanDeMeyer/suppress-sync
Daan De Meyer [Sun, 23 Feb 2025 16:19:52 +0000 (17:19 +0100)] 
Merge pull request #3545 from DaanDeMeyer/suppress-sync

5 months agoSpecify --suppress-sync when running package managers 3545/head
Daan De Meyer [Sun, 23 Feb 2025 15:20:53 +0000 (16:20 +0100)] 
Specify --suppress-sync when running package managers

Package managers tend to make sure of sync() and friends to ensure
that any files they write are actually written to disk. This is
important when a package manager is used to do system package upgrades,
but is unnecessary when using package managers to build OS images. So
let's make sync() and friends a noop when we invoke package managers

Replaces #3544

5 months agosandbox: Add --suppress-sync option to suppress sync() syscalls
Daan De Meyer [Sun, 23 Feb 2025 15:18:27 +0000 (16:18 +0100)] 
sandbox: Add --suppress-sync option to suppress sync() syscalls

We'll make use of this to suppress calls to sync() when running
package managers.

5 months agomkosi-obs: use new sd-keyutil verb to attach dm-verity signature
Luca Boccassi [Mon, 17 Feb 2025 13:21:42 +0000 (13:21 +0000)] 
mkosi-obs: use new sd-keyutil verb to attach dm-verity signature

5 months agoReduce the number of filesystems we remount noexec/nosuid/nodev when root
Daan De Meyer [Fri, 21 Feb 2025 09:57:39 +0000 (10:57 +0100)] 
Reduce the number of filesystems we remount noexec/nosuid/nodev when root

For mkosi-initrd, /etc might very well contain executable scripts which
we should allow to run, so let's only mount /boot and /efi nodev/nosuid/noexec.

5 months agoAdd --debug-sandbox option to mkosi-initrd and mkosi-addon
Antonio Alvarez Feijoo [Fri, 21 Feb 2025 09:48:39 +0000 (10:48 +0100)] 
Add --debug-sandbox option to mkosi-initrd and mkosi-addon

5 months agoUse Config.finalize_environment() in Installer.finalize_environment()
Daan De Meyer [Thu, 20 Feb 2025 19:43:43 +0000 (20:43 +0100)] 
Use Config.finalize_environment() in Installer.finalize_environment()

Otherwise we don't get the required proxy environment variables.

5 months agoinitrd: add modules for fido2 and amd laptop
Luca Boccassi [Wed, 19 Feb 2025 23:13:27 +0000 (23:13 +0000)] 
initrd: add modules for fido2 and amd laptop

Needed for FIDO2 unlock and other stuff on my laptop. Adds
~200kb or so to the UKI.

5 months agoCopy /etc/group into the sandbox tree instead of passwd
Jörg Behrmann [Thu, 20 Feb 2025 17:34:21 +0000 (18:34 +0100)] 
Copy /etc/group into the sandbox tree instead of passwd

5 months agoREADME: Reference EXAMPLES and mkosi documentation
Philip Molloy [Thu, 20 Feb 2025 13:49:26 +0000 (14:49 +0100)] 
README: Reference EXAMPLES and mkosi documentation

Generally, examples are a great way to get started with a new tool.
Additionally, there does not appear to be formal getting started
documentation for mkosi.

5 months agoBump Fedora initrd size
Daan De Meyer [Wed, 19 Feb 2025 15:01:39 +0000 (16:01 +0100)] 
Bump Fedora initrd size

Fixes CI failure because the Fedora initrd increased in size again.

5 months agomkosi-obs: fix searching for multiple files to sign
Luca Boccassi [Wed, 19 Feb 2025 15:15:45 +0000 (15:15 +0000)] 
mkosi-obs: fix searching for multiple files to sign

Due to quotes a single entry in the array is created by 'find', instead of one
entry per file

5 months agomkosi-obs: fix creating subfolder structure for signature cpio
Luca Boccassi [Wed, 19 Feb 2025 15:15:12 +0000 (15:15 +0000)] 
mkosi-obs: fix creating subfolder structure for signature cpio

The signature file will be stored in the same directory structure it was
picked from, to allow having multiple files with the same name

5 months agoClean up default tools tree package lists
Daan De Meyer [Wed, 19 Feb 2025 14:21:18 +0000 (15:21 +0100)] 
Clean up default tools tree package lists

- util-linux is not needed anymore since we do mounts ourselves now
- dpkg is pulled in by apt on arch and we don't list it explicitly elsewhere
- glibc-gconv-modules-extra should be pulled in by something else on opensuse by now
- python3-cryptography is only required on ubuntu, rest already has a dependency on
  it in systemd-ukify or is already on systemd v257 which doesn't need it anymore
- libarchive-tools seems like a leftover that isn't installed anywhere else

5 months agoMerge pull request #3527 from DaanDeMeyer/dependencies
Daan De Meyer [Wed, 19 Feb 2025 14:02:23 +0000 (15:02 +0100)] 
Merge pull request #3527 from DaanDeMeyer/dependencies

5 months agomkosi-tools: Split off misc, package-manager and runtime profiles 3527/head
Daan De Meyer [Wed, 19 Feb 2025 11:39:06 +0000 (12:39 +0100)] 
mkosi-tools: Split off misc, package-manager and runtime profiles

Let's make the dependencies verb a little more flexible by splitting
off various profiles in mkosi-tools, the misc, package-manager and
runtime profiles. The misc profile contains all the useful tools we
install to make sure they're available in scripts. The package manager
contains non-native package managers and related tools. The runtime
profile contains all the tools required to boot images. The regular
configuration now only includes the tools required to build native images
with mkosi.

The default tools tree still includes both the misc, package-manager and
runtime profiles by default but the list of profiles can be changed with
the new ToolsTreeProfiles= setting. The dependencies verb includes neither
profile, but we now allow passing arbitrary settings to the dependency verb
as arguments so that packages from additional profiles can be requested if
needed.