Add labels to MTD partitions.

Add labels to MTD partitions and clean up some of the show code, adding more
info on the MTD prints and eliminating duplicated code.

BRANCH=none
TEST=make runtests & manual cgpt add -l "label"; cgpt show to verify labels
BUG=none

Change-Id: I59736128f394c2aca937a3a0bb5fc5d42b0149a9
Reviewed-on: https://gerrit.chromium.org/gerrit/63367
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
This commit is contained in:
Albert Chaulk
2013-07-25 11:32:57 -07:00
committed by ChromeBot
parent 05f5944a40
commit 32fd6dead1
3 changed files with 55 additions and 39 deletions

View File

@@ -66,6 +66,11 @@ typedef struct {
uint64_t starting_offset;
uint64_t ending_offset;
uint32_t flags;
/* 28 characters is a balance between GPT parity and size constraints, at
* current sizes this table occupies 10% of the FTS data store.
*/
char label[28];
} __attribute__((packed)) MtdDiskPartition;
typedef struct {
@@ -81,9 +86,9 @@ typedef struct {
MtdDiskPartition partitions[MTD_MAX_PARTITIONS];
} __attribute__((packed)) MtdDiskLayout;
#define MTD_DRIVE_V1_SIZE (32 + 16*20)
#define MTD_DRIVE_V1_SIZE (32 + 16*48)
#define MTDENTRY_EXPECTED_SIZE (20)
#define MTDENTRY_EXPECTED_SIZE (48)
#define MTDLAYOUT_EXPECTED_SIZE (32 + 16 * MTDENTRY_EXPECTED_SIZE)