From 8804be8cbeccfca8085a45c76c0d510f030d9061 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Thu, 30 Jul 2015 13:38:24 -0700 Subject: VbNvStorage: Add flags for misc settings 1. Change offset 8 to hold all misc settings (fastboot, boot_on_ac detect) instead of only fastboot settings. 2. Add flag to hold state of boot_on_ac_detect (If set to 1, AP should start booting as soon as AC is connected in off-state). BUG=chrome-os-partner:41680 BRANCH=None TEST=Compiles successfully. make runtests successful. Change-Id: I64b3fc69bd52cbcaf5899c953ccafa2e81b5b8a5 Signed-off-by: Furquan Shaikh Reviewed-on: https://chromium-review.googlesource.com/289900 Trybot-Ready: Furquan Shaikh Tested-by: Furquan Shaikh Reviewed-by: Vincent Palatin Reviewed-by: Randall Spangler Commit-Queue: Furquan Shaikh --- host/lib/crossystem.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'host') diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index 8ac37cc7..268ecdf1 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -533,10 +533,10 @@ int VbGetSystemPropertyInt(const char* name) { value = GetVdatInt(VDAT_INT_TRIED_FIRMWARE_B); } else if (!strcasecmp(name,"recovery_reason")) { value = GetVdatInt(VDAT_INT_RECOVERY_REASON); - } - /* Fastboot-related parameters */ - else if (!strcasecmp(name, "fastboot_unlock_in_fw")) { + } else if (!strcasecmp(name, "fastboot_unlock_in_fw")) { value = VbGetNvStorage(VBNV_FASTBOOT_UNLOCK_IN_FW); + } else if (!strcasecmp(name, "boot_on_ac_detect")) { + value = VbGetNvStorage(VBNV_BOOT_ON_AC_DETECT); } return value; @@ -663,6 +663,8 @@ int VbSetSystemPropertyInt(const char* name, int value) { return VbSetNvStorage_WithBackup(VBNV_DEV_BOOT_FASTBOOT_FULL_CAP, value); } else if (!strcasecmp(name, "fastboot_unlock_in_fw")) { return VbSetNvStorage_WithBackup(VBNV_FASTBOOT_UNLOCK_IN_FW, value); + } else if (!strcasecmp(name, "boot_on_ac_detect")) { + return VbSetNvStorage_WithBackup(VBNV_BOOT_ON_AC_DETECT, value); } return -1; -- cgit v1.2.1