summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2020-06-19 19:30:57 +0800
committerCommit Bot <commit-bot@chromium.org>2020-06-21 08:33:43 +0000
commit23f72259612eccc4557ee7e2c40f3ea2fabf9c11 (patch)
tree87971d5e5240a4a429016e08cbc92e901e6ca4da
parent7361619303b4dc5e945d9b9b47088453a6b13c88 (diff)
downloadvboot-23f72259612eccc4557ee7e2c40f3ea2fabf9c11.tar.gz
vboot: makeshift debug info screen
Provide makeshift debug info functionality while implementation of the proper screen is in progress. BUG=b:146399181, b:144969088 TEST=Build and flash; check <TAB> functionality TEST=make clean && make runtests BRANCH=none Cq-Depend: chromium:2253732 Signed-off-by: Joel Kitching <kitching@google.com> Change-Id: I0a738f731361d1c344c8fc8f5ecdef5b892f5ba7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2253733 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Shelley Chen <shchen@chromium.org> Commit-Queue: Shelley Chen <shchen@chromium.org>
-rw-r--r--firmware/2lib/2ui.c20
-rw-r--r--firmware/2lib/include/2ui_private.h1
2 files changed, 20 insertions, 1 deletions
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c
index ee0da1f1..96a7b939 100644
--- a/firmware/2lib/2ui.c
+++ b/firmware/2lib/2ui.c
@@ -15,6 +15,7 @@
#include "2ui_private.h"
#include "vboot_api.h" /* For VB_SHUTDOWN_REQUEST_POWER_BUTTON */
#include "vboot_kernel.h"
+#include "vboot_ui_legacy.h" /* TODO(b/144969088): VbDisplayDebugInfo */
#define KEY_DELAY_MS 20 /* Delay between key scans in UI loops */
@@ -324,6 +325,10 @@ vb2_error_t developer_action(struct vb2_ui_context *ui)
(DETACHABLE && ui->key == VB_BUTTON_VOL_DOWN_LONG_PRESS))
return vb2_ui_developer_mode_boot_internal_action(ui);
+ /* TODO(b/144969088): Re-implement as debug info screen. */
+ if (ui->key == '\t')
+ VbDisplayDebugInfo(ui->ctx);
+
return VB2_REQUEST_UI_CONTINUE;
}
@@ -332,7 +337,16 @@ vb2_error_t developer_action(struct vb2_ui_context *ui)
vb2_error_t vb2_broken_recovery_menu(struct vb2_context *ctx)
{
- return ui_loop(ctx, VB2_SCREEN_RECOVERY_BROKEN, NULL);
+ return ui_loop(ctx, VB2_SCREEN_RECOVERY_BROKEN, broken_recovery_action);
+}
+
+vb2_error_t broken_recovery_action(struct vb2_ui_context *ui)
+{
+ /* TODO(b/144969088): Re-implement as debug info screen. */
+ if (ui->key == '\t')
+ VbDisplayDebugInfo(ui->ctx);
+
+ return VB2_REQUEST_UI_CONTINUE;
}
/*****************************************************************************/
@@ -366,5 +380,9 @@ vb2_error_t manual_recovery_action(struct vb2_ui_context *ui)
(DETACHABLE && ui->key == VB_BUTTON_VOL_UP_DOWN_COMBO_PRESS))
return vb2_ui_change_screen(ui, VB2_SCREEN_RECOVERY_TO_DEV);
+ /* TODO(b/144969088): Re-implement as debug info screen. */
+ if (ui->key == '\t')
+ VbDisplayDebugInfo(ui->ctx);
+
return VB2_REQUEST_UI_CONTINUE;
}
diff --git a/firmware/2lib/include/2ui_private.h b/firmware/2lib/include/2ui_private.h
index e1e47af3..effa280d 100644
--- a/firmware/2lib/include/2ui_private.h
+++ b/firmware/2lib/include/2ui_private.h
@@ -17,6 +17,7 @@ vb2_error_t menu_navigation_action(struct vb2_ui_context *ui);
vb2_error_t 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 */