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 15:04:26 +0000
commitc10122a1bb29917ab1947374c073d8cc8b679dd9 (patch)
treeee5c0a69021dc180e8b2f5d00bd2f030553b5f49
parent8166a0cf03828cabfa699e7b292d14cf4a12d50c (diff)
downloadvboot-firmware-puff-13324.B.tar.gz
ui: Fix default item for dev external boot screenfirmware-puff-13324.B
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/+/3298656 Reviewed-by: Andrew McRae <amcrae@google.com>
-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 8784a94b..817d575b 100644
--- a/firmware/2lib/2ui_screens.c
+++ b/firmware/2lib/2ui_screens.c
@@ -824,6 +824,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_init(struct vb2_ui_context *ui)
{
vb2_error_t rv;
@@ -836,6 +838,7 @@ static vb2_error_t developer_boot_external_init(struct vb2_ui_context *ui)
return vb2_ui_screen_back(ui);
}
+ ui->state->selected_item = DEVELOPER_BOOT_EXTERNAL_ITEM_BACK;
rv = VbTryLoadKernel(ui->ctx, VB_DISK_FLAG_REMOVABLE);
/* If the status of the external disk doesn't match, skip the screen. */
if (rv != VB2_ERROR_LK_NO_DISK_FOUND)
@@ -846,7 +849,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,
};
@@ -862,9 +865,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,
};
@@ -880,6 +885,7 @@ static vb2_error_t developer_invalid_disk_init(struct vb2_ui_context *ui)
return vb2_ui_screen_back(ui);
}
+ ui->state->selected_item = DEVELOPER_INVALID_DISK_ITEM_BACK;
rv = VbTryLoadKernel(ui->ctx, VB_DISK_FLAG_REMOVABLE);
/* If the status of the external disk doesn't match, skip the screen. */
if (rv == VB2_SUCCESS || rv == VB2_ERROR_LK_NO_DISK_FOUND)