diff --git a/nixos/modules/installer/kexec/kexec-boot.nix b/nixos/modules/installer/kexec/kexec-boot.nix index c2f1a64a36a0..95ab774468c1 100644 --- a/nixos/modules/installer/kexec/kexec-boot.nix +++ b/nixos/modules/installer/kexec/kexec-boot.nix @@ -27,8 +27,9 @@ echo "kexec not found: please install kexec-tools" 2>&1 exit 1 fi - kexec --load ./bzImage \ - --initrd=./initrd.gz \ + SCRIPT_DIR=$( cd -- "$( dirname -- "''${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + kexec --load ''${SCRIPT_DIR}/bzImage \ + --initrd=''${SCRIPT_DIR}/initrd.gz \ --command-line "init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" kexec -e ''; in