From 685bbb233984a6ac9fba83353d0efc0f0212a4de Mon Sep 17 00:00:00 2001 From: phaer Date: Tue, 10 Dec 2024 10:56:47 +0100 Subject: [PATCH] Don't use sudo when uploading extraFiles There seems to be no scenario where we aren't root on the target system at this point. But there is one where it breaks: If hasSudo is true because the pre-kexec env had it, but kexec env does not. See https://github.com/nix-community/nixos-anywhere/issues/431 --- src/nixos-anywhere.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nixos-anywhere.sh b/src/nixos-anywhere.sh index 15049748..bc9a268e 100755 --- a/src/nixos-anywhere.sh +++ b/src/nixos-anywhere.sh @@ -577,7 +577,7 @@ nixosInstall() { if [[ -n ${extraFiles} ]]; then step Copying extra files - tar -C "$extraFiles" -cpf- . | runSsh "${maybeSudo} tar -C /mnt -xf- --no-same-owner" + tar -C "$extraFiles" -cpf- . | runSsh "tar -C /mnt -xf- --no-same-owner" runSsh "chmod 755 /mnt" # tar also changes permissions of /mnt fi