From 38eedebac9eaa3bb11894df05a34dfbd68c0b647 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Fri, 13 Dec 2024 17:15:40 +0800 Subject: [PATCH 1/3] Bump version to 0.2.0 Signed-off-by: Daniel Schaefer --- Cargo.lock | 6 +++--- framework_lib/Cargo.toml | 2 +- framework_tool/Cargo.toml | 2 +- framework_uefi/Cargo.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5176ed0c..7d1941e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -320,7 +320,7 @@ dependencies = [ [[package]] name = "framework_lib" -version = "0.1.0" +version = "0.2.0" dependencies = [ "built", "clap", @@ -351,7 +351,7 @@ dependencies = [ [[package]] name = "framework_tool" -version = "0.1.0" +version = "0.2.0" dependencies = [ "framework_lib", "static_vcruntime", @@ -359,7 +359,7 @@ dependencies = [ [[package]] name = "framework_uefi" -version = "0.1.0" +version = "0.2.0" dependencies = [ "framework_lib", "log", diff --git a/framework_lib/Cargo.toml b/framework_lib/Cargo.toml index a98fa1df..31cfc081 100644 --- a/framework_lib/Cargo.toml +++ b/framework_lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "framework_lib" -version = "0.1.0" +version = "0.2.0" edition = "2021" rust-version = "1.61" build = "build.rs" diff --git a/framework_tool/Cargo.toml b/framework_tool/Cargo.toml index 7a9266da..06defaae 100644 --- a/framework_tool/Cargo.toml +++ b/framework_tool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "framework_tool" -version = "0.1.0" +version = "0.2.0" edition = "2021" [features] diff --git a/framework_uefi/Cargo.toml b/framework_uefi/Cargo.toml index 2d0b672a..05ec7461 100644 --- a/framework_uefi/Cargo.toml +++ b/framework_uefi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "framework_uefi" -version = "0.1.0" +version = "0.2.0" edition = "2021" rust-version = "1.68" From b7bf240583f5fea172ea0da6caed457cae4b9534 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Fri, 13 Dec 2024 17:31:10 +0800 Subject: [PATCH 2/3] framework_uefi: Add support for AcLeft and AcRight Functionality originally added in 69c97b0ed89b3f27a781eca0c06c13a5f111fecb. Forgot to add these to UEFI as well. Signed-off-by: Daniel Schaefer --- README.md | 31 +++++++++++++++++++++++---- framework_lib/src/commandline/uefi.rs | 6 +++++- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0e186e31..f4927fc0 100644 --- a/README.md +++ b/README.md @@ -279,13 +279,13 @@ succcess, 1 on failure. ``` # Check which devices it's available for -> ./framework_system --device - [possible values: bios, ec, pd0, pd1, rtm01, rtm23] +> ./framework_tool --device + [possible values: bios, ec, pd0, pd1, rtm01, rtm23, ac-left, ac-right] For more information try '--help' # Successful compare -> ./framework_system --device bios --compare-version 03.01 +> ./framework_tool --device bios --compare-version 03.01 Target Version "03.01" Comparing BIOS version "03.01" Compared version: 0 @@ -293,7 +293,7 @@ Compared version: 0 0 # Failed compare -> ./framework_system --device bios --compare-version 03.00 +> ./framework_tool --device bios --compare-version 03.00 Finished dev [unoptimized + debuginfo] target(s) in 0.05s Target Version "03.00" Comparing BIOS version "03.01" @@ -304,6 +304,29 @@ Error: "Fail" 1 ``` +On UEFI Shell: + +``` +# Check if AC is attached on left side +Shell> fs0:framework_tool.efi --device ac-left --compare-version 1 +Target Version "1" +Comparing AcLeft "1" +Comparison Result: 0 +# It is +Shell> echo %lasterror% +0x0 + +# Check if AC is attached on right side +Shell> fs0:framework_tool.efi --device ac-right --compare-version 1 +Target Version "1" +Comparing AcLeft "0" +Comparison Result: 1 + +# It is not +Shell> echo %lasterror% +0x1 +``` + ## Debugging To debug, increase the verbosity from the commandline with `-v`. diff --git a/framework_lib/src/commandline/uefi.rs b/framework_lib/src/commandline/uefi.rs index 3a656fe6..283f01a1 100644 --- a/framework_lib/src/commandline/uefi.rs +++ b/framework_lib/src/commandline/uefi.rs @@ -436,12 +436,16 @@ pub fn parse(args: &[String]) -> Cli { Some(HardwareDeviceType::RTM01) } else if console_arg == "rtm23" { Some(HardwareDeviceType::RTM23) + } else if console_arg == "ac-left" { + Some(HardwareDeviceType::AcLeft) + } else if console_arg == "ac-right" { + Some(HardwareDeviceType::AcRight) } else { println!("Invalid value for --device: {}", console_arg); None } } else { - println!("Need to provide a value for --console. Either `follow` or `recent`"); + println!("Need to provide a value for --console. Possible values: bios, ec, pd0, pd1, rtm01, rtm23, ac-left, ac-right"); None }; } From 6f33a24733738e939ad45521fa7bdbfcc8b37de0 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Fri, 13 Dec 2024 17:44:09 +0800 Subject: [PATCH 3/3] framework_lib: Format PD version as hex BIOS setup menu displays it as hex and we usually refer to it as such. Signed-off-by: Daniel Schaefer --- framework_lib/src/ccgx/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework_lib/src/ccgx/mod.rs b/framework_lib/src/ccgx/mod.rs index 185d1037..71f187b1 100644 --- a/framework_lib/src/ccgx/mod.rs +++ b/framework_lib/src/ccgx/mod.rs @@ -121,7 +121,7 @@ impl fmt::Display for BaseVersion { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, - "{}.{}.{}.{:0>3}", + "{:X}.{:X}.{:X}.{:03X}", self.major, self.minor, self.patch, self.build_number ) } @@ -163,7 +163,7 @@ pub struct AppVersion { impl fmt::Display for AppVersion { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}.{}.{:0>2}", self.major, self.minor, self.circuit) + write!(f, "{:X}.{:X}.{:02X}", self.major, self.minor, self.circuit) } }