]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
2 years agoconfig: silence pyright warning 1636/head
Zbigniew Jędrzejewski-Szmek [Tue, 20 Jun 2023 22:39:03 +0000 (16:39 -0600)] 
config: silence pyright warning

/home/runner/work/mkosi/mkosi/mkosi/config.py
  /home/runner/work/mkosi/mkosi/mkosi/config.py:1660:13 - error: "group" is possibly unbound (reportUnboundVariable)
1 error, 0 warnings, 0 informations

2 years agoconfig: reword help message for --root-{password,shell}
Zbigniew Jędrzejewski-Szmek [Wed, 21 Jun 2023 23:59:42 +0000 (17:59 -0600)] 
config: reword help message for --root-{password,shell}

"system root" doesn't seem right, because it sounds like we're talking about
the file system. We would often say just "root password", but that's nor
gramatically correct. "root's password" would be correct, but seems strange.
So let's rephase this to avoid the awkwardness.

2 years agoconfig: generate ArgumentParser options from MkosiConfigSetting items
Zbigniew Jędrzejewski-Szmek [Mon, 19 Jun 2023 19:43:44 +0000 (21:43 +0200)] 
config: generate ArgumentParser options from MkosiConfigSetting items

The diff for --help output:

    @@ -32,3 +32,3 @@
    -Distribution options:
    +Distribution configuration options:
       -d, --distribution {fedora,debian,ubuntu,arch,opensuse,mageia,centos,openmandriva,rocky,alma,gentoo}

    @@ -47,3 +47,3 @@
    -Output options:
    +Output configuration options:
       -t, --format FORMAT   Output Format

    @@ -76,3 +76,3 @@
    -Content options:
    +Content configuration options:

    @@ -85,6 +85,6 @@
    -  --bootable [FEATURE]  Generate ESP partition with systemd-boot and UKIs for
    -                        installed kernels
       --kernel-command-line OPTIONS
                             Set the kernel command line (only bootable images)
    +  --bootable [FEATURE]  Generate ESP partition with systemd-boot and UKIs for
    +                        installed kernels

    @@ -140,6 +140,6 @@
    -Validation options:
    +Validation configuration options:

--bootable and ---kernel-command-line were in different order in the settings list.
The section names in are more consistent.

Mypy supression in required in one place because the typespec doesn't allow
None, even though it is accepted just fine.

2 years agoDrop unnecessary uses of tuple
Zbigniew Jędrzejewski-Szmek [Mon, 19 Jun 2023 18:28:30 +0000 (20:28 +0200)] 
Drop unnecessary uses of tuple

2 years agoRemove --install-directory= option
Daan De Meyer [Tue, 20 Jun 2023 14:07:49 +0000 (16:07 +0200)] 
Remove --install-directory= option

We don't benefit from the caching anymore since we started emptying
the directory completely on reuse as otherwise old leftover files
might get installed. Without the caching, the option does not have
a ton of use anymore, so let's remove it.

2 years agoAdd kernel version to UKI name for versioned images
Marius Schiffer [Mon, 19 Jun 2023 09:48:25 +0000 (09:48 +0000)] 
Add kernel version to UKI name for versioned images

2 years agoMerge pull request #1630 from DaanDeMeyer/repart-boot
Daan De Meyer [Thu, 15 Jun 2023 14:34:40 +0000 (16:34 +0200)] 
Merge pull request #1630 from DaanDeMeyer/repart-boot

Run repart before booting image in systemd-nspawn

2 years agoRun systemd-repart before booting image with systemd-nspawn 1630/head
Daan De Meyer [Wed, 14 Jun 2023 15:41:32 +0000 (17:41 +0200)] 
Run systemd-repart before booting image with systemd-nspawn

To match the behavior when running in qemu, let's run systemd-repart
on the image before running it in systemd-nspawn to make sure that
all the necessary partitions are added if the image has repart
definition files included.

2 years agoIntroduce copy_ephemeral()
Daan De Meyer [Wed, 14 Jun 2023 15:39:19 +0000 (17:39 +0200)] 
Introduce copy_ephemeral()

A generic function to make an ephemeral copy of an image.

2 years agoSet --no-pager for systemd-repart
Daan De Meyer [Wed, 14 Jun 2023 15:37:06 +0000 (17:37 +0200)] 
Set --no-pager for systemd-repart

We don't want systemd-repart to page its output, that should be done
by mkosi itself.

2 years agoqemu: Use SOCK_STREAM for notify socket
Daan De Meyer [Tue, 13 Jun 2023 13:45:11 +0000 (15:45 +0200)] 
qemu: Use SOCK_STREAM for notify socket

The CentOS 8 Stream kernel does not support SOCK_SEQPACKET for
AF_VSOCK so let's use SOCK_STREAM instead and explicitly instruct
systemd running in the VM to use SOCK_STREAM as well.

2 years agoEnsure we return the same exit code in debug mode
Daan De Meyer [Mon, 12 Jun 2023 13:12:01 +0000 (15:12 +0200)] 
Ensure we return the same exit code in debug mode

When running in debug mode, we shouldn't return a different exit
code compared to when we run outside of debug mode.

A trivial example is when running the boot or qemu verbs where we
exit with the exit code of the container/VM by raising an instance
of CalledProcessError. In --debug mode, this exception is handled
as an unhandled exception by the python runtime which always exits
with 1 when an unhandled exception is encountered, whereas outside
of debug mode we exit with the value contained in
CalledProcessError.returncode.

With this commit, we'll always exit with the return value in
CalledProcessError.returncode.

2 years agoMerge pull request #1626 from DaanDeMeyer/epel-next
Jörg Behrmann [Mon, 12 Jun 2023 12:32:27 +0000 (14:32 +0200)] 
Merge pull request #1626 from DaanDeMeyer/epel-next

centos: Add epel-next

2 years agocentos: Streamline repo configuration a bit 1626/head
Daan De Meyer [Mon, 12 Jun 2023 12:02:28 +0000 (14:02 +0200)] 
centos: Streamline repo configuration a bit

2 years agocentos: Remove unused _epel_gpgurl() method
Daan De Meyer [Mon, 12 Jun 2023 11:58:26 +0000 (13:58 +0200)] 
centos: Remove unused _epel_gpgurl() method

2 years agocentos: Add epel-next
Daan De Meyer [Mon, 12 Jun 2023 11:53:18 +0000 (13:53 +0200)] 
centos: Add epel-next

2 years agoMerge pull request #1625 from DaanDeMeyer/fixes
Jörg Behrmann [Mon, 12 Jun 2023 07:44:34 +0000 (09:44 +0200)] 
Merge pull request #1625 from DaanDeMeyer/fixes

Fixes

2 years agoapt: Set "Dir" instead of "Dir::Etc" and set it via APT_CONFIG 1625/head
Daan De Meyer [Sun, 11 Jun 2023 19:55:06 +0000 (21:55 +0200)] 
apt: Set "Dir" instead of "Dir::Etc" and set it via APT_CONFIG

We need to use APT_CONFIG to set "Dir" as otherwise the value of "Dir"
won't be taken into account by apt when looking for configuration files
as options set via the CLI are applied last after parsing the apt
configuration files.

2 years agodnf: Make it possible to override install_weak_deps
Daan De Meyer [Sun, 11 Jun 2023 18:30:18 +0000 (20:30 +0200)] 
dnf: Make it possible to override install_weak_deps

By putting it in the config file, users can provide their own dnf.conf
to override our default value.

2 years agodnf: Use long option names
Daan De Meyer [Sun, 11 Jun 2023 18:30:05 +0000 (20:30 +0200)] 
dnf: Use long option names

2 years agodnf: Write repos to /etc/yum.repos.d/<distribution>.repo
Daan De Meyer [Sun, 11 Jun 2023 18:24:10 +0000 (20:24 +0200)] 
dnf: Write repos to /etc/yum.repos.d/<distribution>.repo

Let's allow providing a config file for dnf without also overriding
all the default repositories by writing the default repositories to
a file in /etc/yum.repos.d/.

2 years agoDo not overwrite package manager config files if they exist
Daan De Meyer [Sun, 11 Jun 2023 18:10:53 +0000 (20:10 +0200)] 
Do not overwrite package manager config files if they exist

Let's allow users to override mkosi's default package manager
settings by providing their own package manager config file. This
is especially important for distributions built using dnf as dnf
does not yet have support for dropins.

2 years agoarch: Drop useless options from config
Daan De Meyer [Sun, 11 Jun 2023 18:03:30 +0000 (20:03 +0200)] 
arch: Drop useless options from config

CheckSpace isn't really useful as we'll just fail a little later
while unpacking or installing packages. HoldPkg isn't useful either
as there's no chance of breaking the system by uninstalling packages
when we're just building an image.

2 years agoarch: Drop community repository
Daan De Meyer [Sun, 11 Jun 2023 18:01:50 +0000 (20:01 +0200)] 
arch: Drop community repository

community has been merged into extra so let's drop it from our
generated config.

2 years agoMerge pull request #1622 from behrmann/doccleanup
Daan De Meyer [Fri, 9 Jun 2023 08:13:50 +0000 (10:13 +0200)] 
Merge pull request #1622 from behrmann/doccleanup

Doc cleanup

2 years agodebian: fix default keyring
Joerg Behrmann [Thu, 8 Jun 2023 16:19:25 +0000 (18:19 +0200)] 
debian: fix default keyring

The key file RELEASE-archive-keyring does not exist, but
DISTRIBUTION-archive-keyring.gpg contains all currently used keys for both
Debian and Ubuntu.

2 years agodocs: remove unused --config option 1622/head
Joerg Behrmann [Fri, 9 Jun 2023 07:54:09 +0000 (09:54 +0200)] 
docs: remove unused --config option

2 years agodocs: mention package manager trees in the execution flow
Joerg Behrmann [Fri, 9 Jun 2023 07:47:44 +0000 (09:47 +0200)] 
docs: mention package manager trees in the execution flow

2 years agodocs: remove mention of kernel-install
Joerg Behrmann [Fri, 9 Jun 2023 07:47:28 +0000 (09:47 +0200)] 
docs: remove mention of kernel-install

2 years agoMerge pull request #1620 from DaanDeMeyer/config-cli
Daan De Meyer [Thu, 8 Jun 2023 17:33:15 +0000 (19:33 +0200)] 
Merge pull request #1620 from DaanDeMeyer/config-cli

Prefer configuration via CLI over configuration via config file

2 years agoPrefer configuration via CLI over configuration via config file 1620/head
Daan De Meyer [Thu, 8 Jun 2023 15:42:35 +0000 (17:42 +0200)] 
Prefer configuration via CLI over configuration via config file

This makes it easier to debug things with --debug as all the options
used will be logged instead of having to go and figure out what's in
the config file.

2 years agoarch: Introduce setup_pacman()
Daan De Meyer [Thu, 8 Jun 2023 16:51:30 +0000 (18:51 +0200)] 
arch: Introduce setup_pacman()

2 years agoHook up install_package_manager_trees()
Daan De Meyer [Thu, 8 Jun 2023 16:54:58 +0000 (18:54 +0200)] 
Hook up install_package_manager_trees()

2 years agoMake sure we close every vsock and read all data from it
Daan De Meyer [Thu, 8 Jun 2023 14:15:09 +0000 (16:15 +0200)] 
Make sure we close every vsock and read all data from it

2 years agoMerge pull request #1618 from behrmann/pkgmanagerskeletons
Daan De Meyer [Thu, 8 Jun 2023 14:56:19 +0000 (16:56 +0200)] 
Merge pull request #1618 from behrmann/pkgmanagerskeletons

Seed package manager config

2 years agoarch: use GPGDir in package manager tree if it exists 1618/head
Joerg Behrmann [Wed, 7 Jun 2023 16:33:40 +0000 (18:33 +0200)] 
arch: use GPGDir in package manager tree if it exists

2 years agodebian: use trusted keys from package manager tree if they exist
Joerg Behrmann [Wed, 7 Jun 2023 13:03:19 +0000 (15:03 +0200)] 
debian: use trusted keys from package manager tree if they exist

2 years agodebian: only write sources.list during setup if one isn't in the package manager...
Joerg Behrmann [Wed, 7 Jun 2023 13:02:48 +0000 (15:02 +0200)] 
debian: only write sources.list during setup if one isn't in the package manager tree

2 years agoconfig: add PackageManagerTrees= option
Joerg Behrmann [Thu, 8 Jun 2023 13:01:23 +0000 (15:01 +0200)] 
config: add PackageManagerTrees= option

2 years agoconfig: remove RepositoryDirectories= option
Joerg Behrmann [Thu, 8 Jun 2023 09:38:42 +0000 (11:38 +0200)] 
config: remove RepositoryDirectories= option

2 years agofedora: move workspace package manager configuration into a tree
Joerg Behrmann [Wed, 7 Jun 2023 11:37:23 +0000 (13:37 +0200)] 
fedora: move workspace package manager configuration into a tree

2 years agoarch: move workspace package manager configuration into a tree
Joerg Behrmann [Wed, 7 Jun 2023 11:37:11 +0000 (13:37 +0200)] 
arch: move workspace package manager configuration into a tree

2 years agodebian: move workspace package manager configuration into a tree
Joerg Behrmann [Wed, 7 Jun 2023 09:15:23 +0000 (11:15 +0200)] 
debian: move workspace package manager configuration into a tree

2 years agostate: add a directory for package manager files in the workspace
Joerg Behrmann [Thu, 8 Jun 2023 13:01:40 +0000 (15:01 +0200)] 
state: add a directory for package manager files in the workspace

2 years agoInstall dmsetup in the initrd on Debian/Ubuntu
Daan De Meyer [Wed, 7 Jun 2023 14:40:04 +0000 (16:40 +0200)] 
Install dmsetup in the initrd on Debian/Ubuntu

On other distros, just installing systemd and udev is sufficient to
make verity work. On Debian and Ubuntu, we need to explicitly install
dmsetup as well to make sure verity works, so let's do that.

2 years agoMerge pull request #1613 from DaanDeMeyer/rework-matches
Daan De Meyer [Wed, 7 Jun 2023 13:58:07 +0000 (15:58 +0200)] 
Merge pull request #1613 from DaanDeMeyer/rework-matches

Make matches work more like systemd conditions

2 years agoMake matches work more like systemd conditions 1613/head
Daan De Meyer [Tue, 6 Jun 2023 09:59:55 +0000 (11:59 +0200)] 
Make matches work more like systemd conditions

Let's make matches behave like systemd conditions. We drop support
for list matches. Instead, we add support for match negation and
trigger matches. A match is a trigger match if it's prefixed with
the pipe symbol (|). A match is satisfied if all its regular matches
and one of its trigger matches are satisfied.

2 years agoMerge pull request #1615 from DaanDeMeyer/fixes
Daan De Meyer [Wed, 7 Jun 2023 12:59:53 +0000 (14:59 +0200)] 
Merge pull request #1615 from DaanDeMeyer/fixes

Fixes

2 years agoDon't unpack extra/skeleton archives if a target is provided 1615/head
Daan De Meyer [Wed, 7 Jun 2023 12:01:51 +0000 (14:01 +0200)] 
Don't unpack extra/skeleton archives if a target is provided

ExtraTrees= and SkeletonTrees= are currently ambiguous when a target
location is provided. The user could either mean that the archive has
to be unpacked to the target location or the user could mean that he
wants to copy the archive to that location in the image.

We should still try to resolve the ambiguity, but for now, let's assume
that when a target is provided that the user wants to copy the archive
into the image instead of unpacking the archive to that specific location.

To make this work, we also modify the logic slightly to create only the
parent directories of the target so that cp doesn't fail because we try
to copy a file to a directory.

2 years agoDon't require extra trees to exist when parsing config
Daan De Meyer [Wed, 7 Jun 2023 11:59:14 +0000 (13:59 +0200)] 
Don't require extra trees to exist when parsing config

These might be created by a preset so leave checking whether these
exist to check_inputs().

2 years agoMerge pull request #1610 from keszybz/emacs-and-spdx
Jörg Behrmann [Mon, 5 Jun 2023 16:15:54 +0000 (18:15 +0200)] 
Merge pull request #1610 from keszybz/emacs-and-spdx

Add emacs config, SPDX headers, fix typo

2 years agoAdd SPDX header to various files with code 1610/head
Zbigniew Jędrzejewski-Szmek [Mon, 5 Jun 2023 15:04:11 +0000 (17:04 +0200)] 
Add SPDX header to various files with code

2 years agoAdd .dir-locals.el file for emacs
Zbigniew Jędrzejewski-Szmek [Mon, 5 Jun 2023 15:00:37 +0000 (17:00 +0200)] 
Add .dir-locals.el file for emacs

2 years agoFix typo
Zbigniew Jędrzejewski-Szmek [Wed, 17 May 2023 15:57:17 +0000 (17:57 +0200)] 
Fix typo

2 years agoMake sure we don't copy symlinks in run_qemu()
Daan De Meyer [Fri, 2 Jun 2023 15:11:20 +0000 (17:11 +0200)] 
Make sure we don't copy symlinks in run_qemu()

2 years agoMerge pull request #1608 from DaanDeMeyer/fixes
Daan De Meyer [Fri, 2 Jun 2023 13:55:53 +0000 (15:55 +0200)] 
Merge pull request #1608 from DaanDeMeyer/fixes

Fixes

2 years agoDrop unused functions 1608/head
Daan De Meyer [Fri, 2 Jun 2023 12:25:21 +0000 (14:25 +0200)] 
Drop unused functions

2 years agoShorten exit status logic a little
Daan De Meyer [Fri, 2 Jun 2023 12:22:42 +0000 (14:22 +0200)] 
Shorten exit status logic a little

2 years agoOnly raise exception if notify exit status is nonzero.
Daan De Meyer [Fri, 2 Jun 2023 11:22:15 +0000 (13:22 +0200)] 
Only raise exception if notify exit status is nonzero.

2 years agoMerge pull request #1606 from DaanDeMeyer/notify-debug
Jörg Behrmann [Fri, 2 Jun 2023 08:15:54 +0000 (10:15 +0200)] 
Merge pull request #1606 from DaanDeMeyer/notify-debug

Log some notify stats at debug level

2 years agoGet rid of unnecessary usage of TypeVar 1606/head
Daan De Meyer [Thu, 1 Jun 2023 11:08:21 +0000 (13:08 +0200)] 
Get rid of unnecessary usage of TypeVar

2 years agoLog some notify stats at debug level
Daan De Meyer [Thu, 1 Jun 2023 11:02:33 +0000 (13:02 +0200)] 
Log some notify stats at debug level

2 years agoaction: Install swtpm
Daan De Meyer [Thu, 1 Jun 2023 10:48:28 +0000 (12:48 +0200)] 
action: Install swtpm

2 years agotests: add missing asserts
Joerg Behrmann [Wed, 24 May 2023 15:11:38 +0000 (17:11 +0200)] 
tests: add missing asserts

2 years agoconfig: add missing whitespace
Joerg Behrmann [Wed, 24 May 2023 14:07:01 +0000 (16:07 +0200)] 
config: add missing whitespace

2 years agoconfig: only use host release if we can detect one
Joerg Behrmann [Mon, 22 May 2023 15:19:43 +0000 (17:19 +0200)] 
config: only use host release if we can detect one

2 years agoci: add --debug flag
Joerg Behrmann [Fri, 26 May 2023 12:29:20 +0000 (14:29 +0200)] 
ci: add --debug flag

2 years agoUpdate installation instructions in the README
Joerg Behrmann [Wed, 31 May 2023 13:55:06 +0000 (15:55 +0200)] 
Update installation instructions in the README

2 years agoMerge pull request #1600 from DaanDeMeyer/fedora
Jörg Behrmann [Thu, 1 Jun 2023 07:45:26 +0000 (09:45 +0200)] 
Merge pull request #1600 from DaanDeMeyer/fedora

fedora: Add Enterprise Linux Next (ELN) support

2 years agoUse repart's new --architecture option
Daan De Meyer [Tue, 30 May 2023 11:40:21 +0000 (13:40 +0200)] 
Use repart's new --architecture option

This makes sure that --architecture works with user specified repart
configs as well instead of just the ones that we generate ourselves.

2 years agofedora: Add Enterprise Linux Next (ELN) support 1600/head
Daan De Meyer [Wed, 31 May 2023 20:42:55 +0000 (22:42 +0200)] 
fedora: Add Enterprise Linux Next (ELN) support

Let's add support for ELN (https://docs.fedoraproject.org/en-US/eln/)
which builds Fedora with the RHEL toolchain.

2 years agofedora: Simplify url handling
Daan De Meyer [Wed, 31 May 2023 19:58:58 +0000 (21:58 +0200)] 
fedora: Simplify url handling

2 years agoAdd QemuSwtpm option
Daan De Meyer [Wed, 31 May 2023 13:51:09 +0000 (15:51 +0200)] 
Add QemuSwtpm option

2 years agoUse VMADDR_PORT_ANY
Daan De Meyer [Wed, 31 May 2023 09:04:44 +0000 (11:04 +0200)] 
Use VMADDR_PORT_ANY

Just cleanup, shouldn't cause any change in behavior

2 years agoaction: Install systemd-measure
Daan De Meyer [Tue, 30 May 2023 12:36:17 +0000 (14:36 +0200)] 
action: Install systemd-measure

2 years agoMerge pull request #1592 from DaanDeMeyer/arch
Daan De Meyer [Tue, 30 May 2023 11:39:46 +0000 (13:39 +0200)] 
Merge pull request #1592 from DaanDeMeyer/arch

Rework architecture handling

2 years agoUse dnf when building foreign architectures 1592/head
Daan De Meyer [Tue, 30 May 2023 10:15:42 +0000 (12:15 +0200)] 
Use dnf when building foreign architectures

dnf5 does not support --forcearch yet which means it can't build
foreign architectures.

2 years agoRework architecture handling
Daan De Meyer [Mon, 29 May 2023 20:41:31 +0000 (22:41 +0200)] 
Rework architecture handling

Let's lock architectures down by making it an enum instead of a
free form string. We also introduce a bunch of mapping functions
to map the Architecture enum to qemu, distribution arches, efi
arches. We only support the architectures defined in the discoverable
partitions spec and use those architectures as the default representation.

2 years agoMerge pull request #1591 from DaanDeMeyer/exception-handling
Daan De Meyer [Sat, 27 May 2023 09:11:10 +0000 (11:11 +0200)] 
Merge pull request #1591 from DaanDeMeyer/exception-handling

Make sure we handle any exceptions thrown in MkosiAsyncioThread()

2 years agoci: Make sure we're running qemu with a vsock 1591/head
Daan De Meyer [Sat, 27 May 2023 09:01:14 +0000 (11:01 +0200)] 
ci: Make sure we're running qemu with a vsock

Let's add a little extra coverage by enforcing that qemu runs with
a vsock.

2 years agoMake sure we handle any exceptions thrown in MkosiAsyncioThread()
Daan De Meyer [Sat, 27 May 2023 08:54:20 +0000 (10:54 +0200)] 
Make sure we handle any exceptions thrown in MkosiAsyncioThread()

Any unhandled exceptions from run() are by default just printed to
stderr. Let's make sure that these exceptions cause mkosi itself to
fail by catching them and re-raising them when the thread is joined.

2 years agoMerge pull request #1583 from Cornelicorn/output-uids
Daan De Meyer [Fri, 26 May 2023 11:46:31 +0000 (13:46 +0200)] 
Merge pull request #1583 from Cornelicorn/output-uids

Improve basename symlinks

2 years agoAdd --all-architectures when we run bootctl
Daan De Meyer [Fri, 26 May 2023 11:27:41 +0000 (13:27 +0200)] 
Add --all-architectures when we run bootctl

To make sure that we install correctly even when doing cross builds

2 years agoVarious improvements
Daan De Meyer [Fri, 26 May 2023 10:01:35 +0000 (12:01 +0200)] 
Various improvements

- Move workspace and install/cache directory handling into MkosiState
- Stop running the build as the user running mkosi, this makes things
simpler as the root user in the userns can write to directories owned
by the user running mkosi but vice versa is not possible. The build
script still can't modify the build image as we mount the build overlay
read-only.
- Create directories that need to be owned by the user running mkosi
before switching to the user namespace
- Various refactorings

2 years agodebian: Fix foreign architecture builds
Daan De Meyer [Fri, 26 May 2023 10:16:50 +0000 (12:16 +0200)] 
debian: Fix foreign architecture builds

--force-architecture forces dpkg to install packages for other
architectures than the host architecture. --force-depends is required
because when building for arm64 it seems it can't quite figure out
all the pre-depends. For extra safety, we also set APT::Architectures
on top of APT::Architecture.

2 years agoAlways overwrite the basename symlink to point to the newest version 1583/head
Cornelius Hoffmann [Fri, 26 May 2023 09:37:41 +0000 (11:37 +0200)] 
Always overwrite the basename symlink to point to the newest version

Having the symlink point to the oldest image is somewhat counterintuitive

2 years agoFix wrong uid:gid on the basename symlink
Cornelius Hoffmann [Fri, 26 May 2023 07:31:50 +0000 (09:31 +0200)] 
Fix wrong uid:gid on the basename symlink

Before this would have the uid:gid of root in the uidmap space
The link is now created in the staging area first to make the change atomic,
so that the wrong uid:gid pair is never seen in the output directory

2 years agoAdd support for pesign to sign secure boot binaries
Daan De Meyer [Thu, 25 May 2023 19:33:09 +0000 (21:33 +0200)] 
Add support for pesign to sign secure boot binaries

sbsign is not packaged on CentOS so let's add support for pesign as
well as support for pesign was recently added to ukify as well.

2 years agoukify: always sign kernel inside of uki if secure boot is enabled
Malte Poll [Thu, 25 May 2023 09:53:47 +0000 (11:53 +0200)] 
ukify: always sign kernel inside of uki if secure boot is enabled

This overrides the auto detection of ukify and always signs the kernel bevore embedding it in the uki (even if the kernel is already signed).
Rationale: When building Fedora 37 images, the Fedora provided kernel is signed with an expired key (id 2574709492).
I would like to add an additional signature with my own signing key to enable kexec and other features that require a correctly signed kernel image.

Co-authored-by: Otto Bittner <cobittner@posteo.net>
2 years agofix missing exist_ok for debian /usr
Cornelius Hoffmann [Wed, 24 May 2023 22:24:41 +0000 (00:24 +0200)] 
fix missing exist_ok for debian /usr

This would prevent having /usr in a skeleton tree

2 years agoFirstboot improvements
Daan De Meyer [Wed, 24 May 2023 12:33:49 +0000 (14:33 +0200)] 
Firstboot improvements

- Merge --root-password-hashed and --root-password-file into
  --root-password. If prefixed with hashed:, we treat it as a hashed
  root password.
- When not building an initrd, also store corresponding credentials
in /usr/lib/credstore, so that the settings work even if only /usr
is shipped in the final image. We don't do this for initrds since
those generally ship with /etc populated.
- Drop setting of firstboot.hostname which isn't actually used by
systemd-firstboot

2 years agoCompress centos 8 variant cpios with xz instead of zstd
Daan De Meyer [Tue, 23 May 2023 10:58:39 +0000 (12:58 +0200)] 
Compress centos 8 variant cpios with xz instead of zstd

The kernel for CentOS 8 and its variants doesn't ship with zstd
initrd compression support, so let's default to xz instead.

2 years agoRefactor image growing
Daan De Meyer [Mon, 22 May 2023 12:08:28 +0000 (14:08 +0200)] 
Refactor image growing

2 years agoUse systemd-repart to grow disk image
Daan De Meyer [Mon, 22 May 2023 12:08:28 +0000 (14:08 +0200)] 
Use systemd-repart to grow disk image

Using truncate isn't entirely right, let's do this properly by letting
systemd-repart handle it.

2 years agoMerge pull request #1571 from DaanDeMeyer/fixes
Daan De Meyer [Mon, 22 May 2023 08:01:38 +0000 (10:01 +0200)] 
Merge pull request #1571 from DaanDeMeyer/fixes

Fixes

2 years agorocky: Drop epel repository from bootable config 1571/head
Daan De Meyer [Mon, 22 May 2023 05:46:22 +0000 (07:46 +0200)] 
rocky: Drop epel repository from bootable config

systemd-boot is provided by the base repositories now so let's drop
the epel repository config.

2 years agoMake mkosi the foreground process again when child process finishes
Daan De Meyer [Sun, 21 May 2023 15:08:51 +0000 (17:08 +0200)] 
Make mkosi the foreground process again when child process finishes

We currently get "Job mkosi has stopped" when fetching running the
summary verb. Let's fix this by making sure we make mkosi the foreground
process again when we finish running a child process.

2 years agoMake sure we page summaries only once when there's multiple presets
Daan De Meyer [Sun, 21 May 2023 15:07:26 +0000 (17:07 +0200)] 
Make sure we page summaries only once when there's multiple presets

2 years agoReturn early if verb is "clean"
Daan De Meyer [Sun, 21 May 2023 15:06:35 +0000 (17:06 +0200)] 
Return early if verb is "clean"

Otherwise we start checking the inputs of the presets which we don't
wanna do if we're just cleaning outputs

2 years agoAdd RepartDirectories to summary
Daan De Meyer [Sun, 21 May 2023 15:06:12 +0000 (17:06 +0200)] 
Add RepartDirectories to summary