fix(menu): fall back to the basic menu if the simple menu fails

The simple menu failed, and boot was aborted, when the console couldn't
set the cursor position or colors or clear the screen, which some
serial consoles and minimal console drivers don't support. Use the
basic menu, which only prints text, when the simple menu fails.
This commit is contained in:
alex authored and Alex Zenla committed 2026-09-26 20:52:15 -07:00
1 parent 5fd2dbb4a7
commit b39436cbe2
1 file changed
+12 -5
+12 -5
View File
@@ -126,10 +126,17 @@ pub fn select<'live>(
}
// Pick the menu that implements the requested style.
let menu: &dyn BootMenu = match style {
MenuStyle::Basic => &BasicMenu,
MenuStyle::Simple => &SimpleMenu,
};
match style {
MenuStyle::Basic => BasicMenu.select(timeout, entries),
menu.select(timeout, entries)
// The simple menu needs a console that can move the cursor and set colors, which
// not every console supports. If it fails, the basic menu is used instead.
MenuStyle::Simple => SimpleMenu.select(timeout, entries).or_else(|error| {
warn!(
"unable to show the simple boot menu, using the basic menu: {:#}",
error
);
BasicMenu.select(timeout, entries)
}),
}
}