feat(boot): use loader.conf, @saved and the boot count path

Read \loader\loader.conf from the partition Sprout was loaded from and
use its default and timeout as the lowest priority source. Sprout now
picks the timeout in this order: LoaderConfigTimeoutOneShot,
--menu-timeout, the configuration, LoaderConfigTimeout, loader.conf. The
default entry order is the configuration, LoaderEntryDefault, loader.conf,
and a source that matches no entry falls through to the next one.

To tell an explicit menu-timeout from the built-in default, the
configuration option is now optional. Existing files are unaffected.

A loader.conf default of @saved selects the entry in
LoaderEntryLastBooted and saves the booted entry there on every boot.

After consuming a boot counter try, publish the renamed entry file in
LoaderBootCountPath and advertise the boot counting and saved entry
features.
This commit is contained in:
alex authored and Alex Zenla committed 2026-10-03 17:39:38 -07:00
1 parent 5c517473e3
commit eac6215a76
5 files changed
+210 -77

No files matched your search

+7
View File
@@ -14,6 +14,8 @@ use uefi_raw::table::runtime::{VariableAttributes, VariableVendor};
pub enum VariableClass {
/// The variable is available in Boot Services and Runtime Services and is not persistent.
BootAndRuntimeTemporary,
/// The variable is available in Boot Services and Runtime Services and is persistent.
BootAndRuntimePersistent,
}
impl VariableClass {
@@ -23,6 +25,11 @@ impl VariableClass {
VariableClass::BootAndRuntimeTemporary => {
VariableAttributes::BOOTSERVICE_ACCESS | VariableAttributes::RUNTIME_ACCESS
}
VariableClass::BootAndRuntimePersistent => {
VariableAttributes::BOOTSERVICE_ACCESS
| VariableAttributes::RUNTIME_ACCESS
| VariableAttributes::NON_VOLATILE
}
}
}
}