* Use qcow2.
svn path=/nixpkgs/trunk/; revision=14296
This commit is contained in:
parent
45081f330d
commit
84a0bd9c83
@ -217,8 +217,8 @@ rec {
|
|||||||
|
|
||||||
createEmptyImage = {size, fullName}: ''
|
createEmptyImage = {size, fullName}: ''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
diskImage=$out/image
|
diskImage=$out/disk-image.qcow2
|
||||||
qemu-img create -f qcow $diskImage "${toString size}M"
|
qemu-img create -f qcow2 $diskImage "${toString size}M"
|
||||||
|
|
||||||
mkdir $out/nix-support
|
mkdir $out/nix-support
|
||||||
echo "${fullName}" > $out/nix-support/full-name
|
echo "${fullName}" > $out/nix-support/full-name
|
||||||
@ -312,10 +312,10 @@ rec {
|
|||||||
QEMU_OPTS = "-m ${toString (if attrs ? memSize then attrs.memSize else 256)}";
|
QEMU_OPTS = "-m ${toString (if attrs ? memSize then attrs.memSize else 256)}";
|
||||||
|
|
||||||
preVM = ''
|
preVM = ''
|
||||||
diskImage=$(pwd)/image
|
diskImage=$(pwd)/disk-image.qcow2
|
||||||
origImage=${attrs.diskImage}
|
origImage=${attrs.diskImage}
|
||||||
if test -d "$origImage"; then origImage="$origImage/image"; fi
|
if test -d "$origImage"; then origImage="$origImage/disk-image.qcow2"; fi
|
||||||
qemu-img create -b "$origImage" -f qcow $diskImage
|
qemu-img create -b "$origImage" -f qcow2 $diskImage
|
||||||
|
|
||||||
echo "$buildCommand" > cmd
|
echo "$buildCommand" > cmd
|
||||||
|
|
||||||
@ -339,10 +339,10 @@ rec {
|
|||||||
/* Mount `image' as the root FS, but use a temporary copy-on-write
|
/* Mount `image' as the root FS, but use a temporary copy-on-write
|
||||||
image since we don't want to (and can't) write to `image'. */
|
image since we don't want to (and can't) write to `image'. */
|
||||||
preVM = ''
|
preVM = ''
|
||||||
diskImage=$(pwd)/image
|
diskImage=$(pwd)/disk-image.qcow2
|
||||||
origImage=${attrs.diskImage}
|
origImage=${attrs.diskImage}
|
||||||
if test -d "$origImage"; then origImage="$origImage/image"; fi
|
if test -d "$origImage"; then origImage="$origImage/disk-image.qcow2"; fi
|
||||||
qemu-img create -b "$origImage" -f qcow $diskImage
|
qemu-img create -b "$origImage" -f qcow2 $diskImage
|
||||||
'';
|
'';
|
||||||
|
|
||||||
/* Inside the VM, run the stdenv setup script normally, but at the
|
/* Inside the VM, run the stdenv setup script normally, but at the
|
||||||
@ -423,7 +423,7 @@ rec {
|
|||||||
fi
|
fi
|
||||||
diskImage="$1"
|
diskImage="$1"
|
||||||
if ! test -e "$diskImage"; then
|
if ! test -e "$diskImage"; then
|
||||||
qemu-img create -b ${image}/image -f qcow "$diskImage"
|
qemu-img create -b ${image}/disk-image.qcow2 -f qcow2 "$diskImage"
|
||||||
fi
|
fi
|
||||||
export TMPDIR=$(mktemp -d)
|
export TMPDIR=$(mktemp -d)
|
||||||
export out=/dummy
|
export out=/dummy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user