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-12-23 07:28:36 +0000
commit661cf1780706d4fc2ee6d49e5cbbc136028a2fad (patch)
tree6f81283378d4758ffe03a284e82c204e8ec2646a
parenta9f0d3d6154da102daf54a9a1b898c71624d2bb9 (diff)
downloadvboot-firmware-volteer-13672.B.tar.gz
ui: Fix default item for dev external boot screenfirmware-volteer-13672.B
(Manually cherry picked from CL:3298933) 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=CC=x86_64-pc-linux-gnu-clang make run2tests BRANCH=firmware-volteer-13672.B Change-Id: I1854502251238394a7e76ad9e676bae436ad0df5 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3298658 Reviewed-by: Isaac Lee <isaaclee@google.com> Reviewed-by: Zhuohao Lee <zhuohao@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 662f5b4c..e5dfebca 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. */