feat(boot): clear screen before boot handoff, if --retain-boot-console is not specified on the command-line (#51)

This commit is contained in:
alex authored and GitHub committed 2025-12-20 21:45:35 -08:00
1 parent fafabe234e
commit 2da457ee7c
3 files changed
+26 -1

No files matched your search

+10
View File
@@ -24,3 +24,13 @@ pub fn phase(context: Rc<SproutContext>, phase: &[PhaseConfiguration]) -> Result
}
Ok(())
}
/// Manual hook called by code in the bootloader that hands off to another image.
/// This is used to perform actions like clearing the screen.
pub fn before_handoff(context: &SproutContext) -> Result<()> {
// If we have not been asked to retain the boot console, then we should clear the screen.
if !context.root().options().retain_boot_console {
uefi::system::with_stdout(|stdout| stdout.reset(true)).context("unable to clear screen")?;
}
Ok(())
}