Enter key at DEV screen no longer transition to TONORM screen

And space at TONORM screen no longer confirms disabling dev mode

Added Ctrl+Refresh as an alias for tonorm screen request.  U-boot will
need to be enhanced to support that.  Until then, many FAFT tests will
break.

BUG=chrome-os-partner:11887
TEST=manual

1. Boot to DEV screen
2. Press Enter.  Nothing happens.
3. Press Space.  Goes to TONORM screen.
4. Press Space.  Nothing happens.
5. Press Enter.  Reboots with dev mode disabled.

Change-Id: I7f61c4001c668ac916f50f931a79a107752c83b5
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28851
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Randall Spangler
2012-07-31 13:07:36 -07:00
committed by Gerrit
parent 463eaeb308
commit 2b45044edf
2 changed files with 7 additions and 7 deletions

View File

@@ -578,6 +578,7 @@ enum VbKeyCode_t {
VB_KEY_LEFT = 0x102, VB_KEY_LEFT = 0x102,
VB_KEY_RIGHT = 0x103, VB_KEY_RIGHT = 0x103,
VB_KEY_CTRL_ENTER = 0x104, VB_KEY_CTRL_ENTER = 0x104,
VB_KEY_CTRL_REFRESH = 0x105
}; };
/* Read the next keypress from the keyboard buffer. /* Read the next keypress from the keyboard buffer.

View File

@@ -149,11 +149,11 @@ VbError_t VbBootDeveloper(VbCommonParams* cparams, LoadKernelParams* p) {
case 0: case 0:
/* nothing pressed */ /* nothing pressed */
break; break;
case '\r':
case ' ': case ' ':
case 0x1B: case 0x1B:
/* Enter, space, or ESC = reboot to recovery */ case VB_KEY_CTRL_REFRESH:
VBDEBUG(("VbBootDeveloper() - user pressed ENTER/SPACE/ESC\n")); /* Space, or ESC = request disable dev. Ctrl+F3 is used for testing. */
VBDEBUG(("VbBootDeveloper() - user pressed SPACE/ESC/CTRL_F3\n"));
VbSetRecoveryRequest(VBNV_RECOVERY_RW_DEV_SCREEN); VbSetRecoveryRequest(VBNV_RECOVERY_RW_DEV_SCREEN);
VbAudioClose(audio); VbAudioClose(audio);
return VBERROR_LOAD_KERNEL_RECOVERY; return VBERROR_LOAD_KERNEL_RECOVERY;
@@ -223,17 +223,16 @@ static VbError_t VbConfirmChangeDevMode(VbCommonParams* cparams, int to_dev) {
while (1) { while (1) {
if (VbExIsShutdownRequested()) if (VbExIsShutdownRequested())
return VBERROR_SHUTDOWN_REQUESTED; return VBERROR_SHUTDOWN_REQUESTED;
/* ENTER is always yes, ESC is always no. /* ENTER is always yes, ESC and SPACE are always no. */
* SPACE is yes when leaving dev-mode, but is no when entering it. */
key = VbExKeyboardRead(); key = VbExKeyboardRead();
if (key == '\r' || (key == ' ' && !to_dev)) { if (key == '\r') {
VBDEBUG(("%s() - Yes: virtual dev-mode switch => %d\n", VBDEBUG(("%s() - Yes: virtual dev-mode switch => %d\n",
__func__, to_dev)); __func__, to_dev));
if (TPM_SUCCESS != SetVirtualDevMode(to_dev)) if (TPM_SUCCESS != SetVirtualDevMode(to_dev))
return VBERROR_TPM_SET_BOOT_MODE_STATE; return VBERROR_TPM_SET_BOOT_MODE_STATE;
VBDEBUG(("%s() - Reboot so it will take effect\n", __func__)); VBDEBUG(("%s() - Reboot so it will take effect\n", __func__));
return VBERROR_TPM_REBOOT_REQUIRED; return VBERROR_TPM_REBOOT_REQUIRED;
} else if (key == 0x1B || (key == ' ' && to_dev)) { } else if (key == 0x1B || key == ' ') {
VBDEBUG(("%s() - No: don't change virtual dev-mode switch\n", __func__)); VBDEBUG(("%s() - No: don't change virtual dev-mode switch\n", __func__));
VbDisplayScreen(cparams, VB_SCREEN_RECOVERY_INSERT, 0, &vnc); VbDisplayScreen(cparams, VB_SCREEN_RECOVERY_INSERT, 0, &vnc);
return VBERROR_SUCCESS; return VBERROR_SUCCESS;