diff options
author | Ben Chan <benchan@chromium.org> | 2018-01-31 11:39:14 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-02-06 18:18:35 -0800 |
commit | a4a8c02ad5988bd4b6fd85f6e09e9e0e79d18feb (patch) | |
tree | a1cc5fb4923c3d5a990fb486debc7cb2fe261f04 /firmware/lib/cgptlib/cgptlib_internal.c | |
parent | 3585eb3d21da676db3d87e9e0490a0df92d597d2 (diff) | |
download | vboot-a4a8c02ad5988bd4b6fd85f6e09e9e0e79d18feb.tar.gz |
cgpt: add support for managing GPT platform required partition bit
Bit 0 in the GPT partition attributes is defined to indicate whether a
partition is required by the platform. This CL adds the support for
managing this bit to cgpt.
BUG=b:70807006
BRANCH=None
TEST=Run unit tests.
Change-Id: Iaf87c828438b3df6730de502ae420fcf4c61277b
Reviewed-on: https://chromium-review.googlesource.com/902196
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'firmware/lib/cgptlib/cgptlib_internal.c')
-rw-r--r-- | firmware/lib/cgptlib/cgptlib_internal.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/lib/cgptlib/cgptlib_internal.c b/firmware/lib/cgptlib/cgptlib_internal.c index 9f37def6..9d7bd0c9 100644 --- a/firmware/lib/cgptlib/cgptlib_internal.c +++ b/firmware/lib/cgptlib/cgptlib_internal.c @@ -379,6 +379,11 @@ void GptRepair(GptData *gpt) gpt->valid_entries = MASK_BOTH; } +int GetEntryRequired(const GptEntry *e) +{ + return e->attrs.fields.required; +} + int GetEntryLegacyBoot(const GptEntry *e) { return e->attrs.fields.legacy_boot; @@ -408,6 +413,11 @@ int GetEntryTries(const GptEntry *e) CGPT_ATTRIBUTE_TRIES_OFFSET; } +void SetEntryRequired(GptEntry *e, int required) +{ + e->attrs.fields.required = required; +} + void SetEntryLegacyBoot(GptEntry *e, int legacy_boot) { e->attrs.fields.legacy_boot = legacy_boot; |