From df5d8f5c3936528689095e45d98a9a0c7ee3ddfc Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Sat, 26 Sep 2026 18:12:35 -0700 Subject: [PATCH] fix(bootloader-interface): ignore invalid timeout values A LoaderConfigTimeout or LoaderConfigTimeoutOneShot value that is not a number or a known keyword made Sprout abort boot. Log a warning and treat the variable as unset instead, matching systemd-boot. --- crates/eficore/src/bootloader_interface.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/eficore/src/bootloader_interface.rs b/crates/eficore/src/bootloader_interface.rs index 1edfa5a..87c6d01 100644 --- a/crates/eficore/src/bootloader_interface.rs +++ b/crates/eficore/src/bootloader_interface.rs @@ -5,6 +5,7 @@ use alloc::format; use alloc::string::{String, ToString}; use alloc::vec::Vec; use anyhow::{Context, Result}; +use log::warn; use uefi::proto::device_path::DevicePath; use uefi::{Guid, guid}; use uefi_raw::table::runtime::VariableVendor; @@ -245,9 +246,14 @@ impl BootloaderInterface { } // Parse the value as a u64 to decode an numeric value. - let value = value - .parse::() - .context("unable to parse timeout value")?; + // An invalid value is ignored, as a bad variable should not prevent booting. + let value = match value.parse::() { + Ok(value) => value, + Err(error) => { + warn!("ignoring invalid {} value '{}': {}", key, value, error); + return Ok(None); + } + }; // The specification says that a value of 0 means that the menu should be hidden. if value == 0 {