From eaf2d21fa940a86ef7bc2b583850f725b86dc180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 23 Dec 2023 18:16:16 +0100 Subject: [PATCH] disable kexec-syscall-auto flag on old kernels --- nix/kexec-installer/kexec-run.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nix/kexec-installer/kexec-run.sh b/nix/kexec-installer/kexec-run.sh index 71b944b..afeed10 100644 --- a/nix/kexec-installer/kexec-run.sh +++ b/nix/kexec-installer/kexec-run.sh @@ -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"