summaryrefslogtreecommitdiff
path: root/cgpt/cgpt_create.c
diff options
context:
space:
mode:
authorDan Ehrenberg <dehrenberg@chromium.org>2015-01-02 14:39:38 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-05 20:35:56 +0000
commitf3f7fca07fbcb6bb9655a71257f09c71b0a1458d (patch)
treef11e478590427dcc3d0214c7cbe819d565d53294 /cgpt/cgpt_create.c
parent5d652cdffa70dc772e80548a760e1f0d67de273f (diff)
downloadvboot-f3f7fca07fbcb6bb9655a71257f09c71b0a1458d.tar.gz
nand: vboot support for small GPTs
This patch makes some small modifications to cgpt and vboot to root out the last vestigates of a fixed 128-entry GPT: - Get rid of the TOTAL_ENTRIES_SIZE constant and all users. - Reduce MAX_NUMBER_OF_ENTRIES to 128 (which is what the GPT spec specifies) so that this can be used for things like memory allocations without additional overhead. - Base the amount of GPT read/written on the number of entries specified in the GPT header on disk/flash. BUG=chromium:433433 TEST=make runalltests TEST=Modified fmap to make an 8k RW_GPT, wrote a GPT with cgpt, then rebooted and found that the GPT was correctly read after restarting and the appropriate mtd partitions were present. BRANCH=none Change-Id: I45317377da20259caf04a7a4fa077a892b03c45f Signed-off-by: Dan Ehrenberg <dehrenberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/238245 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'cgpt/cgpt_create.c')
-rw-r--r--cgpt/cgpt_create.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cgpt/cgpt_create.c b/cgpt/cgpt_create.c
index 60e23c96..c34cfe31 100644
--- a/cgpt/cgpt_create.c
+++ b/cgpt/cgpt_create.c
@@ -48,7 +48,7 @@ static int GptCreate(struct drive *drive, CgptCreateParams *params) {
/* Calculate number of entries */
h->size_of_entry = sizeof(GptEntry);
- h->number_of_entries = TOTAL_ENTRIES_SIZE / h->size_of_entry;
+ h->number_of_entries = MAX_NUMBER_OF_ENTRIES;
if (drive->gpt.flags & GPT_FLAG_EXTERNAL) {
// We might have smaller space for the GPT table. Scale accordingly.
//