We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62d4c22 commit d3db428Copy full SHA for d3db428
src/dmi.rs
@@ -6,6 +6,7 @@ use std::{
6
fmt::Display,
7
fs::File,
8
io::{BufRead, BufReader, Read},
9
+ path::Path,
10
};
11
12
use anyhow::{Result, bail};
@@ -82,6 +83,16 @@ impl DMI {
82
83
let mut system: Option<System> = None;
84
let mut baseboard: Option<Baseboard> = None;
85
86
+ let dmi_file_path = Path::new("/sys/firmware/dmi/tables/DMI");
87
+
88
+ match dmi_file_path.try_exists() {
89
+ Ok(true) => {}
90
+ Ok(false) | Err(_) => {
91
+ eprintln!("No SMBIOS found");
92
+ std::process::exit(1);
93
+ }
94
95
96
let mem_file = File::open("/sys/firmware/dmi/tables/DMI")?;
97
let mut file = BufReader::new(mem_file);
98
0 commit comments