* Fix Amazon image generation (there is no $ORIG_TMPDIR in

runInLinuxVM anymore; use /tmp/xchg instead).

svn path=/nixos/trunk/; revision=29970
This commit is contained in:
Eelco Dolstra 2011-10-21 23:39:05 +00:00
parent 9076456b15
commit 5a03989036
2 changed files with 8 additions and 5 deletions

View file

@ -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.

View file

@ -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.