]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
3 years agoci: Remove systemd.volatile from kernel command line
Daan De Meyer [Thu, 7 Apr 2022 09:49:58 +0000 (11:49 +0200)] 
ci: Remove systemd.volatile from kernel command line

volatile doesn't work on many distros. We initially added it to
support booting GPT squashfs images but since we don't test those
in CI anymore, we can safely remove volatile from the kernel
commandline as well.

3 years agoci: Use gpt_ext4 as the bootable system format instead of gpt_btrfs
Daan De Meyer [Thu, 7 Apr 2022 09:49:27 +0000 (11:49 +0200)] 
ci: Use gpt_ext4 as the bootable system format instead of gpt_btrfs

gpt_ext4 is usable everywhere unlike gpt_btrfs.

3 years agotests: Add back isinstance() check to pytest_assertrepr_compare()
Daan De Meyer [Thu, 7 Apr 2022 08:48:25 +0000 (10:48 +0200)] 
tests: Add back isinstance() check to pytest_assertrepr_compare()

Turns out that the added typing was wrong, not the isinstance()
check so add back the isinstance() check and change the type to Any
instead.

3 years agomachine: Duplicate pexpect serial output to stdout
Daan De Meyer [Wed, 6 Apr 2022 10:44:01 +0000 (12:44 +0200)] 
machine: Duplicate pexpect serial output to stdout

Helps with debugging failing tests.

3 years agoDifferentiate between machine name and interface name
Daan De Meyer [Wed, 6 Apr 2022 10:42:05 +0000 (12:42 +0200)] 
Differentiate between machine name and interface name

We only need to shorten the interface name. For machine names, we
can use the full name.

3 years agoRegister "integration" as a custom pytest marker
Daan De Meyer [Tue, 5 Apr 2022 13:09:32 +0000 (15:09 +0200)] 
Register "integration" as a custom pytest marker

Silences pytest warning message.

3 years agoAdd interface name to interface not found error message
Daan De Meyer [Tue, 5 Apr 2022 13:01:44 +0000 (15:01 +0200)] 
Add interface name to interface not found error message

Helps with debugging

3 years agoShorten interface names to 12 characters
Daan De Meyer [Tue, 5 Apr 2022 13:00:45 +0000 (15:00 +0200)] 
Shorten interface names to 12 characters

Off by one bug, interface names can only be 15 characters instead
of 16 characters so we need to limit the name to 12 characters
instead of 13.

3 years agoSet SSH timeout to 4 minutes for integration tests
Daan De Meyer [Tue, 5 Apr 2022 13:03:27 +0000 (15:03 +0200)] 
Set SSH timeout to 4 minutes for integration tests

3 years agoOnly build test images in bootable mode when using the qemu verb
Daan De Meyer [Tue, 5 Apr 2022 13:03:01 +0000 (15:03 +0200)] 
Only build test images in bootable mode when using the qemu verb

3 years agoci: Fix variable usage with sudo
Daan De Meyer [Tue, 5 Apr 2022 13:02:45 +0000 (15:02 +0200)] 
ci: Fix variable usage with sudo

The variable assignments should be part of the command passed to sudo,
otherwise they'll be ignored.

3 years agotest: squelch asyncio io warning
Joerg Behrmann [Thu, 14 Apr 2022 11:33:31 +0000 (13:33 +0200)] 
test: squelch asyncio io warning

This silences the deprecation warning

     The 'asyncio_mode' default value will change to 'strict' in
     future, please explicitly use 'asyncio_mode=strict' or
     'asyncio_mode=auto' in pytest configuration file.

The difference is whether pytest considers async tests to be
asyncio-driven even when they are not marked @pytest.mark.asyncio
with 'auto' meaning yes, consider them even when not marked, and
'strict' requiring the marking.

This doesn't really make a difference for us, since we don't have
any async tests, but it's nevertheless nice to silence the warning.

3 years agoRun dracut for unified kernel images instead of objcopy
Daan De Meyer [Fri, 8 Apr 2022 15:11:41 +0000 (17:11 +0200)] 
Run dracut for unified kernel images instead of objcopy

objcopy is faster but it doesn't apply any changes in installed
files when running in incremental mode which is a regression. Let's
run dracut again to fix that regression.

We can if needed add an option later to use objcopy instead of dracut
if users would want that.

3 years agoAdd option to run nspawn in current unit
Rémi Palancher [Mon, 24 Jan 2022 08:59:29 +0000 (09:59 +0100)] 
Add option to run nspawn in current unit

This commit adds --nspawn-keep-unit option to add --keep-unit option to
underlying systemd-nspawn commands. This makes systemd-nspawn uses the
current unit scope and allocated ressources. This can be notably useful
when mkosi is run by a system service.

3 years agoFix bootstrapping RPM distro on Debian
Luca Boccassi [Tue, 29 Mar 2022 00:43:40 +0000 (01:43 +0100)] 
Fix bootstrapping RPM distro on Debian

The Debian rpm/dnf packages store the db in the home directory, so
the bootstrapped image has a broken rpm database.
Move it to the right place if it happens.

See: https://bugs.debian.org/1004863

Fixes https://github.com/systemd/mkosi/issues/934

3 years agoMerge pull request #945 from DaanDeMeyer/dnf-vars-stream
Jörg Behrmann [Mon, 4 Apr 2022 16:48:59 +0000 (18:48 +0200)] 
Merge pull request #945 from DaanDeMeyer/dnf-vars-stream

centos: Write stream dnf variable file when a stream release is used

3 years agocentos: Write stream dnf variable file when a stream release is used 945/head
Daan De Meyer [Mon, 4 Apr 2022 12:50:53 +0000 (14:50 +0200)] 
centos: Write stream dnf variable file when a stream release is used

CentOS Stream SIGs use the $stream variable in their repo files to
identify the current CentOS Stream version. Let's make sure we write
this file so that SIG repo files can be copied into mkosi.reposdir
as is without requiring modifications to make them work.

Example SIG repo file using $stream:
https://git.centos.org/rpms/centos-release-hyperscale/blob/c8s-sig-hyperscale/f/SOURCES/CentOS-Stream-Hyperscale.repo

3 years agoConfigure pacman with ParallelDownloads = 5
Daan De Meyer [Thu, 31 Mar 2022 10:56:00 +0000 (12:56 +0200)] 
Configure pacman with ParallelDownloads = 5

Let's include the new ParallelDownloads option from pacman v6 with
the same default value used by pacman itself.

3 years agoAdd --repository-directory option
Daan De Meyer [Wed, 30 Mar 2022 14:00:04 +0000 (16:00 +0200)] 
Add --repository-directory option

The repository directory can contain extra repositories to be
used when installing packages. If mkosi.reposdir/ exists, it's
used as the repository directory unless it's explicitly
specified.

Only supported for rpm based distros and Arch for now. We don't
support Ubuntu/Debian atm because we can't point apt to the
extra repositories directory because apt runs inside the image
compared to dnf and pacman which run outside of the image.

3 years agoMerge pull request #942 from DaanDeMeyer/cache-reuse-machine-id
Jörg Behrmann [Wed, 30 Mar 2022 14:07:13 +0000 (16:07 +0200)] 
Merge pull request #942 from DaanDeMeyer/cache-reuse-machine-id

Reuse machine ID when re-using a cached image

3 years agoReuse machine ID when re-using a cached image 942/head
Daan De Meyer [Wed, 30 Mar 2022 07:58:15 +0000 (09:58 +0200)] 
Reuse machine ID when re-using a cached image

4fb53aea9e04b931cccedf1545831e426d6ec2f7 broke incremental builds
for bootable Fedora images because when building the cached image,
the initrd is installed to "/efi/<machine-id>/...", and when doing
a cached build, a new machine ID is generated inside mkosi (but not
written to /etc/machine-id), making gen_kernel_images() unable to
find the initrd.

Let's fix the issue by re-using the machine ID from /etc/machine-id
when doing a cached build.

In the future, we can use the new entry-token feature of bootctl to
have kernel-install write to directory in /efi that's not tied to
the machine ID but until that's widely available this will have to
do.

3 years agoMerge pull request #941 from DaanDeMeyer/fixes
Daan De Meyer [Tue, 29 Mar 2022 16:24:41 +0000 (18:24 +0200)] 
Merge pull request #941 from DaanDeMeyer/fixes

Two small fixes

3 years agoMake sure --source-file-transfer-final works without a build script 941/head
Daan De Meyer [Tue, 29 Mar 2022 14:32:58 +0000 (16:32 +0200)] 
Make sure --source-file-transfer-final works without a build script

3 years agocentos: Rebuild the rpm db in bdb format on older centos releases
Daan De Meyer [Tue, 29 Mar 2022 14:30:16 +0000 (16:30 +0200)] 
centos: Rebuild the rpm db in bdb format on older centos releases

When building centos stream 8 images from Fedora, the resulting rpmdb
in the image is written in the sqlite format. The rpm version available
in centos stream 8 only supports reading the sqlite format but not writing
to it, which effectively makes installing rpm packages in the resulting
image impossible.

As a temporary workaround, we run rpm --rebuilddb inside the image to rebuild
the db in the older bdb format. Ideally we'd use the rpm from the host for this
but rpm has removed bdb support in newer versions so this isn't possible.

Luckily, we can remove this hack once we remove support for centos stream 8
and lower.

3 years agoMerge pull request #939 from behrmann/envrefactor
Daan De Meyer [Mon, 28 Mar 2022 08:58:20 +0000 (10:58 +0200)] 
Merge pull request #939 from behrmann/envrefactor

Make MkosiArgs.environment a dictionary

3 years agomake MkosiArgs.environment a dictionary 939/head
Joerg Behrmann [Sat, 26 Mar 2022 15:09:49 +0000 (16:09 +0100)] 
make MkosiArgs.environment a dictionary

3 years agorelax accepted types for run_work_space command
Joerg Behrmann [Sat, 26 Mar 2022 15:04:16 +0000 (16:04 +0100)] 
relax accepted types for run_work_space command

3 years agoAdd missing environments to prepare und postinst scripts 938/head
Joerg Behrmann [Sat, 26 Mar 2022 13:41:43 +0000 (14:41 +0100)] 
Add missing environments to prepare und postinst scripts

Fixes: #937
3 years agoci: Add back shellcheck
Daan De Meyer [Fri, 25 Mar 2022 12:18:15 +0000 (13:18 +0100)] 
ci: Add back shellcheck

Turns out the globbing wasn't done quite right. Fixed the globbing
so it applies to all shell scripts in the mkosi repository.

3 years agoci: Remove shellcheck step
Daan De Meyer [Fri, 25 Mar 2022 11:50:15 +0000 (12:50 +0100)] 
ci: Remove shellcheck step

We don't have any scripts to check anymore.

3 years agoMerge pull request #923 from DaanDeMeyer/remove-dracut-uki-script
Daan De Meyer [Fri, 25 Mar 2022 10:46:35 +0000 (11:46 +0100)] 
Merge pull request #923 from DaanDeMeyer/remove-dracut-uki-script

Remove dracut unified kernel image kernel-install script

3 years agoReplace dracut unified kernel image kernel-install script with objcopy 923/head
Daan De Meyer [Sat, 5 Mar 2022 15:51:21 +0000 (15:51 +0000)] 
Replace dracut unified kernel image kernel-install script with objcopy

When using objcopy, we can generate the initrd in the install phase
which is cached which speeds up builds of incremental images. We use
objcopy from the host system to avoid having to install binutils in
all generated images.

We also call kernel-install manually in opensuse, debian and ubuntu
builds to make sure we can find an initrd image to pass to objcopy.
By calling kernel-install, we also make sure that
--without-unified-kernel-images now works for these distros as well.

3 years agoFix unreachable code mypy typing error
Daan De Meyer [Tue, 22 Mar 2022 15:39:31 +0000 (16:39 +0100)] 
Fix unreachable code mypy typing error

3 years agoMerging CI tests with MkosiMachineTest class
gsegatti [Thu, 10 Mar 2022 17:38:10 +0000 (09:38 -0800)] 
Merging CI tests with MkosiMachineTest class

- Removing the usage of the file at /tests/pexpect/boot.py
- Replacing the build/boot process ownership to the mkosi/machine.py file.
- All tests will attempt to build a MkosiMachineTestCase class and run the test functions.
- We leverage the load_args() function from __init__.py in order to replace the if's from the ci.yml file.
- If a set of options is invalid, we skip such test.
- We also define a specific exception for a invalid combination of arguments to be parsed, named "MkosiNotSupportedException".
- MkosiNotSupportedException inherits MkosiException.

3 years agoRemove uneeded "name=" from EPEL repo definition
Justin Vreeland [Thu, 3 Mar 2022 00:09:03 +0000 (16:09 -0800)] 
Remove uneeded "name=" from EPEL repo definition

setup_dnf provides name= already

Before:

CentOS-8-stream - Plus                                                                    10 kB/s | 3.0 kB     00:00
CentOS-8-stream - PowerTools                                                              19 kB/s | 4.4 kB     00:00
name=Extra Packages for Enterprise Linux 8 - x86_64                                       10 kB/s | 4.7 kB     00:00

After:

CentOS-8-stream - Plus                                                                   5.3 kB/s | 3.0 kB     00:00
CentOS-8-stream - PowerTools                                                             8.1 kB/s | 4.4 kB     00:00
Extra Packages for Enterprise Linux 8 - x86_64                                           9.4 kB/s | 4.7 kB     00:00

Signed-off-by: Justin Vreeland <vreeland.justin@gmail.com>
3 years agogentoo: add homed flag to pambase
Paymon MARANDI [Tue, 8 Mar 2022 18:30:04 +0000 (13:30 -0500)] 
gentoo: add homed flag to pambase

[`upstream bug`](https://bugs.gentoo.org/832167):
sys-apps/systemd[homed] should depend on sys-auth/pambase[homed]

3 years agoAdding "shell" verb to Machine class.
gsegatti [Mon, 7 Mar 2022 15:29:06 +0000 (07:29 -0800)] 
Adding "shell" verb to Machine class.

Summary: Adding support for running Mkosi images from within the Machine class using "shell".
- What we do here is skip booting an image whenever using such verb. Then, for running commands, we utilise run_shell_cmdline()'s to leverage systemd-nspawn.
- We also add the shell run of the current set of tests to the CI.
- We add the "--pipe" option to the cmdline utilised by run_shell_cmdline() in case future scripts use Mkosi from outside a terminal.

3 years agoCentralize usage of suppress_stacktrace() and propagate returncode
Daan De Meyer [Mon, 7 Mar 2022 19:38:49 +0000 (19:38 +0000)] 
Centralize usage of suppress_stacktrace() and propagate returncode

Let's centralize the usage of suppress_stacktrace() to run_verb()
and make sure we properly propagate the returncode of the command
that failed.

3 years agodebian: Switch default release from unstable to testing
Daan De Meyer [Fri, 4 Mar 2022 20:57:24 +0000 (20:57 +0000)] 
debian: Switch default release from unstable to testing

Unstable is a bit too bleading edge. Let's switch to testing which
is roughly 5 days behind unstable so we don't get affected by
temporary issues that make it to unstable.

3 years agoProof of concept for integration testing
gsegatti [Mon, 28 Feb 2022 14:36:43 +0000 (06:36 -0800)] 
Proof of concept for integration testing

3 years agoRunning mypy in the tests/ folder and correcting errors raised by it.
gsegatti [Tue, 1 Mar 2022 10:46:51 +0000 (02:46 -0800)] 
Running mypy in the tests/ folder and correcting errors raised by it.

3 years agoCheck /dev/kvm more thoroughly.
Joerg Behrmann [Wed, 23 Feb 2022 08:16:47 +0000 (09:16 +0100)] 
Check /dev/kvm more thoroughly.

Some CI runners, among them apparently GA, present non-working KVM
devices. Let's try to open it, to see whether we can.

Fixes: #914
3 years agoci: Remove nspawn Arch workaround
Daan De Meyer [Fri, 25 Feb 2022 10:42:34 +0000 (10:42 +0000)] 
ci: Remove nspawn Arch workaround

3 years agoAdd PowerTools repo for CentOS Stream 8
Daan De Meyer [Thu, 24 Feb 2022 14:07:30 +0000 (14:07 +0000)] 
Add PowerTools repo for CentOS Stream 8

Enables installing development related packages (e.g. meson).

3 years agoRename --network-veth to --netdev (#909)
Daan De Meyer [Wed, 23 Feb 2022 16:23:41 +0000 (16:23 +0000)] 
Rename --network-veth to --netdev (#909)

Co-authored-by: Jörg Behrmann <behrmann@physik.fu-berlin.de>
3 years agoAdding an Enum class for verb comparison across Mkosi's code.
gsegatti [Tue, 22 Feb 2022 11:05:35 +0000 (03:05 -0800)] 
Adding an Enum class for verb comparison across Mkosi's code.

3 years agoPrint sfdisk spec if sfdisk fails
Daan De Meyer [Mon, 21 Feb 2022 18:07:20 +0000 (18:07 +0000)] 
Print sfdisk spec if sfdisk fails

3 years agoInstall a more specific match when --network-veth is used (#906)
Daan De Meyer [Fri, 18 Feb 2022 10:46:26 +0000 (10:46 +0000)] 
Install a more specific match when --network-veth is used (#906)

* Install a more specific match when --network-veth is used

When doing more complicated network stuff in a QEMU VM, the network
file we install starts matching stuff it shouldn't match. Let's narrow
the match down by driver so we don't accidentally match against stuff
we don't want to match against.

Co-authored-by: Jörg Behrmann <behrmann@physik.fu-berlin.de>
3 years agoAn integration testing mvp that allows building, booting, running and shutting down...
gsegatti [Wed, 26 Jan 2022 21:29:28 +0000 (13:29 -0800)] 
An integration testing mvp that allows building, booting, running and shutting down mkosi images via pexpect.

3 years agoFix needs_build() logic
Daan De Meyer [Mon, 14 Feb 2022 14:24:14 +0000 (14:24 +0000)] 
Fix needs_build() logic

We should only check the -f option if the verb is one of the verbs
that needs a build. With the current check, we start rebuilding an
image even if the verb is "summary".

3 years agoError when trying to build an image without --bootable and run it with qemu
Daan De Meyer [Fri, 11 Feb 2022 12:12:58 +0000 (12:12 +0000)] 
Error when trying to build an image without --bootable and run it with qemu

We can only check this when we're building the image, since when we're not
building the image it's not required to pass the --bootable option in order
to be able to use the qemu verb to run it in qemu.

This also fixes needs_build() to take the args.force option into account.
This fixes usage of needs_build() before unlink_output() is called.

3 years agoMerge pull request #902 from m0gg/gentoo-bootable-fix
Jörg Behrmann [Thu, 10 Feb 2022 13:32:58 +0000 (14:32 +0100)] 
Merge pull request #902 from m0gg/gentoo-bootable-fix

Use Gentoo.EMERGE_UPDATE_OPTS to allows the package manager to uninstall blockers.

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 agoci: Add python integration tests job
Daan De Meyer [Thu, 3 Feb 2022 11:38:18 +0000 (11:38 +0000)] 
ci: Add python integration tests job

To run the actual integration tests, we need to have the mkosi
action and dependencies installed. Instead of running the integration
tests as part of the unit tests job, let's add a new job for these
integration tests where we install the necessary dependencies (including
mkosi itself) and then run all tests marked with "integration" in pytest.

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.