mirror of
https://github.com/edera-dev/sprout.git
synced 2026-11-05 04:22:20 +00:00
feat(boot): clear screen before boot handoff, if --retain-boot-console is not specified on the command-line (#51)
This commit is contained in:
3 files changed
+26
-1
No files matched your search
@@ -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(())
|
||||
}
|
||||
Reference in new issue
Block a user