HomeFreeBSD

gpart: More nuance for GPT support

Description

gpart: More nuance for GPT support

A careful reading of the GPT standard shows that one may have fewer than
128 entries in your GPT table. While the standard requires that we
reserve enough space (32 512-byte-LBAs or 4 4096-byte-LBAs), it also
explicitly allows one to specify fewer actual partitions (since that
controls what is in the CRC). It requires that the first LBA to be 32
(512 sectors) or 6 (4k sectors) or larger. That requirement is not
enforced (it's not listed as one of validation criteria for the GPT).
We should likely do so in the future.

To that end, allow a default number of entries to use (defent) on
creation to be different (larger) than the minimum number of legal
entries. For gpt, these numbers work out to 128 and 1 respectively. For
all the others, make minent == defent so this is a nop for those
partitioning schemes.

Sponsored by: Netflix
Reviewed by: zlei, emaste
Differential Revision: https://reviews.freebsd.org/D42246

Details

Provenance
impAuthored on Oct 15 2024, 11:15 PM
Reviewer
zlei
Differential Revision
D42246: gpart: More nuance for GPT support
Parents
rGac77b2621508: tests: Test endian.h, byteswap.h, sys/endian.h and both endian.h and byteswap.h…
Branches
Unknown
Tags
Unknown