From b39436cbe263910bfb792e6f974339ffa4412716 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Sat, 26 Sep 2026 20:27:22 -0700 Subject: [PATCH] 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. --- crates/boot/src/menu.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/crates/boot/src/menu.rs b/crates/boot/src/menu.rs index 6043e26..1e1dab1 100644 --- a/crates/boot/src/menu.rs +++ b/crates/boot/src/menu.rs @@ -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) + }), + } }