Daan De Meyer [Fri, 26 Jan 2024 22:05:06 +0000 (23:05 +0100)]
Use shared package cache directory by default
Instead of having a separate package cache for each mkosi project,
let's default to having a shared package cache directory that can
also be configured separately from the incremental cache directory.
Daan De Meyer [Fri, 26 Jan 2024 21:50:11 +0000 (22:50 +0100)]
Drop Gentoo support
Gentoo has completely stopped working and nobody has stepped up to
maintain it. It also keeps hindering refactoring so let's remove the
gentoo support so the upcoming work is easier.
Daan De Meyer [Fri, 26 Jan 2024 12:21:23 +0000 (13:21 +0100)]
Rework local repository
Let's have each createrepo function return the repository to use to
access the local packages and let's call this function from the setup()
functions of each distribution.
Daan De Meyer [Fri, 26 Jan 2024 10:50:37 +0000 (11:50 +0100)]
pacman: Make sure we pass packages to repo-add in right order
According to https://wiki.archlinux.org/title/pacman/Tips_and_tricks,
the newest version has to be added last, so let's make sure we sort
the paths we pass to repo-add.
Daan De Meyer [Wed, 24 Jan 2024 12:21:27 +0000 (13:21 +0100)]
Update link to mkosi introduction blog post
Let's stop linking the old blog from 2017 and link the newer one
that was just published instead. The old one isn't really useful
as it uses tons of features that have been removed since.
Winterhuman [Tue, 23 Jan 2024 12:51:55 +0000 (12:51 +0000)]
man: `--debug-shell=` -> `--debug-shell`
`--debug-shell` refuses to take an argument, so the equal sign is misleading (aka. `--debug-shell=yes` errors out), so let's remove it from the `man` page.
Daan De Meyer [Mon, 22 Jan 2024 19:51:00 +0000 (20:51 +0100)]
Only use tools trees for verbs that need a build
Currently we try to use a tools tree that isn't there for verbs
that don't need a build. Let's instead opt to not use one altogether
since building an entire image just to run ssh is kind of overkill.
Daan De Meyer [Mon, 22 Jan 2024 14:17:01 +0000 (15:17 +0100)]
Allow including builtin configs
Let's make it possible to include builtin configurations using
e.g. Include=mkosi-initrd. This allows building the default initrd
or default tools tree independently whereas currently these can only
be built as part of another image.
Daan De Meyer [Mon, 22 Jan 2024 13:23:16 +0000 (14:23 +0100)]
Extract mkosi.resources once
Instead of extracting individual files and directories when we need
them, let's extract the resources once and pass the extracted path
around so that we don't have to deal with context managers every time
we want to use resources.
Daan De Meyer [Thu, 18 Jan 2024 08:56:45 +0000 (09:56 +0100)]
Don't mount /srv and /mnt read-only
It seems there are use cases where users expect to write their output
to a directory in /srv or /mnt so let's make that writable. This should
be safe as we set up a custom sandbox now so none of the tools we run
will have access to /srv and /mnt in the first place.
Daan De Meyer [Thu, 18 Jan 2024 09:24:45 +0000 (10:24 +0100)]
Don't preserve timestamps when copying skeleton/extra trees
If timestamps should be preserved, a tar archive should be used.
Timestamps in directories are very likely to be arbitrary and there's
no point in preserving them. This doesn't impact reproducible builds
as we have SourceDateEpoch= for that.
Daan De Meyer [Wed, 17 Jan 2024 09:34:08 +0000 (10:34 +0100)]
Revert "Don't include root password in /usr/lib/credstore"
If /etc/shadow is included in the image this is just as safe/unsafe
as including the hashed root password in /usr/lib/credstore. We'll
deal with including the plaintext root password in the next commit.
Daan De Meyer [Tue, 16 Jan 2024 20:28:41 +0000 (21:28 +0100)]
Clarify that --build-in-place sets _builddir to the CWD
This isn't exactly obvious, so let's mention that --build-in-place
configures _builddir to the current working directory which explains
why we need to change directory to the upstream sources before
invoking rpmbuild.
Daan De Meyer [Tue, 16 Jan 2024 15:39:05 +0000 (16:39 +0100)]
Cache depmod again
Let's run depmod before we cache our images so that we can skip it
when doing incremental builds for kernels installed with the package
manager. depmod is noticeably slow so this speeds up kernel builds a
bit.
Daan De Meyer [Tue, 16 Jan 2024 13:49:20 +0000 (14:49 +0100)]
kernel-install: Build microcode initrd
Let's make sure we build a microcode initrd as well in the
kernel-install plugin. It's a bit too complicated to reuse
the build_microcode_initrd() function we have already due to
sandboxing so we opt to duplicate it instead.
Daan De Meyer [Mon, 15 Jan 2024 21:24:08 +0000 (22:24 +0100)]
Add PackageDirectories=
Let's make it possible to serve local packages as a local repository
so that users don't have to put local paths in their Packages= setting.
We'll also allow adding more packages to this local repository in the
build script so that these can be installed in the initrd when we build
it or in a postinst or finalize script.
Daan De Meyer [Mon, 15 Jan 2024 19:59:03 +0000 (20:59 +0100)]
Fix --mirror for CentOS and Fedora
Let's unify the interface for --mirror and only require users to
specify a url and add the entire path ourselves in mkosi. This is
required to use EPEL repositories with --mirror= as the epel
repositories are mirrored under <url>/fedora/epel whereas the CentOS
Stream repositories are under <url>/centos-stream