diff options
author | Joel Kitching <kitching@google.com> | 2021-07-01 05:29:16 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-19 09:21:08 +0000 |
commit | 2d3af1227d6c74733f4e16da424ffaabdfcd23d4 (patch) | |
tree | c316b7cc46ddf876db9267872b84487d03637006 /host | |
parent | e33704be83614838400368ce5853becab9b88f4f (diff) | |
download | vboot-2d3af1227d6c74733f4e16da424ffaabdfcd23d4.tar.gz |
vboot: add MINIOS_PRIORITY flag to nvstorage
Flag decides whether MINIOS-A or MINIOS-B is booted.
BUG=b:186682292
TEST=make clean && make runtests
TEST=Deploy and run `crossystem minios_priority` commands
BRANCH=none
Signed-off-by: Joel Kitching <kitching@google.com>
Change-Id: I11460bf1522cde8e98e680b0f00a417e2b4ef9a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2998513
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/crossystem.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index 9d23091f..a2c2104a 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -532,6 +532,8 @@ const char *VbGetSystemPropertyString(const char *name, char *dest, return default_boot[v]; else return "unknown"; + } else if (!strcasecmp(name, "minios_priority")) { + return vb2_get_nv_storage(VB2_NV_MINIOS_PRIORITY) ? "B" : "A"; } return NULL; @@ -671,7 +673,13 @@ int VbSetSystemPropertyString(const char* name, const char* value) return vb2_set_nv_storage(VB2_NV_TRY_NEXT, 1); else return -1; - + } else if (!strcasecmp(name, "minios_priority")) { + if (!strcasecmp(value, "A")) + return vb2_set_nv_storage(VB2_NV_MINIOS_PRIORITY, 0); + else if (!strcasecmp(value, "B")) + return vb2_set_nv_storage(VB2_NV_MINIOS_PRIORITY, 1); + else + return -1; } else if (!strcasecmp(name, "fw_result")) { int i; |