Repository navigation
Conversation
When COS_PERSISTENT is on an encrypted partition, the label resolves to the LUKS mapping /dev/dm-0. parentDiskFromBlockDev took the parent directory of /sys/class/block/dm-0 as the disk, but a device-mapper device lives in /sys/devices/virtual/block, so the disk came out as "block" and the "Grow persistent" stage failed on every boot. Follow a device-mapper device through /sys/class/block/<dm>/slaves to the partition it sits on, and use that partition to find the disk and the partition number. Expanding through the mapping is not done: the LUKS2 mapping can only be resized with the volume key, which the plugin does not have. The plugin now skips the expansion with an info message. The sysfs lookups take a root so the tests can build a fake sysfs tree. Fixes kairos-io/kairos#6165 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: mudler-agent <105103991+ci-robbot@users.noreply.github.com>
|
@ci-robbot needs QA |
QA: pass at 1ee8412, details and proof: kairos-io/kairos#6165 (comment) |
|
Picking this up for QA. |
QA Result: PASSTested at
1. COS_OEM + COS_PERSISTENT encrypted, real boot. immucore unlocks before the OEM mount, so Base ( PR ( After both boots, 2. COS_PERSISTENT encrypted only. At boot, immucore runs 3. Unencrypted control. Both arms behave the same. Boot 1 grows Notes, not caused by this PR:
Summary: On a real Kairos boot with an encrypted persistent partition behind a mapping, the fix turns the QA performed by |
Fixes kairos-io/kairos#6165
What
When
COS_PERSISTENTis on an encrypted partition, the label resolves to the LUKS mapping/dev/dm-0.parentDiskFromBlockDevtook the parent directory of/sys/class/block/dm-0as the disk. A device-mapper device lives in/sys/devices/virtual/block, so the disk came out asblockandGrow persistentfailed on every boot:How
backingDevicefollows a device-mapper device through/sys/class/block/<dm>/slavesto the partition under it (stacked mappings too).FindDiskFromLabelandlabelIsOnLastPartitionuse that partition, so the disk and the partition number are correct.Disk.Mapperrecords the mapping, and the expansion is skipped with an info message when it is set. Growing through LUKS needscryptsetup resize, and on LUKS2 that needs the volume key, which the plugin does not have. So this PR does not grow an encrypted partition; it stops the error.Verified
New unit tests build a fake sysfs (plain, nvme, LUKS on a partition, stacked mappings, a mapping on two devices, an image file).
go test ./pkg/plugins/andgo vet ./pkg/plugins/pass. Not booted on an encrypted install.This PR was written with AI assistance (Claude Code).
🤖 Generated with Claude Code