diff --git a/src/integrations/bootloader_interface.rs b/src/integrations/bootloader_interface.rs index 82351cb..2581f19 100644 --- a/src/integrations/bootloader_interface.rs +++ b/src/integrations/bootloader_interface.rs @@ -5,6 +5,9 @@ use uefi::proto::device_path::DevicePath; use uefi::{CString16, Guid, guid}; use uefi_raw::table::runtime::{VariableAttributes, VariableVendor}; +/// The name of the bootloader to tell the system. +const LOADER_NAME: &str = "Sprout"; + /// Bootloader Interface support. pub struct BootloaderInterface; @@ -30,6 +33,11 @@ impl BootloaderInterface { Self::set_cstr16(key, &elapsed.as_micros().to_string()) } + /// Tell the system what loader is being used. + pub fn set_loader_info() -> Result<()> { + Self::set_cstr16("LoaderInfo", LOADER_NAME) + } + /// Tell the system the relative path to the partition root of the current bootloader. pub fn set_loader_path(path: &DevicePath) -> Result<()> { let subpath = device_path_subpath(path).context("unable to get loader path subpath")?; diff --git a/src/main.rs b/src/main.rs index 7a657f2..15579c5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -76,6 +76,10 @@ fn run() -> Result<()> { BootloaderInterface::set_firmware_info() .context("unable to set firmware info in bootloader interface")?; + // Tell the bootloader interface what loader is being used. + BootloaderInterface::set_loader_info() + .context("unable to set loader info in bootloader interface")?; + // Parse the options to the sprout executable. let options = SproutOptions::parse().context("unable to parse options")?;