From d4936eefc0a6d17514d1c997c67545d409ec734a Mon Sep 17 00:00:00 2001 From: Ikey Doherty Date: Fri, 27 Dec 2024 10:01:43 +0000 Subject: [PATCH] bootloader: Expose systemd_boot query APIs Signed-off-by: Ikey Doherty --- .../src/bootloader/systemd_boot/interface.rs | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/blsforme/src/bootloader/systemd_boot/interface.rs b/blsforme/src/bootloader/systemd_boot/interface.rs index 7ede55b..52c1659 100644 --- a/blsforme/src/bootloader/systemd_boot/interface.rs +++ b/blsforme/src/bootloader/systemd_boot/interface.rs @@ -48,37 +48,37 @@ pub enum Error { } /// Variables that are currently exposed via efivars -pub(crate) enum VariableName { - //TimeInitUSec, - //TimeExecUSec, +pub enum VariableName { + TimeInitUSec, + TimeExecUSec, DevicePartUUID, - //ConfigTimeout, - //ConfigTimeoutOneShot, - //Entries, - //EntryDefault, - //EntrySelected, - //Features, - //ImageIdentifier, + ConfigTimeout, + ConfigTimeoutOneShot, + Entries, + EntryDefault, + EntrySelected, + Features, + ImageIdentifier, Info, - //SystemToken, + SystemToken, } impl VariableName { /// Convert the variable into a static string representation for the EFI variable name fn as_str(&self) -> &'static str { match self { - //VariableName::TimeInitUSec => "LoaderTimeInitUSec", - //VariableName::TimeExecUSec => "LoaderTimeExecUSec", + VariableName::TimeInitUSec => "LoaderTimeInitUSec", + VariableName::TimeExecUSec => "LoaderTimeExecUSec", VariableName::DevicePartUUID => "LoaderDevicePartUUID", - //VariableName::ConfigTimeout => "LoaderConfigTimeout", - //VariableName::ConfigTimeoutOneShot => "LoaderConfigTimeoutOneShot", - //VariableName::Entries => "LoaderEntries", - //VariableName::EntryDefault => "LoaderEntryDefault", - //VariableName::EntrySelected => "LoaderEntrySelected", - //VariableName::Features => "LoaderFeatures", - //VariableName::ImageIdentifier => "LoaderImageIdentifier", + VariableName::ConfigTimeout => "LoaderConfigTimeout", + VariableName::ConfigTimeoutOneShot => "LoaderConfigTimeoutOneShot", + VariableName::Entries => "LoaderEntries", + VariableName::EntryDefault => "LoaderEntryDefault", + VariableName::EntrySelected => "LoaderEntrySelected", + VariableName::Features => "LoaderFeatures", + VariableName::ImageIdentifier => "LoaderImageIdentifier", VariableName::Info => "LoaderInfo", - //VariableName::SystemToken => "LoaderSystemToken", + VariableName::SystemToken => "LoaderSystemToken", } } } @@ -115,7 +115,7 @@ impl BootLoaderInterface { } /// Grab a UCS2 string from efivars - pub(crate) fn get_ucs2_string(&self, var: VariableName) -> Result { + pub fn get_ucs2_string(&self, var: VariableName) -> Result { let mut raw = fs::read(self.join_var(var))? .chunks(2) .skip(2)