summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authoredisonhello <edisonhello@google.com>2021-07-29 18:10:25 +0800
committerCommit Bot <commit-bot@chromium.org>2021-09-14 08:03:05 +0000
commit5256851079ae8178557848090b701fc08eb5dbaa (patch)
treee3baa23b69f466dee700c289187b67650f030a2b /firmware
parent3d7ad1b873803a2be9dd358c6313aa59a2c9b3bc (diff)
downloadvboot-5256851079ae8178557848090b701fc08eb5dbaa.tar.gz
vboot/ui: Remove broken recovery screen
Remove broken recovery screen in vboot, and migrate to depthcharge. Remove broken recovery related tests in vboot. BUG=b:172339016 TEST=Hayato booted into developer mode TEST=export CC=x86_64-pc-linux-gnu-clang DEBUG=1 DETACHABLE=0; \ make -j test_setup && make -j runtests TEST=export CC=x86_64-pc-linux-gnu-clang DEBUG=1 DETACHABLE=1; \ make -j test_setup && make -j runtests BRANCH=none Cq-Depend: chromium:3116129 Change-Id: I7d830e992d9ae1703befba570dfbe3061319b9fe Signed-off-by: edisonhello <edisonhello@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3060559 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/2lib/2stub.c6
-rw-r--r--firmware/2lib/2ui.c18
-rw-r--r--firmware/2lib/2ui_screens.c16
-rw-r--r--firmware/2lib/include/2api.h11
-rw-r--r--firmware/2lib/include/2ui.h11
-rw-r--r--firmware/2lib/include/2ui_private.h1
-rw-r--r--firmware/lib/vboot_api_kernel.c2
7 files changed, 18 insertions, 47 deletions
diff --git a/firmware/2lib/2stub.c b/firmware/2lib/2stub.c
index 7cec2e5d..3a7a36d4 100644
--- a/firmware/2lib/2stub.c
+++ b/firmware/2lib/2stub.c
@@ -256,3 +256,9 @@ vb2_error_t vb2ex_commit_data(struct vb2_context *ctx)
ctx->flags &= ~VB2_CONTEXT_NVDATA_CHANGED;
return VB2_SUCCESS;
}
+
+__attribute__((weak))
+vb2_error_t vb2ex_broken_screen_ui(struct vb2_context *ctx)
+{
+ return VB2_SUCCESS;
+}
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c
index 83dcde07..3cd14f0f 100644
--- a/firmware/2lib/2ui.c
+++ b/firmware/2lib/2ui.c
@@ -451,24 +451,6 @@ vb2_error_t developer_action(struct vb2_ui_context *ui)
}
/*****************************************************************************/
-/* Broken recovery */
-
-vb2_error_t vb2_broken_recovery_menu(struct vb2_context *ctx)
-{
- return vb2_ui_loop(ctx, VB2_SCREEN_RECOVERY_BROKEN,
- broken_recovery_action);
-}
-
-vb2_error_t broken_recovery_action(struct vb2_ui_context *ui)
-{
- /* Broken recovery keyboard shortcuts */
- if (ui->key == '\t')
- return vb2_ui_screen_change(ui, VB2_SCREEN_DEBUG_INFO);
-
- return VB2_SUCCESS;
-}
-
-/*****************************************************************************/
/* Manual recovery */
vb2_error_t vb2_manual_recovery_menu(struct vb2_context *ctx)
diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c
index af273d12..999d90e6 100644
--- a/firmware/2lib/2ui_screens.c
+++ b/firmware/2lib/2ui_screens.c
@@ -252,21 +252,6 @@ static const struct vb2_screen_info language_select_screen = {
};
/******************************************************************************/
-/* VB2_SCREEN_RECOVERY_BROKEN */
-
-static const struct vb2_menu_item recovery_broken_items[] = {
- LANGUAGE_SELECT_ITEM,
- ADVANCED_OPTIONS_ITEM,
- POWER_OFF_ITEM,
-};
-
-static const struct vb2_screen_info recovery_broken_screen = {
- .id = VB2_SCREEN_RECOVERY_BROKEN,
- .name = "Recover broken device",
- .menu = MENU_ITEMS(recovery_broken_items),
-};
-
-/******************************************************************************/
/* VB2_SCREEN_ADVANCED_OPTIONS */
#define ADVANCED_OPTIONS_ITEM_DEVELOPER_MODE 1
@@ -1377,7 +1362,6 @@ static const struct vb2_screen_info diagnostics_memory_full_screen = {
*/
static const struct vb2_screen_info *screens[] = {
&language_select_screen,
- &recovery_broken_screen,
&advanced_options_screen,
&debug_info_screen,
&firmware_log_screen,
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index 6144c84b..273ff012 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -1394,6 +1394,17 @@ vb2_error_t vb2ex_ec_battery_cutoff(void);
/*****************************************************************************/
/* Functions for UI display. */
+/**
+ * UI for a non-manual recovery ("BROKEN").
+ *
+ * Enter the broken screen UI, which shows that an unrecoverable error was
+ * encountered last boot. Wait for the user to physically reset or shut down.
+ *
+ * @param ctx Vboot context
+ * @return VB2_SUCCESS, or non-zero error code.
+ */
+vb2_error_t vb2ex_broken_screen_ui(struct vb2_context *ctx);
+
/* Helpers for bitmask operations */
#define VB2_SET_BIT(mask, index) ((mask) |= ((uint32_t)1 << (index)))
#define VB2_CLR_BIT(mask, index) ((mask) &= ~((uint32_t)1 << (index)))
diff --git a/firmware/2lib/include/2ui.h b/firmware/2lib/include/2ui.h
index 55ff5749..4ae73fc0 100644
--- a/firmware/2lib/include/2ui.h
+++ b/firmware/2lib/include/2ui.h
@@ -246,17 +246,6 @@ vb2_error_t vb2_ui_screen_change(struct vb2_ui_context *ui, enum vb2_screen id);
vb2_error_t vb2_developer_menu(struct vb2_context *ctx);
/**
- * UI for a non-manual recovery ("BROKEN").
- *
- * Enter the recovery menu, which shows that an unrecoverable error was
- * encountered last boot. Wait for the user to physically reset or shut down.
- *
- * @param ctx Vboot context
- * @return VB2_SUCCESS, or non-zero error code.
- */
-vb2_error_t vb2_broken_recovery_menu(struct vb2_context *ctx);
-
-/**
* UI for a manual recovery-mode boot.
*
* Enter the recovery menu, which prompts the user to insert recovery media,
diff --git a/firmware/2lib/include/2ui_private.h b/firmware/2lib/include/2ui_private.h
index 79cdd1b7..9f08c3eb 100644
--- a/firmware/2lib/include/2ui_private.h
+++ b/firmware/2lib/include/2ui_private.h
@@ -27,7 +27,6 @@ vb2_error_t
vb2_ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id,
vb2_error_t (*global_action)(struct vb2_ui_context *ui));
vb2_error_t developer_action(struct vb2_ui_context *ui);
-vb2_error_t broken_recovery_action(struct vb2_ui_context *ui);
vb2_error_t manual_recovery_action(struct vb2_ui_context *ui);
/* From 2ui_screens.c */
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index cab35636..26d096d4 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -197,7 +197,7 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx,
if (vb2api_allow_recovery(ctx))
VB2_TRY(vb2_manual_recovery_menu(ctx));
else
- VB2_TRY(vb2_broken_recovery_menu(ctx));
+ VB2_TRY(vb2ex_broken_screen_ui(ctx));
} else if (vb2api_diagnostic_ui_enabled(ctx) &&
vb2_nv_get(ctx, VB2_NV_DIAG_REQUEST)) {
/*