diff options
author | Joel Kitching <kitching@google.com> | 2018-10-19 14:59:13 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-19 16:28:25 -0800 |
commit | 8c52481794295a40c878277357978e309f7f32a0 (patch) | |
tree | 0f150f79e3b093d60cde011020dbef7a56657702 /host | |
parent | 0f7779862ca4b4973f52c7b851c65ccb8d9cd147 (diff) | |
download | vboot-8c52481794295a40c878277357978e309f7f32a0.tar.gz |
crossystem: add alt_os_enabled to show Alt OS state
Some user-space applications need to know whether Alt OS is
currently enabled or disabled. Add alt_os_enabled to
crossystem as a read-only flag for this purpose.
It is currently based off of reading VBSD_ALT_OS_SHOW_PICKER
from VbSharedDataHeader. We may want to change that to a
field dedicated to showing Alt OS state in the future
(see b/117195332).
BUG=b:117195332,b:117142023
TEST=emerge-eve vboot_reference && \
cros deploy --force --board=eve dut vboot_reference
Change-Id: Ic9a120e7d24021eb984d501f09ce4d7b6f85d730
Reviewed-on: https://chromium-review.googlesource.com/1328390
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/crossystem.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index 0ed88e65..7d5903d6 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -579,6 +579,11 @@ int VbGetSystemPropertyInt(const char *name) value = vb2_get_nv_storage(VB2_NV_DISABLE_ALT_OS_REQUEST); } else if (!strcasecmp(name, "post_ec_sync_delay")) { value = vb2_get_nv_storage(VB2_NV_POST_EC_SYNC_DELAY); + } else if (!strcasecmp(name, "alt_os_enabled")) { + /* TODO(b/117195332): Change this to read from a field + * dedicated to storing Alt OS state. */ + value = !!(GetVdatInt(VDAT_INT_FLAGS) + & VBSD_ALT_OS_SHOW_PICKER); } return value; |