diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2013-07-15 10:38:12 -0700 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2013-12-21 07:28:37 +0100 |
commit | 21d4a85042ced5574333e94083d9ee58480b52a9 (patch) | |
tree | 941046881a274fc622e4e2af6245a0e418be92cd | |
parent | 29f76884092dbd8de492437e9656e48671a12530 (diff) | |
download | coreboot-21d4a85042ced5574333e94083d9ee58480b52a9.tar.xz |
chromeos: Check for recovery reason code in shared data
When using RW firmware path the proper recovery reason can
be retrieved from the shared data region. This will result
in the actual reason being logged instead of the default
"recovery button pressed" reason.
1) build and boot on falco
2) crossystem recovery_request=193
3) reboot into recovery mode, check reason with <TAB>
4) reboot back into chromeos
5) check event log entry for previous recovery mode:
25 | 2013-07-15 10:34:23 | Chrome OS Recovery Mode | Test from User Mode
Change-Id: I6f9dfed501f06881e9cf4392724ad28b97521305
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61906
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/4368
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
-rw-r--r-- | src/vendorcode/google/chromeos/gnvs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vendorcode/google/chromeos/gnvs.c b/src/vendorcode/google/chromeos/gnvs.c index 5ee366598a..9f510973e8 100644 --- a/src/vendorcode/google/chromeos/gnvs.c +++ b/src/vendorcode/google/chromeos/gnvs.c @@ -29,6 +29,7 @@ #include "gnvs.h" #if CONFIG_VBOOT_VERIFY_FIRMWARE #include "vboot_handoff.h" +#include <vboot_struct.h> #endif chromeos_acpi_t *vboot_data = NULL; @@ -60,6 +61,13 @@ void chromeos_init_vboot(chromeos_acpi_t *chromeos) elog_add_event(ELOG_TYPE_CROS_DEVELOPER_MODE); if (recovery_mode_enabled()) { int reason = get_recovery_mode_from_vbnv(); +#if CONFIG_VBOOT_VERIFY_FIRMWARE + if (vboot_handoff && !reason) { + VbSharedDataHeader *sd = (VbSharedDataHeader *) + vboot_handoff->shared_data; + reason = sd->recovery_reason; + } +#endif elog_add_event_byte(ELOG_TYPE_CROS_RECOVERY_MODE, reason ? reason : ELOG_CROS_RECOVERY_MODE_BUTTON); } |