Skip to content

Add GPT partition identity to ZInfoStorage#146

Merged
rene merged 2 commits into
lf-edge:mainfrom
eriknordmark:zinfo-storage-partition-fields
May 20, 2026
Merged

Add GPT partition identity to ZInfoStorage#146
rene merged 2 commits into
lf-edge:mainfrom
eriknordmark:zinfo-storage-partition-fields

Conversation

@eriknordmark
Copy link
Copy Markdown
Contributor

Summary

Extend ZInfoStorage (the per-partition entry in
ZInfoDevice.storageList) with three optional fields so a controller
can identify each entry by its GPT role rather than only by raw device
name:

  • partitionLabel (5) — GPT PARTLABEL, e.g. EFI System, CONFIG,
    IMGA, IMGB, P3.
  • partitionTypeGuid (6) — GPT partition-type GUID.
  • partitionUuid (7) — GPT PARTUUID — the same identifier EVE's boot
    path uses to resolve IMGA / IMGB / CONFIG.

Motivation

EVE already enumerates every block partition lsblk sees and reports
each one's size in ZInfoStorage.total. But a controller seeing
/dev/sda1, /dev/sda2, /dev/sda3 with sizes cannot tell which is
the EFI partition, which is IMGA vs IMGB, or compare the size of
either against the rootfs being staged. With these three fields it
can.

Compatibility

Pure additive change. New fields are appended as 5/6/7; existing
clients keep parsing the message unchanged. EVE fills the fields only
for block-partition entries on GPT-partitioned disks; directory
entries and partitions on non-GPT disks emit empty strings.

Follow-up

EVE pillar needs a follow-up change to populate the new fields from
lsblk -o PARTLABEL,PARTTYPE,PARTUUID (or equivalent). That change
is not in this PR.

@eriknordmark eriknordmark requested review from milan-zededa and rene May 19, 2026 17:44
Comment thread proto/info/info.proto Outdated
// Per filesystem/partition information
// Per filesystem/partition information.
//
// Block-partition entries (device != "") carry GPT identification in
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is a bit odd. Device carrying GPT identification will be block devices like sda, sdb, etc, not sda1, sda2, sda3 which represents the partition itself.... and why device != "". Please, review the comment...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The device field can be either /dev/sda or /dev/sdaN and all of those are block devices in Linux.
The comment refers to the underying disk (aka /dev/sda) being GPT.
The GPT info is contained in /dev/sda but is associated with the partitions.

So I don't see anything wrong in the comments - maybe this can be made more clear somehow. Let me try.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right — "block-partition" lumped whole disks and partitions together, and device != "" is the wrong gate (the empty-device case is the directory entries from ReportDirPaths, not whole-disk entries).

Rewrote the comments in the latest force-push: dropped the umbrella note and made each field's comment state its own emptiness rules — the GPT fields are set only when the entry is a GPT partition, and empty for whole-disk entries (e.g. sda), for partitions on non-GPT disks, and for directory entries.

eriknordmark and others added 2 commits May 20, 2026 11:39
Add partitionLabel, partitionTypeGuid, and partitionUuid so a
controller can tell which ZInfoStorage entry is the EFI partition,
which is IMGA vs IMGB, and how large each of them is on a given
device. ZInfoDevice.storageList today lists every block partition by
raw device name only, so role-keyed sizes (EFI, CONFIG, IMGA, IMGB,
P3) cannot be read off it. The new fields are the GPT PARTLABEL,
partition-type GUID, and PARTUUID — the same identifiers EVE's boot
path uses to resolve IMGA/IMGB/CONFIG. Appended as 5/6/7 and empty
for non-GPT or directory-only entries; existing clients remain
wire-compatible.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
No functional changes; generated code and assets only.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eriknordmark eriknordmark force-pushed the zinfo-storage-partition-fields branch from 5344d71 to 81aecec Compare May 20, 2026 09:50
@rene rene merged commit 2a982d0 into lf-edge:main May 20, 2026
4 checks passed
eriknordmark added a commit to eriknordmark/eve that referenced this pull request May 20, 2026
Pulls in lf-edge/eve-api#146 to add three optional GPT-identity fields
to ZInfoStorage (partitionLabel, partitionTypeGuid, partitionUuid) for
per-partition entries in ZInfoDevice.storageList, and catches up
remaining eve-api changes since the prior bump.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
eriknordmark added a commit to eriknordmark/eve that referenced this pull request May 21, 2026
Pulls in lf-edge/eve-api#146 to add three optional GPT-identity fields
to ZInfoStorage (partitionLabel, partitionTypeGuid, partitionUuid) for
per-partition entries in ZInfoDevice.storageList, and catches up
remaining eve-api changes since the prior bump.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
eriknordmark added a commit to eriknordmark/eve that referenced this pull request May 21, 2026
Pulls in lf-edge/eve-api#146 to add three optional GPT-identity fields
to ZInfoStorage (partitionLabel, partitionTypeGuid, partitionUuid) for
per-partition entries in ZInfoDevice.storageList, and catches up
remaining eve-api changes since the prior bump.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
eriknordmark added a commit to lf-edge/eve that referenced this pull request May 21, 2026
Pulls in lf-edge/eve-api#146 to add three optional GPT-identity fields
to ZInfoStorage (partitionLabel, partitionTypeGuid, partitionUuid) for
per-partition entries in ZInfoDevice.storageList, and catches up
remaining eve-api changes since the prior bump.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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