Add crossystem loc_idx

Change-Id: I9fdedabd02b11e5623b9417f24dc388ce092548c

R=wfrichar@chromium.org
BUG=chromium-os:14069
TEST=manual

crossystem loc_idx=3
crossystem loc_idx    # prints 3
crossystem loc_idx=0
crossystem loc_idx    # prints 0

Review URL: http://codereview.chromium.org/6826057
This commit is contained in:
Randall Spangler
2011-04-12 13:16:40 -07:00
parent 07f34845e1
commit 44a127675b
2 changed files with 5 additions and 0 deletions

View File

@@ -359,6 +359,8 @@ int VbGetSystemPropertyInt(const char* name) {
value = VbGetNvStorage(VBNV_KERNEL_FIELD);
if (value != -1)
value &= KERN_NV_FWUPDATE_TRIES_MASK;
} else if (!strcasecmp(name,"loc_idx")) {
value = VbGetNvStorage(VBNV_LOCALIZATION_INDEX);
}
/* Other parameters */
else if (!strcasecmp(name,"cros_debug")) {
@@ -432,6 +434,8 @@ int VbSetSystemPropertyInt(const char* name, int value) {
kern_nv &= ~KERN_NV_FWUPDATE_TRIES_MASK;
kern_nv |= (value & KERN_NV_FWUPDATE_TRIES_MASK);
return VbSetNvStorage(VBNV_KERNEL_FIELD, kern_nv);
} else if (!strcasecmp(name,"loc_idx")) {
return VbSetNvStorage(VBNV_LOCALIZATION_INDEX, value);
}
return -1;

View File

@@ -66,6 +66,7 @@ const Param sys_param_list[] = {
"Times to try OS firmware update (writable, inside kern_nv)"},
{"vbtest_errfunc", CAN_WRITE, "Verified boot test error function (writable)"},
{"vbtest_errno", CAN_WRITE, "Verified boot test error number (writable)"},
{"loc_idx", CAN_WRITE, "Localization index for firmware screens (writable)"},
/* Fields not shown in a print-all list */
{"vdat_lfdebug", IS_STRING|NO_PRINT_ALL,
"LoadFirmware() debug data (not in print-all)"},