mirror of
https://github.com/edera-dev/sprout.git
synced 2026-02-04 07:10:18 +00:00
fix(boot): on boot handoff, clear the screen using clear rather than reset (#52)
On some Dell firmware, the reset operation doesn't actually clear the screen. This change uses clear instead of reset to ensure the screen is properly cleared.
This commit is contained in:
@@ -30,7 +30,12 @@ pub fn phase(context: Rc<SproutContext>, phase: &[PhaseConfiguration]) -> Result
|
|||||||
pub fn before_handoff(context: &SproutContext) -> Result<()> {
|
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 we have not been asked to retain the boot console, then we should clear the screen.
|
||||||
if !context.root().options().retain_boot_console {
|
if !context.root().options().retain_boot_console {
|
||||||
uefi::system::with_stdout(|stdout| stdout.reset(true)).context("unable to clear screen")?;
|
// Clear the screen. We use clear here instead of reset because some firmware,
|
||||||
|
// particularly Dell firmware, does not clear the screen on reset.
|
||||||
|
// We clear both stdout and stderr because it's not guaranteed that they are the same
|
||||||
|
// text output.
|
||||||
|
uefi::system::with_stdout(|stdout| stdout.clear()).context("unable to clear screen")?;
|
||||||
|
uefi::system::with_stderr(|stderr| stderr.clear()).context("unable to clear screen")?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user