Page MenuHomeFreeBSD

gpart: Add warning when the start sector is too low.
ClosedPublic

Authored by imp on Oct 17 2023, 2:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 5, 9:30 PM
Unknown Object (File)
Mon, Dec 2, 3:45 PM
Unknown Object (File)
Sat, Nov 30, 6:49 AM
Unknown Object (File)
Nov 19 2024, 8:38 AM
Unknown Object (File)
Nov 17 2024, 11:01 AM
Unknown Object (File)
Oct 27 2024, 11:31 PM
Unknown Object (File)
Oct 22 2024, 11:33 AM
Unknown Object (File)
Oct 16 2024, 12:53 AM
Subscribers

Details

Summary

Add a warning if the starting sector is too low. The standard requires
that at least 16k is reserved for the GPT Partition Array, but some
tools produce GPT images with fewer than the required number of reserved
sectors.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 54050
Build 50940: arc lint + arc unit

Event Timeline

imp requested review of this revision.Oct 17 2023, 2:28 AM
imp created this revision.

I imagine "some tools" is only mkimg w/o D42245.

jrtc27 added inline comments.
sys/geom/part/g_part_gpt.c
1047
1055

Condition divides by sectorsize, this print doesn't

I imagine "some tools" is only mkimg w/o D42245.

I've seen python scripts that create embedded SD images for things like mediatek or similar that also violate these rules. They code is quite ugly...
I imagine no mainstream tool does this, but I'll also note that EDK II likes our old mkimg images and isn't bothered by them, suggesting that they had to cope in the past as well...

EDK II likes our old mkimg images and isn't bothered by them

I think there's not much value in a consumer (system firmware, OS partition handling code) in rejecting a GPT that violates the spec and has a too-low start LBA so I guess it's not too surprising that EDK II accepts it.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 16 2024, 12:15 AM
This revision was automatically updated to reflect the committed changes.

Sorry I didn't spot this / comment until after commit -- shouldn't this go to stderr? perhaps warnx?