diff options
author | Furquan Shaikh <furquan@google.com> | 2015-10-01 19:22:31 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-04-05 13:16:31 -0700 |
commit | 723b3c09debfa350f7a17e7927116c3535ac081b (patch) | |
tree | 084d0fec40c90a65e39b8743c60818215cbc2ae2 | |
parent | f482470b72086d5ba672513434f3da5d62599538 (diff) | |
download | vboot-723b3c09debfa350f7a17e7927116c3535ac081b.tar.gz |
cgpt: Update behavior of GptUpdateKernelWithEntrystabilize-8172.47.Bfirmware-lucid-8173.B
In order to support slots, we need to update behavior of
GptUpdateKernelWithEntry so that:
1. Invalid - Marks kernel entry as invalid
2. Active - Marks kernel entry as active
CQ-DEPEND=CL:336906
BUG=chrome-os-partner:51807
BRANCH=None
TEST=Compiles successfully "sudo emerge vboot_reference" "emerge-smaug
vboot_reference". "make -j runtests" successful.
Change-Id: If248b3c6bdd23d03cb1dd24f4e21cacef5cc3f26
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/335942
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r-- | firmware/include/gpt_misc.h | 8 | ||||
-rw-r--r-- | firmware/lib/cgptlib/cgptlib.c | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/firmware/include/gpt_misc.h b/firmware/include/gpt_misc.h index 49e13518..9f442c49 100644 --- a/firmware/include/gpt_misc.h +++ b/firmware/include/gpt_misc.h @@ -51,12 +51,12 @@ enum { */ GPT_UPDATE_ENTRY_BAD = 2, /* - * Used for fastboot mode. When an image is written to kernel partition, - * its GPT entry is marked with S1,P1,T15. + * Used for fastboot mode. If kernel partition slot is marked active, + * its GPT entry is marked with S1,P2,T0. */ - GPT_UPDATE_ENTRY_RESET = 3, + GPT_UPDATE_ENTRY_ACTIVE = 3, /* - * Used for fastboot mode. When an image is written to kernel partition, + * Used for fastboot mode. If kernel partition slot is marked invalid, * its GPT entry is marked with S0,P0,T0. */ GPT_UPDATE_ENTRY_INVALID = 4, diff --git a/firmware/lib/cgptlib/cgptlib.c b/firmware/lib/cgptlib/cgptlib.c index 05ee29cb..11512a0e 100644 --- a/firmware/lib/cgptlib/cgptlib.c +++ b/firmware/lib/cgptlib/cgptlib.c @@ -157,21 +157,21 @@ int GptUpdateKernelWithEntry(GptData *gpt, GptEntry *e, uint32_t update_type) } break; } - case GPT_UPDATE_ENTRY_RESET: { + case GPT_UPDATE_ENTRY_ACTIVE: { /* - * Used for fastboot mode. If image is written to kernel - * partition, its GPT entry is marked with S1,P1,T15 + * Used for fastboot mode. If kernel partition slot is marked + * active, its GPT entry is marked with S1,P2,T0. */ modified = 1; - SetEntryTries(e, 15); - SetEntryPriority(e, 1); + SetEntryTries(e, 0); + SetEntryPriority(e, 2); SetEntrySuccessful(e, 1); break; } case GPT_UPDATE_ENTRY_INVALID: { /* - * Used for fastboot mode. If kernel partition is erased, its - * GPT entry is marked with S0,P0,T0 + * Used for fastboot mode. If kernel partition slot is marked + * invalid, its GPT entry is marked with S0,P0,T0 */ modified = 1; SetEntryTries(e, 0); |