Skip to content

discover: populate partition UUID from sysfs uevent#21

Merged
deitch merged 2 commits into
diskfs:mainfrom
eriknordmark:esp-b-retrofit
Jul 17, 2026
Merged

discover: populate partition UUID from sysfs uevent#21
deitch merged 2 commits into
diskfs:mainfrom
eriknordmark:esp-b-retrofit

Conversation

@eriknordmark

@eriknordmark eriknordmark commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

The sysfs (block-device) discovery path parsed only PARTNAME from a
partition's uevent, leaving its UUID empty — so selecting a partition by
IdentifierByUUID matched only image files (which read the GUID through
go-diskfs), never a real block device. 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.

A regression test builds a /sys fixture whose uevent carries PARTUUID
and asserts findDisks populates 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 adding
reserved-partition creation.

eriknordmark and others added 2 commits July 7, 2026 15:09
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

Copy link
Copy Markdown
Contributor Author

@deitch this is ready for review when you get a chance — thanks!

@deitch
deitch merged commit f6daf67 into diskfs:main Jul 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants