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>
This commit is contained in:
Dan Ehrenberg
2014-11-06 16:22:24 -08:00
committed by chrome-internal-fetch
parent 837b408c92
commit a524a3a515
6 changed files with 77 additions and 63 deletions

View File

@@ -91,7 +91,7 @@ int CheckParameters(GptData* gpt);
* Returns 0 if header is valid, 1 if invalid.
*/
int CheckHeader(GptHeader *h, int is_secondary, uint64_t drive_sectors,
uint8_t stored_on_device);
uint64_t gpt_drive_sectors, uint8_t stored_on_device);
/**
* Calculate and return the header CRC.