Skip to content

Commit bee2257

Browse files
Merge pull request #172 from FrameworkComputer/copyright
framework_tool: Add copyright into .exe properties
2 parents 489264f + 62bdc22 commit bee2257

4 files changed

Lines changed: 35 additions & 15 deletions

File tree

framework_lib/src/chromium_ec/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -276,25 +276,25 @@ impl CrosEc {
276276
}
277277
}
278278

279-
pub fn check_mem_magic(&self) -> Option<()> {
279+
pub fn check_mem_magic(&self) -> EcResult<()> {
280280
match self.read_memory(EC_MEMMAP_ID, 2) {
281281
Some(ec_id) => {
282282
if ec_id.len() != 2 {
283-
error!(" Unexpected length returned: {:?}", ec_id.len());
284-
return None;
285-
}
286-
if ec_id[0] != b'E' || ec_id[1] != b'C' {
287-
error!(" This machine doesn't look like it has a Framework EC");
288-
None
283+
Err(EcError::DeviceError(format!(
284+
" Unexpected length returned: {:?}",
285+
ec_id.len()
286+
)))
287+
} else if ec_id[0] != b'E' || ec_id[1] != b'C' {
288+
Err(EcError::DeviceError(
289+
"This machine doesn't look like it has a Framework EC".to_string(),
290+
))
289291
} else {
290-
println!(" Verified that Framework EC is present!");
291-
Some(())
292+
Ok(())
292293
}
293294
}
294-
None => {
295-
error!(" Failed to read EC ID from memory map");
296-
None
297-
}
295+
None => Err(EcError::DeviceError(
296+
"Failed to read EC ID from memory map".to_string(),
297+
)),
298298
}
299299
}
300300

framework_lib/src/chromium_ec/windows.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ use windows::{
1414
use crate::chromium_ec::protocol::HEADER_LEN;
1515
use crate::chromium_ec::EC_MEMMAP_SIZE;
1616
use crate::chromium_ec::{EcError, EcResponseStatus, EcResult};
17+
use crate::smbios;
18+
use crate::util::Platform;
1719

1820
// Create a wrapper around HANDLE to mark it as Send.
1921
// I'm not sure, but I think it's safe to do that for this type of HANDL.
@@ -46,6 +48,20 @@ fn init() -> bool {
4648
let handle = match res {
4749
Ok(h) => h,
4850
Err(err) => {
51+
let platform = smbios::get_platform();
52+
match platform {
53+
Some(platform @ Platform::IntelGen11)
54+
| Some(platform @ Platform::IntelGen12)
55+
| Some(platform @ Platform::IntelGen13)
56+
| Some(platform @ Platform::Framework13Amd7080)
57+
| Some(platform @ Platform::Framework16Amd7080) => {
58+
println!("The windows driver is not enabled on {:?}.", platform);
59+
println!("Please stay tuned for future BIOS and driver updates.");
60+
println!();
61+
}
62+
_ => (),
63+
}
64+
4965
error!("Failed to find Windows driver. {:?}", err);
5066
return false;
5167
}

framework_lib/src/commandline/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
844844
} else if args.version {
845845
print_tool_version();
846846
} else if args.features {
847-
ec.get_features().unwrap();
847+
print_err(ec.get_features());
848848
} else if args.esrt {
849849
print_esrt();
850850
} else if let Some(compare_version_ver) = &args.compare_version {
@@ -1340,7 +1340,8 @@ fn selftest(ec: &CrosEc) -> Option<()> {
13401340
}
13411341

13421342
println!(" Checking EC memory mapped magic bytes");
1343-
ec.check_mem_magic()?;
1343+
print_err(ec.check_mem_magic())?;
1344+
println!(" Verified that Framework EC is present!");
13441345

13451346
println!(" Reading EC Build Version");
13461347
print_err(ec.version_info())?;

framework_tool/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ version = "0.3.9"
2626
features = [
2727
"wincon"
2828
]
29+
30+
[package.metadata.winresource]
31+
LegalCopyright = "Framework Computer Inc © 2022"

0 commit comments

Comments
 (0)