summaryrefslogtreecommitdiff
path: root/firmware/2lib/2ui.c
diff options
context:
space:
mode:
authorHsuan Ting Chen <roccochen@chromium.org>2020-03-05 14:57:51 +0800
committerCommit Bot <commit-bot@chromium.org>2020-03-21 09:33:12 +0000
commit5feac6eb9d105a1c9526b4dd981dce36ba91d79d (patch)
treedfd4567fe040b8b6188366cfc66bedc9c678d09b /firmware/2lib/2ui.c
parent29ac143e2806182a4d25c6c6d41cda063d786807 (diff)
downloadvboot-5feac6eb9d105a1c9526b4dd981dce36ba91d79d.tar.gz
vboot: Introduce menu UI
According to crbug.com/1033815, add files for MENU_UI: - 2ui.{c,h} for entry point functions called by kernel selection. - vb2_ui_tests.c for tests (normal boot included). There are three entry points: vb2_developer_menu(), vb2_broken_recovery_menu(), and vb2_manual_recovery_menu(). Only infinite loop for this CL, others will be added in separate CLs. BRANCH=none BUG=b:146399181,chromium:1033815 TEST=USE="legacy_clamshell_ui" emerge-nami vboot_reference depthcharge TEST=USE="legacy_menu_ui" emerge-nami vboot_reference depthcharge TEST=USE="menu_ui" emerge-nami vboot_reference depthcharge TEST=make runtests Cq-Depend: chromium:2043102 Change-Id: I5a23eb006754b5ff08eb42bcd5021374995eab40 Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2087557 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'firmware/2lib/2ui.c')
-rw-r--r--firmware/2lib/2ui.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c
new file mode 100644
index 00000000..b6892cb9
--- /dev/null
+++ b/firmware/2lib/2ui.c
@@ -0,0 +1,43 @@
+/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * User interfaces for developer and recovery mode menus.
+ */
+
+#include "2api.h"
+#include "2common.h"
+#include "2ui.h"
+
+/*****************************************************************************/
+/* Entry points */
+
+vb2_error_t vb2_developer_menu(struct vb2_context *ctx)
+{
+ /* TODO(roccochen): Init, wait for user, and boot. */
+ vb2ex_display_ui(VB2_SCREEN_BLANK, 0);
+
+ while (1);
+
+ return VB2_SUCCESS;
+}
+
+vb2_error_t vb2_broken_recovery_menu(struct vb2_context *ctx)
+{
+ /* TODO(roccochen): Init and wait for user to reset or shutdown. */
+ vb2ex_display_ui(VB2_SCREEN_BLANK, 0);
+
+ while (1);
+
+ return VB2_SUCCESS;
+}
+
+vb2_error_t vb2_manual_recovery_menu(struct vb2_context *ctx)
+{
+ /* TODO(roccochen): Init and wait for user. */
+ vb2ex_display_ui(VB2_SCREEN_BLANK, 0);
+
+ while (1);
+
+ return VB2_SUCCESS;
+}