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