Merge pull request #13114 from colemickens/azure

azure: package qemu 2.2.0 to fix VHD creation
This commit is contained in:
zimbatm 2016-02-23 22:47:44 +00:00
commit cfa99e5a99
3 changed files with 25 additions and 2 deletions

View file

@ -16,14 +16,14 @@ in
cyl=$(((${diskSize}*1024*1024)/(512*63*255))) cyl=$(((${diskSize}*1024*1024)/(512*63*255)))
size=$(($cyl*255*63*512)) size=$(($cyl*255*63*512))
roundedsize=$((($size/(1024*1024)+1)*(1024*1024))) roundedsize=$((($size/(1024*1024)+1)*(1024*1024)))
${pkgs.vmTools.qemu}/bin/qemu-img create -f raw $diskImage $roundedsize ${pkgs.vmTools.qemu-220}/bin/qemu-img create -f raw $diskImage $roundedsize
mv closure xchg/ mv closure xchg/
''; '';
postVM = postVM =
'' ''
mkdir -p $out mkdir -p $out
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -O vpc -o subformat=fixed $diskImage $out/disk.vhd ${pkgs.vmTools.qemu-220}/bin/qemu-img convert -f raw -O vpc -o subformat=fixed $diskImage $out/disk.vhd
rm $diskImage rm $diskImage
''; '';
diskImageBase = "nixos-image-${config.system.nixosLabel}-${pkgs.stdenv.system}.raw"; diskImageBase = "nixos-image-${config.system.nixosLabel}-${pkgs.stdenv.system}.raw";

View file

@ -0,0 +1,14 @@
diff --git a/Makefile b/Makefile
index d6b9dc1..ce7c493 100644
--- a/Makefile
+++ b/Makefile
@@ -384,8 +384,7 @@ install-confdir:
install-sysconfig: install-datadir install-confdir
$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
-install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig \
-install-datadir install-localstatedir
+install: all $(if $(BUILD_DOCS),install-doc) install-datadir
ifneq ($(TOOLS),)
$(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
endif

View file

@ -11,6 +11,15 @@ rec {
qemu = pkgs.qemu_kvm; qemu = pkgs.qemu_kvm;
qemu-220 = lib.overrideDerivation pkgs.qemu_kvm (attrs: rec {
version = "2.2.0";
src = fetchurl {
url = "http://wiki.qemu.org/download/qemu-${version}.tar.bz2";
sha256 = "1703c3scl5n07gmpilg7g2xzyxnr7jczxgx6nn4m8kv9gin9p35n";
};
patches = [ ../../../nixos/modules/virtualisation/azure-qemu-220-no-etc-install.patch ];
});
qemuProg = "${qemu}/bin/qemu-kvm"; qemuProg = "${qemu}/bin/qemu-kvm";