summaryrefslogtreecommitdiff
path: root/host/lib
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2011-03-11 13:34:56 -0800
committerRandall Spangler <rspangler@chromium.org>2011-03-11 13:34:56 -0800
commit227f792c1ba64eb8dd3474395659e27696fcf355 (patch)
tree5745083050e0ad5755c9d13834fe4347c13e7be9 /host/lib
parent1a0975f5f477abe7425e2b7ade655d73138e5c64 (diff)
downloadvboot-227f792c1ba64eb8dd3474395659e27696fcf355.tar.gz
Add check-value support and check /proc/cmdline for cros_nodebug
Change-Id: I35158810184be03f18d98893e4dd640088384579 BUG=12904 TEST=manual crossystem fwb_tries=1 crossystem fwb_tries?1 && echo YES || echo NO --> YES crossystem fwb_tries?0x01 && echo YES || echo NO --> YES crossystem fwb_tries?0 && echo YES || echo NO --> NO crossystem fwb_tries=0 crossystem fwb_tries?0 && echo YES || echo NO --> YES crossystem fwb_tries?1 && echo YES || echo NO --> NO crossystem fwb_tries?0x01 && echo YES || echo NO --> NO crossystem ecfw_act --> RW (if it's not, change RW to RO in the tests below) crossystem ecfw_act?RW && echo YES || echo NO --> YES crossystem ecfw_act?BOB && echo YES || echo NO --> NO For the following tests, boot Alex with dev switch on and fwb_tries=1 Expected output of `crossystem mainfw_type mainfw_act cros_debug` under each of the following scenarios: * Neither "cros_debug" nor" cros_nodebug" in kernel command line: normal B 1 * Kernel command line changed to include "cros_nodebug": normal B 0 * Kernel command line changed to include "cros_nodebugg": normal B 1 * Kernel command line changed to include "ccros_nodebug": normal B 1 Review URL: http://codereview.chromium.org/6665005
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/crossystem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 17f4f505..04dc9756 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -473,7 +473,7 @@ int VbGetCrosDebug(void) {
return 1; /* Developer firmware always allows debug. */
/* Normal new firmware, older ChromeOS firmware, or non-Chrome firmware.
- * For all these cases, check /proc/cmdline for cros_debug. */
+ * For all these cases, check /proc/cmdline for cros_[no]debug. */
f = fopen(KERNEL_CMDLINE_PATH, "rt");
if (f) {
if (NULL == fgets(buf, sizeof(buf), f))
@@ -483,6 +483,8 @@ int VbGetCrosDebug(void) {
for (t = strtok_r(buf, " ", &saveptr); t; t=strtok_r(NULL, " ", &saveptr)) {
if (0 == strcmp(t, "cros_debug"))
return 1;
+ else if (0 == strcmp(t, "cros_nodebug"))
+ return 0;
}
/* Normal new firmware or older Chrome OS firmware allows debug if the