diff options
-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); |