Repository navigation
osbuild: support LUKS devices in bootupd stage - #2708
Conversation
|
|
||
| type LUKS2DeviceOptions struct { | ||
| Passphrase string `json:"passphrase"` | ||
| Partnum *int `json:"partnum,omitempty"` |
There was a problem hiding this comment.
This doesn't (yet) exist in the osbuild device: https://github.com/osbuild/osbuild/blob/main/devices/org.osbuild.luks2.meta.json#L18-L23
There was a problem hiding this comment.
Yeah, I wanted to open a discussion in the Slack channel. These changes will require changes in the osbuild code.
There was a problem hiding this comment.
Given that the parent device (org.osbuild.loopback) can easily be created to reference a specific partition (by offset and size), I don't think this is necessary and just adds extra complexity to the stage.
There was a problem hiding this comment.
I tried to add loopback for the LUKS partition, and it didn't work.
After the creation of the bootc install to-filesystem runs, and when it gets the LUKS loopback (as it has the /sysroot), it fails because it cannot find the EFI. I tried to add the --device option to bootc to navigate it to the real disk, but bootc does not expose this option currently. It needs changes in the osbuild to get the device and use it. WDYT? Should we go with the partnum solution, or should I keep trying to do the loopback option?
There was a problem hiding this comment.
Interesting. Silly of me to assume that the details of the backing device shouldn't matter but it doesn't surprise me that bootc gets tripped up by it. I'd be interested to see a minimal reproducer for the failure, out of curiosity, but based on what you're saying, it sounds like we'll have to add the partition number to the luks device module like you said.
Have you tested the solution in this PR already?
There was a problem hiding this comment.
Hi @achilleas-k ,
I will share the error with you.
AIB run.txt
The way I run it is I use AIB with my changes to add LUKS.
So it starts with AIB and fails in the image builder.
In the error files, you can see that
device/luks-partition-5 (org.osbuild.loopback): loop1 acquired
so LUKS takes /dev/loop1
and the error that fails is
[WARN bootupd::bootupd] Skipping device /dev/loop1 for EFI: ESP partition not found on /dev/loop1
error: boot data installation failed: installing component EFI to device (auto): No device specified and no mounted ESP found
error: Installing to filesystem: Installing bootloader: Failed to run command: Command {
program: "bootupctl",
args: [
"bootupctl",
"backend",
"install",
"--write-uuid",
"--filesystem",
"/sysroot",
"/",
],
env: CommandEnv {
clear: true,
vars: {
"PATH": Some(
"/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
),
},
},
create_pidfd: false,
}
which means that bootupctl tried to find EFI in loop1 but can't, as it only contains the file system.
Have you tested the solution in this PR already?
If you mean locally with AIB changes and osbuild changes and with partnum, then yes.
I ran AIB and got the raw image, checked inside the raw image, and saw the LUKS-encrypted file system.
There was a problem hiding this comment.
I guess we'll have to add the partnum to luks2 device then. Have you prepared the patch for osbuild to support this?
There was a problem hiding this comment.
Yes I do have. I will push MR to the osbuild.
There was a problem hiding this comment.
We will be able to merge it only after the osbuild release, right?
If yes, when is the new osbuild release scheduled?
5a150da to
24efecc
Compare
b1b0945 to
a5d4fac
Compare
a5d4fac to
14fd93d
Compare
|
Should be good to go now |
supakeen
left a comment
There was a problem hiding this comment.
Sorry, yes this is good like this. @ArtiomDivak this fell out of my visibility because I had already reviewed. If you want you can hit the 're-request' review in the PR on my name so it pops up in my list of PRs (maybe for next time) or reach out elsewhere.
Generate LUKS2 devices and mount their contained filesystems for bootupd. Add tests for valid and invalid LUKS payloads. Signed-off-by: Artiom Divak <[email protected]>
Head branch was pushed to by a user without write access
14fd93d to
dce0c3f
Compare
|
Sorry, I thought I needed to wait for the osbuild 194 release |
Generate LUKS2 devices and mount their contained filesystems for bootupd. Add tests for valid and invalid LUKS payloads.