mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 21:00:20 +00:00
feat(bootloader-interface): identify ourselves as sprout
This commit is contained in:
@@ -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")?;
|
||||
|
||||
Reference in New Issue
Block a user