]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
3 years agoUse Gentoo.EMERGE_UPDATE_OPTS for invoke_emerge call to install pkgs_boot 902/head
Marcel Sackermann [Wed, 9 Feb 2022 21:06:27 +0000 (22:06 +0100)] 
Use Gentoo.EMERGE_UPDATE_OPTS for invoke_emerge call to install pkgs_boot

Using Gentoo.EMERGE_UPDATE_OPTS allows for greater maintainability than directly
specifying `--update` and `--deep`.

The configured `opts` for `invoke_emerge` enable the package manager to replace
blocking packages. This is required to successfully replace
`sys-kernel/installkernel-gentoo` (which is already installed in the gentoo
stage3 tar ball) with the requested `sys-kernel/installkernel-systemd-boot`.

3 years agoAdd `--update` and `--deep` to invoke_emerge call for pkgs_boot
Marcel Sackermann [Sun, 6 Feb 2022 17:11:46 +0000 (18:11 +0100)] 
Add `--update` and `--deep` to invoke_emerge call for pkgs_boot

When generating bootable images for gentoo, the emerge call to install
pkgs_boot fails for `sys-kernel/installkernel-systemd-boot`:

```
[…]
‣   Invoking emerge(1) inside stage3
!!! /etc/portage/binrepos.conf is missing (or PORTAGE_BINHOST is unset), but use is requested.

 * IMPORTANT: 9 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

!!! /etc/portage/binrepos.conf is missing (or PORTAGE_BINHOST is unset), but use is requested.
[binary  N    ] app-arch/cpio-2.12-r1-1
[binary  N    ] sys-firmware/edk2-ovmf-202105-r2-1
[binary  N    ] dev-libs/elfutils-0.186-1
[binary  N    ] sys-kernel/installkernel-systemd-boot-1-1
[binary  N    ] sys-kernel/dracut-055-r4-2
[binary  N    ] virtual/libelf-3-1
[binary  N    ] sys-kernel/gentoo-kernel-bin-5.15.19-1
[binary  N    ] virtual/dist-kernel-5.15.19-1
[blocks B     ] sys-kernel/installkernel-gentoo ("sys-kernel/installkernel-gentoo" is soft blocking sys-kernel/installkernel-systemd-boot-1)
[blocks B     ] sys-kernel/installkernel-systemd-boot ("sys-kernel/installkernel-systemd-boot" is soft blocking sys-kernel/installkernel-gentoo-3)

 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (sys-kernel/installkernel-gentoo-3-1:0/0::gentoo, installed) pulled in by
    sys-kernel/installkernel-gentoo required by (sys-kernel/gentoo-kernel-bin-5.15.19-1:5.15.19/5.15.19::gentoo, binary scheduled for merge) USE="initramfs -test"

  (sys-kernel/installkernel-systemd-boot-1-1:0/0::gentoo, binary scheduled for merge) pulled inby
    sys-kernel/installkernel-systemd-boot

‣ Error: Workspace command /usr/bin/emerge sys-kernel/installkernel-systemd-boot sys-kernel/gentoo-kernel-bin sys-firmware/edk2-ovmf --buildpkg=y --usepkg=y --keep-going=y --jobs=16 --load-average=15 --nospinner --quiet-build --quiet returned non-zero exit code 1.
‣  (Unmounting Package Cache)
‣  (Unmounting image)
‣  (Detaching /dev/loop0)
```

Adding `--update` and `--deep` allows to unmerge
`sys-kernel/installkernel-gentoo` and use `sys-kernel/installkernel-systemd-boot` instead.

3 years agoMake 9-stream the default for centos and centos_epel
Davide Cavalca [Thu, 3 Feb 2022 16:05:09 +0000 (08:05 -0800)] 
Make 9-stream the default for centos and centos_epel

3 years agoMerge pull request #868 from davide125/centos
Daan De Meyer [Thu, 3 Feb 2022 14:34:54 +0000 (14:34 +0000)] 
Merge pull request #868 from davide125/centos

Add support for CentOS Stream releases

3 years agoChange parse_args() arg type from List to Sequence
Daan De Meyer [Thu, 3 Feb 2022 10:08:55 +0000 (10:08 +0000)] 
Change parse_args() arg type from List to Sequence

We don't modify the passed args so we can use Sequence as the type
instead of List.

3 years agoMake 8-stream the default for centos and centos_epel 868/head
Davide Cavalca [Wed, 8 Dec 2021 15:26:04 +0000 (07:26 -0800)] 
Make 8-stream the default for centos and centos_epel

3 years agoAdd support for CentOS Stream releases
Davide Cavalca [Tue, 7 Dec 2021 18:46:31 +0000 (10:46 -0800)] 
Add support for CentOS Stream releases

3 years agoAdding sudo to both instances where pytest appears in the CI in order to allow testin...
gsegatti [Wed, 2 Feb 2022 16:54:57 +0000 (08:54 -0800)] 
Adding sudo to both instances where pytest appears in the CI in order to allow testing when going through functions that check for root privileges.

3 years agoci: Only run integration tests when the unit tests succeed
Daan De Meyer [Tue, 1 Feb 2022 19:31:46 +0000 (19:31 +0000)] 
ci: Only run integration tests when the unit tests succeed

To make this work, we need to combine both workflows. The CI workflow
now has two jobs, the unit-test job and the integration-test job.

The integration-tests job depends on the uni-tests job so that it only
runs when the unit-tests job succeeds.

3 years ago Initial framework for testing parse_args(), load_args(). Done using pytest. 896/head
gsegatti [Thu, 20 Jan 2022 10:33:34 +0000 (02:33 -0800)] 
 Initial framework for testing parse_args(), load_args(). Done using pytest.

3 years agoPytest framework for unit testing Mkosi's methods.
gsegatti [Fri, 14 Jan 2022 10:53:12 +0000 (02:53 -0800)] 
Pytest framework for unit testing Mkosi's methods.

3 years agoRemoval of Gentoo check
gsegatti [Mon, 24 Jan 2022 12:25:00 +0000 (04:25 -0800)] 
Removal of Gentoo check
The parse_args() method has a check for whether Gentoo's modules are currently installed.
While this allows the system to fail early, it makes unit testing dependable on installing such packages.
By removing this if() we're able to test argument parsing without on any distro with no package dependance.
Additionally, system's correctness ir preserved since this same check is done later on gentoo.py

3 years agoMerge pull request #890 from DaanDeMeyer/missing-format
Jörg Behrmann [Fri, 21 Jan 2022 12:33:53 +0000 (13:33 +0100)] 
Merge pull request #890 from DaanDeMeyer/missing-format

Fix missing format string specifiers

3 years agoFix missing format string specifiers 890/head
Daan De Meyer [Fri, 21 Jan 2022 12:12:54 +0000 (12:12 +0000)] 
Fix missing format string specifiers

3 years agoAdding --machine-id option.
gsegatti [Tue, 18 Jan 2022 16:07:49 +0000 (08:07 -0800)] 
Adding --machine-id option.

Update mkosi.md

Co-authored-by: Daan De Meyer <daan.j.demeyer@gmail.com>
3 years agobuild: check for BUILD_ID/VERSION_ID before adding systemd-boot workaround
Luca Boccassi [Tue, 18 Jan 2022 00:08:54 +0000 (00:08 +0000)] 
build: check for BUILD_ID/VERSION_ID before adding systemd-boot workaround

Instead of hard-coding the debian release, which breaks booting on
testing/bookworm, check os-release to see if BUILD_ID or VERSION_ID
are actually there.

3 years agoMerge pull request #885 from gsegatti/close-osrelease
Jörg Behrmann [Mon, 17 Jan 2022 17:44:38 +0000 (18:44 +0100)] 
Merge pull request #885 from gsegatti/close-osrelease

Closing etc/os-release

3 years agoClosing the etc/os-release file, which raises a warning when conducting unit tests... 885/head
gsegatti [Mon, 17 Jan 2022 17:03:54 +0000 (09:03 -0800)] 
Closing the etc/os-release file, which raises a warning when conducting unit tests, even in read only mode.

3 years agoSupport older versions of sfdisk without "grain" support
Daan De Meyer [Mon, 3 Jan 2022 16:29:12 +0000 (08:29 -0800)] 
Support older versions of sfdisk without "grain" support

If "grain" is not available, let's fall back to the default grain
size of 1 MiB. To check if "grain" is available, let's run sfdisk
against /dev/full and try to configure the "grain" which will fail
if "grain" is not supported.

3 years agoMerge pull request #877 from DaanDeMeyer/man
Daan De Meyer [Mon, 3 Jan 2022 13:11:03 +0000 (14:11 +0100)] 
Merge pull request #877 from DaanDeMeyer/man

Docs improvements

3 years agodocs: Update examples 877/head
Daan De Meyer [Thu, 23 Dec 2021 14:56:47 +0000 (15:56 +0100)] 
docs: Update examples

Use mkosi verbs instead of direct invocations of systemd-nspawn and qemu.

3 years agoaction: Fix libsolv in combination with rpm 4.17.0
Daan De Meyer [Mon, 3 Jan 2022 10:09:09 +0000 (11:09 +0100)] 
action: Fix libsolv in combination with rpm 4.17.0

This applies the patch from https://github.com/systemd/mkosi/issues/861#issuecomment-1003624115
until the issue is fixed upstream and the fix is released.

3 years agodocs: Move supported output formats section down a little
Daan De Meyer [Thu, 23 Dec 2021 14:32:43 +0000 (15:32 +0100)] 
docs: Move supported output formats section down a little

The verbs and execution flow are likely more important info to new
users than all the supported output formats so let's reorder the
sections accordingly.

3 years agodocs: Remove Other Features section
Daan De Meyer [Thu, 23 Dec 2021 14:29:45 +0000 (15:29 +0100)] 
docs: Remove Other Features section

This just lists some very specific features that are already
documented in their respective config options. Let's remove it
so we get rid of one more section that should be updated when we
add new features.

3 years agoFix mypy redundant cast typing error
Daan De Meyer [Mon, 20 Dec 2021 13:03:57 +0000 (14:03 +0100)] 
Fix mypy redundant cast typing error

3 years agoMerge pull request #871 from DaanDeMeyer/force
Daan De Meyer [Sun, 19 Dec 2021 12:05:34 +0000 (13:05 +0100)] 
Merge pull request #871 from DaanDeMeyer/force

Various improvements

3 years agoRemove unused verity_sig and verity_sig_size from MkosiArgs 871/head
Daan De Meyer [Wed, 8 Dec 2021 15:29:51 +0000 (16:29 +0100)] 
Remove unused verity_sig and verity_sig_size from MkosiArgs

3 years agoRemove unused ran_sfdisk field from MkosiArgs
Daan De Meyer [Wed, 8 Dec 2021 15:13:26 +0000 (16:13 +0100)] 
Remove unused ran_sfdisk field from MkosiArgs

3 years agoRemove releasever from MkosiArgs
Daan De Meyer [Wed, 8 Dec 2021 15:12:17 +0000 (16:12 +0100)] 
Remove releasever from MkosiArgs

Its scope is limited to a single function so just make it a local
variable.

3 years agoRename CommandLineArguments to MkosiArgs
Daan De Meyer [Wed, 8 Dec 2021 14:45:10 +0000 (15:45 +0100)] 
Rename CommandLineArguments to MkosiArgs

CommandLineArguments is a bad name as the stuff in it can also come
from config files.

3 years agoCI: Remove ext4, xfs and gpt_squashfs jobs
Daan De Meyer [Wed, 8 Dec 2021 14:23:38 +0000 (15:23 +0100)] 
CI: Remove ext4, xfs and gpt_squashfs jobs

We're running too many CI jobs, let's disable some that are similar
to others to reduce the strain on the CI.

3 years agoMerge pull request #869 from DaanDeMeyer/fix-typing
Jörg Behrmann [Wed, 8 Dec 2021 16:15:20 +0000 (17:15 +0100)] 
Merge pull request #869 from DaanDeMeyer/fix-typing

typing: Fix typing error when calling add_signer()

3 years agoCombine args.force and args.force_count
Daan De Meyer [Wed, 8 Dec 2021 14:20:53 +0000 (15:20 +0100)] 
Combine args.force and args.force_count

args.force becomes an integer which behaves the same as a bool.
args.force_count is removed and every usage of force_count is
replaced by force.

3 years agotyping: Fix typing error when calling add_signer() 869/head
Daan De Meyer [Wed, 8 Dec 2021 11:23:12 +0000 (12:23 +0100)] 
typing: Fix typing error when calling add_signer()

The add_signer() method of PKCS7SignatureBuilder only supports a
subset of the key types returned by load_pem_private_key() so let's
make sure the loaded key is of one of the supported types to fix
the error.

3 years agoMerge pull request #865 from DaanDeMeyer/fedora-keys
Jörg Behrmann [Mon, 6 Dec 2021 16:07:38 +0000 (17:07 +0100)] 
Merge pull request #865 from DaanDeMeyer/fedora-keys

fedora: Fedora >= 35 don't use short key IDs anymore

3 years agofedora: Bump default version to 35 865/head
Daan De Meyer [Mon, 6 Dec 2021 12:57:56 +0000 (13:57 +0100)] 
fedora: Bump default version to 35

3 years agofedora: Fedora >= 35 don't use short key IDs anymore
Daan De Meyer [Mon, 6 Dec 2021 11:30:08 +0000 (12:30 +0100)] 
fedora: Fedora >= 35 don't use short key IDs anymore

3 years agoBump version numbers for v12 v12
Zbigniew Jędrzejewski-Szmek [Tue, 30 Nov 2021 08:39:26 +0000 (09:39 +0100)] 
Bump version numbers for v12

3 years agoNEWS: add entries for v12
Zbigniew Jędrzejewski-Szmek [Tue, 30 Nov 2021 08:39:09 +0000 (09:39 +0100)] 
NEWS: add entries for v12

3 years agogentoo: unmerge baselayout early on.
Paymon MARANDI [Wed, 24 Nov 2021 17:36:59 +0000 (12:36 -0500)] 
gentoo: unmerge baselayout early on.

fixes ``Couldn't find '=sys-apps/baselayout-2.7' to unmerge``

intro:
there are 2 problems that require messing with baselayout package.
both are being worked on upstream [bug1][bug2].

1. `/etc/os-release` missing `VERSION_ID` which causes KUI generated by
   dracut/installkernel et al not being accepted by the firmware/bootloader.

2. `/usr` is not merged in stage3. but `baselayout` with `"USE=build
   -split-usr"` has a usrmerge layout.

[bug1] is fixed but that fix hasn't made it into the release.
[bug2] has 6 blocking bugs as of this writing.

we merge baselayout before copying stage3 tree over into `root` so the
usrmerge layout is in place.

source of the problem:
hard-coded baselayout version, "-2.7", was the source of the problem
which was inevitable to cause problem once upstream bumped the version
of baselayout they ship with stage3.

in the old logic we removed baselayout by hand during fetch_fix_stage3()
by removing members of baselaouy_qlist array from stage3 before copying
stage3 tree into `root`. this would cause the root to have two "slots"
of baselayout installed which the call to `emerge(1)` in `update_stage3`
would try to fix by removing the *bad* slot (=sys-apps/baselayout-2.7).

the new logic simply unmerges stage3's baselayout during
fetch_fix_stage3() using emerge(1).

[bug1]: https://bugs.gentoo.org/788190
[bug2]: https://bugs.gentoo.org/690294

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
3 years agoMerge pull request #860 from bluca/lintian
Daan De Meyer [Thu, 25 Nov 2021 09:41:30 +0000 (10:41 +0100)] 
Merge pull request #860 from bluca/lintian

Fix some Lintian warnings

3 years agoresources: add +x to bash scripts 860/head
Luca Boccassi [Wed, 24 Nov 2021 19:44:40 +0000 (19:44 +0000)] 
resources: add +x to bash scripts

3 years agomkosi: fix typos found by Lintian
Luca Boccassi [Wed, 24 Nov 2021 19:44:10 +0000 (19:44 +0000)] 
mkosi: fix typos found by Lintian

3 years agoNEWS: c11 is actually released now, fix the NEWS entry post-tag
Lennart Poettering [Wed, 24 Nov 2021 17:51:23 +0000 (18:51 +0100)] 
NEWS: c11 is actually released now, fix the NEWS entry post-tag

3 years agoBump version numbers for v11 v11
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 15:10:05 +0000 (16:10 +0100)] 
Bump version numbers for v11

3 years agoman: rebuild the man page
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 15:10:02 +0000 (16:10 +0100)] 
man: rebuild the man page

3 years agotools/do-a-release: rebuild the man page in a separate commit
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 15:06:53 +0000 (16:06 +0100)] 
tools/do-a-release: rebuild the man page in a separate commit

Otherwise the interesting changes are hidden behind a very long diff of
generated output.

3 years agoImport updated GPT partition UUID list from systemd
Daan De Meyer [Tue, 23 Nov 2021 12:22:56 +0000 (13:22 +0100)] 
Import updated GPT partition UUID list from systemd

Source: https://github.com/systemd/systemd/blob/244cab4a651d4a5b5d9f0275ef59b8273418ee51/src/shared/gpt.h

3 years agoNEWS: add entries for v11
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 17:01:44 +0000 (18:01 +0100)] 
NEWS: add entries for v11

3 years agoSet loglevel to something sane when --qemu-headless is set
Daan De Meyer [Fri, 12 Nov 2021 16:23:42 +0000 (16:23 +0000)] 
Set loglevel to something sane when --qemu-headless is set

Avoids spamming the console with kernel messages when using
--qemu-headless.

3 years agoci: Cancel in-progress jobs when new changes are pushed
Daan De Meyer [Wed, 10 Nov 2021 16:23:56 +0000 (16:23 +0000)] 
ci: Cancel in-progress jobs when new changes are pushed

Copied from https://github.com/systemd/systemd/pull/21293.

3 years agoAdd StandardOutput=tty to getty resources
Daan De Meyer [Wed, 10 Nov 2021 11:17:18 +0000 (11:17 +0000)] 
Add StandardOutput=tty to getty resources

Forgot to add these in #848.

3 years agoSet new TTYRows and TTYColumns properties when overriding getty units
Daan De Meyer [Wed, 27 Oct 2021 21:49:32 +0000 (22:49 +0100)] 
Set new TTYRows and TTYColumns properties when overriding getty units

Sometimes, it's not sufficient to set the LINES and COLUMNS environment
variables to configure the serial terminal size. To properly configure
the serial terminal size when the env variables are not sufficient, we
need to configure the tty size in the kernel as well. To accomplish this,
two new properties TTYRows and TTYCols were added to systemd. Let's set
these properties when we override the getty units so systemd properly
configures the kernel tty size for us when systemd's version is recent
enough.

Additionally, this commit updates the getty unit resources to include
the recent systemd change to how the TTY is passed to agetty. Without
this change, the tty size configured with TTYRows and TTYCols is reset
when systemd invokes agetty. See https://github.com/systemd/systemd/pull/21171
for more information.

3 years agoMerge pull request #850 from bluca/ssh_debian
Zbigniew Jędrzejewski-Szmek [Fri, 5 Nov 2021 13:54:05 +0000 (14:54 +0100)] 
Merge pull request #850 from bluca/ssh_debian

ssh: add agent-socket and port parameters

3 years agossh: do not print warning if networkd is not running on the host 850/head
Luca Boccassi [Tue, 2 Nov 2021 19:38:41 +0000 (19:38 +0000)] 
ssh: do not print warning if networkd is not running on the host

Tools like VSCode can use 'mkosi ssh' but use pexpect, so don't print
these warnings as it will break them.

3 years agossh: add port parameter
Luca Boccassi [Tue, 2 Nov 2021 01:18:58 +0000 (01:18 +0000)] 
ssh: add port parameter

When NetworkVeth is disabled, allow to simply connect on localhost:.

3 years agossh: optionally connect to ssh-agent
Luca Boccassi [Mon, 1 Nov 2021 23:38:37 +0000 (23:38 +0000)] 
ssh: optionally connect to ssh-agent

If a path to the ssh-agent socket (typically /run/user/1000/gnupg/S.gpg-agent.ssh) is passed,
connect to it to fetch the public key(s) with ssh-add -L and avoid passing
the key(s) manually to ssh.

3 years agodebian: do not try to enable resolved if systemd is not in the package list
Luca Boccassi [Tue, 2 Nov 2021 14:22:55 +0000 (14:22 +0000)] 
debian: do not try to enable resolved if systemd is not in the package list

It will not be installed, so it will fail

3 years agoFix --base-image and --base-packages combination
Luca Boccassi [Thu, 4 Nov 2021 12:59:33 +0000 (12:59 +0000)] 
Fix --base-image and --base-packages combination

args.base_packages defaults to 'True', so it's never 'None', so this
check was always false. Remove it.

3 years agossh: enable ssh.socket on Debian/Ubuntu
Luca Boccassi [Mon, 1 Nov 2021 23:32:20 +0000 (23:32 +0000)] 
ssh: enable ssh.socket on Debian/Ubuntu

On Debian/Ubuntu there's a socket plus templated service for the ssh
server, which works much more nicely than the fixed one. Use it.

3 years agomkosi: add utility functions to create unit dropin configs
Joerg Behrmann [Thu, 4 Nov 2021 13:37:14 +0000 (14:37 +0100)] 
mkosi: add utility functions to create unit dropin configs

3 years agomanifest: record the architecture field separately
Luca Boccassi [Thu, 4 Nov 2021 00:28:06 +0000 (00:28 +0000)] 
manifest: record the architecture field separately

We recently split this out in https://systemd.io/COREDUMP_PACKAGE_METADATA/
and the package-notes tooling, so split it out here too.

3 years agoRemove check=True argument from calls to run()
Daan De Meyer [Tue, 2 Nov 2021 12:27:26 +0000 (12:27 +0000)] 
Remove check=True argument from calls to run()

check=True is the default for our version of run() so let's not pass
check=True explicitly anywhere whenever we call run().

3 years agoMerge pull request #841 from bluca/manifest_debian
Daan De Meyer [Tue, 2 Nov 2021 14:37:07 +0000 (14:37 +0000)] 
Merge pull request #841 from bluca/manifest_debian

manifest: add support for deb distros

3 years agoCall flush() in a few more places
Daan De Meyer [Sun, 31 Oct 2021 21:01:28 +0000 (21:01 +0000)] 
Call flush() in a few more places

Since we never explicitly close these files, sometimes the stuff
we write to them doesn't seem to get flushed which causes the
files to be empty in the output directory. Add calls to flush()
to make sure the files aren't empty when mkosi finishes.

3 years agomanifest: add support for deb distros 841/head
Luca Boccassi [Sat, 16 Oct 2021 20:39:41 +0000 (21:39 +0100)] 
manifest: add support for deb distros

Use 'dpkg-query' and 'apt-get changelog' to get metadata and changelogs

3 years agobackend: optionally capture output with run_workspace_command
Luca Boccassi [Sun, 24 Oct 2021 16:40:22 +0000 (17:40 +0100)] 
backend: optionally capture output with run_workspace_command

3 years agogentoo: support gentoo (#717)
Paymon MARANDI [Thu, 21 Oct 2021 09:51:13 +0000 (05:51 -0400)] 
gentoo: support gentoo (#717)

Flow is the following:

we fetch stage3, untar it into the image's root and run emerge(1) from
within that root tree.

we _append_ our configurations to /etc/portage/env/mkosi.conf users
should not use that file since it, to some extend, documents what was
done during the image creation. users could instead drop-in their conf
file under mkosi.skeleton/etc/portage/env/ (say user.conf) and a pointer
under package.env/ (say user) with:
*/* user.conf

profile:
for now we only support 17.1/no-multilib; arm64 support is on the
roadmap.

3 years agoRevert "gentoo: support gentoo (#717)"
Zbigniew Jędrzejewski-Szmek [Thu, 21 Oct 2021 19:31:58 +0000 (21:31 +0200)] 
Revert "gentoo: support gentoo (#717)"

This reverts commit c4243b5b72c9f7ba08d3644586e49d2bbc0f8457.

The authorship was wrong.

3 years agobin/mkosi: support running from the source checkout
Zbigniew Jędrzejewski-Szmek [Thu, 21 Oct 2021 07:39:50 +0000 (09:39 +0200)] 
bin/mkosi: support running from the source checkout

It is super useful for development if we can use the helper and not
worry about setting PYTHONPATH manually. We can also run mkosi directly after
cloing the repo, without doing any other setup.

3 years agogentoo: support gentoo (#717)
jrun [Thu, 21 Oct 2021 09:51:13 +0000 (05:51 -0400)] 
gentoo: support gentoo (#717)

Flow is the following:

we fetch stage3, untar it into the image's root and run emerge(1) from
within that root tree.

we _append_ our configurations to /etc/portage/env/mkosi.conf users
should not use that file since it, to some extend, documents what was
done during the image creation. users could instead drop-in their conf
file under mkosi.skeleton/etc/portage/env/ (say user.conf) and a pointer
under package.env/ (say user) with:
*/* user.conf

profile:
for now we only support 17.1/no-multilib; arm64 support is on the
roadmap.

3 years agoMerge pull request #846 from bluca/removal_debian
Jörg Behrmann [Thu, 21 Oct 2021 07:57:28 +0000 (09:57 +0200)] 
Merge pull request #846 from bluca/removal_debian

mkosi: implement RemovePackages= option for apt

3 years agomkosi: implement RemovePackages= option for apt 846/head
Luca Boccassi [Tue, 19 Oct 2021 22:09:30 +0000 (23:09 +0100)] 
mkosi: implement RemovePackages= option for apt

3 years agoREADME: skip eol versions and sites in the badge
Zbigniew Jędrzejewski-Szmek [Tue, 19 Oct 2021 20:10:08 +0000 (22:10 +0200)] 
README: skip eol versions and sites in the badge

https://github.com/repology/repology-webapp/issues/117

3 years agoMerge pull request #842 from bluca/sysext_debian
Zbigniew Jędrzejewski-Szmek [Wed, 20 Oct 2021 07:38:43 +0000 (09:38 +0200)] 
Merge pull request #842 from bluca/sysext_debian

sysext: support building deb extensions

3 years agosysext: support building deb extensions 842/head
Luca Boccassi [Sat, 16 Oct 2021 23:27:41 +0000 (00:27 +0100)] 
sysext: support building deb extensions

debootstrap will fail if the root is already populated, so skip it when building
an extension.
While there, skip also other tasks that apply only to the base image (kernel, etc).

3 years agomkosi: do not install base packages in extensions
Luca Boccassi [Tue, 19 Oct 2021 20:41:10 +0000 (21:41 +0100)] 
mkosi: do not install base packages in extensions

3 years agomkosi: do not configure dracut if it is not installed
Luca Boccassi [Tue, 19 Oct 2021 20:40:45 +0000 (21:40 +0100)] 
mkosi: do not configure dracut if it is not installed

3 years agotyping: use Iterator instead of Generator
Zbigniew Jędrzejewski-Szmek [Mon, 18 Oct 2021 20:08:16 +0000 (22:08 +0200)] 
typing: use Iterator instead of Generator

Inspired by https://sethmlarson.dev/blog/2021-10-18/tests-arent-enough-case-study-after-adding-types-to-urllib3:
> Don’t expose Generators unless you want Generator functionality
>
> Generators have additional behaviors over iterables so if the API isn’t meant
> to be used like a generator then it’s best to keep this fact a secret and
> annotate with Iterable[X] instead of Generator[X, None, None].

3 years agoMerge pull request #840 from keszybz/remove-packages
Zbigniew Jędrzejewski-Szmek [Mon, 18 Oct 2021 19:02:17 +0000 (21:02 +0200)] 
Merge pull request #840 from keszybz/remove-packages

Clean up repo management and add RemovePackages= option

3 years agoUse fixed comment format distro TODOs 840/head
Zbigniew Jędrzejewski-Szmek [Mon, 18 Oct 2021 12:10:43 +0000 (14:10 +0200)] 
Use fixed comment format distro TODOs

3 years agomkosi: add RemovePackages= option
Zbigniew Jędrzejewski-Szmek [Fri, 15 Oct 2021 12:03:15 +0000 (14:03 +0200)] 
mkosi: add RemovePackages= option

This is useful to reduce the size of the final image by dropping
packages which are required during the installation, but are not needed
in the final image. So in particular, this includes packages pulled
in as Requires(pre) on rpm-based systems.

Example:
 sudo mkosi -r rawhide-36 --remove-package=shadow-utils

3 years agoman: describe the syntax that Packages= accepts a bit more
Zbigniew Jędrzejewski-Szmek [Fri, 15 Oct 2021 12:04:49 +0000 (14:04 +0200)] 
man: describe the syntax that Packages= accepts a bit more

What exactly is supported is different between the different distros.
But let's at least list the various options, so that people are aware
of the possibilities. Many people might not even think about the more
esoteric ones.

3 years agofedora: do not pull duplicate repo metadata on rawhide
Zbigniew Jędrzejewski-Szmek [Fri, 15 Oct 2021 10:19:12 +0000 (12:19 +0200)] 
fedora: do not pull duplicate repo metadata on rawhide

3 years agomkosi: fix grammar in comment
Zbigniew Jędrzejewski-Szmek [Fri, 15 Oct 2021 10:13:03 +0000 (12:13 +0200)] 
mkosi: fix grammar in comment

3 years agomkosi: simplify repo selection for rpm distros
Zbigniew Jędrzejewski-Szmek [Fri, 15 Oct 2021 10:12:44 +0000 (12:12 +0200)] 
mkosi: simplify repo selection for rpm distros

We create a custom repo file from scratch, with a bunch of repos.
We would then pass --disablerepo=* --enablerepo=… --enablerepo=…
to dnf to enable the repos we configured. This is pointlessly complicated:
let's instead just enable the repos in the config file we write.
(The config file is only used by the dnf commands we invoke.)

This changes the behaviour of UseHostRepositories=true a bit:
we now use the repos that are enabled on the host, instead of enabling
select repos. I think this actually makes more sense: the list of
repos on the host and their names is something that we have no control
over. So we don't really know which ones to enable. And the user can
still use Repositories= to select some repos. So UseHostRepositories=true
alone means "use host repositories as configured", and
UseHostRepositories=true + Repositories=… means "use the specified
host repositories".

3 years agomkosi: move install_centos_repos_old() right after …_new()
Zbigniew Jędrzejewski-Szmek [Fri, 15 Oct 2021 09:37:47 +0000 (11:37 +0200)] 
mkosi: move install_centos_repos_old() right after …_new()

I have no idea why they were separated, but it was confusing when editing
the code.

3 years agomkosi: refactor the code to call yum/dnf
Zbigniew Jędrzejewski-Szmek [Fri, 15 Oct 2021 08:42:21 +0000 (10:42 +0200)] 
mkosi: refactor the code to call yum/dnf

Each function to install packages is split in two:
an invoke_[t]dnf() function that accepts a verb and a list of packages,
and an install_packages_[t]dnf() function that calls the first
one with 'install' as the verb.

The idea is to allow other verbs to be called in the future.

I also merged invoke_dnf, invoke_yum, invoke_yum_or_dnf into a single
function. Nowadays, yum is just an aliast to dnf, so they both accept
the same options and provide the same functionality. They actually were
called with different options, but I think this was by mistake: people
added new functionality and forgot to update the callpath for yum.
And if the ancient yum in EPEL doesn't support some option, we can easily
conditionalize on the command name internally.
(Effectively, this changes how yum is called, more options are passed to
it now.)

3 years agoMerge pull request #839 from DaanDeMeyer/revert-nofile
Jörg Behrmann [Fri, 15 Oct 2021 08:37:41 +0000 (10:37 +0200)] 
Merge pull request #839 from DaanDeMeyer/revert-nofile

Remove NOFILE adjustment from nspawn settings

3 years agoRemove NOFILE adjustment from nspawn settings 839/head
Daan De Meyer [Thu, 14 Oct 2021 13:56:58 +0000 (15:56 +0200)] 
Remove NOFILE adjustment from nspawn settings

See https://github.com/systemd/mkosi/pull/837#issuecomment-943362723

3 years agomkosi: Fix autologin configs for different PAM versions
Vishal Verma [Wed, 6 Oct 2021 07:36:19 +0000 (01:36 -0600)] 
mkosi: Fix autologin configs for different PAM versions

Some PAM versions require full /dev/<tty> paths for the autologin setup
done by mkosi, where as others only need the <tty> portion.

If full paths are required, the <tty> only setup breaks, and vice versa.
However having both variants in the config isn't adverse in any way.

As distros upgrade their PAM versions, the distro based checks would
have to constantly play whack-a-mole to switch to the 'prefix-required'
vs. not variations.

Add both variants unconditionally - this way we solve the problem for
all distros, regardless of when they update.

Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
3 years agonspawn: Copy RLIMIT_CORE and RLIMIT_NOFILE in non-booted nspawn containers
Daan De Meyer [Wed, 13 Oct 2021 10:18:41 +0000 (11:18 +0100)] 
nspawn: Copy RLIMIT_CORE and RLIMIT_NOFILE in non-booted nspawn containers

Avoid surprises by copying open files and coredump limits from the user
running mkosi. Most noteably, this makes sure core dumps in non-booted
mkosi containers actually end up on the host as previously the coredump
size limit was zero in non-booted mkosi nspawn containers which led to
no coredumps being generated at all on the host of processes that dumped
core in the build containers (e.g. tests that raise SIGABRT).

3 years agoMerge pull request #833 from keszybz/manifest-recording-improvements
Zbigniew Jędrzejewski-Szmek [Wed, 13 Oct 2021 20:35:22 +0000 (22:35 +0200)] 
Merge pull request #833 from keszybz/manifest-recording-improvements

Manifest recording improvements

3 years agoMerge pull request #834 from keszybz/fedora-35-no-glibc-minimimal-langpack
Jörg Behrmann [Wed, 13 Oct 2021 15:37:07 +0000 (17:37 +0200)] 
Merge pull request #834 from keszybz/fedora-35-no-glibc-minimimal-langpack

fedora: only add glibc-minimal-langpack for F33-

3 years agofedora: only add glibc-minimal-langpack for F33- 834/head
Zbigniew Jędrzejewski-Szmek [Sat, 11 Sep 2021 06:54:54 +0000 (08:54 +0200)] 
fedora: only add glibc-minimal-langpack for F33-

Since F34, glibc changed from 'Suggests: glibc-all-langpacks' to
'Suggests: glibc-minimal-langpack', so we don't need to do this ourselves.
The advantage is that we avoid one line of output from dnf (about
glibc-minimal-langpack being already installed, which is confusing when
the user didn't request glibc-minimal-langpack explicitly).

3 years agoMerge pull request #836 from keszybz/tools-shell-cleanup
Jörg Behrmann [Tue, 12 Oct 2021 15:46:27 +0000 (17:46 +0200)] 
Merge pull request #836 from keszybz/tools-shell-cleanup

Shell coding cleanup and one documentation update

3 years agoman: mention cpio output 836/head
Zbigniew Jędrzejewski-Szmek [Tue, 12 Oct 2021 10:40:24 +0000 (12:40 +0200)] 
man: mention cpio output

Fixes #835.

3 years agotools/do-a-release: capitalize the commit title
Zbigniew Jędrzejewski-Szmek [Tue, 12 Oct 2021 10:35:52 +0000 (12:35 +0200)] 
tools/do-a-release: capitalize the commit title

That matches the prevalent style.

3 years agotools/do-a-release: stop trying to adjust MKOSI_TAG
Zbigniew Jędrzejewski-Szmek [Tue, 12 Oct 2021 10:34:00 +0000 (12:34 +0200)] 
tools/do-a-release: stop trying to adjust MKOSI_TAG

It was removed in 030873a0fe541df062974708e6afebd669c86232.
(The sed didn't do anything, so it wasn't harmful.)

3 years agotools: make shellcheck clean
Zbigniew Jędrzejewski-Szmek [Tue, 12 Oct 2021 10:30:47 +0000 (12:30 +0200)] 
tools: make shellcheck clean

https://github.com/koalaman/shellcheck/wiki/SC2268 is a good read.
Is says the reason to use x-prefix was fixed in bash in 1996.