Skip to content

Commit

Permalink
framework_uefi: Add support for AcLeft and AcRight
Browse files Browse the repository at this point in the history
Functionality originally added in 69c97b0.
Forgot to add these to UEFI as well.

Signed-off-by: Daniel Schaefer <[email protected]>
  • Loading branch information
JohnAZoidberg committed Dec 13, 2024
1 parent 38eedeb commit b7bf240
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,21 +279,21 @@ 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
> echo $?
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"
Expand All @@ -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`.
Expand Down
6 changes: 5 additions & 1 deletion framework_lib/src/commandline/uefi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}
Expand Down

0 comments on commit b7bf240

Please sign in to comment.