From 35d21dc6af2c4a52431cc9c7116ed8021a58b8b0 Mon Sep 17 00:00:00 2001 From: Zach Dykstra Date: Mon, 2 Feb 2026 09:54:37 -0600 Subject: [PATCH] zfsbootmenu-core: try to kexec twice On some Lenovo x13s models, kexec fails the first time. A subsequent attempt is successful. --- zfsbootmenu/lib/zfsbootmenu-core.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/zfsbootmenu/lib/zfsbootmenu-core.sh b/zfsbootmenu/lib/zfsbootmenu-core.sh index 05539ac..2a2c954 100644 --- a/zfsbootmenu/lib/zfsbootmenu-core.sh +++ b/zfsbootmenu/lib/zfsbootmenu-core.sh @@ -456,13 +456,15 @@ kexec_kernel() { echo -e "\nBooting $( colorize yellow "${kernel}" ) for $( colorize cyan "${fs}" ) ...\n" - if ! output="$( kexec -e -i 2>&1 )"; then - zerror "kexec -e -i failed!" - zerror "${output}" - timed_prompt -d 10 \ - -m "$( colorize red "kexec run of ${kernel} failed!" )" - return 1 - fi + # Try to kexec twice, the first attempt can fail intermittently + output="$( kexec -e -i 2>&1 )" + output="$( kexec -e -i 2>&1 )" + + # If we ever reach this, it means our kexec failed + zerror "kexec -e -i failed!" + zerror "${output}" + timed_prompt -d 10 -m "$( colorize red "kexec run of ${kernel} failed!" )" + return 1 } # arg1: snapshot name