summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorKever Yang <kever.yang@rock-chips.com>2016-07-29 11:12:18 +0800
committerTom Rini <trini@konsulko.com>2016-08-05 20:55:16 -0400
commitc2fdd34569145ad281aeea5ef16fff83d7075830 (patch)
tree596fddf6ec6cc840d5d092651068c29866aa00a2 /disk
parent584550d76ad113a072470b806cc785141632b9f5 (diff)
cmd: gpt: fix the wrong size parse for the last partition
The calculation of "dev_desc->lba - 34 - 1 - offset" is not correct for size '-', because both fist_usable_lba and last_usable_lba will remain 34 sectors. We can simply use 0 for size '-' because the part_efi module will decode the size and auto extend the size to maximum available size. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'disk')
-rw-r--r--disk/part_efi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 01f71bee79..8d67c09a43 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -655,6 +655,10 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
(unsigned long long)partitions[i].size);
if (le64_to_cpu(gpt_part_size) != partitions[i].size) {
+ /* We do not check the extend partition size */
+ if ((i == parts - 1) && (partitions[i].size == 0))
+ continue;
+
error("Partition %s size: %llu does not match %llu!\n",
efi_str, (unsigned long long)gpt_part_size,
(unsigned long long)partitions[i].size);