Repository navigation
osinfo: default LUKS pbkdf memory and parallelism, log the disk.yaml found - #2727
Conversation
A `luks` payload in a bootc `disk.yaml` that leaves out `pbkdf.memory` or `pbkdf.parallelism` makes the build panic, because the LUKS2 format stage options reject zero for both. The `org.osbuild.luks2.format` stage itself treats them as optional and uses 32 and 1, so fill in the same values when the `disk.yaml` is read. See [1]. [1]: osbuild#2609 Signed-off-by: Andrew Dunn <[email protected]>
Log the path of the `disk.yaml` that is read, so that `bootc-image-builder --verbose` shows which file in the container the disk definitions came from. See [1]. [1]: osbuild#2609 Signed-off-by: Andrew Dunn <[email protected]>
|
Thanks! I've approved CI, I'll take a look at the code more in depth soon. A question up front: could zero values be actual values here? E.g, do we want to be able to actually set them to zero or do we not? 🙂 |
|
Zero can't be a real value for either today. I did notice the stage itself skips On the |
|
The 32 and 1 in this PR are the stage's defaults and also its minimums. The built-in LUKS image types use the same values with a With the defaults in place |
supakeen
left a comment
There was a problem hiding this comment.
Thanks look good to me, thank you! The wording of the log message can be changed later if we need to; and it's not being output anyhow.
avitova
left a comment
There was a problem hiding this comment.
LGTM:) Thanks for insights in the discussion:) I only have one question, maybe mainly for Simon.
Do we want to set the default here in osinfo.go? This codepath is not executed everywhere, as I understand this, this is used only for bootc. Is this something we would like to put into luks.go to be executed maybe during Unmarshaling the JSON (and thus also for distrodefs)? If not, why only bootc?
That's a good question. This way of setting defaults needs to be applied anywhere we load a partition table from YAML (or JSON) and we do it directly in |
There was a problem hiding this comment.
That's a good question. This way of setting defaults needs to be applied anywhere we load a partition table from YAML (or JSON) and we do it directly in osinfo for disk.yaml I can see moving the defaults function into luks.go (maybe only once we need to?) but I don't think we can move calling it into a place where it's shared between the two at a glance or do you want to put it into a custom unmarshaller for the type? That could work and I didn't think of it, but maybe a smaller potential blast radius is nice initially? I am unsure :)
Okay, let's leave this in osinfo for now. Our distrodefs have all this information, and this fixes not having memory and parallelism in bootc's disk.yaml. :)
avitova
left a comment
There was a problem hiding this comment.
Ooops, forgot to hit approve.
A
lukspayload in a bootcdisk.yamlcan now leave outpbkdf.memoryandpbkdf.parallelism. Reading the file fills in theorg.osbuild.luks2.formatstage defaults, 32 and 1, soNewLUKS2CreateStageno longer panics on the zero values.iterationshas no stage default and stays required.The second commit logs the path of the
disk.yamlit finds, sobootc-image-builder --verboseshows which file the disk definitions came from.Both changes were suggested in #2609.