Author: eelco
Date: Fri Oct 21 23:39:05 2011
New Revision: 29970
URL: https://nixos.org/websvn/nix/?rev=29970&sc=1

Log:
* Fix Amazon image generation (there is no $ORIG_TMPDIR in
  runInLinuxVM anymore; use /tmp/xchg instead).

Modified:
   nixos/trunk/modules/virtualisation/amazon-image.nix
   nixos/trunk/modules/virtualisation/nova-image.nix

Modified: nixos/trunk/modules/virtualisation/amazon-image.nix
==============================================================================
--- nixos/trunk/modules/virtualisation/amazon-image.nix Fri Oct 21 23:36:48 
2011        (r29969)
+++ nixos/trunk/modules/virtualisation/amazon-image.nix Fri Oct 21 23:39:05 
2011        (r29970)
@@ -13,6 +13,7 @@
               mkdir $out
               diskImage=$out/nixos.img
               ${pkgs.vmTools.kvm}/bin/qemu-img create -f raw $diskImage "4G"
+              mv closure xchg/
             '';
           buildInputs = [ pkgs.utillinux pkgs.perl ];
           exportReferencesGraph =
@@ -31,13 +32,14 @@
           mount -o bind /proc /mnt/proc
 
           # Copy all paths in the closure to the filesystem.
-          storePaths=$(perl ${pkgs.pathsFromGraph} $ORIG_TMPDIR/closure)
+          storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
 
           mkdir -p /mnt/nix/store
-          cp -prvd $storePaths /mnt/nix/store/
+          echo "copying everything (will take a while)..."
+          cp -prd $storePaths /mnt/nix/store/
 
           # Register the paths in the Nix database.
-          printRegistration=1 perl ${pkgs.pathsFromGraph} $ORIG_TMPDIR/closure 
| \
+          printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
               chroot /mnt ${config.environment.nix}/bin/nix-store --load-db
 
           # Create the system profile to allow nixos-rebuild to work.

Modified: nixos/trunk/modules/virtualisation/nova-image.nix
==============================================================================
--- nixos/trunk/modules/virtualisation/nova-image.nix   Fri Oct 21 23:36:48 
2011        (r29969)
+++ nixos/trunk/modules/virtualisation/nova-image.nix   Fri Oct 21 23:39:05 
2011        (r29970)
@@ -13,6 +13,7 @@
               mkdir $out
               diskImage=$out/image
               ${pkgs.vmTools.kvm}/bin/qemu-img create -f raw $diskImage "4G"
+              mv closure xchg/
             '';
           buildInputs = [ pkgs.utillinux pkgs.perl ];
           exportReferencesGraph =
@@ -38,13 +39,13 @@
           mount --bind /sys /mnt/sys
 
           # Copy all paths in the closure to the filesystem.
-          storePaths=$(perl ${pkgs.pathsFromGraph} $ORIG_TMPDIR/closure)
+          storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
 
           mkdir -p /mnt/nix/store
           ${pkgs.rsync}/bin/rsync -av $storePaths /mnt/nix/store/
 
           # Register the paths in the Nix database.
-          printRegistration=1 perl ${pkgs.pathsFromGraph} $ORIG_TMPDIR/closure 
| \
+          printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
               chroot /mnt ${config.environment.nix}/bin/nix-store --load-db
 
           # Create the system profile to allow nixos-rebuild to work.
_______________________________________________
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to