class EfiGptBlockDevice
Defined at line 24 of file ../../src/firmware/gigaboot/cpp/gpt.h
Can't include gpt.h due to circular includes so declare the type here.
Public Methods
void EfiGptBlockDevice (const EfiGptBlockDevice & )
No copy.
Defined at line 29 of file ../../src/firmware/gigaboot/cpp/gpt.h
EfiGptBlockDevice & operator= (const EfiGptBlockDevice & )
Defined at line 30 of file ../../src/firmware/gigaboot/cpp/gpt.h
void EfiGptBlockDevice (EfiGptBlockDevice && )
Defined at line 32 of file ../../src/firmware/gigaboot/cpp/gpt.h
EfiGptBlockDevice & operator= (EfiGptBlockDevice && )
Defined at line 33 of file ../../src/firmware/gigaboot/cpp/gpt.h
const gpt_header_t & GptHeader ()
Defined at line 40 of file ../../src/firmware/gigaboot/cpp/gpt.h
size_t BlockSize ()
Defined at line 43 of file ../../src/firmware/gigaboot/cpp/gpt.h
uint64_t LastBlock ()
Defined at line 44 of file ../../src/firmware/gigaboot/cpp/gpt.h
fit::result<efi_status, EfiGptBlockDevice> Create (efi_handle device_handle)
Defined at line 248 of file ../../src/firmware/gigaboot/cpp/gpt.cc
fit::result<efi_status> ReadPartition (std::string_view name, size_t offset, size_t length, void * out)
Defined at line 413 of file ../../src/firmware/gigaboot/cpp/gpt.cc
fit::result<efi_status> ReadPartition (std::string_view name, size_t offset, size_t length, void * out)
Defined at line 413 of file ../../src/firmware/gigaboot/cpp/gpt.cc
fit::result<efi_status> WritePartition (std::string_view name, const void * data, size_t offset, size_t length)
Defined at line 430 of file ../../src/firmware/gigaboot/cpp/gpt.cc
fit::result<efi_status> WritePartition (std::string_view name, const void * data, size_t offset, size_t length)
Defined at line 430 of file ../../src/firmware/gigaboot/cpp/gpt.cc
std::span<const std::array<char, 72 / 2>> ListPartitionNames ()
Defined at line 447 of file ../../src/firmware/gigaboot/cpp/gpt.cc
const gpt_entry_t * FindPartition (std::string_view name)
Find partition info.
Note: this function will reload the GPT if the on-disk GPT has been reinitialized
by another EfiGptBlockDevice that references the same physical device.
Defined at line 380 of file ../../src/firmware/gigaboot/cpp/gpt.cc
const gpt_entry_t * FindPartition (std::string_view name)
Find partition info.
Note: this function will reload the GPT if the on-disk GPT has been reinitialized
by another EfiGptBlockDevice that references the same physical device.
Defined at line 380 of file ../../src/firmware/gigaboot/cpp/gpt.cc
fit::result<efi_status> Load ()
Load GPT from device.
Note: this function MAY reset the primary GPT but NOT the backup.
The backup is only read and verified if the primary is corrupted;
if this is the case the primary is restored from the backup.
There is a hole where the backup is corrupted first.
At some point, if the primary is ever corrupted, the load will fail.
To prevent this we would need to read both tables all the time during boot
and then repair any damage done to either table.
Reading both tables all the time slows down boot in the common case where
both tables are fine. This sort of verification and repair is arguably better
suited to a post-boot daemon.
Defined at line 269 of file ../../src/firmware/gigaboot/cpp/gpt.cc
FuchsiaFirmwareStorage GenerateStorageOps ()
Create a FuchsiaFirmwareStorage structure for the firmware SDK storage library.
Defined at line 61 of file ../../src/firmware/gigaboot/cpp/gpt.cc
fit::result<efi_status> Reinitialize ()
Reinitialize device's GPT.
Generates the factory default partition table, writes it to disk,
and updates internal data structures.
Return values from FindPartition are invalidated.
Return values from ListPartitionNames are invalidated.
Note: this function requires all other EfiGptBlockDevice objects
that reference the same disk to reread the disk's partition information.
Subsequent method calls on those objects may result in reloading
the partition information from disk.
Defined at line 108 of file ../../src/firmware/gigaboot/cpp/gpt.cc