From 3db198a018f694842f095febbda6a9d3562964cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 15 May 2023 11:15:15 +0200 Subject: [PATCH] kexec-installer: print dmesg if kexec --load fails In some cases dmesg contains interesting errors --- nix/kexec-installer/kexec-run.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nix/kexec-installer/kexec-run.sh b/nix/kexec-installer/kexec-run.sh index c56fb7c..09d9d33 100644 --- a/nix/kexec-installer/kexec-run.sh +++ b/nix/kexec-installer/kexec-run.sh @@ -53,9 +53,13 @@ done find . | cpio -o -H newc | gzip -9 >> "$SCRIPT_DIR/initrd" # Dropped --kexec-syscall-auto because it broke on GCP... -"$SCRIPT_DIR/kexec" --load "$SCRIPT_DIR/bzImage" \ +if ! "$SCRIPT_DIR/kexec" --load "$SCRIPT_DIR/bzImage" \ --initrd="$SCRIPT_DIR/initrd" --no-checks \ - --command-line "init=$init $kernelParams" + --command-line "init=$init $kernelParams"; then + echo "kexec failed, dumping dmesg" + dmesg | tail -n 100 + exit 1 +fi # Disconnect our background kexec from the terminal echo "machine will boot into nixos in in 6s..."