Index: host/lib/crossystem.c |
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c |
index 8e482d360d8bcadfd64c314bb4c1b0b7469d76c2..5951e10b7bd839c24e6e8f3b65a8d54dd6b672bb 100644 |
--- a/host/lib/crossystem.c |
+++ b/host/lib/crossystem.c |
@@ -489,6 +489,8 @@ int VbGetSystemPropertyInt(const char* name) { |
value = VbGetNvStorage(VBNV_TRIED_FIRMWARE_B); |
} else if (!strcasecmp(name,"kern_nv")) { |
value = VbGetNvStorage(VBNV_KERNEL_FIELD); |
+ } else if (!strcasecmp(name,"nvram_cleared")) { |
+ value = VbGetNvStorage(VBNV_KERNEL_SETTINGS_RESET); |
} |
/* NV storage values. If unable to get from NV storage, fall back to the |
* CMOS reboot field used by older BIOS. */ |
@@ -512,10 +514,6 @@ int VbGetSystemPropertyInt(const char* name) { |
value = ReadFileInt(ACPI_FMAP_PATH); |
} |
- /* TODO: implement the following properties: |
- * nvram_cleared |
- */ |
- |
return value; |
} |
@@ -574,7 +572,10 @@ const char* VbGetSystemPropertyString(const char* name, char* dest, int size) { |
int VbSetSystemPropertyInt(const char* name, int value) { |
/* NV storage values with no defaults for older BIOS. */ |
- if (!strcasecmp(name,"kern_nv")) { |
+ if (!strcasecmp(name,"nvram_cleared")) { |
+ /* Can only clear this flag; it's set inside the NV storage library. */ |
+ return VbSetNvStorage(VBNV_KERNEL_SETTINGS_RESET, 0); |
+ } else if (!strcasecmp(name,"kern_nv")) { |
return VbSetNvStorage(VBNV_KERNEL_FIELD, value); |
} |
/* NV storage values. If unable to get from NV storage, fall back to the |
@@ -593,10 +594,6 @@ int VbSetSystemPropertyInt(const char* name, int value) { |
return VbSetCmosRebootField(CMOSRF_TRY_B, value); |
} |
- /* TODO: implement the following: |
- * nvram_cleared |
- */ |
- |
return -1; |
} |