]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
11 months agoIntroduce mkosi-sandbox and stop using subuids for image builds 2956/head
Daan De Meyer [Fri, 16 Aug 2024 21:41:49 +0000 (23:41 +0200)] 
Introduce mkosi-sandbox and stop using subuids for image builds

Over the last years, we've accumulated a rather nasty set of workarounds
for various issues in bubblewrap:

- We contributed setpgid to util-linux and use it if available because
  bubblewrap does not support making its child process the foreground
  process.
- We added the innerpid logic to run() because bubblewrap does not forward
  signals to the separate child process it runs in the sandbox which meant
  they were getting SIGKILLed when we killed bubblewrap, preventing proper
  cleanup from happening.
- bubblewrap does not provide a proper way to detect whether the command
  was found in the sandbox or not, which meant we had to execute command -v
  within the sandbox separately to check whether the command exists or not.
- We had to add extra logic to make sure / was a mount in the initramfs to
  allow running mkosi in the initramfs as bubblewrap does not fall back to
  MS_MOVE if pivot_root() doesn't work.
- We had to stitch together shell invocations after bubblewrap but before
  executing the actual command we want to run to make sure directories had
  the correct mode as bubblewrap creates everything with mode 0700 which was
  too restrictive in many cases for us. This was fixed with new --perms and
  --chmod options in bubblewrap 0.5 but we had to keep compat with 0.4
  because that's what's shipped in CentOS Stream 9.
- We had to figure out a shell hack to do overlayfs mounts as these are not
  supported by bubblewrap (even though a PR for the feature has been open for
  years).
- We had to introduce a Mount struct to pass around mounts so we could deduplicate
  and sort them before passing them to bubblewrap as bubblewrap did not do this
  itself.
- Debugging all the above was made all the harder by the fact that bubblewrap's
  source code is full of tech debt from its history of being a setuid tool
  instead of using user namespaces. Getting any fixes into upstream is almost
  impossible as the tool is practically unmaintained.

Aside from bubblewrap, our other source of troubles has been newuidmap/newgidmap.
Running as a user within the subuid range configured in /etc/sub{u,g}id has
meant we're constantly fixing ownership and permissions issues where stuff needs
to be chowned and chmodded everywhere to make sure the current user and the
subuid user can access the proper files. Another unfortunate side effect is that
users end up with many files owned by the subuid root user in their home
directories when building images with mkosi;

Let's fix all these issues at once by getting rid of bubblewrap and
newuidmap/newgidmap.

bubblewrap is replaced with a new tool mkosi-sandbox. It looks and behaves a
lot like bubblewrap, except it's much less code and much more flexible to fit
our needs, allowing us to get rid of all the hacks we've built up over the years to
work around issues that didn't get fixed in bubblewrap.

To get rid of newuidmap/newgidmap, a rework of our user namespacing was needed.
The need to use newuidmap/newgidmap came from the assumption that we need a full
65k subuid range to do unprivileged image builds, as distributions ship packages
containing files and directories that are not owned by the root user. After some
investigation, it turns out that there's very few files and directories not owned
by root in distribution packages if you ignore /var. If we could temporarily
ignore the ownership on these files and directories until we can get distributions
to only ship root owned files in /usr and /etc of their packages, we could simply
map the current user to root in a user namespace and get rid of the subuid range
completely.

Turns out that's possible with a seccomp filter. seccomp allows you to make all
chown() syscalls succeed without actually doing anything. The files and directories
end up owned by the root user instead. If we assume this is OK and are OK with
instructing users to use tmpfiles to fix up the permissions on first boot if needed,
a seccomp filter like this is sufficient to allow us to get rid of doing image
builds within a subuid user namespace.

It turns out we can go one step further. It turns out that for the majority of
the image build, one doesn't actually need to be the root user. Only package
managers and systemd-repart need the current user to be mapped to root to do their
job correctly. The reason we did the entire build mapped to root until now was
that we need to do a few mounts as part of the image build process and for now
I was under the assumption that you needed to be root for that. It turns out that
when you unshare a user namespace, you get a full set of capabilities regardless
of whether you're root or some other uid in the user namespace. The only difference
is that when you exec a subprocess as root, the capabilities aren't lost, whereas
they are when you exec a subprocess as a non-root user. This can be avoided by
adding the capabilities of the non-root user to the inheritable and ambient set.
Once that's done, any subprocess exec'd by a non-root user in the user namespace
can mount as many bind and overlay mounts as they can think of.

The above allows us to run most of the image build under the current user uid
instead of root, only switching to root when running package managers, invoking
systemd-repart or systemd-tmpfiles, or when chroot-ing into the image. This allows
us to get rid of various hacks we had to look up the proper user name or home
directory.

Specifically, we can get rid of the following:

- mkosi-as-caller can become a noop since we now by default run the build as the
  caller.
- Lots of chmod()'s and chown()'s can be removed
- All uses of INVOKING_USER.uid/gid can be removed, and most can be replaced with
  simple os.getuid()/os.getgid()
- We can use /etc/passwd and /etc/group from the host instead of building our own
- We can get rid of the Acl= option as the user will now be able to remove (almost)
  all files written by mkosi.
- We don't have to rchown the package manager cache directory anymore after each
  build. Root user builds will now use the system cache instead of the per user
  cache.
- We can get rid of the Mount struct as mkosi-sandbox dedups and sorts operations
  itself.

One thing to note is that if we're invoked as root, none of the seccomp or capabilities
stuff applies and it is all skipped as it's not required in that case. This means that
when building as root it's still possible to have more than one user in the generated
image unlike when building unprivileged. Also note that users can still be added to
/etc/passwd and such, they just can't own any files or directories in the image itself
until the image is booted.

11 months agoapt: Remove mounts argument from invoke()
Daan De Meyer [Wed, 21 Aug 2024 06:17:51 +0000 (08:17 +0200)] 
apt: Remove mounts argument from invoke()

11 months agoMerge pull request #2954 from NekkoDroid/executable-mkosi-version
Daan De Meyer [Tue, 20 Aug 2024 10:42:17 +0000 (12:42 +0200)] 
Merge pull request #2954 from NekkoDroid/executable-mkosi-version

Add executable `mkosi.version` support for generating the version dynamically

11 months agoClean up version bump logic 2954/head
Michael Ferrari [Wed, 14 Aug 2024 20:19:00 +0000 (22:19 +0200)] 
Clean up version bump logic

11 months agoAdd executable `mkosi.version` support
Michael Ferrari [Wed, 7 Aug 2024 09:37:48 +0000 (11:37 +0200)] 
Add executable `mkosi.version` support

`mkosi.version` is executed during configuration parsing, as opposed
to reading the contents of `mkosi.version`. This allows querying the
version before the build without needing to manually adjust the version
beforehand.

This allows using date based versioning by writing a script outputting
`date '+%Y-%m-%d'` or using git tag based versioning by outputting
`git describe --tags`.

11 months agoDo not generate random seed when running bootctl install
Daan De Meyer [Mon, 19 Aug 2024 13:15:40 +0000 (15:15 +0200)] 
Do not generate random seed when running bootctl install

11 months agoDon't include excluded subimages in default dependencies
Daan De Meyer [Mon, 19 Aug 2024 11:22:54 +0000 (13:22 +0200)] 
Don't include excluded subimages in default dependencies

11 months agoMerge pull request #2959 from DaanDeMeyer/split
Jörg Behrmann [Mon, 19 Aug 2024 08:53:13 +0000 (10:53 +0200)] 
Merge pull request #2959 from DaanDeMeyer/split

Various improvements

11 months agoci: Add missing shebangs 2959/head
Daan De Meyer [Fri, 16 Aug 2024 22:47:56 +0000 (00:47 +0200)] 
ci: Add missing shebangs

No clue how this worked before.

11 months agoci: Improve formatting a bit
Daan De Meyer [Fri, 16 Aug 2024 22:47:17 +0000 (00:47 +0200)] 
ci: Improve formatting a bit

11 months agomkosi-initrd: Remove /var/cache/ldconfig/aux-cache
Daan De Meyer [Sun, 18 Aug 2024 12:54:10 +0000 (14:54 +0200)] 
mkosi-initrd: Remove /var/cache/ldconfig/aux-cache

The file is not reproducible so let's remove it so that reproducible
initrds can be built by default.

Fixes #2957

12 months agoSet SYSTEMD_IN_CHROOT for package managers
Daan De Meyer [Fri, 16 Aug 2024 21:41:00 +0000 (23:41 +0200)] 
Set SYSTEMD_IN_CHROOT for package managers

systemd's built-in chroot detection doesn't work when unprivileged
so tell it explicitly that we're in a chroot.

12 months agoOptimize remove_files()
Daan De Meyer [Fri, 16 Aug 2024 08:30:04 +0000 (10:30 +0200)] 
Optimize remove_files()

12 months agoOptimize clean_package_manager_metadata()
Daan De Meyer [Fri, 16 Aug 2024 08:29:33 +0000 (10:29 +0200)] 
Optimize clean_package_manager_metadata()

12 months agokali: A distribution based on Debian: https://www.kali.org/
Andreas Oberritter [Thu, 4 Jul 2024 08:28:46 +0000 (10:28 +0200)] 
kali: A distribution based on Debian: https://www.kali.org/

Kali includes many packages suitable for offensive security tasks.
It follows a rolling release model and serves fewer architectures
than Debian.

Building a kali image requires installing kali-archive-keyring:
- Source: https://gitlab.com/kalilinux/packages/kali-archive-keyring
- Packages: https://pkg.kali.org/pkg/kali-archive-keyring

12 months agoCheck for required tools earlier
Daan De Meyer [Mon, 12 Aug 2024 09:55:53 +0000 (11:55 +0200)] 
Check for required tools earlier

Let's check for required tools before we run sync or configure scripts
so that all required tools are checked before we actually use them.

12 months agoAlways specify _sourcedir as an absolute path
Daan De Meyer [Mon, 12 Aug 2024 10:08:06 +0000 (12:08 +0200)] 
Always specify _sourcedir as an absolute path

Relative _sourcedir was never supported by rpm:
https://github.com/rpm-software-management/rpm/issues/3208#issuecomment-2283520243

12 months agoFix loaded host modules filter
Markus Weippert [Sat, 10 Aug 2024 07:36:56 +0000 (09:36 +0200)] 
Fix loaded host modules filter

Module filenames might use dashes instead of underscores.
Also, anchoring the filename to a directory avoids including unrelated
modules (e.g. exfat vs fat).

12 months agoAdd --wipe-build-dir to allow clearing the build directory independently
Daan De Meyer [Fri, 9 Aug 2024 10:15:09 +0000 (12:15 +0200)] 
Add --wipe-build-dir to allow clearing the build directory independently

Currently, to clear the build directory, -ff has to be used which
also clears the image cache. Let's add --wipe-build-dir (-w) to allow
clearing only the build directory without clearing the image cache.

12 months agoMerge pull request #2946 from bluca/os_release
Luca Boccassi [Thu, 8 Aug 2024 13:25:53 +0000 (15:25 +0200)] 
Merge pull request #2946 from bluca/os_release

os-release fixes for Debian and derivatives

12 months agodistributions: drop Debian workaround for lack of VERSION_CODENAME 2946/head
Luca Boccassi [Wed, 7 Aug 2024 22:39:06 +0000 (23:39 +0100)] 
distributions: drop Debian workaround for lack of VERSION_CODENAME

It has been present since Debian 9, so we can rely on it now.
It is wrong on sid, but that's a separate issue that this old
workaround doesn't solve anyway.

12 months agodistributions: try reading /etc/os-release first
Luca Boccassi [Wed, 7 Aug 2024 22:35:39 +0000 (23:35 +0100)] 
distributions: try reading /etc/os-release first

It might be a local modification by an image builder, read it first
as per specification instructions

12 months agoMerge pull request #2947 from DaanDeMeyer/debian
Luca Boccassi [Thu, 8 Aug 2024 12:00:11 +0000 (14:00 +0200)] 
Merge pull request #2947 from DaanDeMeyer/debian

debian: Fix up os-release for unstable/sid builds

12 months agodebian: Fix up os-release for unstable/sid builds 2947/head
Daan De Meyer [Thu, 8 Aug 2024 11:09:46 +0000 (13:09 +0200)] 
debian: Fix up os-release for unstable/sid builds

The version codename for unstable/sid builds is indistinguishable from
testing. Let's make sure we fix that up ourselves so that unstable image
builds can be properly distinguished from testing builds.

12 months agoCheck /etc/os-release as well in configure_os_release()
Daan De Meyer [Thu, 8 Aug 2024 11:09:02 +0000 (13:09 +0200)] 
Check /etc/os-release as well in configure_os_release()

It might not be a symlink. If that's the case, fix it up as well.

12 months agoMerge pull request #2944 from DaanDeMeyer/fix
Daan De Meyer [Wed, 7 Aug 2024 05:34:46 +0000 (07:34 +0200)] 
Merge pull request #2944 from DaanDeMeyer/fix

Don't pass down empty lists to subimages unless explicitly configured

12 months agoDon't pass down empty lists to subimages unless explicitly configured 2944/head
Daan De Meyer [Tue, 6 Aug 2024 07:57:46 +0000 (09:57 +0200)] 
Don't pass down empty lists to subimages unless explicitly configured

This makes sure that subimages use default values for list based
settings unless they were explicitly configured in configuration or
on the command line or have a non-empty default value in the main
image.

Fixes #2874

12 months agoDon't use for loop to create subimages in test
Daan De Meyer [Tue, 6 Aug 2024 07:56:56 +0000 (09:56 +0200)] 
Don't use for loop to create subimages in test

This gives us more flexibility in configuring the individual subimages.

12 months agoStore finalized values only on config object
Daan De Meyer [Tue, 6 Aug 2024 07:55:56 +0000 (09:55 +0200)] 
Store finalized values only on config object

This allows us to use context.config to determine whether a value
was specified in a configuration file or not.

12 months agoStore default values in separate namespace
Daan De Meyer [Tue, 6 Aug 2024 07:55:01 +0000 (09:55 +0200)] 
Store default values in separate namespace

This allows us to check whether a value was explicitly configured
in configuration files or on the CLI.

12 months agoProperly escape paths in virtiofsd scope names
Daan De Meyer [Mon, 5 Aug 2024 14:04:47 +0000 (16:04 +0200)] 
Properly escape paths in virtiofsd scope names

12 months agoClarify that inherited settings take priority over CLI/main settings
Daan De Meyer [Mon, 5 Aug 2024 12:24:41 +0000 (14:24 +0200)] 
Clarify that inherited settings take priority over CLI/main settings

If "inherited" settings are configured explicitly in subimages, those
values should take priority over values configured in the main config
and CLI.

12 months agoMake `{SYSEXT,CONFEXT}_SCOPE` configurable
Michael Ferrari [Mon, 5 Aug 2024 08:53:45 +0000 (10:53 +0200)] 
Make `{SYSEXT,CONFEXT}_SCOPE` configurable

By setting `SYSEXT_SCOPE` and `CONFEXT_SCOPE` environment variables the
values to write to the extension-release file can be configured.

12 months agoMerge pull request #2941 from DaanDeMeyer/scope
Daan De Meyer [Mon, 5 Aug 2024 10:43:15 +0000 (12:43 +0200)] 
Merge pull request #2941 from DaanDeMeyer/scope

Make ImageId= and ImageVersion= overridable by subimages

12 months agoAllow SectorSize= to be overridden by subimages 2941/head
Daan De Meyer [Mon, 5 Aug 2024 08:46:46 +0000 (10:46 +0200)] 
Allow SectorSize= to be overridden by subimages

Fixes #2939

12 months agoMake ImageId= and ImageVersion= overridable by subimages
Daan De Meyer [Mon, 5 Aug 2024 08:15:11 +0000 (10:15 +0200)] 
Make ImageId= and ImageVersion= overridable by subimages

Fixes #2938

12 months agoIntroduce SettingScope
Daan De Meyer [Mon, 5 Aug 2024 08:10:54 +0000 (10:10 +0200)] 
Introduce SettingScope

Let's also have a concept of inheritable settings which are inherited
by subimages but can be overridden.

12 months agoAdd "Building vagrant images with mkosi" to the readme
Daan De Meyer [Fri, 2 Aug 2024 18:39:50 +0000 (20:39 +0200)] 
Add "Building vagrant images with mkosi" to the readme

12 months agoMerge pull request #2935 from DaanDeMeyer/repository-key-fetch
Daan De Meyer [Fri, 2 Aug 2024 19:20:46 +0000 (21:20 +0200)] 
Merge pull request #2935 from DaanDeMeyer/repository-key-fetch

Enable RepositoryKeyFetch= by default on Ubuntu without a tools tree

12 months agoEnable RepositoryKeyFetch= by default on Ubuntu without a tools tree 2935/head
Daan De Meyer [Fri, 2 Aug 2024 08:14:49 +0000 (10:14 +0200)] 
Enable RepositoryKeyFetch= by default on Ubuntu without a tools tree

Ubuntu does not have distribution-gpg-keys yet, so let's enable
RepositoryKeyFetch= for it by default when a tools tree is not used.

12 months agoUse debian as the default tools tree again on Ubuntu
Daan De Meyer [Fri, 2 Aug 2024 08:13:20 +0000 (10:13 +0200)] 
Use debian as the default tools tree again on Ubuntu

Debian has distribution-gpg-keys which Ubuntu doesn't. As we'll likely
keep running into similar scenarios in the future, let's just stick with
Debian as Ubuntu's default tools tree.

12 months agoExit early if output format is none and there are no build scripts
Daan De Meyer [Fri, 2 Aug 2024 11:16:17 +0000 (13:16 +0200)] 
Exit early if output format is none and there are no build scripts

In systemd, the build script is part of a subimage so the build is
done as part of the subimage and there's nothing to do for the main
image. To speed things up a bit, exit early if there are no build
scripts and the output format is none.

12 months agoMerge pull request #2931 from DaanDeMeyer/debian
Jörg Behrmann [Fri, 2 Aug 2024 08:03:42 +0000 (10:03 +0200)] 
Merge pull request #2931 from DaanDeMeyer/debian

 Introduce RepositoryKeyFetch=

12 months agoIntroduce RepositoryKeyFetch= 2931/head
Daan De Meyer [Thu, 1 Aug 2024 10:37:50 +0000 (12:37 +0200)] 
Introduce RepositoryKeyFetch=

This setting controls whether we'll fetch GPG keys remotely or not.
We disable it by default so that we only rely on locally available GPG
keys for checking package and repository metadata signatures.

This new setting only affects dnf/zypper based distributions as apt
and pacman do not support retrieving GPG keys remotely in the first
place.

zypper does not trust GPG keys listed in gpgkey= by default so we import
local GPG keys manually with rpm to work around that.

Fixes #757

12 months agotests: Reduce duplication
Daan De Meyer [Thu, 1 Aug 2024 14:38:30 +0000 (16:38 +0200)] 
tests: Reduce duplication

Let's reduce the amount of duplication in the tests.

12 months agotests: Pass host environment when invoking mkosi
Daan De Meyer [Thu, 1 Aug 2024 14:37:14 +0000 (16:37 +0200)] 
tests: Pass host environment when invoking mkosi

12 months agoOnly use unshare to become root if we're actually going to use a scope
Daan De Meyer [Thu, 1 Aug 2024 14:35:36 +0000 (16:35 +0200)] 
Only use unshare to become root if we're actually going to use a scope

If the relevant environment variables are not set, scope_cmd() will
return an empty list and we won't use a scope after all. In that case
we don't need to use unshare either to become root and can rely on our
own become_root() function so check whether we're actually going to use
a scope or not.

12 months agotests: Simplify initrd tests
Daan De Meyer [Thu, 1 Aug 2024 13:26:32 +0000 (15:26 +0200)] 
tests: Simplify initrd tests

Let's get rid of the fixtures and just rely on the default initrd
built as part of the image itself. This also means any settings
picked up from mkosi.local.conf are applied to the initrd build.

12 months agoBump redhat-plumbers-in-action/differential-shellcheck
dependabot[bot] [Thu, 1 Aug 2024 22:38:02 +0000 (22:38 +0000)] 
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.3.0 to 5.4.0.
- [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/60c9f2b924a9c5a2ddbb25e7b23e8e11b56faab9...cc6721c45a8800cc666de45493545a07a638d121)

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

Signed-off-by: dependabot[bot] <support@github.com>
12 months agoBump github/codeql-action from 3.25.11 to 3.25.15
dependabot[bot] [Thu, 1 Aug 2024 22:37:58 +0000 (22:37 +0000)] 
Bump github/codeql-action from 3.25.11 to 3.25.15

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.11 to 3.25.15.
- [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/b611370bb5703a7efb587f9d136a52ea24c5c38c...afb54ba388a7dca6ecae48f608c4ff05ff4cc77a)

---
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>
12 months agotests: Drop workaround for older Ubuntu
Daan De Meyer [Thu, 1 Aug 2024 13:13:24 +0000 (15:13 +0200)] 
tests: Drop workaround for older Ubuntu

12 months agoci: add nop versions of all scripts to our integration tests
Jörg Behrmann [Thu, 1 Aug 2024 07:53:38 +0000 (09:53 +0200)] 
ci: add nop versions of all scripts to our integration tests

12 months agoopensuse: Rename gpgurls to gpgkeys
Daan De Meyer [Thu, 1 Aug 2024 10:32:13 +0000 (12:32 +0200)] 
opensuse: Rename gpgurls to gpgkeys

12 months agoFix RepositoryKeyCheck docs
Daan De Meyer [Thu, 1 Aug 2024 09:44:28 +0000 (11:44 +0200)] 
Fix RepositoryKeyCheck docs

12 months agoInstall distribution-gpg-keys in Debian/Ubuntu tools tree if available
Daan De Meyer [Thu, 1 Aug 2024 09:11:16 +0000 (11:11 +0200)] 
Install distribution-gpg-keys in Debian/Ubuntu tools tree if available

It recently got into debian testing so let's add it to the tools tree.

12 months agoUse apt search patterns a little more
Daan De Meyer [Thu, 1 Aug 2024 09:10:13 +0000 (11:10 +0200)] 
Use apt search patterns a little more

Let's use apt search patterns more to match packages that are only
available on specific ubuntu/debian releases.

12 months agoMerge pull request #2929 from DaanDeMeyer/fixes
Daan De Meyer [Thu, 1 Aug 2024 08:55:45 +0000 (10:55 +0200)] 
Merge pull request #2929 from DaanDeMeyer/fixes

Two fixes

12 months agoDon't try to chmod /tmp if it's being bind mounted in 2929/head
Daan De Meyer [Thu, 1 Aug 2024 07:45:01 +0000 (09:45 +0200)] 
Don't try to chmod /tmp if it's being bind mounted in

12 months agoHandle SIGHUP as well
Daan De Meyer [Thu, 1 Aug 2024 07:44:29 +0000 (09:44 +0200)] 
Handle SIGHUP as well

Let's do a graceful shutdown on SIGHUP as well.

12 months agoStop always setting autologin credentials
Daan De Meyer [Wed, 31 Jul 2024 14:53:13 +0000 (16:53 +0200)] 
Stop always setting autologin credentials

Let's require users to set these automatically if they want to
have autologin without enabling the Autologin= setting. This gives
more flexibility after https://github.com/systemd/systemd/pull/33873
is merged in systemd as users can choose to enable the settings
globally or per tty depending on what they need.

12 months agoMerge pull request #2924 from DaanDeMeyer/kernel-install
Daan De Meyer [Tue, 30 Jul 2024 06:11:31 +0000 (08:11 +0200)] 
Merge pull request #2924 from DaanDeMeyer/kernel-install

Set up proper environment variables for kernel-install

12 months agoBump version to 25~devel
Daan De Meyer [Mon, 29 Jul 2024 19:14:20 +0000 (21:14 +0200)] 
Bump version to 25~devel

12 months agoRelease 24.3 v24.3
Daan De Meyer [Mon, 29 Jul 2024 19:14:20 +0000 (21:14 +0200)] 
Release 24.3

12 months agoMerge pull request #2927 from DaanDeMeyer/home
Daan De Meyer [Mon, 29 Jul 2024 19:13:58 +0000 (21:13 +0200)] 
Merge pull request #2927 from DaanDeMeyer/home

Check for $HOME environment variable as well

12 months agoaction: Show environment 2927/head
Daan De Meyer [Mon, 29 Jul 2024 18:16:55 +0000 (20:16 +0200)] 
action: Show environment

12 months agoDon't use .cache if HOME=/
Daan De Meyer [Mon, 29 Jul 2024 17:57:53 +0000 (19:57 +0200)] 
Don't use .cache if HOME=/

If the user's home directory is /, don't use .cache but use /var/cache
instead.

12 months agoCheck for $HOME environment variable as well
Daan De Meyer [Mon, 29 Jul 2024 17:43:51 +0000 (19:43 +0200)] 
Check for $HOME environment variable as well

Similar to our check for $USER, let's check for $HOME to allow
setting a custom home directory in weird build environments.

12 months agoOnly look at $USER if we can't find a user in /etc/passwd
Daan De Meyer [Mon, 29 Jul 2024 18:28:02 +0000 (20:28 +0200)] 
Only look at $USER if we can't find a user in /etc/passwd

12 months agoNudge kernel-install towards using the BLS layout 2924/head
Daan De Meyer [Mon, 29 Jul 2024 15:06:06 +0000 (17:06 +0200)] 
Nudge kernel-install towards using the BLS layout

12 months agoSet up proper environment variables for kernel-install
Daan De Meyer [Mon, 29 Jul 2024 13:38:49 +0000 (15:38 +0200)] 
Set up proper environment variables for kernel-install

If we're not explicitly disabling kernel-install during package
manager invocations, let's set up the environment to make it do the
right thing instead.

12 months agoSet $BOOT_ROOT when invoking kernel-install
Daan De Meyer [Mon, 29 Jul 2024 13:58:26 +0000 (15:58 +0200)] 
Set $BOOT_ROOT when invoking kernel-install

Instead of setting $SYSTEMD_XBOOTLDR_PATH and $SYSTEMD_ESP_PATH, let's
just set $BOOT_ROOT which does the same thing.

12 months agoBump version to 25~devel
Daan De Meyer [Mon, 29 Jul 2024 17:09:40 +0000 (19:09 +0200)] 
Bump version to 25~devel

12 months agoRelease 24.2 v24.2
Daan De Meyer [Mon, 29 Jul 2024 17:09:39 +0000 (19:09 +0200)] 
Release 24.2

12 months agoLook for $USER for the username before reading /etc/passwd
Daan De Meyer [Mon, 29 Jul 2024 15:47:47 +0000 (17:47 +0200)] 
Look for $USER for the username before reading /etc/passwd

Let's take $USER into account if set before reading /etc/passwd
for the username. This gives a way out for environments where the
uid of the user does not have an entry in /etc/passwd.

12 months agoBump version to 25~devel
Daan De Meyer [Mon, 29 Jul 2024 15:33:19 +0000 (17:33 +0200)] 
Bump version to 25~devel

12 months agoRelease 24.1
Daan De Meyer [Mon, 29 Jul 2024 15:33:18 +0000 (17:33 +0200)] 
Release 24.1

12 months agoMake do-a-release.sh handle point releases properly
Daan De Meyer [Mon, 29 Jul 2024 15:30:53 +0000 (17:30 +0200)] 
Make do-a-release.sh handle point releases properly

12 months agoHandle failure to detect the distribution in test_parse_config()
Daan De Meyer [Mon, 29 Jul 2024 10:26:51 +0000 (12:26 +0200)] 
Handle failure to detect the distribution in test_parse_config()

If /usr/lib/os-release isn't available, we can't detect the current
distribution, so let's make sure we handle that scenario as well by
checking for Distribution.custom instead of None.

Fixes #2921

12 months agoHandle dangling symlinks in rmtree() and run_clean()
Daan De Meyer [Mon, 29 Jul 2024 10:14:43 +0000 (12:14 +0200)] 
Handle dangling symlinks in rmtree() and run_clean()

12 months agoAdd missing __init__.py to mkosi/initrd/resources
Daan De Meyer [Mon, 29 Jul 2024 09:43:32 +0000 (11:43 +0200)] 
Add missing __init__.py to mkosi/initrd/resources

12 months agoAdd some documentation on how to implement a new distribution
Daan De Meyer [Mon, 29 Jul 2024 08:19:07 +0000 (10:19 +0200)] 
Add some documentation on how to implement a new distribution

12 months agocompletion: fix bash completion script
Jörg Behrmann [Sat, 27 Jul 2024 20:18:37 +0000 (22:18 +0200)] 
completion: fix bash completion script

Template the options definitions directly into the completion function, since
for some weird scoping reasons even though the script is read fine and when
running a shell with set -x one can see e.g. _mkosi_options being assigned the
proper values, the completion function still uses '' for
"${_mkosi_options[*]}".

This wasn't caught during development because the script works fine when
sourced.

12 months agoBump version to 25~devel
Daan De Meyer [Fri, 26 Jul 2024 16:05:39 +0000 (18:05 +0200)] 
Bump version to 25~devel

12 months agoRelease 24 v24
Daan De Meyer [Fri, 26 Jul 2024 16:05:36 +0000 (18:05 +0200)] 
Release 24

12 months agoUpdate NEWS
Daan De Meyer [Fri, 26 Jul 2024 15:13:07 +0000 (17:13 +0200)] 
Update NEWS

12 months agomkosi-initrd: Always add virtio_mmio to initramfs
Daan De Meyer [Fri, 26 Jul 2024 11:56:12 +0000 (13:56 +0200)] 
mkosi-initrd: Always add virtio_mmio to initramfs

12 months agomkosi-initrd: Sort module list
Daan De Meyer [Fri, 26 Jul 2024 11:55:48 +0000 (13:55 +0200)] 
mkosi-initrd: Sort module list

12 months agoFix typo
Daan De Meyer [Fri, 26 Jul 2024 11:07:50 +0000 (13:07 +0200)] 
Fix typo

12 months agoDocumentation update
Eugeny Shcheglov [Fri, 26 Jul 2024 10:33:40 +0000 (13:33 +0300)] 
Documentation update

Add IMAGE_ID and IMAGE_VERSION to the available variables list

12 months agoMerge pull request #2910 from DaanDeMeyer/qemu
Daan De Meyer [Thu, 25 Jul 2024 09:08:23 +0000 (11:08 +0200)] 
Merge pull request #2910 from DaanDeMeyer/qemu

Look up qemu and virt-fw-vars in extra search paths

12 months agoLook up qemu and virt-fw-vars in extra search paths 2910/head
Daan De Meyer [Thu, 25 Jul 2024 05:41:21 +0000 (07:41 +0200)] 
Look up qemu and virt-fw-vars in extra search paths

Because qemu uses OVMF firmware descriptions from /usr, we look
those up in the same root that we'll be invoking qemu from. Because
virt-fw-vars operates on the same files, we also invoke it in the
same root that we find qemu in.

12 months agoRemove noisy debug logging
Daan De Meyer [Thu, 25 Jul 2024 08:31:38 +0000 (10:31 +0200)] 
Remove noisy debug logging

There could potentially be a huge amount of modules and firmware
which makes these log messages very noisy. Let's drop them to make
debug logs less annoying to parse.

12 months agoAssign return code before calling sys.excepthook()
Daan De Meyer [Thu, 25 Jul 2024 07:15:13 +0000 (09:15 +0200)] 
Assign return code before calling sys.excepthook()

It seems sys.excepthook() can raise its own exception? I'm not entirely
sure what's going on, but as a safety measure, let's assign the correct
return code before we invoke sys.excepthook() so that we always exit with
the right returncode.

12 months agoMerge pull request #2779 from behrmann/completion
Zbigniew Jędrzejewski-Szmek [Wed, 24 Jul 2024 20:26:33 +0000 (22:26 +0200)] 
Merge pull request #2779 from behrmann/completion

Shell completion

12 months agoMerge pull request #2908 from DaanDeMeyer/kmod
Jörg Behrmann [Wed, 24 Jul 2024 16:47:26 +0000 (18:47 +0200)] 
Merge pull request #2908 from DaanDeMeyer/kmod

Various kernel modules improvements

12 months agoDon't clean tools tree unless at least -f is specified 2908/head
Daan De Meyer [Wed, 24 Jul 2024 15:27:26 +0000 (17:27 +0200)] 
Don't clean tools tree unless at least -f is specified

Otherwise if we run mkosi qemu and the cache is out of date we
remove the tools tree which we shouldn't do.

12 months agoAlways add all nls modules to the initramfs
Daan De Meyer [Wed, 24 Jul 2024 14:24:05 +0000 (16:24 +0200)] 
Always add all nls modules to the initramfs

Potentially required for mounting FAT filesystems so let's make sure
these are included.

12 months agoOnly include default kernel modules in default image
Daan De Meyer [Wed, 24 Jul 2024 13:47:10 +0000 (15:47 +0200)] 
Only include default kernel modules in default image

Let's add some coverage for the default modules list by enabling it
for the default image.

12 months agocompletion: forward define (hash) arrays for bash completion 2779/head
Jörg Behrmann [Wed, 24 Jul 2024 14:29:16 +0000 (16:29 +0200)] 
completion: forward define (hash) arrays for bash completion

12 months agoAlways add raid modules to the initrd
Daan De Meyer [Wed, 24 Jul 2024 13:44:20 +0000 (15:44 +0200)] 
Always add raid modules to the initrd

Raid needs to be set up from the initrd so let's make sure the
modules required to do that are always available.