From 91b85236d0651983b2d2162623309f497cc0f225 Mon Sep 17 00:00:00 2001 From: Thomas Strobel Date: Thu, 2 Jul 2015 16:38:17 +0200 Subject: [PATCH] Virtualization: add XEN/KVM related drivers for Windows --- .../driver/win-pvdrivers/default.nix | 30 ++++++++ .../driver/win-qemu/default.nix | 38 ++++++++++ .../win-signed-gplpv-drivers/default.nix | 46 +++++++++++++ .../driver/win-spice/default.nix | 69 +++++++++++++++++++ .../driver/win-virtio/default.nix | 37 ++++++++++ pkgs/top-level/all-packages.nix | 6 ++ 6 files changed, 226 insertions(+) create mode 100644 pkgs/applications/virtualization/driver/win-pvdrivers/default.nix create mode 100644 pkgs/applications/virtualization/driver/win-qemu/default.nix create mode 100644 pkgs/applications/virtualization/driver/win-signed-gplpv-drivers/default.nix create mode 100644 pkgs/applications/virtualization/driver/win-spice/default.nix create mode 100644 pkgs/applications/virtualization/driver/win-virtio/default.nix diff --git a/pkgs/applications/virtualization/driver/win-pvdrivers/default.nix b/pkgs/applications/virtualization/driver/win-pvdrivers/default.nix new file mode 100644 index 000000000000..faa1076e2998 --- /dev/null +++ b/pkgs/applications/virtualization/driver/win-pvdrivers/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchgit }: + +stdenv.mkDerivation { + name = "win-pvdrivers-git-20150701"; + version = "20150701"; + + src = fetchgit { + url = "https://github.com/ts468/win-pvdrivers"; + rev = "3054d645fc3ee182bea3e97ff01869f01cc3637a"; + sha256 = "6232ca2b7c9af874abbcb9262faf2c74c819727ed2eb64599c790879df535106"; + }; + + buildPhase = + let unpack = x: "tar xf $src/${x}.tar; mkdir -p x86/${x} amd64/${x}; cp ${x}/x86/* x86/${x}/.; cp ${x}/x64/* amd64/${x}/."; + in stdenv.lib.concatStringsSep "\n" (map unpack ["xenbus" "xeniface" "xenvif" "xennet" "xenvbd"]); + + installPhase = '' + mkdir -p $out + cp -r x86 $out/. + cp -r amd64 $out/. + ''; + + meta = with stdenv.lib; { + description = "Xen Subproject: Windows PV Driver"; + homepage = "http://xenproject.org/downloads/windows-pv-drivers.html"; + maintainers = [ maintainers.tstrobel ]; + platforms = platforms.linux; + license = licenses.bsd3; + }; +} diff --git a/pkgs/applications/virtualization/driver/win-qemu/default.nix b/pkgs/applications/virtualization/driver/win-qemu/default.nix new file mode 100644 index 000000000000..97a1f0b3039b --- /dev/null +++ b/pkgs/applications/virtualization/driver/win-qemu/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchurl, p7zip }: + +stdenv.mkDerivation { + name = "win-qemu-0.1.105-1"; + version = "0.1.105-1"; + + phases = [ "buildPhase" "installPhase" ]; + + src = fetchurl { + url = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.105-1/virtio-win.iso"; + sha256 = "065gz7s77y0q9kfqbr27451sr28rm9azpi88sqjkfph8c6r8q3wc"; + }; + + buildPhase = '' + ${p7zip}/bin/7z x $src + ''; + + installPhase = + let + copy_pvpanic = arch: version: "mkdir -p $out/${arch}/qemupanic; cp pvpanic/${version}/${arch}/* $out/${arch}/qemupanic/. \n"; + copy_pciserial = arch: "mkdir -p $out/${arch}/qemupciserial; cp qemupciserial/* $out/${arch}/qemupciserial/. \n"; + copy_agent = arch: '' + mkdir -p $out/${arch}/qemuagent + cp guest-agent/${if arch=="x86" then "qemu-ga-x86.msi" else "qemu-ga-x64.msi"} $out/${arch}/qemuagent/qemu-guest-agent.msi + (cd $out/${arch}/qemuagent; ${p7zip}/bin/7z x qemu-guest-agent.msi; rm qemu-guest-agent.msi) + ''; + copy = arch: version: (copy_pvpanic arch version) + (copy_pciserial arch) + (copy_agent arch); + in + (copy "amd64" "w8.1") + (copy "x86" "w8.1"); + + meta = with stdenv.lib; { + description = "Windows QEMU Drivers"; + homepage = "https://fedoraproject.org/wiki/Windows_Virtio_Drivers"; + maintainers = [ maintainers.tstrobel ]; + platforms = platforms.linux; + license = licenses.gpl2; + }; +} diff --git a/pkgs/applications/virtualization/driver/win-signed-gplpv-drivers/default.nix b/pkgs/applications/virtualization/driver/win-signed-gplpv-drivers/default.nix new file mode 100644 index 000000000000..c4684a20914f --- /dev/null +++ b/pkgs/applications/virtualization/driver/win-signed-gplpv-drivers/default.nix @@ -0,0 +1,46 @@ +{ stdenv, fetchurl, p7zip }: + +let + src_x86 = fetchurl { + url = "http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x32_signed_0.11.0.373.msi"; + sha256 = "04r11xw8ikjmcdhrsk878c86g0d0pvras5arsas3zs6dhgjykqap"; + }; + + src_amd64 = fetchurl { + url = "http://apt.univention.de/download/addons/gplpv-drivers/gplpv_Vista2008x64_signed_0.11.0.373.msi"; + sha256 = "00k628mg9b039p8lmg2l9n81dr15svy70p3m6xmq6f0frmci38ph"; + }; +in + +stdenv.mkDerivation { + name = "gplpv-0.11.0.373"; + version = "0.11.0.373"; + + phases = [ "buildPhase" "installPhase" ]; + + buildPhase = '' + mkdir -p x86 + (cd x86; ${p7zip}/bin/7z e ${src_x86}) + mkdir -p amd64 + (cd amd64; ${p7zip}/bin/7z e ${src_amd64}) + ''; + + installPhase = '' + mkdir -p $out/x86 $out/amd64 + cp x86/* $out/x86/. + cp amd64/* $out/amd64/. + ''; + + meta = with stdenv.lib; { + description = '' + A collection of open source Window PV drivers that allow + Windows to be para-virtualized. + The drivers are signed by Univention with a Software Publishers + Certificate obtained from the VeriSign CA. + ''; + homepage = "http://wiki.univention.de/index.php?title=Installing-signed-GPLPV-drivers"; + maintainers = [ maintainers.tstrobel ]; + platforms = platforms.linux; + license = licenses.gpl2; + }; +} diff --git a/pkgs/applications/virtualization/driver/win-spice/default.nix b/pkgs/applications/virtualization/driver/win-spice/default.nix new file mode 100644 index 000000000000..689d36e71101 --- /dev/null +++ b/pkgs/applications/virtualization/driver/win-spice/default.nix @@ -0,0 +1,69 @@ +{ stdenv, fetchurl, p7zip, win-virtio }: + +let + src_usbdk_x86 = fetchurl { + url = "http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.4_x86.msi"; + sha256 = "17hv8034wk1xqnanm5jxs4741nl7asps1fdz6lhnrpp6gvj6yg9y"; + }; + + src_usbdk_amd64 = fetchurl { + url = "http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.4_x64.msi"; + sha256 = "0alcqsivp33pm8sy0lmkvq7m5yh6mmcmxdl39zjxjra67kw8r2sd"; + }; + + src_qxlwddm = fetchurl { + url = "http://people.redhat.com/~vrozenfe/qxlwddm/qxlwddm-0.11.zip"; + sha256 = "082zdpbh9i3bq2ds8g33rcbcw390jsm7cqf46rrlx02x8r03dm98"; + }; + + src_vdagent_x86 = fetchurl { + url = "http://www.spice-space.org/download/windows/vdagent/vdagent-win-0.7.3/vdagent_0_7_3_x86.zip"; + sha256 = "0d928g49rf4dl79jmvnqh6g864hp1flw1f0384sfp82himm3bxjs"; + }; + + src_vdagent_amd64 = fetchurl { + url = "http://www.spice-space.org/download/windows/vdagent/vdagent-win-0.7.3/vdagent_0_7_3_x64.zip"; + sha256 = "0djmvm66jcmcyhhbjppccbai45nqpva7vyvry6w8nyc0fwi1vm9l"; + }; +in + +stdenv.mkDerivation { + # use version number of qxlwddm as qxlwddm is the most important component + name = "win-spice-0.11"; + version = "0.11"; + + phases = [ "buildPhase" "installPhase" ]; + + buildPhase = '' + mkdir -p usbdk/x86 usbdk/amd64 + (cd usbdk/x86; ${p7zip}/bin/7z x ${src_usbdk_x86}) + (cd usbdk/amd64; ${p7zip}/bin/7z x ${src_usbdk_amd64}) + + mkdir -p vdagent/x86 vdagent/amd64 + (cd vdagent/x86; ${p7zip}/bin/7z x ${src_vdagent_x86}; mv vdagent_0_7_3_x86/* .; rm -r vdagent_0_7_3_x86) + (cd vdagent/amd64; ${p7zip}/bin/7z x ${src_vdagent_amd64}; mv vdagent_0_7_3_x64/* .; rm -r vdagent_0_7_3_x64) + + mkdir -p qxlwddm + (cd qxlwddm; ${p7zip}/bin/7z x ${src_qxlwddm}; mv Win8 w8.1; cd w8.1; mv x64 amd64) + ''; + + installPhase = + let + copy_qxl = arch: version: "mkdir -p $out/${arch}/qxl; cp qxlwddm/${version}/${arch}/* $out/${arch}/qxl/. \n"; + copy_usbdk = arch: "mkdir -p $out/${arch}/usbdk; cp usbdk/${arch}/* $out/${arch}/usbdk/. \n"; + copy_vdagent = arch: "mkdir -p $out/${arch}/vdagent; cp vdagent/${arch}/* $out/${arch}/vdagent/. \n"; + # SPICE needs vioserial + # TODO: Link windows version in win-spice (here) to version used in win-virtio. + # That way it would never matter whether vioserial is installed from win-virtio or win-spice. + copy_vioserial = arch: "mkdir -p $out/${arch}/vioserial; cp ${win-virtio}/${arch}/vioserial/* $out/${arch}/vioserial/. \n"; + copy = arch: version: (copy_qxl arch version) + (copy_usbdk arch) + (copy_vdagent arch) + (copy_vioserial arch); + in + (copy "amd64" "w8.1") + (copy "x86" "w8.1"); + + meta = with stdenv.lib; { + description = ''Windows SPICE Drivers''; + homepage = "http://www.spice-space.org"; + maintainers = [ maintainers.tstrobel ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/virtualization/driver/win-virtio/default.nix b/pkgs/applications/virtualization/driver/win-virtio/default.nix new file mode 100644 index 000000000000..5cf2e0a30622 --- /dev/null +++ b/pkgs/applications/virtualization/driver/win-virtio/default.nix @@ -0,0 +1,37 @@ +{ stdenv, fetchurl, p7zip }: + +stdenv.mkDerivation { + name = "win-virtio-0.1.105-1"; + version = "0.1.105-1"; + + phases = [ "buildPhase" "installPhase" ]; + + src = fetchurl { + url = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.105-1/virtio-win.iso"; + sha256 = "065gz7s77y0q9kfqbr27451sr28rm9azpi88sqjkfph8c6r8q3wc"; + }; + + buildPhase = '' + ${p7zip}/bin/7z x $src + ''; + + installPhase = + let + copy = arch: version: {input, output}: "mkdir -p $out/${arch}/${output}; cp ${input}/${version}/${arch}/* $out/${arch}/${output}/."; + virtio = [{input="Balloon"; output="vioballoon";} + {input="NetKVM"; output="vionet";} + {input="vioscsi"; output="vioscsi";} + {input="vioserial"; output="vioserial";} + {input="viostor"; output="viostor";} + {input="viorng"; output="viorng";} + ]; + in + stdenv.lib.concatStringsSep "\n" ((map (copy "amd64" "w8.1") virtio) ++ (map (copy "x86" "w8.1") virtio)); + + meta = with stdenv.lib; { + description = "Windows VirtIO Drivers"; + homepage = "https://fedoraproject.org/wiki/Windows_Virtio_Drivers"; + maintainers = [ maintainers.tstrobel ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 47510d8424d8..404a6c063e9a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13108,6 +13108,12 @@ let xen_xenServer = callPackage ../applications/virtualization/xen/4.5.0.nix { xenserverPatched = true; }; xen = xen_4_5_1; + win-spice = callPackage ../applications/virtualization/driver/win-spice { }; + win-virtio = callPackage ../applications/virtualization/driver/win-virtio { }; + win-qemu = callPackage ../applications/virtualization/driver/win-qemu { }; + win-pvdrivers = callPackage ../applications/virtualization/driver/win-pvdrivers { }; + win-signed-gplpv-drivers = callPackage ../applications/virtualization/driver/win-signed-gplpv-drivers { }; + xfe = callPackage ../applications/misc/xfe { fox = fox_1_6; };