summaryrefslogtreecommitdiff
path: root/firmware/lib/vboot_ui_common.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-10-16 19:36:48 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-11-16 05:01:45 -0800
commita0ae31871275b389ea0f8b99ee4de359970b7db6 (patch)
treef8a5a5867dfbe1fa9f1ee5ed21928bd8daa392e9 /firmware/lib/vboot_ui_common.c
parent4586b0c1dea8af8fd603ee7f1a0f6271bdcc1963 (diff)
downloadvboot-a0ae31871275b389ea0f8b99ee4de359970b7db6.tar.gz
Add a screen showing a menu for alternative firmware
At present we allow the user to press a keypad number to boot into another bootloader but there is no indication which one is which. Add a new screen for this. It is entered via Ctrl-L and shows the available bootloaders, along with the number to press for each. The contents of the screen is rendered by the bootloader, as usual. This is supported by two new screens, one for the keyboard UI and one for the menu UI. Also a new function, VbExGetAltFwIdxMask(), is added to find out what bootloaders are available. Note: This CL combines changes for both UIs. The changes may be easier to review separately. CQ-DEPEND=CL:1273269 BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: Ib3227545dc677c8f9587944753e32f3b49647360 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1273268 Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware/lib/vboot_ui_common.c')
-rw-r--r--firmware/lib/vboot_ui_common.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/firmware/lib/vboot_ui_common.c b/firmware/lib/vboot_ui_common.c
index 727ed779..df1615d1 100644
--- a/firmware/lib/vboot_ui_common.c
+++ b/firmware/lib/vboot_ui_common.c
@@ -38,3 +38,20 @@ void vb2_run_altfw(int altfw_num)
VbExLegacy(altfw_num); /* will not return if found */
vb2_error_beep(VB_BEEP_FAILED);
}
+
+void vb2_error_no_altfw(void)
+{
+ VB2_DEBUG("Legacy boot is disabled\n");
+ VbExDisplayDebugInfo("WARNING: Booting legacy BIOS has not been "
+ "enabled. Refer to the developer-mode "
+ "documentation for details.\n");
+ vb2_error_beep(VB_BEEP_NOT_ALLOWED);
+}
+
+void vb2_try_alt_fw(int allowed, int altfw_num)
+{
+ if (allowed)
+ vb2_run_altfw(altfw_num); /* will not return if found */
+ else
+ vb2_error_no_altfw();
+}