From 19a41188cd50b5cdcd6fc50b718031a3d469c025 Mon Sep 17 00:00:00 2001 From: Shelley Chen Date: Tue, 14 Feb 2017 14:50:54 -0800 Subject: [PATCH] poppy: reinstating fw ctrl functions Putting ctrl+D, ctrl+U, ctrl+L shortcuts back in from the fw screens. BUG=b:35585623 BRANCH=None TEST=reboot and try ctrl+D, etc. in fw screen to make sure that they have desired effects. Change-Id: I5ca555658eddabeeea6a2f64794e6839f35d75f7 Signed-off-by: Shelley Chen Reviewed-on: https://chromium-review.googlesource.com/443349 Reviewed-by: Randall Spangler --- firmware/lib/vboot_ui_menu.c | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c index c731c7331f..7cf18525d6 100644 --- a/firmware/lib/vboot_ui_menu.c +++ b/firmware/lib/vboot_ui_menu.c @@ -670,6 +670,49 @@ VbError_t vb2_developer_menu(struct vb2_context *ctx, VbCommonParams *cparams) /* Only disable virtual dev switch if allowed by GBB */ if (!(gbb->flags & GBB_FLAG_ENTER_TRIGGERS_TONORM)) break; + case 0x04: + /* Ctrl+D = dismiss warning; advance to timeout */ + VB2_DEBUG("user pressed Ctrl+D; skip delay\n"); + ctrl_d_pressed = 1; + goto fallout; + break; + case 0x0c: + VB2_DEBUG("user pressed Ctrl+L; Try legacy boot\n"); + VbTryLegacyMenu(allow_legacy); + break; + case 0x15: + /* Ctrl+U = try USB boot, or beep if failure */ + VB2_DEBUG("user pressed Ctrl+U; try USB\n"); + if (!allow_usb) { + VB2_DEBUG("USB booting is disabled\n"); + VbExDisplayDebugInfo( + "WARNING: Booting from external media " + "(USB/SD) has not been enabled. Refer " + "to the developer-mode documentation " + "for details.\n"); + VbExBeep(120, 400); + VbExSleepMs(120); + VbExBeep(120, 400); + } else { + /* + * Clear the screen to show we get the Ctrl+U + * key press. + */ + VbDisplayScreen(ctx, cparams, VB_SCREEN_BLANK, + 0); + if (VBERROR_SUCCESS == + VbTryUsbMenu(ctx, cparams)) { + VbAudioClose(audio); + return VBERROR_SUCCESS; + } else { + /* Show dev mode warning screen again */ + VbDisplayScreen(ctx, + cparams, + VB_SCREEN_BASE, + 0); + } + } + break; case VB_BUTTON_VOL_UP: case VB_KEY_UP: vb2_get_current_menu_size(current_menu,