Skip to content

Commit 8a8aec9

Browse files
committed
smbioslib: Build from crates.io on non-UEFI
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent b3c5d5b commit 8a8aec9

File tree

4 files changed

+61
-10
lines changed

4 files changed

+61
-10
lines changed

Cargo.lock

Lines changed: 52 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

framework_lib/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ uefi = { version = "0.20", features = ["alloc"] }
4040
uefi-services = "0.17"
4141
plain = "0.2.3"
4242
redox_hwio = { version = "0.1.6", default-features = false }
43-
smbios-lib = { git = "https://github.com/FrameworkComputer/smbios-lib.git", branch = "no-std", default-features = false }
43+
smbios-lib-no-std = { package = "smbios-lib", git = "https://github.com/FrameworkComputer/smbios-lib.git", branch = "no-std", default-features = false }
4444
guid-create-no-std = { package = "guid-create", git = "https://github.com/FrameworkComputer/guid-create", branch = "no_std", default-features = false }
4545

4646
[target.'cfg(windows)'.dependencies]
4747
wmi = "0.15.0"
48-
smbios-lib = { git = "https://github.com/FrameworkComputer/smbios-lib.git", branch = "no-std" }
48+
smbios-lib = "0.9.2"
4949
env_logger = "0.11"
5050
clap = { version = "4.5", features = ["derive", "cargo"] }
5151
clap-num = { version = "1.2.0" }
@@ -56,7 +56,7 @@ guid-create = "0.4.1"
5656
[target.'cfg(unix)'.dependencies]
5757
libc = "0.2.155"
5858
nix = { version = "0.29.0", features = ["ioctl", "user"] }
59-
smbios-lib = { git = "https://github.com/FrameworkComputer/smbios-lib.git", branch = "no-std" }
59+
smbios-lib = "0.9.2"
6060
env_logger = "0.11"
6161
clap = { version = "4.5", features = ["derive", "cargo"] }
6262
clap-num = { version = "1.2.0" }

framework_lib/src/commandline/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ use crate::util::{self, Config, Platform, PlatformFamily};
6969
use hidapi::HidApi;
7070
use sha2::{Digest, Sha256, Sha384, Sha512};
7171
//use smbioslib::*;
72+
#[cfg(feature = "uefi")]
73+
use smbios_lib_no_std::{DefinedStruct, SMBiosInformation};
74+
#[cfg(not(feature = "uefi"))]
7275
use smbioslib::{DefinedStruct, SMBiosInformation};
7376

7477
use crate::chromium_ec::{CrosEc, CrosEcDriverType, HardwareDeviceType};

framework_lib/src/smbios.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ use crate::util::Config;
99
pub use crate::util::{Platform, PlatformFamily};
1010
use num_derive::FromPrimitive;
1111
use num_traits::FromPrimitive;
12+
#[cfg(feature = "uefi")]
13+
use smbios_lib_no_std::*;
14+
#[cfg(not(feature = "uefi"))]
1215
use smbioslib::*;
1316
#[cfg(feature = "uefi")]
1417
use spin::Mutex;

0 commit comments

Comments
 (0)