diff options
author | Bill Richardson <wfrichar@chromium.org> | 2012-12-17 14:35:22 -0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-12-17 17:05:01 -0800 |
commit | 699ebf398f84bb0a6138856c38db1d693e581f85 (patch) | |
tree | 42d8e4bbbc9c147c165be896e076c70bd005bcbb /host | |
parent | b55c538fca8939e58d20c127a9f42ce4eba7282c (diff) | |
download | vboot-699ebf398f84bb0a6138856c38db1d693e581f85.tar.gz |
Add recovery_subcode field to nvstorage and crossystem
This just adds a one-byte field in the nvstorage region for use in debugging
hard-to-catch errors. There's no official meaning or expectation for this
field. It's just a handy place to emit some information.
BUG=chrome-os-partner:11534
BRANCH=parrot
TEST=manual
Just change the value and ensure that it persists across a (working) reboot.
It's only updated at specific points under very exacting error conditions,
so all we really want to test is that it works as a place to store some
extra info.
crossystem recovery_subcode
crossystem recovery_subcode=14
reboot
crossystem recovery_subcode
The recovery_subcode byte is at index [6] of the VbNv.raw bytes that appear
when you press TAB, so you can find it there too:
VbNv.raw: 60 20 00 00 00 00 0e 00 00 00 00 00 00 00 00 65
Decimal 14 == 0x0e
Change-Id: I1930b8f81a03ab838dbee99a8d72c35a444efdfd
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39803
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/crossystem.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index e1ee4fc5..c4d0a607 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -427,6 +427,8 @@ int VbGetSystemPropertyInt(const char* name) { value = VbGetNvStorage(VBNV_DEV_BOOT_SIGNED_ONLY); } else if (!strcasecmp(name,"oprom_needed")) { value = VbGetNvStorage(VBNV_OPROM_NEEDED); + } else if (!strcasecmp(name,"recovery_subcode")) { + value = VbGetNvStorage(VBNV_RECOVERY_SUBCODE); } /* Other parameters */ else if (!strcasecmp(name,"cros_debug")) { @@ -501,6 +503,8 @@ int VbSetSystemPropertyInt(const char* name, int value) { return VbSetNvStorage(VBNV_KERNEL_SETTINGS_RESET, 0); } else if (!strcasecmp(name,"recovery_request")) { return VbSetNvStorage(VBNV_RECOVERY_REQUEST, value); + } else if (!strcasecmp(name,"recovery_subcode")) { + return VbSetNvStorage(VBNV_RECOVERY_SUBCODE, value); } else if (!strcasecmp(name,"dbg_reset")) { return VbSetNvStorage(VBNV_DEBUG_RESET_MODE, value); } else if (!strcasecmp(name,"disable_dev_request")) { |