mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 15:40:16 +00:00
fix(bootloader-interface): use the correct uefi revision and firmware revision format
This commit is contained in:
@@ -118,14 +118,17 @@ impl BootloaderInterface {
|
|||||||
/// Tell the system about the UEFI firmware we are running on.
|
/// Tell the system about the UEFI firmware we are running on.
|
||||||
pub fn set_firmware_info() -> Result<()> {
|
pub fn set_firmware_info() -> Result<()> {
|
||||||
// Access the firmware revision.
|
// Access the firmware revision.
|
||||||
let revision = uefi::system::firmware_revision();
|
let firmware_revision = uefi::system::firmware_revision();
|
||||||
|
|
||||||
|
// Access the UEFI revision.
|
||||||
|
let uefi_revision = uefi::system::uefi_revision();
|
||||||
|
|
||||||
// Format the firmware information string into something human-readable.
|
// Format the firmware information string into something human-readable.
|
||||||
let firmware_info = format!(
|
let firmware_info = format!(
|
||||||
"{} {}.{:02}",
|
"{} {}.{:02}",
|
||||||
uefi::system::firmware_vendor(),
|
uefi::system::firmware_vendor(),
|
||||||
revision >> 16,
|
firmware_revision >> 16,
|
||||||
revision & 0xffff,
|
firmware_revision & 0xffff,
|
||||||
);
|
);
|
||||||
Self::VENDOR.set_cstr16(
|
Self::VENDOR.set_cstr16(
|
||||||
"LoaderFirmwareInfo",
|
"LoaderFirmwareInfo",
|
||||||
@@ -134,7 +137,11 @@ impl BootloaderInterface {
|
|||||||
)?;
|
)?;
|
||||||
|
|
||||||
// Format the firmware revision into something human-readable.
|
// Format the firmware revision into something human-readable.
|
||||||
let firmware_type = format!("UEFI {}.{:02}", revision >> 16, revision & 0xffff);
|
let firmware_type = format!(
|
||||||
|
"UEFI {}.{:02}",
|
||||||
|
uefi_revision.major(),
|
||||||
|
uefi_revision.minor()
|
||||||
|
);
|
||||||
Self::VENDOR.set_cstr16(
|
Self::VENDOR.set_cstr16(
|
||||||
"LoaderFirmwareType",
|
"LoaderFirmwareType",
|
||||||
&firmware_type,
|
&firmware_type,
|
||||||
|
|||||||
@@ -198,7 +198,8 @@ impl ShimSupport {
|
|||||||
|
|
||||||
// Call the shim verify function.
|
// Call the shim verify function.
|
||||||
// SAFETY: The shim verify function is specified by the shim lock protocol.
|
// SAFETY: The shim verify function is specified by the shim lock protocol.
|
||||||
// Calling this function is considered safe because
|
// Calling this function is considered safe because the shim verify function is
|
||||||
|
// guaranteed to be defined by the environment if we are able to acquire the protocol.
|
||||||
let status =
|
let status =
|
||||||
unsafe { (protocol.shim_verify)(buffer.as_ptr() as *mut c_void, buffer.len() as u32) };
|
unsafe { (protocol.shim_verify)(buffer.as_ptr() as *mut c_void, buffer.len() as u32) };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user