Add support for flags in the firmware preamble.

The old (v2.0) parser is compatible with new (v2.1) structs.  That is,
this won't break existing firmware or vbutil_firmware.

A new (v2.1) parser parsing an old (v2.0) struct will return 0 for the
flags.

This will be used to support the RO-normal code path in a subsequent CL.

BUG=chromium-os:17304
TEST=added unit tests; make && make runtests

Change-Id: I73bcd8acd3330b0d7d143061b5ef838e6d79cf1a
Reviewed-on: http://gerrit.chromium.org/gerrit/4030
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Randall Spangler
2011-07-13 09:48:41 -07:00
parent d70241f37d
commit a712e01ae7
11 changed files with 125 additions and 26 deletions

View File

@@ -138,9 +138,13 @@ typedef struct VbInitParams {
* VbSelectFirmwareParams.selected_firmware. Note that we store these
* in a uint32_t because enum maps to int, which isn't fixed-size. */
enum VbSelectFirmware_t {
/* Recovery mode */
VB_SELECT_FIRMWARE_RECOVERY = 0,
/* Rewritable firmware A/B for normal or developer path */
VB_SELECT_FIRMWARE_A = 1,
VB_SELECT_FIRMWARE_B = 2
VB_SELECT_FIRMWARE_B = 2,
/* Read only firmware for normal or developer path */
VB_SELECT_FIRMWARE_READONLY = 3
};