From 84bd84b7d2e2b90bef2522271a26cfaddbf407bf Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Sat, 26 Sep 2026 18:19:29 -0700 Subject: [PATCH] fix(phases): run the late phase after the entry is chosen The late phase is documented to run after the entry is chosen but before its actions are executed, but it ran before the boot menu was shown. Run it after the entry is selected and reported to the bootloader interface, right before executing the entry's actions. --- crates/boot/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/boot/src/main.rs b/crates/boot/src/main.rs index 12a60e5..377eb0c 100644 --- a/crates/boot/src/main.rs +++ b/crates/boot/src/main.rs @@ -261,9 +261,6 @@ fn run() -> Result<()> { BootloaderInterface::set_entries(entries.iter().map(|entry| entry.name())) .context("unable to set entries in bootloader interface")?; - // Execute the late phase. - phase(context.clone(), &config.phases.late).context("unable to execute late phase")?; - // Acquire the timeout setting from the bootloader interface. let bootloader_interface_timeout = BootloaderInterface::get_timeout().context("unable to get bootloader interface timeout")?; @@ -355,6 +352,9 @@ fn run() -> Result<()> { BootloaderInterface::set_selected_entry(entry.name().to_string()) .context("unable to set selected entry in bootloader interface")?; + // Execute the late phase, now that the entry is chosen but before its actions are executed. + phase(context.clone(), &config.phases.late).context("unable to execute late phase")?; + // Execute all the actions for the selected entry. for action in &entry.declaration().actions { let action = entry.context().stamp(action);