Skip to content

Commit

Permalink
disable kexec-syscall-auto flag on old kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 authored and mergify[bot] committed Dec 23, 2023
1 parent 1d92ed3 commit eaf2d21
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nix/kexec-installer/kexec-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,15 @@ done

find . | cpio -o -H newc | gzip -9 >> "$SCRIPT_DIR/initrd"

kexecSyscallFlags=""
# only do kexec-syscall-auto on kernels newer than 6.0.
# On older kernel we often get errors like: https://github.com/nix-community/nixos-anywhere/issues/264
if ! printf "%s\n" "6.1" "$(uname -r)" | sort -c -V; then
kexecSyscallFlags="--kexec-syscall-auto"
fi

if ! "$SCRIPT_DIR/kexec" --load "$SCRIPT_DIR/bzImage" \
--kexec-syscall-auto \
"$kexecSyscallFlags" \
--initrd="$SCRIPT_DIR/initrd" --no-checks \
--command-line "init=$init $kernelParams"; then
echo "kexec failed, dumping dmesg"
Expand Down

0 comments on commit eaf2d21

Please sign in to comment.