summaryrefslogtreecommitdiff
path: root/gnu/packages/virtualization.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/virtualization.scm')
-rw-r--r--gnu/packages/virtualization.scm291
1 files changed, 275 insertions, 16 deletions
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 0cbd16f534..26855b8007 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1,15 +1,16 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2018. 2019 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2017 Andy Patterson <ajpatter@uwaterloo.ca>
;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -29,17 +30,22 @@
(define-module (gnu packages virtualization)
#:use-module (gnu packages)
#:use-module (gnu packages admin)
+ #:use-module (gnu packages assembly)
#:use-module (gnu packages attr)
#:use-module (gnu packages autotools)
#:use-module (gnu packages bison)
#:use-module (gnu packages check)
+ #:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages cross-base)
#:use-module (gnu packages curl)
#:use-module (gnu packages cyrus-sasl)
#:use-module (gnu packages disk)
#:use-module (gnu packages dns)
#:use-module (gnu packages docbook)
#:use-module (gnu packages documentation)
+ #:use-module (gnu packages figlet)
+ #:use-module (gnu packages firmware)
#:use-module (gnu packages flex)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gettext)
@@ -62,6 +68,7 @@
#:use-module (gnu packages protobuf)
#:use-module (gnu packages python)
#:use-module (gnu packages python-web)
+ #:use-module (gnu packages python-xyz)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages selinux)
#:use-module (gnu packages sdl)
@@ -70,8 +77,10 @@
#:use-module (gnu packages textutils)
#:use-module (gnu packages tls)
#:use-module (gnu packages web)
+ #:use-module (gnu packages wget)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xml)
+ #:use-module (gnu packages xorg)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system go)
@@ -101,6 +110,8 @@
(method url-fetch)
(uri (string-append "https://download.qemu.org/qemu-"
version ".tar.xz"))
+ (patches (search-patches "qemu-CVE-2018-16872.patch"
+ "qemu-CVE-2019-6778.patch"))
(sha256
(base32
"1z5bd5nfyjvhfi1s95labc82y4hjdjjkdabw931362ls0zghh1ba"))))
@@ -387,14 +398,14 @@ manage system or application containers.")
(define-public libvirt
(package
(name "libvirt")
- (version "4.3.0")
+ (version "4.10.0")
(source (origin
(method url-fetch)
(uri (string-append "https://libvirt.org/sources/libvirt-"
version ".tar.xz"))
(sha256
(base32
- "1dy243dqaj174hcka0my7q781wf0dvyi7f9328nwnplqicnf4cd5"))))
+ "0v17zzyyb25nn9l18v5244myg7590dp6ppwgi8xysipifc0q77bz"))))
(build-system gnu-build-system)
(arguments
`(;; FAIL: virshtest
@@ -438,6 +449,8 @@ manage system or application containers.")
#t))))))
(inputs
`(("libxml2" ,libxml2)
+ ("eudev" ,eudev)
+ ("libpciaccess" ,libpciaccess)
("gnutls" ,gnutls)
("dbus" ,dbus)
("qemu" ,qemu)
@@ -520,13 +533,13 @@ three libraries:
(define-public python-libvirt
(package
(name "python-libvirt")
- (version "4.1.0")
+ (version "4.10.0")
(source (origin
(method url-fetch)
(uri (pypi-uri "libvirt-python" version))
(sha256
(base32
- "1ixqhxjkczl8vk9wjx4cknw4374cw5nnsacbd2s755kpd0ys7hny"))))
+ "11fipj9naihgc9afc8bz5hi05xa1shp4qcy170sa18p3sl4zljb9"))))
(build-system python-build-system)
(arguments
`(#:phases
@@ -653,14 +666,14 @@ domains, their live performance and resource utilization statistics.")
(define-public criu
(package
(name "criu")
- (version "3.7")
+ (version "3.11")
(source (origin
(method url-fetch)
(uri (string-append "http://download.openvz.org/criu/criu-"
version ".tar.bz2"))
(sha256
(base32
- "0qrpz7pvnks34v7d8lb73flz3mb7qwnib94pdwaxh0mskn8470fq"))))
+ "03nimyn3wy5mlw30gq7bvlzvvprqjv8f25240yj5arzlld8mhsw8"))))
(build-system gnu-build-system)
(arguments
`(#:test-target "test"
@@ -689,7 +702,23 @@ domains, their live performance and resource utilization statistics.")
(assoc-ref inputs "docbook-xsl")
"/xml/xsl/docbook-xsl-"
,(package-version docbook-xsl)
- "/manpages/docbook.xsl")))
+ "/manpages/docbook.xsl"))
+ (("\\$\\(XMLTO\\);")
+ (string-append (assoc-ref inputs "xmlto")
+ "/bin/xmlto;")))
+ #t))
+ (add-after 'unpack 'hardcode-variables
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Hardcode arm version detection
+ (substitute* "Makefile"
+ (("ARMV.*:=.*") "ARMV := 7\n"))
+ ;; We are currently using python-2
+ (substitute* "crit/Makefile"
+ (("\\$\\(PYTHON\\)") "python2"))
+ (substitute* "lib/Makefile"
+ (("\\$\\(PYTHON\\)")
+ (string-append (assoc-ref inputs "python")
+ "/bin/python")))
#t))
(add-before 'build 'fix-symlink
(lambda* (#:key inputs #:allow-other-keys)
@@ -772,13 +801,13 @@ Machine Protocol.")
(version "a12")
(source
(origin
- (method url-fetch)
- (uri (string-append "https://github.com/gnif/LookingGlass/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version))
+ (method git-fetch)
+ (uri (git-reference (url "https://github.com/gnif/LookingGlass")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
(base32
- "0x57chx83f8pq56d9sfxmc9p4qjm9nqvdyamj41bmy145mxw5w3m"))))
+ "0r6bvl9q94039r6ff4f2bg8si95axx9w8bf1h1qr5730d2kv5yxq"))))
(build-system cmake-build-system)
(inputs `(("fontconfig" ,fontconfig)
("glu" ,glu)
@@ -875,7 +904,7 @@ Open Container Initiative specification.")
(define-public umoci
(package
(name "umoci")
- (version "0.4.2")
+ (version "0.4.3")
(source (origin
(method url-fetch)
(uri (string-append
@@ -884,7 +913,7 @@ Open Container Initiative specification.")
(file-name (string-append "umoci-" version ".tar.xz"))
(sha256
(base32
- "1rq5jxcss9cmy05x9b2kh9ld57ribi8hgnx2w67jpmf343b83m4q"))))
+ "1hy3gcs8z25153qpw4rk2lispfaf2c90hv1q64xwyjxn22j9ayy9"))))
(build-system go-build-system)
(arguments
'(#:import-path "github.com/openSUSE/umoci"
@@ -1055,3 +1084,233 @@ and the user can specify exactly what parts of the filesystem should be visible
in the sandbox. Any such directories specified is mounted nodev by default,
and can be made readonly.")
(license license:lgpl2.0+)))
+
+(define-public bochs
+ (package
+ (name "bochs")
+ (version "2.6.9")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://sourceforge.net/projects/bochs/files/bochs/"
+ version "/bochs-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1379cq4cnfprhw8mgh60i0q9j8fz8d7n3d5fnn2g9fdiv5znfnzf"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f)) ; No tests exist
+ (inputs
+ `(("libxrandr" ,libxrandr)))
+ (home-page "http://bochs.sourceforge.net/")
+ (synopsis "Emulator for x86 PC")
+ (description
+ "Bochs is an emulator which can emulate Intel x86 CPU, common I/O
+devices, and a custom BIOS. It can also be compiled to emulate many different
+x86 CPUs, from early 386 to the most recent x86-64 Intel and AMD processors.
+Bochs can run most Operating Systems inside the emulation including Linux,
+DOS or Microsoft Windows.")
+ (license license:lgpl2.0+)))
+
+(define-public xen
+ (package
+ (name "xen")
+ (version "4.11.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "git://xenbits.xenproject.org/xen.git")
+ (commit (string-append "RELEASE-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1wv1hyfii14vi9lfjmnv07h2gpm3b7kvh2p55f4yy2b40simksgk"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:configure-flags
+ (list "--enable-rpath"
+ "--disable-qemu-traditional" ; It tries to do "git clone"
+ "--disable-rombios" ; would try to "git clone" via etherboot.
+ ;; TODO: Re-enable stubdom (it's "more secure" to use it).
+ "--disable-stubdom" ; tries to "git clone" old patched newlib.
+ (string-append "--with-initddir="
+ (assoc-ref %outputs "out")
+ "/etc/init.d")
+ (string-append "--with-system-qemu="
+ (assoc-ref %build-inputs "qemu")
+ "/bin/qemu-system-i386")
+ (string-append "--with-system-seabios="
+ (assoc-ref %build-inputs "seabios")
+ "/share/firmware/bios.bin")
+ (string-append "--with-system-ovmf="
+ (assoc-ref %build-inputs "ovmf")
+ "/share/firmware/ovmf_ia32.bin"))
+ #:make-flags (list "-j" "1"
+ "XEN_BUILD_DATE=Thu Jan 1 01:00:01 CET 1970"
+ "XEN_BUILD_TIME=01:00:01"
+ "XEN_BUILD_HOST="
+ "ETHERBOOT_NICS="
+ "SMBIOS_REL_DATE=01/01/1970"
+ "VGABIOS_REL_DATE=01 Jan 1970"
+ ; QEMU_TRADITIONAL_LOC
+ ; QEMU_UPSTREAM_LOC
+ "SYSCONFIG_DIR=/tmp/etc/default"
+ (string-append "BASH_COMPLETION_DIR="
+ (assoc-ref %outputs "out")
+ "/etc/bash_completion.d")
+ (string-append "BOOT_DIR="
+ (assoc-ref %outputs "out")
+ "/boot")
+ (string-append "DEBUG_DIR="
+ (assoc-ref %outputs "out")
+ "/lib/debug")
+ (string-append "EFI_DIR="
+ (assoc-ref %outputs "out")
+ "/lib/efi") ; TODO lib64 ?
+ "MINIOS_UPSTREAM_URL="
+ ;(string-append "DISTDIR="
+ ; (assoc-ref %outputs "out"))
+)
+ #:test-target "test"
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'unpack-mini-os
+ (lambda* (#:key inputs #:allow-other-keys)
+ (copy-recursively (assoc-ref inputs "mini-os") "extras/mini-os")
+ #t))
+ (add-after 'unpack-mini-os 'patch
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (substitute* "tools/firmware/Rules.mk"
+ (("override XEN_TARGET_ARCH = x86_32")
+ (string-append "override XEN_TARGET_ARCH = x86_32
+override CC = " (assoc-ref inputs "cross-gcc") "/bin/i686-linux-gnu-gcc"))
+ (("^CFLAGS =$")
+ (string-append "CFLAGS=-I" (assoc-ref inputs "cross-libc")
+ "/include\n")))
+ (substitute* "config/x86_32.mk"
+ (("CFLAGS += -m32 -march=i686")
+ (string-append "CFLAGS += -march=i686 -I"
+ (assoc-ref inputs "cross-libc")
+ "/include")))
+ ;; /var is not in /gnu/store , so don't try to create it.
+ (substitute* '("tools/Makefile"
+ "tools/xenstore/Makefile"
+ "tools/xenpaging/Makefile")
+ (("\\$\\(INSTALL_DIR\\) .*XEN_(DUMP|LOG|RUN|LIB|PAGING)_DIR.*")
+ "\n")
+ (("\\$\\(INSTALL_DIR\\) .*XEN_(RUN|LIB)_STORED.*")
+ "\n"))
+ ;; Prevent xen from creating /etc .
+ (substitute* "tools/examples/Makefile"
+ ((" install-readmes") "")
+ ((" install-configs") ""))
+ ;; Set rpath.
+ (substitute* "tools/pygrub/setup.py"
+ (("library_dirs =")
+ ; TODO: extra_link_args = ['-Wl,-rpath=/opt/foo'],
+ (string-append "runtime_library_dirs = ['"
+ (assoc-ref outputs "out")
+ "/lib'],\nlibrary_dirs =")))
+ #t))
+ (add-before 'configure 'patch-xen-script-directory
+ (lambda* (#:key outputs #:allow-other-keys)
+ (substitute* '("configure"
+ "tools/configure"
+ "docs/configure")
+ (("XEN_SCRIPT_DIR=.*")
+ (string-append "XEN_SCRIPT_DIR="
+ (assoc-ref outputs "out")
+ "/etc/xen/scripts")))
+ #t))
+ (add-before 'configure 'set-environment-up
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (define (cross? x)
+ (string-contains x "cross-i686-linux"))
+ (define (filter-environment! filter-predicate
+ environment-variable-names)
+ (for-each
+ (lambda (env-name)
+ (let* ((env-value (getenv env-name))
+ (search-path (search-path-as-string->list env-value))
+ (new-search-path (filter filter-predicate
+ search-path))
+ (new-env-value (list->search-path-as-string
+ new-search-path ":")))
+ (setenv env-name new-env-value)))
+ environment-variable-names))
+ (setenv "CROSS_C_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))
+ (setenv "CROSS_CPLUS_INCLUDE_PATH" (getenv "CPLUS_INCLUDE_PATH"))
+ (setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
+ (filter-environment! cross?
+ '("CROSS_C_INCLUDE_PATH" "CROSS_CPLUS_INCLUDE_PATH"
+ "CROSS_LIBRARY_PATH"))
+ (filter-environment! (lambda (e) (not (cross? e)))
+ '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH"
+ "LIBRARY_PATH"))
+ ;; Guix tries to be helpful and automatically adds
+ ;; mini-os-git-checkout/include to the include path,
+ ;; but actually we don't want it to be there (yet).
+ (filter-environment! (lambda (e)
+ (not
+ (string-contains e
+ "mini-os-git-checkout")))
+ '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH"
+ "LIBRARY_PATH"))
+ (setenv "EFI_VENDOR" "guix")
+ #t))
+ (replace 'build
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (apply invoke "make" "world" make-flags))))))
+ (inputs
+ `(("acpica" ,acpica) ; TODO: patch iasl invocation.
+ ("bridge-utils" ,bridge-utils) ; TODO: patch invocations.
+ ("glib" ,glib)
+ ("iproute" ,iproute) ; TODO: patch invocations.
+ ("libaio" ,libaio)
+ ("libx11" ,libx11)
+ ("libyajl" ,libyajl)
+ ("ncurses" ,ncurses)
+ ("openssl" ,openssl)
+ ("ovmf" ,ovmf)
+ ("pixman" ,pixman)
+ ("qemu" ,qemu-minimal)
+ ("seabios" ,seabios)
+ ("util-linux" ,util-linux) ; uuid
+ ; TODO: ocaml-findlib, ocaml-nox.
+ ("xz" ,xz) ; for liblzma
+ ("zlib" ,zlib)))
+ (native-inputs
+ `(("dev86" ,dev86)
+ ("bison" ,bison)
+ ("cmake" ,cmake)
+ ("figlet" ,figlet)
+ ("flex" ,flex)
+ ("gettext" ,gettext-minimal)
+ ("libnl" ,libnl)
+ ("mini-os"
+ ,(origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "http://xenbits.xen.org/git-http/mini-os.git")
+ (commit (string-append "xen-RELEASE-" version))))
+ (sha256
+ (base32
+ "1i8pcl19n60i2m9vlg79q3nknpj209c9ic5x10wxaicx45kc107f"))
+ (file-name "mini-os-git-checkout")))
+ ("perl" ,perl)
+ ; TODO: markdown
+ ("pkg-config" ,pkg-config)
+ ("python" ,python-2)
+ ("wget" ,wget)
+ ("cross-gcc" ,(cross-gcc "i686-linux-gnu"
+ #:xbinutils (cross-binutils "i686-linux-gnu")
+ #:libc (cross-libc "i686-linux-gnu")))
+ ("cross-libc" ,(cross-libc "i686-linux-gnu")) ; header files
+ ("cross-libc-static" ,(cross-libc "i686-linux-gnu") "static")))
+ (home-page "https://xenproject.org/")
+ (synopsis "Xen Virtual Machine Monitor")
+ (description "This package provides the Xen Virtual Machine Monitor
+which is a hypervisor.")
+ ;; TODO: Some files are licensed differently. List those.
+ (license license:gpl2)
+ (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))))