]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - doc/README.gpt
LG Optimus Black (P970) codename sniper support
[karo-tx-uboot.git] / doc / README.gpt
index 81dfe584c5d16cd55e3db608051c544af3cd1011..59fdeebfe89ccedbf6dc41e7d70c6449bb505c23 100644 (file)
@@ -6,7 +6,6 @@
 #
 # SPDX-License-Identifier:     GPL-2.0+
 
-
 Glossary:
 ========
 - UUID -(Universally Unique Identifier)
@@ -22,7 +21,6 @@ Introduction:
 This document describes the GPT partition table format and usage of
 the gpt command in u-boot.
 
-
 UUID introduction:
 ====================
 
@@ -68,17 +66,16 @@ GPT brief explanation:
                       |Partition n                      |
                       |                                 |
        ----------------------------------------------------------
-       LBA -34        |Entry 1|Entry 2| Entry 3| Entry 4| Secondary
-       -------------------------------------------------- (bkp)
-       LBA -33        |Entries 5 - 128                  | GPT
+       LBA -34        |Entry 1|Entry 2| Entry 3| Entry 4| Backup
+       -------------------------------------------------- GPT
+       LBA -33        |Entries 5 - 128                  |
                       |                                 |
                       |                                 |
        LBA -2         |                                 |
        --------------------------------------------------
-       LBA -1         |Secondary GPT Header             |
+       LBA -1         |Backup GPT Header                |
        ----------------------------------------------------------
 
-
 For a legacy reasons, GPT's LBA 0 sector has a MBR structure. It is called
 "protective MBR".
 Its first partition entry ID has 0xEE value, and disk software, which is not
@@ -89,7 +86,7 @@ It is possible to define 128 linearly placed partition entries.
 "LBA -1" means the last addressable block (in the mmc subsystem:
 "dev_desc->lba - 1")
 
-Primary/Secondary GPT header:
+Primary/Backup GPT header:
 ----------------------------
 Offset  Size    Description
 
@@ -114,12 +111,11 @@ Offset  Size    Description
 TOTAL: 512 B
 
 
-
 IMPORTANT:
 
 GPT headers and partition entries are protected by CRC32 (the POSIX CRC32).
 
-Primary GPT header and Secondary GPT header have swapped values of "Current LBA"
+Primary GPT header and Backup GPT header have swapped values of "Current LBA"
 and "Backup LBA" and therefore different CRC32 check-sum.
 
 CRC32 for GPT headers (field "CRC of header") are calculated up till
@@ -129,16 +125,15 @@ CRC32 for partition entries (field "CRC32 of partition array") is calculated for
 the whole array entry ( Number_of_partition_entries *
 sizeof(partition_entry_size (usually 128)))
 
-Observe, how Secondary GPT is placed in the memory. It is NOT a mirror reflect
+Observe, how Backup GPT is placed in the memory. It is NOT a mirror reflect
 of the Primary.
 
-
           Partition Entry Format:
           ----------------------
           Offset  Size    Description
 
-          0       16 B    Partition type GUID
-          16      16 B    Unique partition GUID
+          0       16 B    Partition type GUID (Big Endian)
+          16      16 B    Unique partition GUID in (Big Endian)
           32      8  B    First LBA (Little Endian)
           40      8  B    Last LBA (inclusive)
           48      8  B    Attribute flags [+]
@@ -150,7 +145,6 @@ of the Primary.
           Bit 62 - Hidden
           Bit 63 - Not mount
 
-
 Creating GPT partitions in U-Boot:
 ==============
 
@@ -163,23 +157,36 @@ To restore GUID partition table one needs to:
      "partitions=uuid_disk=${uuid_gpt_disk};name=${uboot_name},
        size=${uboot_size},uuid=${uboot_uuid};"
 
-   Fields 'name', 'size' and 'uuid' are mandatory for every partition.
+   The fields 'name' and 'size' are mandatory for every partition.
    The field 'start' is optional.
 
+   The fields 'uuid' and 'uuid_disk' are optional if CONFIG_RANDOM_UUID is
+   enabled. A random uuid will be used if omitted or they point to an empty/
+   non-existent environment variable. The environment variable will be set to
+   the generated UUID.
+
 2. Define 'CONFIG_EFI_PARTITION' and 'CONFIG_CMD_GPT'
 
 2. From u-boot prompt type:
    gpt write mmc 0 $partitions
 
-
 Useful info:
 ============
 
-Two programs, namely: 'fdisk' and 'parted' are recommended to work with GPT
-recovery. Parted is able to handle GUID partitions. Unfortunately the 'fdisk'
-hasn't got such ability.
+Two programs, namely: 'gdisk' and 'parted' are recommended to work with GPT
+recovery. Both are able to handle GUID partitions.
 Please, pay attention at -l switch for parted.
 
 "uuid" program is recommended to generate UUID string. Moreover it can decode
 (-d switch) passed in UUID string. It can be used to generate partitions UUID
 passed to u-boot environment variables.
+If optional CONFIG_RANDOM_UUID is defined then for any partition which environment
+uuid is unset, uuid is randomly generated and stored in correspond environment
+variable.
+
+note:
+Each string block of UUID generated by program "uuid" is in big endian and it is
+also stored in big endian in disk GPT.
+Partitions layout can be printed by typing "mmc part". Note that each partition
+GUID has different byte order than UUID generated before, this is because first
+three blocks of GUID string are in Little Endian.