diff options
author | Hsuan Ting Chen <roccochen@chromium.org> | 2020-03-05 14:57:51 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-21 09:33:12 +0000 |
commit | 5feac6eb9d105a1c9526b4dd981dce36ba91d79d (patch) | |
tree | dfd4567fe040b8b6188366cfc66bedc9c678d09b /firmware/lib/vboot_api_kernel.c | |
parent | 29ac143e2806182a4d25c6c6d41cda063d786807 (diff) | |
download | vboot-5feac6eb9d105a1c9526b4dd981dce36ba91d79d.tar.gz |
vboot: Introduce menu UI
According to crbug.com/1033815, add files for MENU_UI:
- 2ui.{c,h} for entry point functions called by kernel selection.
- vb2_ui_tests.c for tests (normal boot included).
There are three entry points: vb2_developer_menu(),
vb2_broken_recovery_menu(), and vb2_manual_recovery_menu().
Only infinite loop for this CL, others will be added in separate CLs.
BRANCH=none
BUG=b:146399181,chromium:1033815
TEST=USE="legacy_clamshell_ui" emerge-nami vboot_reference depthcharge
TEST=USE="legacy_menu_ui" emerge-nami vboot_reference depthcharge
TEST=USE="menu_ui" emerge-nami vboot_reference depthcharge
TEST=make runtests
Cq-Depend: chromium:2043102
Change-Id: I5a23eb006754b5ff08eb42bcd5021374995eab40
Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2087557
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'firmware/lib/vboot_api_kernel.c')
-rw-r--r-- | firmware/lib/vboot_api_kernel.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 82b2b033..8b7aab9e 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -13,6 +13,7 @@ #include "2rsa.h" #include "2secdata.h" #include "2sysincludes.h" +#include "2ui.h" #include "load_kernel_fw.h" #include "utility.h" #include "vb2_common.h" @@ -241,10 +242,16 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, VB2_DEBUG("NO_BOOT in RECOVERY mode\n"); /* Recovery boot. This has UI. */ - if (LEGACY_MENU_UI) + if (MENU_UI) { + if (vb2_allow_recovery(ctx)) + rv = vb2_manual_recovery_menu(ctx); + else + rv = vb2_broken_recovery_menu(ctx); + } else if (LEGACY_MENU_UI) { rv = VbBootRecoveryLegacyMenu(ctx); - else + } else { rv = VbBootRecoveryLegacyClamshell(ctx); + } } else if (DIAGNOSTIC_UI && vb2_nv_get(ctx, VB2_NV_DIAG_REQUEST)) { vb2_nv_set(ctx, VB2_NV_DIAG_REQUEST, 0); @@ -264,7 +271,9 @@ 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 (LEGACY_MENU_UI) + if (MENU_UI) + rv = vb2_developer_menu(ctx); + else if (LEGACY_MENU_UI) rv = VbBootDeveloperLegacyMenu(ctx); else rv = VbBootDeveloperLegacyClamshell(ctx); |