summary refs log tree commit diff
path: root/nixos
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 /nixos
parent82624cbb9a5b4202d43c3b24222b6ff174bb75f1 (diff)
downloadnixlib-e0e520a5191542ba6b204f1226bf97299b85b286.tar
nixlib-e0e520a5191542ba6b204f1226bf97299b85b286.tar.gz
nixlib-e0e520a5191542ba6b204f1226bf97299b85b286.tar.bz2
nixlib-e0e520a5191542ba6b204f1226bf97299b85b286.tar.lz
nixlib-e0e520a5191542ba6b204f1226bf97299b85b286.tar.xz
nixlib-e0e520a5191542ba6b204f1226bf97299b85b286.tar.zst
nixlib-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.
Diffstat (limited to 'nixos')
-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 556454c6b5f8..a03c45bfeff0 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 | \