diff options
author | Yu-Ping Wu <yupingso@chromium.org> | 2021-11-24 16:03:39 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-26 14:15:47 +0000 |
commit | 8f786f34a97b9ccbd5e6f1733489c14e6bacc87e (patch) | |
tree | 6d4cf9498ea6061c97fda5850da5356da6a6410f | |
parent | ddc65b3c2125e2413d8abf03a51ac790eec98aba (diff) | |
download | vboot-8f786f34a97b9ccbd5e6f1733489c14e6bacc87e.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/+/3298659
Tested-by: Ian Feng <ian_feng@compal.corp-partner.google.com>
Reviewed-by: Henry Sun <henrysun@google.com>
Commit-Queue: Henry Sun <henrysun@google.com>
-rw-r--r-- | firmware/2lib/2ui_screens.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c index 617f2d3a..34f236d2 100644 --- a/firmware/2lib/2ui_screens.c +++ b/firmware/2lib/2ui_screens.c @@ -894,6 +894,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) || @@ -911,6 +913,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. */ @@ -922,7 +925,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, }; @@ -938,9 +941,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, }; @@ -948,6 +953,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. */ |