discover: populate partition UUID from sysfs uevent#21
Merged
Conversation
Selecting a partition by IdentifierByUUID on a real block device requires the sysfs discovery path to expose each partition's GUID. Add a regression test that builds a /sys fixture whose uevent carries PARTUUID and asserts findDisks populates the partition uuid, upper-cased to match go-diskfs's UUID() so the value compares equal on both discovery paths. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The block-device discovery path parsed only PARTNAME from a partition's uevent, leaving its UUID empty, so a caller selecting by IdentifierByUUID never matched a disk found via sysfs; it worked only for image files, which read the GUID through go-diskfs. Read PARTUUID from the same uevent and upper-case it to match go-diskfs's UUID(), the value convert.go compares against when resolving the identifier on the GPT. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
eriknordmark
marked this pull request as ready for review
July 8, 2026 20:35
Contributor
Author
|
@deitch this is ready for review when you get a chance — thanks! |
deitch
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The sysfs (block-device) discovery path parsed only
PARTNAMEfrom apartition's uevent, leaving its UUID empty — so selecting a partition by
IdentifierByUUIDmatched only image files (which read the GUID throughgo-diskfs), never a real block device. Read
PARTUUIDfrom the same ueventand upper-case it to match go-diskfs's
UUID(), the valueconvert.gocompares against when resolving the identifier on the GPT.
A regression test builds a
/sysfixture whose uevent carriesPARTUUIDand asserts
findDiskspopulates the partition UUID; it fails without the fix.This is groundwork for selecting the EFI System Partition by GUID (two
partitions can now share the
"EFI System"label), ahead of addingreserved-partition creation.