mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 15:40:16 +00:00
fix(variables): set bool should have variable class parameter
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
use crate::integrations::shim::hook::SecurityHook;
|
use crate::integrations::shim::hook::SecurityHook;
|
||||||
use crate::utils;
|
use crate::utils;
|
||||||
use crate::utils::ResolvedPath;
|
use crate::utils::ResolvedPath;
|
||||||
use crate::utils::variables::VariableController;
|
use crate::utils::variables::{VariableClass, VariableController};
|
||||||
use anyhow::{Context, Result, anyhow, bail};
|
use anyhow::{Context, Result, anyhow, bail};
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
@@ -282,7 +282,11 @@ impl ShimSupport {
|
|||||||
/// for the full lifetime of boot services.
|
/// for the full lifetime of boot services.
|
||||||
pub fn retain() -> Result<()> {
|
pub fn retain() -> Result<()> {
|
||||||
Self::SHIM_LOCK_VARIABLES
|
Self::SHIM_LOCK_VARIABLES
|
||||||
.set_bool("ShimRetainProtocol", true)
|
.set_bool(
|
||||||
|
"ShimRetainProtocol",
|
||||||
|
true,
|
||||||
|
VariableClass::BootAndRuntimeTemporary,
|
||||||
|
)
|
||||||
.context("unable to retain shim protocol")?;
|
.context("unable to retain shim protocol")?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ impl VariableController {
|
|||||||
|
|
||||||
/// Set a boolean variable specified by `key` to `value`, converting the value.
|
/// Set a boolean variable specified by `key` to `value`, converting the value.
|
||||||
/// The variable `class` controls the attributes for the variable.
|
/// The variable `class` controls the attributes for the variable.
|
||||||
pub fn set_bool(&self, key: &str, value: bool) -> Result<()> {
|
pub fn set_bool(&self, key: &str, value: bool, class: VariableClass) -> Result<()> {
|
||||||
self.set(key, &[value as u8], VariableClass::BootAndRuntimeTemporary)
|
self.set(key, &[value as u8], class)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user