diff options
author | Evan Benn <evanbenn@chromium.org> | 2022-11-09 16:57:53 +1100 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2022-11-24 03:33:00 +0000 |
commit | d8be2ced58ef22dad6ee1265ddaeef6b38259b1c (patch) | |
tree | 87cebba58421b4b2ef3f3602b0f7bc2540c3e517 /util/flashrom_tester/src/cros_sysinfo.rs | |
parent | 63ae7ae91c5372010d5fc4124e6c901275dc7940 (diff) | |
download | flashrom-d8be2ced58ef22dad6ee1265ddaeef6b38259b1c.tar.gz flashrom-d8be2ced58ef22dad6ee1265ddaeef6b38259b1c.tar.bz2 flashrom-d8be2ced58ef22dad6ee1265ddaeef6b38259b1c.zip |
flashrom_tester: Log some cros lsb-release information
os-release does not quite have as much information so use lsb-release.
BUG=b:258289727
BRANCH=None
TEST=flashrom_tester --libflashrom host Lock
Change-Id: If3452ead9e02e0ddeaa0fdf4852d7c17a8ab7650
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69403
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/flashrom_tester/src/cros_sysinfo.rs')
-rw-r--r-- | util/flashrom_tester/src/cros_sysinfo.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/util/flashrom_tester/src/cros_sysinfo.rs b/util/flashrom_tester/src/cros_sysinfo.rs index e047f8e6..37e1ec65 100644 --- a/util/flashrom_tester/src/cros_sysinfo.rs +++ b/util/flashrom_tester/src/cros_sysinfo.rs @@ -34,6 +34,7 @@ // use std::ffi::OsStr; +use std::fs; use std::io::Result as IoResult; use std::process::{Command, Stdio}; @@ -58,3 +59,12 @@ pub fn system_info() -> IoResult<String> { pub fn bios_info() -> IoResult<String> { dmidecode_dispatch(&["-q", "-t0"]) } + +pub fn release_description() -> IoResult<String> { + for l in fs::read_to_string("/etc/lsb-release")?.lines() { + if l.starts_with("CHROMEOS_RELEASE_DESCRIPTION") { + return Ok(l.to_string()); + } + } + Err(std::io::ErrorKind::NotFound.into()) +} |