1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-06 08:07:07 +02:00

flashrom_tester: Remove subprocess from elog_sanity_test

Make elog_sanity_test read the elog region itself, instead of calling
out to elogtool. This avoids the need to subprocess and resolves
a deadlock when elogtool attempts to obtain a flash reading lock.

TEST=/usr/bin/flashrom_tester host Coreboot_ELOG_sanity
TEST=flashrom --image RW_ELOG -p host -r /tmp/file.tmp2 # comparison
TEST=hexdump the file and check magic signature == 0x474f4c45

Change-Id: I8ac63e15e063f9c0928e3e185154bb083b367ba9
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65119
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
Evan Benn
2022-06-10 16:43:02 +10:00
committed by Edward O'Callaghan
parent b9e7d20d19
commit 4342cc0f14
4 changed files with 42 additions and 32 deletions

View File

@ -59,22 +59,3 @@ pub fn system_info() -> IoResult<String> {
pub fn bios_info() -> IoResult<String> {
dmidecode_dispatch(&["-q", "-t0"])
}
pub fn eventlog_list() -> Result<String, std::io::Error> {
elogtool_dispatch(&["list"])
}
fn elogtool_dispatch<S: AsRef<OsStr> + Debug>(args: &[S]) -> IoResult<String> {
info!("elogtool_dispatch() running: /usr/bin/elogtool {:?}", args);
let output = Command::new("/usr/bin/elogtool")
.args(args)
.stdin(Stdio::null())
.output()?;
if !output.status.success() {
return Err(utils::translate_command_error(&output));
}
let stdout = String::from_utf8_lossy(&output.stdout).into_owned();
Ok(stdout)
}