Skip to content

Commit ac3378a

Browse files
committed
--meinfo: Implement for UEFI
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 10b17a4 commit ac3378a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

framework_lib/src/commandline/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,13 +2138,17 @@ fn smbios_info() {
21382138

21392139
fn me_info(verbose: bool, dump_path: Option<&str>) {
21402140
let smbios = if let Some(path) = dump_path {
2141-
match std::fs::read(path) {
2142-
Ok(data) => Some(smbioslib::SMBiosData::from_vec_and_version(data, None)),
2141+
#[cfg(feature = "uefi")]
2142+
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(path);
2143+
#[cfg(not(feature = "uefi"))]
2144+
let data = match std::fs::read(path) {
2145+
Ok(data) => Some(data),
21432146
Err(e) => {
21442147
error!("Failed to read SMBIOS dump file '{}': {}", path, e);
2145-
return;
2148+
None
21462149
}
2147-
}
2150+
};
2151+
data.map(|d| smbioslib::SMBiosData::from_vec_and_version(d, None))
21482152
} else {
21492153
get_smbios()
21502154
};

framework_lib/src/commandline/uefi.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ pub fn parse(args: &[String]) -> Cli {
225225
cli.info = true;
226226
found_an_option = true;
227227
} else if arg == "--meinfo" {
228-
cli.meinfo = Some(String::new());
228+
cli.meinfo = if args.len() > i + 1 {
229+
Some(Some(args[i + 1].clone()))
230+
} else {
231+
Some(None)
232+
};
229233
found_an_option = true;
230234
} else if arg == "--intrusion" {
231235
cli.intrusion = true;

0 commit comments

Comments
 (0)