diff options
Diffstat (limited to 'host/lib/crossystem.c')
-rw-r--r-- | host/lib/crossystem.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index 3080344d..e2066cee 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -61,6 +61,7 @@ typedef enum VbBuildOption { } VbBuildOption; static const char *fw_results[] = {"unknown", "trying", "success", "failure"}; +static const char *default_boot[] = {"disk", "usb", "legacy"}; /* Masks for kern_nv usage by kernel. */ #define KERN_NV_FWUPDATE_TRIES_MASK 0x0000000F @@ -586,6 +587,12 @@ const char* VbGetSystemPropertyString(const char* name, char* dest, return fw_results[v]; else return "unknown"; + } else if (!strcasecmp(name,"dev_default_boot")) { + int v = VbGetNvStorage(VBNV_DEV_DEFAULT_BOOT); + if (v < ARRAY_SIZE(default_boot)) + return default_boot[v]; + else + return "unknown"; } return NULL; @@ -694,6 +701,14 @@ int VbSetSystemPropertyString(const char* name, const char* value) { return VbSetNvStorage(VBNV_FW_RESULT, i); } return -1; + } else if (!strcasecmp(name, "dev_default_boot")) { + int i; + + for (i = 0; i < ARRAY_SIZE(default_boot); i++) { + if (!strcasecmp(value, default_boot[i])) + return VbSetNvStorage(VBNV_DEV_DEFAULT_BOOT, i); + } + return -1; } return -1; |