Repository navigation
Add GPT type-guid option and validate partuuid - #125
Draft
mschwan-phytec wants to merge 10 commits into
Draft
mschwan-phytec wants to merge 10 commits into
mschwan-phytec wants to merge 10 commits into
Conversation
Configuration values like partuuid are handed to sfdisk unchecked, so a typo only shows up late as an sfdisk failure. Add a helper that checks the canonical 8-4-4-4-12 hexadecimal UUID format, so such values can be validated while parsing the layout configuration. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
A malformed partuuid used to be passed to sfdisk, which failed only while writing to the device. Validate the value when parsing the layout configuration, so the error is reported early and names the partition. Values on non-GPT disks are still ignored with a warning as before. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Partition flags only map to a fixed set of GPT partition type GUIDs. Add a helper that sets an arbitrary type GUID using sfdisk --part-type, mirroring pu_partition_set_partuuid(). Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Partition flags cannot express arbitrary GPT partition type GUIDs, such as the ones of the Discoverable Partitions Specification. Add the type-guid option to set any type GUID on a partition. Like partuuid, it is validated while parsing on GPT disks and ignored with a warning on other disk labels. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Cover valid values on GPT, malformed values failing with a parse error on GPT, and the same malformed values being ignored on msdos disks, so existing msdos configurations keep working. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
The test needs root privileges for the loop device and was not run as part of the user suite. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Describe the new type-guid option and that malformed partuuid and type-guid values are rejected on GPT partitioned devices. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Signed-off-by: Martin Schwan <m.schwan@phytec.de>
mschwan-phytec
force-pushed
the
wip-gpt-support
branch
from
November 17, 2026 09:18
b1e48dd to
ced6886
Compare
This branch has not been deployed
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.
This PR adds two GPT-related improvements to the layout configuration:
New type-guid partition option. It sets an arbitrary GPT partition type GUID, for example the Discoverable Partitions Specification
GUIDs. Partition flags only map to a fixed set of types. The GUID is applied via sfdisk --part-type after the flags, so it overrides any flag-derived type.
Early partuuid validation. A malformed partuuid on a GPT disk now fails with a parse error that names the partition. Before, it failed late in sfdisk while writing. type-guid is validated the same way.