From 045aef2cda7284dae0afc04957a42320f0497149 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Mon, 26 Feb 2018 12:57:20 +0100 Subject: make EC_FEATURE_RWSIG definition more useful Also define the EC_FEATURE_RWSIG feature bit if the RO firmware contains the RWSIG task but not the RW. Given the RWSIG verification task is not terribly useful in RW (where it is never executed), it can be skipped there but the host program trying to detect RWSIG usage (e.g. flashrom) still wants to be able to detect it. In order to be able to do so, add the HAS_TASK_xXx_RO and HAS_TASK_xXx_RW flags which define the tasks defined in the other partition (at compilation-time you might still run a frankeinstein combo). Fix ectool 'inventory' to avoid segfaulting on missing feature string definition. Signed-off-by: Vincent Palatin BRANCH=none BUG=b:36125319 TEST=on ZerbleBarn, run 'ectool inventory', also uses flashrom to re-flash the RW partition. Change-Id: I224a6cc4aef956204792a2cc04ad12aaed5abf47 Reviewed-on: https://chromium-review.googlesource.com/937262 Commit-Ready: Vincent Palatin Tested-by: Vincent Palatin Reviewed-by: Randall Spangler --- util/ectool.c | 1 + 1 file changed, 1 insertion(+) (limited to 'util') diff --git a/util/ectool.c b/util/ectool.c index ea1a580067..8b774f5649 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -555,6 +555,7 @@ int cmd_inventory(int argc, char *argv[]) for (j = 0; j < 32; j++, idx++) { if (r.flags[i] & (1 << j)) { if (idx >= ARRAY_SIZE(ec_feature_names) || + !ec_feature_names[idx] || strlen(ec_feature_names[idx]) == 0) printf("%-4d: Unknown feature\n", idx); else -- cgit v1.2.1