diff options
author | Evan Benn <evanbenn@chromium.org> | 2022-07-19 14:20:30 +1000 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2022-08-23 01:14:28 +0000 |
commit | 7346cda9e934cc71708efddba7a24e83f546992c (patch) | |
tree | 209b027ee0edd2af62ff2321084c71a22e844204 /util/flashrom_tester/src/main.rs | |
parent | 1d386518653c070ba51cd88bdfeaf18c81ee8186 (diff) | |
download | flashrom-7346cda9e934cc71708efddba7a24e83f546992c.tar.gz flashrom-7346cda9e934cc71708efddba7a24e83f546992c.tar.bz2 flashrom-7346cda9e934cc71708efddba7a24e83f546992c.zip |
flashrom_tester: Call crossystem with write protect argument
crossystem uses flashrom to gather data on some platforms. To avoid
firmware lock deadlock, call crossystem before initialising libflashrom.
When querying hardware write protect status, provide an argument to
crossystem so that only that field is queried. This also avoids the
deadlock, and improves performance.
BUG=b:239496316
BRANCH=None
TEST=on trogdor(arm), grunt(amd), hatch(intel):
TEST=flashrom_tester --libflashrom /usr/sbin/flashrom host Coreboot_ELOG_sanity
TEST=flashrom_tester /usr/sbin/flashrom host Coreboot_ELOG_sanity
Change-Id: I7d94cfc6ccbfbec91f12151eb0004724ccfc4e00
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65962
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Diffstat (limited to 'util/flashrom_tester/src/main.rs')
-rw-r--r-- | util/flashrom_tester/src/main.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util/flashrom_tester/src/main.rs b/util/flashrom_tester/src/main.rs index 69bb92db..dd09f9a3 100644 --- a/util/flashrom_tester/src/main.rs +++ b/util/flashrom_tester/src/main.rs @@ -113,6 +113,10 @@ fn main() { ); debug!("Args parsed and logging initialized OK"); + debug!("Collecting crossystem info"); + let crossystem = + flashrom_tester::utils::collect_crosssystem(&[]).expect("could not run crossystem"); + let flashrom_path = matches .value_of("flashrom_binary") .expect("flashrom_binary should be required"); @@ -143,6 +147,7 @@ fn main() { output_format, test_names, Some(handle_sigint()), + crossystem, ) { eprintln!("Failed to run tests: {:?}", e); std::process::exit(1); |