Commit graph

10 commits

Author SHA1 Message Date
Michael Marineau
e4d25afd18 gpt: prefer disk size from header over firmware
The firmware and the OS may disagree on the disk configuration and size.
Although such a setup should be avoided users are unlikely to know about
the problem, assuming everything behaves like the OS. Tolerate this as
best we can and trust the reported on-disk location over the firmware
when looking for the backup GPT. If the location is inaccessible report
the error as best we can and move on.
2016-09-23 12:25:53 -07:00
Michael Marineau
bf127238ee gpt: fix partition table indexing and validation
Portions of the code attempted to handle the fact that GPT entries on
disk may be larger than the currently defined struct while others
assumed the data could be indexed by the struct size directly. This
never came up because no utility uses a size larger than 128 bytes but
for the sake of safety we need to do this by the spec.
2016-09-02 17:04:13 -07:00
Alex Crawford
53a4e99990 gpt: add search by disk uuid command 2015-08-31 16:20:37 -07:00
Alex Crawford
a8c24e86d0 gpt: minor cleanup 2015-08-31 15:23:39 -07:00
Michael Marineau
c70627bc9f gpt: add search by partition label and uuid commands
Builds on the existing filesystem search code. Only for GPT right now.
2014-11-27 18:49:24 -08:00
Michael Marineau
9c61d9bc2c tests: add some partitions to the gpt unit test data 2014-11-27 16:39:07 -08:00
Michael Marineau
6278c3e75f gpt: add a new generic GUID type
In order to do anything with partition GUIDs they need to be stored in a
proper structure like the partition type GUIDs. Additionally add an
initializer macro to simplify defining both GUID types.
2014-11-15 13:32:37 -08:00
Michael Marineau
478458d404 gpt: add new repair function to sync up primary and backup tables. 2014-10-20 13:54:58 -07:00
Michael Marineau
3b2674aef7 gpt: rename misnamed header location fields
The header location fields refer to 'this header' and 'alternate header'
respectively, not 'primary header' and 'backup header'. The previous
field names are backwards for the backup header.
2014-10-20 13:52:55 -07:00
Michael Marineau
f82f65f338 gpt: start new GPT module
This module is a new implementation for reading GUID Partition Tables
which is much stricter than the existing part_gpt module and exports GPT
data directly instead of the generic grub_partition structure. It will
be the basis for modules that need to read/write/update GPT data.

The current code does nothing more than read and verify the table.
2014-10-18 13:54:54 -07:00