@@ -593,9 +593,6 @@ importFacts() {
593
593
done
594
594
set -u
595
595
596
- # Compute the log file path from the home directory
597
- remoteLogFile=" ${remoteHomeDir} /.nixos-anywhere.log"
598
-
599
596
if [[ -n ${enableDebug} ]]; then
600
597
set -x
601
598
fi
@@ -722,10 +719,6 @@ runKexec() {
722
719
kexecUrl=${kexecUrl/ " github.com" / " gh-v6.com" }
723
720
fi
724
721
725
- if [[ -z $remoteLogFile ]]; then
726
- abort " Could not create a temporary log file for $sshUser "
727
- fi
728
-
729
722
# Handle kexec operation failures
730
723
handleKexecFailure () {
731
724
local operation=$1
@@ -734,7 +727,7 @@ runKexec() {
734
727
local logContent=" "
735
728
if logContent=$(
736
729
set +x
737
- runSsh " cat \" $remoteLogFile \" 2>/dev/null" 2> /dev/null
730
+ runSsh " cat \" $remoteHomeDir /kexec/nixos-anywhere.log \" 2>/dev/null" 2> /dev/null
738
731
) ; then
739
732
echo " Remote output log:" >&2
740
733
echo " $logContent " >&2
@@ -761,10 +754,10 @@ runKexec() {
761
754
# Execute tar command
762
755
%TAR_COMMAND%
763
756
TMPDIR=\" $remoteHomeDir /kexec\" ${maybeSudo} setsid --wait \" $remoteHomeDir /kexec/kexec/run\" --kexec-extra-flags $( printf ' %q' " $kexecExtraFlags " )
764
- } 2>&1 | tee \" $remoteLogFile \" || true
757
+ } 2>&1 | tee \" $remoteHomeDir /kexec/nixos-anywhere.log \" || true
765
758
766
759
# The script will likely disconnect us, so we consider it successful if we see the kexec message
767
- if ! grep -q 'machine will boot into nixos' \" $remoteLogFile \" ; then
760
+ if ! grep -q 'machine will boot into nixos' \" $remoteHomeDir /kexec/nixos-anywhere.log \" ; then
768
761
echo 'Kexec may have failed - check output above'
769
762
exit 1
770
763
fi
0 commit comments