mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 23:43:42 +02:00
flashrom_tester: Use elogtool to list firmware eventlog
Mosys is dropping the eventlog command, in favor of the elogtool command provided in coreboot. The output is compatible with what mosys used to output. Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I8c4be82fed28b6a19746e6b93fafce23bd8ede5d Reviewed-on: https://review.coreboot.org/c/flashrom/+/58527 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Ricardo Quesada <ricardoq@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
parent
8d8281c3d6
commit
b3df1390dc
@ -61,13 +61,13 @@ pub fn bios_info() -> IoResult<String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn eventlog_list() -> Result<String, std::io::Error> {
|
pub fn eventlog_list() -> Result<String, std::io::Error> {
|
||||||
mosys_dispatch(&["eventlog", "list"])
|
elogtool_dispatch(&["list"])
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mosys_dispatch<S: AsRef<OsStr> + Debug>(args: &[S]) -> IoResult<String> {
|
fn elogtool_dispatch<S: AsRef<OsStr> + Debug>(args: &[S]) -> IoResult<String> {
|
||||||
info!("mosys_dispatch() running: /usr/sbin/mosys {:?}", args);
|
info!("elogtool_dispatch() running: /usr/bin/elogtool {:?}", args);
|
||||||
|
|
||||||
let output = Command::new("/usr/sbin/mosys")
|
let output = Command::new("/usr/bin/elogtool")
|
||||||
.args(args)
|
.args(args)
|
||||||
.stdin(Stdio::null())
|
.stdin(Stdio::null())
|
||||||
.output()?;
|
.output()?;
|
||||||
|
@ -234,13 +234,13 @@ fn lock_test(env: &mut TestEnv) -> TestResult {
|
|||||||
|
|
||||||
fn elog_sanity_test(env: &mut TestEnv) -> TestResult {
|
fn elog_sanity_test(env: &mut TestEnv) -> TestResult {
|
||||||
// Check that the elog contains *something*, as an indication that Coreboot
|
// Check that the elog contains *something*, as an indication that Coreboot
|
||||||
// is actually able to write to the Flash. Because this invokes mosys on the
|
// is actually able to write to the Flash. Because this invokes elogtool on
|
||||||
// host, it doesn't make sense to run for other chips.
|
// the host, it doesn't make sense to run for other chips.
|
||||||
if env.chip_type() != FlashChip::HOST {
|
if env.chip_type() != FlashChip::HOST {
|
||||||
info!("Skipping ELOG sanity check for non-host chip");
|
info!("Skipping ELOG sanity check for non-host chip");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
// mosys reads the flash, it should be back in the golden state
|
// elogtool reads the flash, it should be back in the golden state
|
||||||
env.ensure_golden()?;
|
env.ensure_golden()?;
|
||||||
// Output is one event per line, drop empty lines in the interest of being defensive.
|
// Output is one event per line, drop empty lines in the interest of being defensive.
|
||||||
let event_count = cros_sysinfo::eventlog_list()?
|
let event_count = cros_sysinfo::eventlog_list()?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user