summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu-Ping Wu <yupingso@chromium.org>2021-11-24 16:03:39 +0800
committerCommit Bot <commit-bot@chromium.org>2021-11-24 09:32:22 +0000
commitd0bcac282af65c1e4f554c008d1c95bf76983599 (patch)
tree94a09cf558e7d397e293505b0324d0a3b9af7c3f
parenta0e382e9c4abba0c113f68b60e1a8cc583c7cc5a (diff)
downloadvboot-d0bcac282af65c1e4f554c008d1c95bf76983599.tar.gz
ui: Fix default item for dev external boot screen
Fix the default selected menu item for 2 screens in developer mode: - VB2_SCREEN_DEVELOPER_BOOT_EXTERNAL - VB2_SCREEN_DEVELOPER_INVALID_DISK Previously in CL:3195521 we forgot to explicitly set it in the init() and reinit() screen functions. BUG=b:207448560, b:207448571 TEST=make run2tests BRANCH=none Change-Id: I1854502251238394a7e76ad9e676bae436ad0df5 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3298655 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
-rw-r--r--firmware/2lib/2ui_screens.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c
index e1e1d31a..9381d772 100644
--- a/firmware/2lib/2ui_screens.c
+++ b/firmware/2lib/2ui_screens.c
@@ -885,6 +885,8 @@ static const struct vb2_screen_info developer_to_norm_screen = {
/******************************************************************************/
/* VB2_SCREEN_DEVELOPER_BOOT_EXTERNAL */
+#define DEVELOPER_BOOT_EXTERNAL_ITEM_BACK 1
+
static vb2_error_t developer_boot_external_check(struct vb2_ui_context *ui)
{
if (!(ui->ctx->flags & VB2_CONTEXT_DEVELOPER_MODE) ||
@@ -902,6 +904,7 @@ static vb2_error_t developer_boot_external_init(struct vb2_ui_context *ui)
{
vb2_error_t rv;
+ ui->state->selected_item = DEVELOPER_BOOT_EXTERNAL_ITEM_BACK;
VB2_TRY(developer_boot_external_check(ui));
rv = VbTryLoadKernel(ui->ctx, VB_DISK_FLAG_REMOVABLE);
/* If the status of the external disk doesn't match, skip the screen. */
@@ -913,7 +916,7 @@ static vb2_error_t developer_boot_external_init(struct vb2_ui_context *ui)
static const struct vb2_menu_item developer_boot_external_items[] = {
LANGUAGE_SELECT_ITEM,
- BACK_ITEM,
+ [DEVELOPER_BOOT_EXTERNAL_ITEM_BACK] = BACK_ITEM,
POWER_OFF_ITEM,
};
@@ -929,9 +932,11 @@ static const struct vb2_screen_info developer_boot_external_screen = {
/******************************************************************************/
/* VB2_SCREEN_DEVELOPER_INVALID_DISK */
+#define DEVELOPER_INVALID_DISK_ITEM_BACK 1
+
static const struct vb2_menu_item developer_invalid_disk_items[] = {
LANGUAGE_SELECT_ITEM,
- BACK_ITEM,
+ [DEVELOPER_INVALID_DISK_ITEM_BACK] = BACK_ITEM,
POWER_OFF_ITEM,
};
@@ -939,6 +944,7 @@ static vb2_error_t developer_invalid_disk_init(struct vb2_ui_context *ui)
{
vb2_error_t rv;
+ ui->state->selected_item = DEVELOPER_INVALID_DISK_ITEM_BACK;
VB2_TRY(developer_boot_external_check(ui));
rv = VbTryLoadKernel(ui->ctx, VB_DISK_FLAG_REMOVABLE);
/* If the status of the external disk doesn't match, skip the screen. */