Enumerations

enum PartitionScheme
Name Value
kNew 0
kLegacy 1

Whether to use the new or legacy partition scheme.

Defined at line 25 of file ../../src/storage/gpt/include/gpt/guid.h

Records

Functions

  • bool gpt_cros_is_kernel_guid (const uint8_t * guid, size_t len)

    Defined at line 24 of file ../../src/storage/gpt/cros.cc

  • bool gpt_cros_attr_get_successful (uint64_t flags)

    Defined at line 29 of file ../../src/storage/gpt/cros.cc

  • void gpt_cros_attr_set_successful (uint64_t * flags, bool successful)

    Defined at line 31 of file ../../src/storage/gpt/cros.cc

  • uint8_t gpt_cros_attr_get_tries (uint64_t flags)

    Defined at line 35 of file ../../src/storage/gpt/cros.cc

  • int gpt_cros_attr_set_tries (uint64_t * flags, uint8_t tries)

    Defined at line 37 of file ../../src/storage/gpt/cros.cc

  • uint64_t BackupHeaderStartBlock (uint64_t block_count)

    Last block should contain the header for GPT backup copy.

    Defined at line 43 of file ../../src/storage/gpt/include/gpt/gpt.h

  • uint8_t gpt_cros_attr_get_priority (uint64_t flags)

    Defined at line 46 of file ../../src/storage/gpt/cros.cc

  • int gpt_cros_attr_set_priority (uint64_t * flags, uint8_t priority)

    Defined at line 50 of file ../../src/storage/gpt/cros.cc

  • fpromise::result<size_t, zx_status_t> MinimumBytesPerCopy (uint64_t block_size)

    Returns the maximum size in bytes to hold header block and partition table.

    Defined at line 88 of file ../../src/storage/gpt/include/gpt/gpt.h

  • fpromise::result<uint64_t, zx_status_t> MinimumBlocksPerCopy (uint64_t block_size)

    Returns the maximum blocks needed to hold header block and partition table.

    Defined at line 96 of file ../../src/storage/gpt/include/gpt/gpt.h

  • fpromise::result<uint64_t, zx_status_t> MinimumBlockDeviceSize (uint64_t block_size)

    Returns the minimum blocks needed to hold two copies of GPT at appropriate

    offset (considering mbr block).

    Defined at line 105 of file ../../src/storage/gpt/include/gpt/gpt.h

  • void gpt_set_debug_output_enabled (bool enabled)

    Defined at line 191 of file ../../src/storage/gpt/gpt.cc

  • void gpt_sort_partitions (const gpt_partition_t ** partitions, size_t count)

    Defined at line 193 of file ../../src/storage/gpt/gpt.cc

  • void cstring_to_utf16 (uint16_t * dst, const char * src, size_t maxlen)

    TODO(69527): migrate usages to |utf8_to_utf16| in utf_conversion.h

    Defined at line 198 of file ../../src/storage/gpt/gpt.cc

  • char * utf16_to_cstring (char * dst, const uint16_t * src, size_t len)

    TODO(69527): migrate usages to |utf16_to_utf8| in utf_conversion.h

    Defined at line 210 of file ../../src/storage/gpt/gpt.cc

  • bool gpt_is_sys_guid (const uint8_t * guid, ssize_t len)

    Defined at line 223 of file ../../src/storage/gpt/gpt.cc

  • bool gpt_is_data_guid (const uint8_t * guid, ssize_t len)

    Defined at line 228 of file ../../src/storage/gpt/gpt.cc

  • bool gpt_is_efi_guid (const uint8_t * guid, ssize_t len)

    Defined at line 233 of file ../../src/storage/gpt/gpt.cc

  • bool gpt_is_factory_guid (const uint8_t * guid, ssize_t len)

    Defined at line 238 of file ../../src/storage/gpt/gpt.cc

  • void uint8_to_guid_string (char * dst, const uint8_t * src)

    Defined at line 243 of file ../../src/storage/gpt/gpt.cc

  • fpromise::result<uint64_t, zx_status_t> EntryBlockCount (const gpt_entry_t * entry)

    Returns number of addressable blocks. On finding entry

    - nullptr, returns ZX_ERR_INVALID_ARGS

    - invalid, returns ZX_ERR_BAD_STATE

    - uninitialized, returns ZX_ERR_NOT_FOUND

    Defined at line 365 of file ../../src/storage/gpt/gpt.cc

  • void SetPartitionVisibility (gpt_partition_t * partition, bool visible)

    Sets or clears partition visibility flag

    Defined at line 416 of file ../../src/storage/gpt/gpt.cc

  • bool IsPartitionVisible (const gpt_partition_t * partition)

    Returns true if partition's kHiddenFlag is not set i.e. partition

    is visible

    Defined at line 412 of file ../../src/storage/gpt/gpt.cc

  • zx::result<> GetPartitionName (const gpt_entry_t & entry, char * name, size_t capacity)

    Returns a null terminated UTF-8 representation of the partition name.

    Defined at line 249 of file ../../src/storage/gpt/gpt.cc

  • fpromise::result<gpt_header_t, zx_status_t> InitializePrimaryHeader (uint64_t block_size, uint64_t block_count)

    On success returns initialized gpt header. On finding either |block_size| or

    |block_count| is not large enough, returns error.

    Defined at line 267 of file ../../src/storage/gpt/gpt.cc

  • zx_status_t ValidateHeader (const gpt_header_t * header, uint64_t block_count)

    Validates gpt header. Each type of inconsistency leads to unique status code.

    The status can be used to print user friendly error messages.

    Defined at line 334 of file ../../src/storage/gpt/gpt.cc

  • fpromise::result<bool, zx_status_t> ValidateEntry (const gpt_entry_t * entry)

    A gpt entry can exists in three states

    - unused; where all fields are zeroed.

    - valid; field have sensible values;

    - error; one or more fields are in inconsistent state.

    Returns

    - true if the entry is valid

    - false if entry is unused

    - error if entry fields are inconsistent

    Defined at line 381 of file ../../src/storage/gpt/gpt.cc

  • const char * HeaderStatusToCString (zx_status_t status)

    Converts status returned by ValidateHeader to a human readable error message.

    Defined at line 311 of file ../../src/storage/gpt/gpt.cc

  • mbr::Mbr MakeProtectiveMbr (uint64_t blocks_in_disk)

    Defined at line 424 of file ../../src/storage/gpt/gpt.cc

  • bool RangesOverlapsWithOtherRanges (const fbl::Vector<BlockRange> & ranges, const BlockRange & range)

    Defined at line 531 of file ../../src/storage/gpt/gpt.cc

  • uint64_t ComputePerCopySize (uint64_t block_size)

    Defined at line 948 of file ../../src/storage/gpt/test/gpt-tests.cc

  • uint64_t ComputePerCopyBlockCount (uint64_t block_size)

    Defined at line 952 of file ../../src/storage/gpt/test/gpt-tests.cc

  • uint64_t ComputeMinimumBlockDeviceSize (uint64_t block_size)

    Defined at line 956 of file ../../src/storage/gpt/test/gpt-tests.cc