From 5a03989036ac206fd7e77784cb76face69a86733 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 21 Oct 2011 23:39:05 +0000 Subject: [PATCH] * Fix Amazon image generation (there is no $ORIG_TMPDIR in runInLinuxVM anymore; use /tmp/xchg instead). svn path=/nixos/trunk/; revision=29970 --- modules/virtualisation/amazon-image.nix | 8 +++++--- modules/virtualisation/nova-image.nix | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/virtualisation/amazon-image.nix b/modules/virtualisation/amazon-image.nix index c7b3184b17e..66474158c68 100644 --- a/modules/virtualisation/amazon-image.nix +++ b/modules/virtualisation/amazon-image.nix @@ -13,6 +13,7 @@ with pkgs.lib; 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 @@ with pkgs.lib; 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. diff --git a/modules/virtualisation/nova-image.nix b/modules/virtualisation/nova-image.nix index 96b637b3019..1e891c35dc0 100644 --- a/modules/virtualisation/nova-image.nix +++ b/modules/virtualisation/nova-image.nix @@ -13,6 +13,7 @@ with pkgs.lib; 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 @@ with pkgs.lib; 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.