diff options
author | Yu-Ping Wu <yupingso@chromium.org> | 2019-12-23 17:59:33 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-07 07:55:30 +0000 |
commit | c46b7269a7b2928134550a688c859c127f47eba2 (patch) | |
tree | 4873d12fd4955de76682ebc4b42e1abbf23ffaff | |
parent | edfe2f28738571aab8f83880c453916bcc4b3985 (diff) | |
download | vboot-c46b7269a7b2928134550a688c859c127f47eba2.tar.gz |
vboot: Deprecate VB2_CONTEXT_DETACHABLE_UI
With CL:1975390, utilize the environment variable LEGACY_MENU_UI to
define a macro with the same name in compile time. Deprecate
VB2_CONTEXT_DETACHABLE_UI since it is no longer needed.
BRANCH=none
BUG=chromium:953656,chromium:1033815
TEST=USE="legacy_menu_ui" emerge-nami depthcharge
Cq-Depend: chromium:1975336, chromium:1975390
Change-Id: I47deaf62fd3e9ea499b7d899f00f36caf7702c3a
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1980543
Reviewed-by: Joel Kitching <kitching@chromium.org>
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | firmware/2lib/include/2api.h | 8 | ||||
-rw-r--r-- | firmware/lib/vboot_api_kernel.c | 4 |
3 files changed, 17 insertions, 4 deletions
@@ -195,6 +195,15 @@ ifneq (${MOCK_TPM},) CFLAGS += -DMOCK_TPM endif +# LEGACY_MENU_UI controls whether to enable legacy menu UI, which is used with +# devices that don't have a keyboard (detachables). +# Pass LEGACY_MENU_UI= (or =0) to make to disable feature. +ifneq ($(filter-out 0,${LEGACY_MENU_UI}),) +CFLAGS += -DLEGACY_MENU_UI=1 +else +CFLAGS += -DLEGACY_MENU_UI=0 +endif + # enable all features during local compile (permits testing) ifeq (${FIRMWARE_ARCH},) DIAGNOSTIC_UI := 1 diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h index dd72b974..3b3fd8d1 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -185,8 +185,12 @@ enum vb2_context_flags { */ VB2_CONTEXT_NO_SECDATA_FWMP = (1 << 21), - /* Enable detachable menu ui (volume up/down + power). */ - VB2_CONTEXT_DETACHABLE_UI = (1 << 22), + /* + * Enable detachable menu ui (volume up/down + power). + * + * Deprecated with CL:1975390. + */ + VB2_CONTEXT_DEPRECATED_DETACHABLE_UI = (1 << 22), }; /* Helper for aligning fields in vb2_context. */ diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 0c825519..565fc981 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -454,7 +454,7 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, /* Select boot path */ if (ctx->flags & VB2_CONTEXT_RECOVERY_MODE) { /* Recovery boot. This has UI. */ - if (ctx->flags & VB2_CONTEXT_DETACHABLE_UI) + if (LEGACY_MENU_UI) rv = VbBootRecoveryMenu(ctx); else rv = VbBootRecovery(ctx); @@ -477,7 +477,7 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, rv = VBERROR_REBOOT_REQUIRED; } else if (ctx->flags & VB2_CONTEXT_DEVELOPER_MODE) { /* Developer boot. This has UI. */ - if (ctx->flags & VB2_CONTEXT_DETACHABLE_UI) + if (LEGACY_MENU_UI) rv = VbBootDeveloperMenu(ctx); else rv = VbBootDeveloper(ctx); |