]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
2 years agoarch: Support enabling testing repositories with --repositories 1674/head
Daan De Meyer [Thu, 13 Jul 2023 07:52:51 +0000 (09:52 +0200)] 
arch: Support enabling testing repositories with --repositories

2 years agoUse http_proxy and https_proxy from environment
Daan De Meyer [Thu, 13 Jul 2023 07:25:09 +0000 (09:25 +0200)] 
Use http_proxy and https_proxy from environment

We generally don't use environment variables passed to the process,
but let's be a little more relaxed on this policy and make sure we
use any configured proxy variables so mkosi works out of the box on
servers behind a proxy.

2 years agoAdd back support for bwrap 0.4
Daan De Meyer [Wed, 12 Jul 2023 21:15:30 +0000 (23:15 +0200)] 
Add back support for bwrap 0.4

CentOS Stream 9 is still on bwrap 0.4 which is unfortunately still
important so let's add back support for bwrap 0.4. Luckily, instead
of doing awkward template formatting, shells pass extra arguments
received when "-c" is used as arguments to the invoked command, so
we can make use of that to keep the same API for bwrap_cmd().

2 years agocentos: Add SIG testing repositories
Daan De Meyer [Mon, 10 Jul 2023 10:45:18 +0000 (12:45 +0200)] 
centos: Add SIG testing repositories

2 years agoopensuse: Install systemd-boot package
Daan De Meyer [Mon, 10 Jul 2023 07:42:16 +0000 (09:42 +0200)] 
opensuse: Install systemd-boot package

systemd-boot package was split from systemd in Tumbleweed, so let's
make sure we install it in CI.

2 years agoubuntu: Enable universe repository by default on kinetic and later
Daan De Meyer [Sun, 9 Jul 2023 18:24:21 +0000 (20:24 +0200)] 
ubuntu: Enable universe repository by default on kinetic and later

From kinetic onwards, the usr-is-merged package is available and
has to be installed to get a proper usrmerge system but for some
reason it's in the universe repository so we enable the universe
repository by default from kinetic onwards so we can install the
usrmerge package.

2 years agoAdd BuildSources mount points.
Marius Schiffer [Fri, 7 Jul 2023 14:59:21 +0000 (14:59 +0000)] 
Add BuildSources mount points.

2 years agoMerge pull request #1666 from DaanDeMeyer/sources
Daan De Meyer [Thu, 6 Jul 2023 10:24:15 +0000 (12:24 +0200)] 
Merge pull request #1666 from DaanDeMeyer/sources

Make BuildSources more flexible

2 years agoMake BuildSources more flexible 1666/head
Daan De Meyer [Wed, 5 Jul 2023 07:38:57 +0000 (09:38 +0200)] 
Make BuildSources more flexible

Currently, when you want to build multiple projects together, you
have to make the other projects subdirectories of the one with the
mkosi config, which is inconvenient. To make this more flexible, let's
allow specifying multiple source trees and where to mount them under
/work/src so that multiple projects can be mounted in a fixed location
regardless of their location on the host.

2 years agoStop automatically bind mounting build sources into containers
Daan De Meyer [Wed, 5 Jul 2023 07:58:45 +0000 (09:58 +0200)] 
Stop automatically bind mounting build sources into containers

This should eventually go behind a setting again, but should not be
done by default, especially since we don't do the same for virtual
machines.

2 years agoUse /work for prepare and postinst script as well
Daan De Meyer [Wed, 5 Jul 2023 07:30:06 +0000 (09:30 +0200)] 
Use /work for prepare and postinst script as well

We already use /work for the build script, let's do the same for
the postinst script and the prepare script.

2 years agoFix --incremental with build script and without build packages
Daan De Meyer [Wed, 5 Jul 2023 07:25:59 +0000 (09:25 +0200)] 
Fix --incremental with build script and without build packages

2 years agocentos: Add Special Interest Group (SIG) repositories
Daan De Meyer [Tue, 4 Jul 2023 10:36:39 +0000 (12:36 +0200)] 
centos: Add Special Interest Group (SIG) repositories

See https://wiki.centos.org/SpecialInterestGroup for more information
on SIGs. This commit only adds the Hyperscale SIG repositories. More can
be added later on an as-needed basis.

2 years agoProtect common system directories when running with bubblewrap
Daan De Meyer [Tue, 4 Jul 2023 08:51:22 +0000 (10:51 +0200)] 
Protect common system directories when running with bubblewrap

Let's make sure that even when we run as root the tools we run
can't brick the system by making core system directories read-only
bind mounts when running tools with bubblewrap.

As an example of the stuff this protects again, let's say a package
installs an absolute symlink to /usr and in the finalize script a
user tries to remove everything under this symlink, they'll end up
erasing /usr from their host system. By making /usr read-only, we
prevent this from happening.

2 years agoMerge pull request #1659 from bluca/compat
Daan De Meyer [Tue, 4 Jul 2023 08:46:18 +0000 (10:46 +0200)] 
Merge pull request #1659 from bluca/compat

Add backward-compat stubs for infrastructure options

2 years agodebian: do not assume package files are versioned 1659/head
Luca Boccassi [Tue, 4 Jul 2023 00:37:14 +0000 (01:37 +0100)] 
debian: do not assume package files are versioned

When creating a mirror the package names might not be versioned,
so if partition(_) leaves the suffix, strip it, otherwise apt
will fail

2 years agoAdd stubs for --nspawn-keep-unit, --default and --cache
Luca Boccassi [Sun, 2 Jul 2023 23:30:03 +0000 (00:30 +0100)] 
Add stubs for --nspawn-keep-unit, --default and --cache

Avoid breaking existing scripts and tools. Catch, print a warning
and delete.

2 years agoAllow always/never as booleans for backward compat
Luca Boccassi [Sun, 2 Jul 2023 23:08:07 +0000 (00:08 +0100)] 
Allow always/never as booleans for backward compat

Avoid breaking --with-network=never

2 years agoMake sure PATH is correct when using --tools-tree
Daan De Meyer [Mon, 3 Jul 2023 13:58:20 +0000 (15:58 +0200)] 
Make sure PATH is correct when using --tools-tree

2 years agoMerge pull request #1652 from DaanDeMeyer/extra-search-tree
Daan De Meyer [Mon, 3 Jul 2023 13:10:33 +0000 (15:10 +0200)] 
Merge pull request #1652 from DaanDeMeyer/extra-search-tree

Add --tools-tree= option

2 years agoMerge pull request #1658 from DaanDeMeyer/mkosi-repo
Daan De Meyer [Mon, 3 Jul 2023 12:38:17 +0000 (14:38 +0200)] 
Merge pull request #1658 from DaanDeMeyer/mkosi-repo

Repository fixes

2 years agoFail again if --repositories is specified for Gentoo 1658/head
Daan De Meyer [Mon, 3 Jul 2023 12:00:13 +0000 (14:00 +0200)] 
Fail again if --repositories is specified for Gentoo

2 years agoFix documentation for Repositories=
Daan De Meyer [Mon, 3 Jul 2023 11:59:09 +0000 (13:59 +0200)] 
Fix documentation for Repositories=

2 years agoWrite dnf/zypper default repos as mkosi.repo
Daan De Meyer [Mon, 3 Jul 2023 11:56:40 +0000 (13:56 +0200)] 
Write dnf/zypper default repos as mkosi.repo

This is more identifiable than a file named after the distribution
since such a file could conceivably be shipped by the distro as well.

2 years agoopensuse: Use http mirror
Daan De Meyer [Mon, 3 Jul 2023 11:51:38 +0000 (13:51 +0200)] 
opensuse: Use http mirror

The https mirror is still flaky with zypper, let's see if the http
mirror fares better.

2 years agoAdd --tools-tree= option 1652/head
Daan De Meyer [Sun, 2 Jul 2023 21:24:13 +0000 (23:24 +0200)] 
Add --tools-tree= option

Currently, mkosi image builds can differ depending on the host they
were built from. This can happen because we execute all kinds of
binaries to build the image and depending on the host these binaries
can differ. Usually, it's different versions of tools causing issues,
but it can also be due to different build configurations, such as rpm
writing its database in a different format depending on whether it's
executed from CentOS, Fedora, or Opensuse.

To allow for more reproducibility in image builds regardless of the
host system, this commit adds a new option --tools-tree= that allows
specifying a tree in which we look up most of the programs that we
execute during an image build.

Of course, that still leaves the question of what tree should be passed
to --tools-tree=. To solve that problem, --tools-tree= can be used
together with presets, so that as the first preset, a "bootstrap" image
can be built which can then be used with --tools-tree= in later presets.

Note that we only use /usr from the given tree. If tools end up using
config files from /etc or such, we expect those tools to expose a knob
to specify a different configuration file (instead of us overmounting
/etc).

Note that in a few cases, we don't yet execute tools in the given tree:
- systemd-analyze in GenericVersion() can't be executed in the tree
  because it could be executed during config parsing when we don't
  know the tree to use yet.
- newuidmap/newgidmap have to be executed before we can run
  bubblewrap so we can't run them in bubblewrap itself
- Figuring out the credentials is inherently tied to the host system
  so we execute all scripts and tools to figure out credentials on
  the host system as well
- mount because bubblewrap does not propagate mounts to the real root
  so any mounts we do within bubblewrap don't survive the bubblewrap
  process
- systemd-dissect for the same reason

2 years agoInline dissect_and_mount()
Daan De Meyer [Sun, 2 Jul 2023 21:59:06 +0000 (23:59 +0200)] 
Inline dissect_and_mount()

Only has one caller, so let's just inline it.

2 years agoInline grow_image() and finalize_image()
Daan De Meyer [Sun, 2 Jul 2023 19:40:59 +0000 (21:40 +0200)] 
Inline grow_image() and finalize_image()

Both have only one caller, so let's just inline the functions

2 years agoAssume systemd-nspawn --autopipe is available
Daan De Meyer [Sun, 2 Jul 2023 19:20:28 +0000 (21:20 +0200)] 
Assume systemd-nspawn --autopipe is available

We already require very recent versions of other systemd tools so
relying on --autopipe being available shouldn't be a problem
anymore.

2 years agoUse stat tool to check if we're on a btrfs subsystem
Daan De Meyer [Mon, 3 Jul 2023 11:41:28 +0000 (13:41 +0200)] 
Use stat tool to check if we're on a btrfs subsystem

Currently, we let the btrfs tool log errors when we're not on a
btrfs filesystem. Let's avoid unnecessary errors by checking if we're
on a btrfs filesystem before invoking the btrfs tool.

2 years agoMerge pull request #1653 from bluca/offline
Luca Boccassi [Mon, 3 Jul 2023 10:38:30 +0000 (11:38 +0100)] 
Merge pull request #1653 from bluca/offline

Fix offline builds with initrd or zypper

2 years agozypper: respect --local-mirror too 1653/head
Luca Boccassi [Sun, 2 Jul 2023 20:01:41 +0000 (21:01 +0100)] 
zypper: respect --local-mirror too

2 years agoinitd: respect --local-mirror too
Luca Boccassi [Sun, 2 Jul 2023 19:55:31 +0000 (20:55 +0100)] 
initd: respect --local-mirror too

2 years agoMerge pull request #1646 from DaanDeMeyer/gentoo
Daan De Meyer [Mon, 3 Jul 2023 05:28:09 +0000 (07:28 +0200)] 
Merge pull request #1646 from DaanDeMeyer/gentoo

Gentoo fixes

2 years agoDrop shell workaround in bwrap() and run_workspace_command()
Daan De Meyer [Tue, 25 Apr 2023 14:56:20 +0000 (16:56 +0200)] 
Drop shell workaround in bwrap() and run_workspace_command()

Let's use --perms and --chmod to fix the permissions of /tmp, /var/tmp
and /dev/shm instead of our hacky shell workaround. Let's also drop
all usage of shlex.join() in run() since it doesn't really by us anything.

This required bubblewrap 0.5.0.

2 years agoGentoo fixes 1646/head
Daan De Meyer [Tue, 27 Jun 2023 11:40:43 +0000 (13:40 +0200)] 
Gentoo fixes

- Use boot use flag for systemd instead of gnuefi
- Add --deep to emerge invocation to fix dep resolution failures
- Use curl to download stage3 tarball so we get a progress bar
- Do not exclude dev, proc and sys directories when extracting tarball
  (only exclude their contents)
- Copy pkgmngr/ directory into stage3/ directory wholesale instead of
  individual files
- Various coding style fixes
- Stop using Repositories= to specify binary package repositories as it
  is not its intended purpose. Instead, pass configured environment
  variables to emerge so users can set PORTAGE_BINHOST instead.

2 years agoUse a separate workdir for each overlay mount
Daan De Meyer [Tue, 27 Jun 2023 13:05:31 +0000 (15:05 +0200)] 
Use a separate workdir for each overlay mount

2 years agoopensuse: Add back support for zypper
Daan De Meyer [Sun, 2 Jul 2023 15:34:23 +0000 (17:34 +0200)] 
opensuse: Add back support for zypper

Let's add back support for zypper to build opensuse images. If both
zypper and dnf are installed, let's prefer using zypper.

2 years agodebian: drop workarounds for EoL Debian versions
Joerg Behrmann [Mon, 12 Jun 2023 13:59:24 +0000 (15:59 +0200)] 
debian: drop workarounds for EoL Debian versions

2 years agoUse systemd-repart's new --offline argument
Daan De Meyer [Tue, 27 Jun 2023 14:04:58 +0000 (16:04 +0200)] 
Use systemd-repart's new --offline argument

When building images, we never want to use loop devices, so use
--offline=yes in that case. When booting images, we know that
systemd-nspawn requires loop devices, so require them for
systemd-repart as well using --offline=no.

2 years agofedora: fix RemovePackages with dnf5
Zbigniew Jędrzejewski-Szmek [Fri, 23 Jun 2023 14:45:47 +0000 (08:45 -0600)] 
fedora: fix RemovePackages with dnf5

2 years agoMerge pull request #1570 from 257/gentoo
Daan De Meyer [Tue, 27 Jun 2023 08:40:32 +0000 (10:40 +0200)] 
Merge pull request #1570 from 257/gentoo

Gentoo

2 years agogentoo: reinstate systemd flags and lost emerge_vars 1570/head
Paymon MARANDI [Sat, 24 Jun 2023 16:11:06 +0000 (12:11 -0400)] 
gentoo: reinstate systemd flags and lost emerge_vars

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: backup vanilla PORTAGE_CONFIG, use pkgmngr if provided
Paymon MARANDI [Fri, 23 Jun 2023 14:39:19 +0000 (10:39 -0400)] 
gentoo: backup vanilla PORTAGE_CONFIG, use pkgmngr if provided

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: drop .cache_isclean
Paymon MARANDI [Thu, 22 Jun 2023 12:10:57 +0000 (08:10 -0400)] 
gentoo: drop .cache_isclean

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: don't clobber pkgmngr, rework repositories, enfore gnuefi
Paymon MARANDI [Thu, 22 Jun 2023 11:33:42 +0000 (07:33 -0400)] 
gentoo: don't clobber pkgmngr, rework repositories, enfore gnuefi

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: type properly
Paymon MARANDI [Thu, 22 Jun 2023 11:10:56 +0000 (07:10 -0400)] 
gentoo: type properly

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: drop cls.stage3_cache
Paymon MARANDI [Thu, 22 Jun 2023 11:09:30 +0000 (07:09 -0400)] 
gentoo: drop cls.stage3_cache

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: drop init/kernel
Paymon MARANDI [Thu, 22 Jun 2023 10:57:45 +0000 (06:57 -0400)] 
gentoo: drop init/kernel

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: drop documentation of portage variables used during build
Paymon MARANDI [Wed, 21 Jun 2023 17:27:49 +0000 (13:27 -0400)] 
gentoo: drop documentation of portage variables used during build

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: drop root, conform more with coding style
Paymon MARANDI [Wed, 21 Jun 2023 16:41:34 +0000 (12:41 -0400)] 
gentoo: drop root, conform more with coding style

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: install kernel only if a bootable image was requested
Paymon MARANDI [Wed, 21 Jun 2023 16:38:12 +0000 (12:38 -0400)] 
gentoo: install kernel only if a bootable image was requested

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: don't bother with @system set and bash
Paymon MARANDI [Wed, 21 Jun 2023 15:23:13 +0000 (11:23 -0400)] 
gentoo: don't bother with @system set and bash

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: hardcode stage3 path
Paymon MARANDI [Tue, 20 Jun 2023 15:41:05 +0000 (11:41 -0400)] 
gentoo: hardcode stage3 path

2 more things:
- bring back cache_clean so we extract stage3 once. that also means
  configure pkgmngr once
- add ./proc to exclusion list during extraction

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: use state.pkgmngr
Paymon MARANDI [Tue, 20 Jun 2023 15:17:56 +0000 (11:17 -0400)] 
gentoo: use state.pkgmngr

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: let portage handle thread_count
Paymon MARANDI [Tue, 20 Jun 2023 14:55:41 +0000 (10:55 -0400)] 
gentoo: let portage handle thread_count

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: remove indirections, use state.config.mirror itself
Paymon MARANDI [Sun, 11 Jun 2023 15:24:06 +0000 (11:24 -0400)] 
gentoo: remove indirections, use state.config.mirror itself

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: drop unused `root` argument for `invoke_emerge`
Paymon MARANDI [Sun, 11 Jun 2023 13:33:09 +0000 (09:33 -0400)] 
gentoo: drop unused `root` argument for `invoke_emerge`

we could add this in the future if we ever need to pass a different root
to `invoke_emerge` other that default;  `state.root`.

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: drop flock for cache clean
Paymon MARANDI [Sun, 11 Jun 2023 13:29:19 +0000 (09:29 -0400)] 
gentoo: drop flock for cache clean

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: consolidate Gentoo class into GentooInstaller
Paymon MARANDI [Sat, 3 Jun 2023 13:44:00 +0000 (09:44 -0400)] 
gentoo: consolidate Gentoo class into GentooInstaller

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: capitalise Symbolic Constants
Paymon MARANDI [Tue, 30 May 2023 13:11:54 +0000 (09:11 -0400)] 
gentoo: capitalise Symbolic Constants

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: support --mirror
Paymon MARANDI [Tue, 30 May 2023 13:07:32 +0000 (09:07 -0400)] 
gentoo: support --mirror

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: s/List/list/
Paymon MARANDI [Tue, 30 May 2023 12:59:09 +0000 (08:59 -0400)] 
gentoo: s/List/list/

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: document taget_root_mntpnt
Paymon MARANDI [Tue, 30 May 2023 12:56:03 +0000 (08:56 -0400)] 
gentoo: document taget_root_mntpnt

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: fix Reworked architecture handling
Paymon MARANDI [Tue, 30 May 2023 12:35:30 +0000 (08:35 -0400)] 
gentoo: fix Reworked architecture handling

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: s/state.cache/state.cache_dir/
Paymon MARANDI [Sat, 27 May 2023 11:45:40 +0000 (07:45 -0400)] 
gentoo: s/state.cache/state.cache_dir/

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: assume hyperthreaded cpu
Paymon MARANDI [Sat, 27 May 2023 11:28:36 +0000 (07:28 -0400)] 
gentoo: assume hyperthreaded cpu

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: drop portage dependency
Paymon MARANDI [Thu, 25 May 2023 14:22:55 +0000 (10:22 -0400)] 
gentoo: drop portage dependency

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: default to btrfs
Paymon MARANDI [Thu, 25 May 2023 13:19:34 +0000 (09:19 -0400)] 
gentoo: default to btrfs

Given that mkosi is *bespoken* and since it leverages features from
btrfs in some configurations we switch to btrfs by default.

Gentoo doesn't actually care one way or the other what the undelying fs
is and ext4, previous default, was in fact an arbitrarily choice (a
copy-pasted from some other distro's module).

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: DRY
Paymon MARANDI [Wed, 24 May 2023 13:57:16 +0000 (09:57 -0400)] 
gentoo: DRY

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: comply with CodeQl
Paymon MARANDI [Wed, 24 May 2023 12:11:23 +0000 (08:11 -0400)] 
gentoo: comply with CodeQl

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: support prebuilt initrds.
Paymon MARANDI [Sat, 20 May 2023 13:50:08 +0000 (09:50 -0400)] 
gentoo: support prebuilt initrds.

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: support initrd
Paymon MARANDI [Sat, 20 May 2023 12:38:21 +0000 (08:38 -0400)] 
gentoo: support initrd

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: support --repositories
Paymon MARANDI [Sat, 13 May 2023 14:45:11 +0000 (10:45 -0400)] 
gentoo: support --repositories

this is for binpkg repositories not ebuilds

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: leverage cache for artifacts
Paymon MARANDI [Sat, 13 May 2023 15:05:33 +0000 (11:05 -0400)] 
gentoo: leverage cache for artifacts

this will help to speedup incremental builds as well as initrd
same for syncing ebuild repos distfiles (source file for pkgs)

also resulting image will not include binpkgs and distfiles which would
reduce the size by great deal; this is required for initrd support.

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agogentoo: build initrd, do not ask for udev
Paymon MARANDI [Fri, 5 May 2023 15:23:48 +0000 (11:23 -0400)] 
gentoo: build initrd, do not ask for udev

udev is always included with systemd

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agoAdd support for ukify config at /etc/kernel/uki.conf.
Marius Schiffer [Fri, 16 Jun 2023 10:00:53 +0000 (10:00 +0000)] 
Add support for ukify config at /etc/kernel/uki.conf.
This allows specifying further options, e.g. a splash image for the
generated UKI file, given to ukify.
Ukify is run from the same working directory as mkosi itself,
so given paths in the ukify config can be relative to this.

2 years agoMerge pull request #1636 from keszybz/config-parser-generation
Jörg Behrmann [Thu, 22 Jun 2023 08:19:14 +0000 (10:19 +0200)] 
Merge pull request #1636 from keszybz/config-parser-generation

Generate argument parser from config setting list

2 years agoRun systemd-hwdb when building an image
Daan De Meyer [Wed, 21 Jun 2023 11:12:46 +0000 (13:12 +0200)] 
Run systemd-hwdb when building an image

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 agoMake sure output directory mountpoint exists in build overlay
Daan De Meyer [Wed, 21 Jun 2023 07:52:11 +0000 (09:52 +0200)] 
Make sure output directory mountpoint exists in build overlay

2 years agoMerge pull request #1635 from DaanDeMeyer/build-output
Zbigniew Jędrzejewski-Szmek [Tue, 20 Jun 2023 22:57:14 +0000 (00:57 +0200)] 
Merge pull request #1635 from DaanDeMeyer/build-output

Add support for building arbitrary output artifacts

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 agoAdd "none" output format 1635/head
Daan De Meyer [Tue, 20 Jun 2023 15:40:49 +0000 (17:40 +0200)] 
Add "none" output format

This is a re-implementation of the --skip-final-phase option, but
instead of doing it via an option, we do it via a new output format,
which feels much more natural. In combination with mounting the
staging directory into the build script, this allows using mkosi to
produce arbitrary artifacts using the build script.

2 years agoMount staging directory into build script
Daan De Meyer [Tue, 20 Jun 2023 15:24:12 +0000 (17:24 +0200)] 
Mount staging directory into build script

The build script might produce additional outputs, so let's allow
the user to funnel those out of the container by mounting the staging
directory and setting the OUTPUTDIR environment variable.

2 years agoUse staging directory as OUTPUTDIR in finalize script
Daan De Meyer [Tue, 20 Jun 2023 15:23:13 +0000 (17:23 +0200)] 
Use staging directory as OUTPUTDIR in finalize script

We should use the staging directory which is where all the outputs
will be located when we run the finalize script.

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