mkosi icon indicating copy to clipboard operation
mkosi copied to clipboard

Minimizing doesn't work on Github Actions

Open thedrow opened this issue 3 years ago • 2 comments

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.

thedrow avatar Jan 11 '22 16:01 thedrow

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.

mrc0mmand avatar Jan 13 '22 21:01 mrc0mmand

Couldn't we resize and than encrypt?

thedrow avatar Jan 14 '22 19:01 thedrow

Minimize= via systemd-repart works in GA, so let's close this issue

DaanDeMeyer avatar Feb 14 '23 14:02 DaanDeMeyer