]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
2 years agoAdd our own "which" implementation 1677/head
Daan De Meyer [Mon, 17 Jul 2023 07:50:28 +0000 (09:50 +0200)] 
Add our own "which" implementation

shutil.which() doesn't take into account any configured tools tree
so let's implement our own which() that does take the tools tree into
account.

2 years agoRename extra argument of invoke_apt() to packages
Daan De Meyer [Sun, 16 Jul 2023 21:46:13 +0000 (23:46 +0200)] 
Rename extra argument of invoke_apt() to packages

2 years agoAdd scripts support to bwrap() and use it for chrooting
Daan De Meyer [Sun, 16 Jul 2023 20:24:38 +0000 (22:24 +0200)] 
Add scripts support to bwrap() and use it for chrooting

The new scripts argument to bwrap() allows providing a mapping of
script names to command lines. Each of these becomes a script in a
directory that's prepended to PATH before executing the command
given to bwrap(). This allows us to make extra commands available
to scripts we execute with bwrap().

The first usage of this is to replace the extra argument which is
used to provide the extra arguments to chroot into the root directory.
Instead, we provide a chroot script and use that in the command line
we pass to bwrap() to perform the chroot.

2 years agoDrop checks for binaries in config loading
Daan De Meyer [Sun, 16 Jul 2023 19:25:00 +0000 (21:25 +0200)] 
Drop checks for binaries in config loading

These might be in the tools tree so let's not check whether they
exist early.

2 years agoStop prepending extra search paths during config validation
Daan De Meyer [Sun, 16 Jul 2023 18:24:12 +0000 (20:24 +0200)] 
Stop prepending extra search paths during config validation

Not required anymore now that we have version comparisons in pure
python.

2 years agoRemove kwargs argument from run() and spawn()
Daan De Meyer [Sun, 16 Jul 2023 17:57:54 +0000 (19:57 +0200)] 
Remove kwargs argument from run() and spawn()

Let's prefer listing arguments explicitly so that mypy can catch
the wrong ones easily.

2 years agoImplement run_workspace_command() on top of bwrap()
Daan De Meyer [Sun, 16 Jul 2023 16:09:01 +0000 (18:09 +0200)] 
Implement run_workspace_command() on top of bwrap()

Instead of duplicating the apivfs setup between bwrap() and
run_workspace_command(), let's make bwrap() responsible for setting
up the apivfs and implement chrooting on top of it. Specifically,
to chroot, we just run bwrap nested to do the chroot and any
additional setup before running the actual command. This is implemented
in the new chroot_cmd() function which returns the command to do the
chroot. This also sets the stage for running scripts on the host and
somehow providing the chroot_cmd() command to scripts to use themselves
to run something inside the root directory.

To keep --debug-shell working smoothly for scripts, we pass the chroot
command as a new extra argument to bwrap() so we can also apply it when
starting the debug shell.

We also rework the /etc/resolv.conf bind mounting so we don't have
to do any cleanup after the command finishes.

2 years agoReplace kwargs from bwrap with individual arguments
Daan De Meyer [Sun, 16 Jul 2023 16:01:43 +0000 (18:01 +0200)] 
Replace kwargs from bwrap with individual arguments

kwargs makes it impossible for mypy to point out wrong arguments
so let's drop it in favor of individual arguments to get more out
of the type checker.

2 years agoRename various "root" arguments to "tools"
Daan De Meyer [Sun, 16 Jul 2023 15:56:25 +0000 (17:56 +0200)] 
Rename various "root" arguments to "tools"

"tools" is more descriptive than "root" about indicating that we're
passing a tree of tools.

2 years agoPut dnf command last again in the cmdline
Daan De Meyer [Sun, 16 Jul 2023 09:59:19 +0000 (11:59 +0200)] 
Put dnf command last again in the cmdline

It only has to be in front of the cmd specific options, which in
our case was only --allowerasing, so since that's gone now, let's
put the command last again.

2 years agoDrop --allowerasing dnf option
Daan De Meyer [Sun, 16 Jul 2023 09:51:55 +0000 (11:51 +0200)] 
Drop --allowerasing dnf option

We don't want to allow dnf to remove packages when installing other
packages. If it wants to do so that indicates something is wrong
elsewhere.

2 years agoFix logdir handling for dnf
Daan De Meyer [Fri, 14 Jul 2023 13:00:46 +0000 (15:00 +0200)] 
Fix logdir handling for dnf

logdir= is always taken relative to the installroot. Let's leave it
at it's default value and remove any log files from the install root
after running dnf.

2 years agoMerge pull request #1675 from DaanDeMeyer/loglevel
Daan De Meyer [Thu, 13 Jul 2023 16:25:45 +0000 (18:25 +0200)] 
Merge pull request #1675 from DaanDeMeyer/loglevel

Beef up --kernel-command-line-extra= defaults a little bit

2 years agoAdd --kernel-command-line-extra= to summary 1675/head
Daan De Meyer [Thu, 13 Jul 2023 11:13:29 +0000 (13:13 +0200)] 
Add --kernel-command-line-extra= to summary

2 years agoBeef up --kernel-command-line-extra= defaults a little bit
Daan De Meyer [Thu, 13 Jul 2023 10:51:46 +0000 (12:51 +0200)] 
Beef up --kernel-command-line-extra= defaults a little bit

Let's provide a better experience out of the box when booting an image:
- Always blacklist vmw_vmci so it can't interfere with vsock
- Always pull in network-online.target
- Configure systemd-network-generator for enp0s1 and host0 if not
  configured explicitly
- Use a default loglevel where only warnings or higher are logged to
  the serial console by the kernel
- Set SYSTEMD_SULOGIN_FORCE=1 unless configured explicitly so users
  get a shell in the initrd if something goes wrong, even if no root
  password is configured

2 years agoubuntu: Make lunar the default release
Daan De Meyer [Thu, 13 Jul 2023 13:46:39 +0000 (15:46 +0200)] 
ubuntu: Make lunar the default release

2 years agoMerge pull request #1674 from DaanDeMeyer/bwrap-0.4.0
Daan De Meyer [Thu, 13 Jul 2023 08:26:11 +0000 (10:26 +0200)] 
Merge pull request #1674 from DaanDeMeyer/bwrap-0.4.0

Add back support for bwrap 0.4

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 agoci: drop building systemd-analyze
Joerg Behrmann [Wed, 12 Jul 2023 13:29:33 +0000 (15:29 +0200)] 
ci: drop building systemd-analyze

2 years agoMerge pull request #1669 from behrmann/pyversioncomp
Daan De Meyer [Wed, 12 Jul 2023 13:15:22 +0000 (15:15 +0200)] 
Merge pull request #1669 from behrmann/pyversioncomp

Reimplement version comparison in pure python

2 years agoUse -1, 0, 1 instead of 12, 0, 11 for comparisons in GenericVersion 1669/head
Joerg Behrmann [Wed, 12 Jul 2023 08:48:53 +0000 (10:48 +0200)] 
Use -1, 0, 1 instead of 12, 0, 11 for comparisons in GenericVersion

2 years agoReimplement GenericVersion without shelling out to systemd-analyze
Joerg Behrmann [Fri, 7 Jul 2023 11:49:50 +0000 (13:49 +0200)] 
Reimplement GenericVersion without shelling out to systemd-analyze

2 years agotests: add tests to exercise GenericVersion
Joerg Behrmann [Fri, 7 Jul 2023 07:54:50 +0000 (09:54 +0200)] 
tests: add tests to exercise GenericVersion

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