Minimizing doesn't work on Github Actions
See build log.
I'm not sure if this is resolvable but at least it should be documented that in some environments, this doesn't work.
I think the main issue here is that blkdiscard is unsupported on dm-crypt devices:
# dd if=/dev/zero of=crypt.img bs=1M count=64
# cryptsetup luksFormat --force-password crypt.img
# cryptsetup luksOpen crypt.img test
# blkdiscard /dev/mapper/test
blkdiscard: /dev/mapper/test: BLKDISCARD ioctl failed: Operation not supported
which is relevant in your case, since you're using Encrypt=all. Nonetheless, mkosi should handle this scenario as well.
However, while debugging this, I came across another strange issue. The build passes with a simple config (see below) and no build script:
https://github.com/systemd-ci-incubator/mkosi-playground/runs/4808819744?check_suite_focus=true#step:4:1599
but with a build script blkdiscard fails:
https://github.com/systemd-ci-incubator/mkosi-playground/runs/4809153393?check_suite_focus=true#step:4:1932
For debugging I created a test repo (https://github.com/systemd-ci-incubator/mkosi-playground) with following mkosi config:
mkosi.default
[Distribution]
Distribution=ubuntu
Release=focal
[Output]
Format=gpt_ext4
Bootable=yes
Minimize=yes
mkosi.build
#!/bin/bash
echo "hello world"
And as said before - without mkosi.build present everything works (in GH Actions), with the script present the build fails.
Couldn't we resize and than encrypt?
Minimize= via systemd-repart works in GA, so let's close this issue