mirror of
https://github.com/edera-dev/sprout.git
synced 2026-11-04 19:02:20 +00:00
fix(boot): load loader.conf before one-shot variables and normalize the boot count path
This commit is contained in:
1 parent
2c18f229c0
commit
7d913b3ab4
3 files changed
+45
-11
No files matched your search
+7
-10
@@ -333,6 +333,12 @@ fn run() -> Result<()> {
|
||||
.context("unable to set entries in bootloader interface"),
|
||||
);
|
||||
|
||||
// Load the loader.conf of the partition Sprout was loaded from.
|
||||
let loader_conf = load_loader_conf(&context).context("unable to load loader.conf")?;
|
||||
for warning in &loader_conf.warnings {
|
||||
warn!("{}", warning);
|
||||
}
|
||||
|
||||
// Acquire the timeouts from the bootloader interface.
|
||||
let bootloader_interface_timeouts = advisory(
|
||||
BootloaderInterface::get_timeouts().context("unable to get bootloader interface timeouts"),
|
||||
@@ -350,12 +356,6 @@ fn run() -> Result<()> {
|
||||
.context("unable to get bootloader interface oneshot entry"),
|
||||
);
|
||||
|
||||
// Load the loader.conf of the partition Sprout was loaded from.
|
||||
let loader_conf = load_loader_conf(&context).context("unable to load loader.conf")?;
|
||||
for warning in &loader_conf.warnings {
|
||||
warn!("{}", warning);
|
||||
}
|
||||
|
||||
// If --boot is specified, boot that entry immediately.
|
||||
let mut force_boot_entry = context.root().options().boot.clone();
|
||||
// If --force-menu is specified, show the boot menu regardless of the value of --boot.
|
||||
@@ -576,10 +576,7 @@ fn run() -> Result<()> {
|
||||
Ok(path) => {
|
||||
info!("updated boot counter of entry {}: {}", entry.name(), path);
|
||||
// Tell the system where the counter is, so it can mark the boot as good.
|
||||
let path = format!(
|
||||
"/{}",
|
||||
path.to_string().replace('\\', "/").trim_start_matches('/')
|
||||
);
|
||||
let path = edera_sprout_bls::boot_path(&path.to_string());
|
||||
advisory(
|
||||
BootloaderInterface::set_boot_count_path(&path)
|
||||
.context("unable to set boot count path in bootloader interface"),
|
||||
|
||||
Reference in new issue
Block a user