mirror of
https://github.com/edera-dev/sprout.git
synced 2026-11-05 03:22:22 +00:00
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:
1 parent
5c517473e3
commit
eac6215a76
5 files changed
+210
-77
No files matched your search
@@ -1,5 +1,6 @@
|
||||
use crate::boot_counter::BootCounterTarget;
|
||||
use crate::context::SproutContext;
|
||||
use alloc::format;
|
||||
use alloc::rc::Rc;
|
||||
use alloc::string::{String, ToString};
|
||||
use edera_sprout_config::entries::EntryDeclaration;
|
||||
@@ -132,6 +133,13 @@ impl BootableEntry {
|
||||
glob_match(needle, &self.name) || glob_match(needle, &self.title)
|
||||
}
|
||||
|
||||
/// Determine if this entry matches `needle` by comparing to the id of the entry, which is
|
||||
/// the name with or without the `.conf` suffix. This is how loader.conf selects entries.
|
||||
/// The `needle` is a glob pattern, where `*` matches any sequence of characters.
|
||||
pub fn is_match_id(&self, needle: &str) -> bool {
|
||||
glob_match(needle, &self.name) || glob_match(needle, &format!("{}.conf", self.name))
|
||||
}
|
||||
|
||||
/// Create a variant of this entry, with the name suffixed by `suffix` and using `context`.
|
||||
/// The actions of the entry are stamped with `context`, the same as the list generator.
|
||||
/// Variants of the same entry keep the sort key of this entry, so they stay grouped
|
||||
|
||||
Reference in new issue
Block a user