Support virtual dev-switch (keyboard-based dev-mode)

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

Currently, Link is the only platform that enables this feature.

To enter dev-mode:

  Boot into recovery mode using the magic key chord. At the Insert screen,
  press Ctrl-D. You'll be asked if you want to enter developer mode. If you
  then press ENTER, it will reboot with dev-mode enabled. If you press SPACE
  or ESC, it will return to the Insert screen.

  If you enter recovery mode through any other means, or if dev-mode is
  already enabled, pressing Ctrl-D at the Insert screen will have no effect.

To return to normal mode:

  Reboot. At the Dev screen, press ENTER or SPACE. It will reboot to
  recovery mode and ask you if you want to return to normal mode. If you
  press ESC or power off, you'll still be in dev-mode. Press ENTER or SPACE,
  and it will reboot into normal mode (of course, if you've messed up your
  images while in dev-mode, you'll just come right back to recovery mode
  again).

  You can also request a direct return to normal mode by running

    crossystem disable_dev_request=1

  and rebooting.

Change-Id: I435905855a6c39932ee466cc046bdc4c4c860f98
Reviewed-on: https://gerrit.chromium.org/gerrit/24160
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Bill Richardson
2012-06-07 04:21:14 -07:00
committed by Gerrit
parent 1d75e69f3d
commit ec8df1628c
12 changed files with 231 additions and 83 deletions

View File

@@ -67,11 +67,11 @@ uint32_t RollbackS3Resume(void);
/* These functions are callable from VbSelectFirmware(). They cannot use
* global variables. */
/* Setup must be called. Pass recovery_mode=nonzero if in recovery mode. Pass
* *developer_mode=nonzero if in developer mode. Set hw_dev_sw if there's a
* hardware developer switch. Duh. */
uint32_t RollbackFirmwareSetup(int recovery_mode, int hw_dev_sw,
int* dev_mode_ptr, uint32_t* version);
/* This must be called. */
uint32_t RollbackFirmwareSetup(int recovery_mode, int is_hw_dev,
int disable_dev_request,
/* two outputs on success */
int *is_virt_dev, uint32_t *tpm_version);
/* Write may be called if the versions change */
uint32_t RollbackFirmwareWrite(uint32_t version);
@@ -118,6 +118,9 @@ uint32_t OneTimeInitializeTPM(RollbackSpaceFirmware* rsf,
/* SetupTPM starts the TPM and establishes the root of trust for the
* anti-rollback mechanism. */
uint32_t SetupTPM(int recovery_mode, int developer_mode,
RollbackSpaceFirmware* rsf);
int disable_dev_request, RollbackSpaceFirmware* rsf);
/* Utility function to turn the virtual dev-mode flag on or off. 0=off, 1=on */
uint32_t SetVirtualDevMode(int val);
#endif /* VBOOT_REFERENCE_ROLLBACK_INDEX_H_ */