Skip to content

Commit ae9184d

Browse files
committed
framework_lib: Rename uefi module to fw_uefi
Rename the internal uefi module to fw_uefi to avoid naming conflicts with the uefi crate, in preparation for updating to uefi 0.36.1. Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent c4ada2d commit ae9184d

7 files changed

Lines changed: 18 additions & 18 deletions

File tree

framework_lib/src/capsule.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub fn dump_winux_image(data: &[u8], header: &DisplayCapsule, filename: &str) {
183183
}
184184
#[cfg(feature = "uefi")]
185185
{
186-
let ret = crate::uefi::fs::shell_write_file(filename, image);
186+
let ret = crate::fw_uefi::fs::shell_write_file(filename, image);
187187
if let Err(err) = ret {
188188
println!("Failed to dump winux image: {:?}", err);
189189
}

framework_lib/src/chromium_ec/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
//! - `windows` - It uses [DHowett's Windows driver](https://github.com/DHowett/FrameworkWindowsUtils)
1010
1111
use crate::ec_binary;
12+
#[cfg(feature = "uefi")]
13+
use crate::fw_uefi::shell_get_execution_break_flag;
1214
use crate::os_specific;
1315
use crate::power;
1416
use crate::smbios;
15-
#[cfg(feature = "uefi")]
16-
use crate::uefi::shell_get_execution_break_flag;
1717
use crate::util::{self, Platform};
1818

1919
use no_std_compat::time::Duration;

framework_lib/src/commandline/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ use crate::chromium_ec::{CrosEcDriver, EcError, EcResult};
4747
use crate::csme;
4848
use crate::ec_binary;
4949
use crate::esrt::{self, ResourceType};
50+
#[cfg(feature = "uefi")]
51+
use crate::fw_uefi::enable_page_break;
5052
#[cfg(feature = "rusb")]
5153
use crate::inputmodule::check_inputmodule_version;
5254
#[cfg(target_os = "linux")]
@@ -61,8 +63,6 @@ use crate::smbios::{dmidecode_string_val, get_smbios, is_framework};
6163
use crate::touchpad::print_touchpad_fw_ver;
6264
#[cfg(feature = "hidapi")]
6365
use crate::touchscreen;
64-
#[cfg(feature = "uefi")]
65-
use crate::uefi::enable_page_break;
6666
#[cfg(feature = "rusb")]
6767
use crate::usbhub::check_usbhub_version;
6868
use crate::util::{self, Config, Platform, PlatformFamily};
@@ -1047,7 +1047,7 @@ fn print_esrt() {
10471047

10481048
fn flash_ec(ec: &CrosEc, ec_bin_path: &str, flash_type: EcFlashType, dry_run: bool) {
10491049
#[cfg(feature = "uefi")]
1050-
let data = crate::uefi::fs::shell_read_file(ec_bin_path);
1050+
let data = crate::fw_uefi::fs::shell_read_file(ec_bin_path);
10511051
#[cfg(not(feature = "uefi"))]
10521052
let data: Option<Vec<u8>> = {
10531053
match fs::read(ec_bin_path) {
@@ -1082,7 +1082,7 @@ fn dump_ec_flash(ec: &CrosEc, dump_path: &str) {
10821082
}
10831083
#[cfg(feature = "uefi")]
10841084
{
1085-
let ret = crate::uefi::fs::shell_write_file(dump_path, &flash_bin);
1085+
let ret = crate::fw_uefi::fs::shell_write_file(dump_path, &flash_bin);
10861086
if ret.is_err() {
10871087
println!("Failed to dump EC FW image.");
10881088
}
@@ -1147,7 +1147,7 @@ fn dump_dgpu_eeprom(ec: &CrosEc, dump_path: &str) {
11471147
}
11481148
#[cfg(feature = "uefi")]
11491149
{
1150-
if let Err(err) = crate::uefi::fs::shell_write_file(dump_path, &flash_bin) {
1150+
if let Err(err) = crate::fw_uefi::fs::shell_write_file(dump_path, &flash_bin) {
11511151
error!("Failed to dump EC FW image: {:?}", err);
11521152
return;
11531153
}
@@ -1616,7 +1616,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
16161616
}
16171617
} else if let Some(pd_bin_path) = &args.pd_bin {
16181618
#[cfg(feature = "uefi")]
1619-
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(pd_bin_path);
1619+
let data: Option<Vec<u8>> = crate::fw_uefi::fs::shell_read_file(pd_bin_path);
16201620
#[cfg(not(feature = "uefi"))]
16211621
let data = match fs::read(pd_bin_path) {
16221622
Ok(data) => Some(data),
@@ -1635,7 +1635,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
16351635
}
16361636
} else if let Some(ec_bin_path) = &args.ec_bin {
16371637
#[cfg(feature = "uefi")]
1638-
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(ec_bin_path);
1638+
let data: Option<Vec<u8>> = crate::fw_uefi::fs::shell_read_file(ec_bin_path);
16391639
#[cfg(not(feature = "uefi"))]
16401640
let data = match fs::read(ec_bin_path) {
16411641
Ok(data) => Some(data),
@@ -1654,7 +1654,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
16541654
}
16551655
} else if let Some(capsule_path) = &args.capsule {
16561656
#[cfg(feature = "uefi")]
1657-
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(capsule_path);
1657+
let data: Option<Vec<u8>> = crate::fw_uefi::fs::shell_read_file(capsule_path);
16581658
#[cfg(not(feature = "uefi"))]
16591659
let data = match fs::read(capsule_path) {
16601660
Ok(data) => Some(data),
@@ -1683,7 +1683,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
16831683
}
16841684
} else if let Some(capsule_path) = &args.h2o_capsule {
16851685
#[cfg(feature = "uefi")]
1686-
let data = crate::uefi::fs::shell_read_file(capsule_path);
1686+
let data = crate::fw_uefi::fs::shell_read_file(capsule_path);
16871687
#[cfg(not(feature = "uefi"))]
16881688
let data = match fs::read(capsule_path) {
16891689
Ok(data) => Some(data),
@@ -1736,7 +1736,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
17361736
} else if let Some(hash_file) = &args.hash {
17371737
println!("Hashing file: {}", hash_file);
17381738
#[cfg(feature = "uefi")]
1739-
let data = crate::uefi::fs::shell_read_file(hash_file);
1739+
let data = crate::fw_uefi::fs::shell_read_file(hash_file);
17401740
#[cfg(not(feature = "uefi"))]
17411741
let data = match fs::read(hash_file) {
17421742
Ok(data) => Some(data),
@@ -1765,7 +1765,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
17651765
Some(PlatformFamily::Framework16) | None
17661766
) {
17671767
#[cfg(feature = "uefi")]
1768-
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(gpu_descriptor_file);
1768+
let data: Option<Vec<u8>> = crate::fw_uefi::fs::shell_read_file(gpu_descriptor_file);
17691769
#[cfg(not(feature = "uefi"))]
17701770
let data = match fs::read(gpu_descriptor_file) {
17711771
Ok(data) => Some(data),
@@ -2156,7 +2156,7 @@ fn smbios_info() {
21562156
fn me_info(verbose: bool, dump_path: Option<&str>) {
21572157
let smbios = if let Some(path) = dump_path {
21582158
#[cfg(feature = "uefi")]
2159-
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(path);
2159+
let data: Option<Vec<u8>> = crate::fw_uefi::fs::shell_read_file(path);
21602160
#[cfg(not(feature = "uefi"))]
21612161
let data = match std::fs::read(path) {
21622162
Ok(data) => Some(data),

framework_lib/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ pub mod commandline;
4242
pub mod csme;
4343
pub mod ec_binary;
4444
pub mod esrt;
45+
#[cfg(feature = "uefi")]
46+
pub mod fw_uefi;
4547
mod os_specific;
4648
pub mod parade_retimer;
4749
pub mod power;
4850
pub mod smbios;
49-
#[cfg(feature = "uefi")]
50-
pub mod uefi;
5151
mod util;
5252

5353
pub mod built_info {

framework_lib/src/smbios.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ pub fn get_smbios() -> Option<SMBiosData> {
193193
#[cfg(feature = "uefi")]
194194
pub fn get_smbios() -> Option<SMBiosData> {
195195
trace!("get_smbios() uefi entry");
196-
let data = crate::uefi::smbios_data().unwrap();
196+
let data = crate::fw_uefi::smbios_data().unwrap();
197197
let version = None; // TODO: Maybe add the version here
198198
let smbios = SMBiosData::from_vec_and_version(data, version);
199199
Some(smbios)

0 commit comments

Comments
 (0)