summary refs log tree commit diff
diff options
context:
space:
mode:
authorc74d <8573dd@gmail.com>2017-03-24 00:52:56 +0000
committerRobin Gloster <mail@glob.in>2017-03-24 02:14:10 +0100
commite0e520a5191542ba6b204f1226bf97299b85b286 (patch)
tree740bccd8d4af8f42b6417c93715452bf14599c10
parent82624cbb9a5b4202d43c3b24222b6ff174bb75f1 (diff)
downloadnixpkgs-e0e520a5191542ba6b204f1226bf97299b85b286.tar
nixpkgs-e0e520a5191542ba6b204f1226bf97299b85b286.tar.gz
nixpkgs-e0e520a5191542ba6b204f1226bf97299b85b286.tar.bz2
nixpkgs-e0e520a5191542ba6b204f1226bf97299b85b286.tar.lz
nixpkgs-e0e520a5191542ba6b204f1226bf97299b85b286.tar.xz
nixpkgs-e0e520a5191542ba6b204f1226bf97299b85b286.tar.zst
nixpkgs-e0e520a5191542ba6b204f1226bf97299b85b286.zip
google-compute-image: copy store paths with rsync
In `nixos/modules/virtualisation/google-compute-image.nix`, copy store
paths with `rsync -a` rather than `cp -prd`, because `rsync` seems
better able to handle the hard-links that may be present in the store,
whereas `cp` may fail to copy them.

I have tested that the Google Compute Engine image builds successfully
for me with this patch, whereas it did not without this patch.

This is the same fix applied for Azure images in commit
097ef6e435d5b3fcde92e67abbaaaaaf05c0723d.

Fixes #23973.
-rw-r--r--nixos/modules/virtualisation/google-compute-image.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix
index 556454c6b5f..a03c45bfeff 100644
--- a/nixos/modules/virtualisation/google-compute-image.nix
+++ b/nixos/modules/virtualisation/google-compute-image.nix
@@ -62,7 +62,7 @@ in
 
           mkdir -p /mnt/nix/store
           echo "copying everything (will take a while)..."
-          cp -prd $storePaths /mnt/nix/store/
+          ${pkgs.rsync}/bin/rsync -a $storePaths /mnt/nix/store/
 
           # Register the paths in the Nix database.
           printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \