aboutsummaryrefslogtreecommitdiff
path: root/cgpt/cgpt_common.c
diff options
context:
space:
mode:
authorDan Ehrenberg <dehrenberg@chromium.org>2014-11-06 16:22:24 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-14 22:46:54 +0000
commita524a3a51591618c1395cb9e1238ee72b3f5e767 (patch)
treee3ba27f590375e71ff40d8df29c9e04466a743bb /cgpt/cgpt_common.c
parent837b408c92d02108cbb16a97769675f39598d576 (diff)
downloadvboot_reference-a524a3a51591618c1395cb9e1238ee72b3f5e767.tar.gz
vboot: cgpt: fix my_lba of the secondary GPT
Previously, my_lba of the secondary GPT was recorded as if that GPT was written at the end of the device. This patch tweaks my_lba to report where it is in the random-access GPT address space, namely at the end of that space. TEST=Compiled it into the firmware and observed the firmware to update the my_lba field of the secondary GPT. BRANCH=none BUG=chromium:425677 Signed-off-by: Dan Ehrenberg <dehrenberg@chromium.org> Change-Id: I88791fb2cff1086351ca8a3adeef675c4a88cc9a Reviewed-on: https://chromium-review.googlesource.com/228942 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Daniel Ehrenberg <dehrenberg@chromium.org> Tested-by: Daniel Ehrenberg <dehrenberg@chromium.org>
Diffstat (limited to 'cgpt/cgpt_common.c')
-rw-r--r--cgpt/cgpt_common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cgpt/cgpt_common.c b/cgpt/cgpt_common.c
index 43312fe6..caee434a 100644
--- a/cgpt/cgpt_common.c
+++ b/cgpt/cgpt_common.c
@@ -340,6 +340,7 @@ static int GptLoad(struct drive *drive, uint32_t sector_bytes) {
}
GptHeader* primary_header = (GptHeader*)drive->gpt.primary_header;
if (CheckHeader(primary_header, 0, drive->gpt.drive_sectors,
+ drive->gpt.gpt_drive_sectors,
drive->gpt.stored_on_device) == 0) {
if (CGPT_OK != Load(drive, &drive->gpt.primary_entries,
primary_header->entries_lba,
@@ -352,6 +353,7 @@ static int GptLoad(struct drive *drive, uint32_t sector_bytes) {
}
GptHeader* secondary_header = (GptHeader*)drive->gpt.secondary_header;
if (CheckHeader(secondary_header, 1, drive->gpt.drive_sectors,
+ drive->gpt.gpt_drive_sectors,
drive->gpt.stored_on_device) == 0) {
if (CGPT_OK != Load(drive, &drive->gpt.secondary_entries,
secondary_header->entries_lba,