Skip to content

Commit 19a14c4

Browse files
committed
framework_lib: Rename uefi module to fw_uefi
Avoid namespace clash with the uefi crate, which is confusing when both are used in the same file. Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 9d2ff67 commit 19a14c4

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::os_specific;
1313
use crate::power;
1414
use crate::smbios;
1515
#[cfg(feature = "uefi")]
16-
use crate::uefi::shell_get_execution_break_flag;
16+
use crate::fw_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: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ use crate::touchpad::print_touchpad_fw_ver;
6262
#[cfg(feature = "hidapi")]
6363
use crate::touchscreen;
6464
#[cfg(feature = "uefi")]
65-
use crate::uefi::enable_page_break;
65+
use crate::fw_uefi::enable_page_break;
6666
#[cfg(feature = "rusb")]
6767
use crate::usbhub::check_usbhub_version;
6868
use crate::util::{self, Config, Platform, PlatformFamily};
@@ -1048,7 +1048,7 @@ fn print_esrt() {
10481048

10491049
fn flash_ec(ec: &CrosEc, ec_bin_path: &str, flash_type: EcFlashType, dry_run: bool) {
10501050
#[cfg(feature = "uefi")]
1051-
let data = crate::uefi::fs::shell_read_file(ec_bin_path);
1051+
let data = crate::fw_uefi::fs::shell_read_file(ec_bin_path);
10521052
#[cfg(not(feature = "uefi"))]
10531053
let data: Option<Vec<u8>> = {
10541054
match fs::read(ec_bin_path) {
@@ -1083,7 +1083,7 @@ fn dump_ec_flash(ec: &CrosEc, dump_path: &str) {
10831083
}
10841084
#[cfg(feature = "uefi")]
10851085
{
1086-
let ret = crate::uefi::fs::shell_write_file(dump_path, &flash_bin);
1086+
let ret = crate::fw_uefi::fs::shell_write_file(dump_path, &flash_bin);
10871087
if ret.is_err() {
10881088
println!("Failed to dump EC FW image.");
10891089
}
@@ -1148,7 +1148,7 @@ fn dump_dgpu_eeprom(ec: &CrosEc, dump_path: &str) {
11481148
}
11491149
#[cfg(feature = "uefi")]
11501150
{
1151-
if let Err(err) = crate::uefi::fs::shell_write_file(dump_path, &flash_bin) {
1151+
if let Err(err) = crate::fw_uefi::fs::shell_write_file(dump_path, &flash_bin) {
11521152
error!("Failed to dump EC FW image: {:?}", err);
11531153
return;
11541154
}
@@ -1608,7 +1608,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
16081608
// raw_command(&args[1..]);
16091609
} else if let Some(pd_bin_path) = &args.pd_bin {
16101610
#[cfg(feature = "uefi")]
1611-
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(pd_bin_path);
1611+
let data: Option<Vec<u8>> = crate::fw_uefi::fs::shell_read_file(pd_bin_path);
16121612
#[cfg(not(feature = "uefi"))]
16131613
let data = match fs::read(pd_bin_path) {
16141614
Ok(data) => Some(data),
@@ -1627,7 +1627,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
16271627
}
16281628
} else if let Some(ec_bin_path) = &args.ec_bin {
16291629
#[cfg(feature = "uefi")]
1630-
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(ec_bin_path);
1630+
let data: Option<Vec<u8>> = crate::fw_uefi::fs::shell_read_file(ec_bin_path);
16311631
#[cfg(not(feature = "uefi"))]
16321632
let data = match fs::read(ec_bin_path) {
16331633
Ok(data) => Some(data),
@@ -1646,7 +1646,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
16461646
}
16471647
} else if let Some(capsule_path) = &args.capsule {
16481648
#[cfg(feature = "uefi")]
1649-
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(capsule_path);
1649+
let data: Option<Vec<u8>> = crate::fw_uefi::fs::shell_read_file(capsule_path);
16501650
#[cfg(not(feature = "uefi"))]
16511651
let data = match fs::read(capsule_path) {
16521652
Ok(data) => Some(data),
@@ -1675,7 +1675,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
16751675
}
16761676
} else if let Some(capsule_path) = &args.h2o_capsule {
16771677
#[cfg(feature = "uefi")]
1678-
let data = crate::uefi::fs::shell_read_file(capsule_path);
1678+
let data = crate::fw_uefi::fs::shell_read_file(capsule_path);
16791679
#[cfg(not(feature = "uefi"))]
16801680
let data = match fs::read(capsule_path) {
16811681
Ok(data) => Some(data),
@@ -1728,7 +1728,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
17281728
} else if let Some(hash_file) = &args.hash {
17291729
println!("Hashing file: {}", hash_file);
17301730
#[cfg(feature = "uefi")]
1731-
let data = crate::uefi::fs::shell_read_file(hash_file);
1731+
let data = crate::fw_uefi::fs::shell_read_file(hash_file);
17321732
#[cfg(not(feature = "uefi"))]
17331733
let data = match fs::read(hash_file) {
17341734
Ok(data) => Some(data),
@@ -1757,7 +1757,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
17571757
Some(PlatformFamily::Framework16) | None
17581758
) {
17591759
#[cfg(feature = "uefi")]
1760-
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(gpu_descriptor_file);
1760+
let data: Option<Vec<u8>> = crate::fw_uefi::fs::shell_read_file(gpu_descriptor_file);
17611761
#[cfg(not(feature = "uefi"))]
17621762
let data = match fs::read(gpu_descriptor_file) {
17631763
Ok(data) => Some(data),
@@ -2148,7 +2148,7 @@ fn smbios_info() {
21482148
fn me_info(verbose: bool, dump_path: Option<&str>) {
21492149
let smbios = if let Some(path) = dump_path {
21502150
#[cfg(feature = "uefi")]
2151-
let data: Option<Vec<u8>> = crate::uefi::fs::shell_read_file(path);
2151+
let data: Option<Vec<u8>> = crate::fw_uefi::fs::shell_read_file(path);
21522152
#[cfg(not(feature = "uefi"))]
21532153
let data = match std::fs::read(path) {
21542154
Ok(data) => Some(data),

framework_lib/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub mod parade_retimer;
4747
pub mod power;
4848
pub mod smbios;
4949
#[cfg(feature = "uefi")]
50-
pub mod uefi;
50+
pub mod fw_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)