git.iko.soy/typeable/nixpkgs
on master help sign in
Update: Xen -> 4.4.1
commit732c303bb813e01b477c4ae268d008b960f27555 authorThomas Strobel <ts468@cam.ac.uk> dateMon 22 Dec 2014, 00:03 (12 years ago) parent86213a1
3 files changed+89−103
pkgs/applications/virtualization/xen/default.nix+89−24 pkgs/applications/virtualization/xen/gcc-4.5.patch−39 pkgs/applications/virtualization/xen/has-header.patch−40
pkgs/applications/virtualization/xen/default.nix+89−24
@@ -1,19 +1,50 @@
11{ stdenv, fetchurl, which, zlib, pkgconfig, SDL, openssl
2−, libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2, xz
3−, lvm2, utillinux, procps, texinfo, perl, pythonPackages }:
2+, libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2
3+, lvm2, utillinux, procps, texinfo, perl, pythonPackages
4+, glib, bridge_utils, xlibs, pixman, iproute, udev, bison
5+, flex, cmake, ocaml, ocamlPackages, figlet, libaio, yajl
6+, checkpolicy, transfig, glusterfs, fetchgit, xz }:
47
58with stdenv.lib;
69
710let
8−
9− version = "4.0.3";
11+ version = "4.4.1";
1012
1113 libDir = if stdenv.is64bit then "lib64" else "lib";
1214
13− # Sources needed to build the stubdoms.
15+ # Sources needed to build the xen tools and tools/firmware.
16+ toolsGits =
17+ [ # tag qemu-xen-4.4.1
18+ #{ name = "qemu-xen";
19+ # url = git://xenbits.xen.org/qemu-upstream-4.4-testing.git;
20+ # rev = "65fc9b78ba3d868a26952db0d8e51cecf01d47b4";
21+ # sha256 = "e7abaf0e927f7a2bba4c59b6dad6ae19e77c92689c94fa0384e2c41742f8cdb6";
22+ #}
23+ # tag xen-4.4.1
24+ { name = "qemu-xen-traditional";
25+ url = git://xenbits.xen.org/qemu-xen-4.4-testing.git;
26+ rev = "6ae4e588081620b141071eb010ec40aca7e12876";
27+ sha256 = "b1ed1feb92fbe658273a8d6d38d6ea60b79c1658413dd93979d6d128d8554ded";
28+ }
29+ ];
30+ firmwareGits =
31+ [ # tag 1.7.3.1
32+ { name = "seabios";
33+ url = git://xenbits.xen.org/seabios.git;
34+ rev = "7d9cbe613694924921ed1a6f8947d711c5832eee";
35+ sha256 = "c071282bbcb1dd0d98536ef90cd1410f5d8da19648138e0e3863bc540d954a87";
36+ }
37+ { name = "ovmf";
38+ url = git://xenbits.xen.org/ovmf.git;
39+ rev = "447d264115c476142f884af0be287622cd244423";
40+ sha256 = "7086f882495a8be1497d881074e8f1005dc283a5e1686aec06c1913c76a6319b";
41+ }
42+ ];
43+
1444
15− stubdomSrcs =
16− [ { url = http://xenbits.xensource.com/xen-extfiles/lwip-1.3.0.tar.gz;
45+ # Sources needed to build the stubdoms and tools
46+ xenExtfiles = [
47+ { url = http://xenbits.xensource.com/xen-extfiles/lwip-1.3.0.tar.gz;
1748 sha256 = "13wlr85s1hnvia6a698qpryyy12lvmqw0a05xmjnd0h71ralsbkp";
1849 }
1950 { url = http://xenbits.xensource.com/xen-extfiles/zlib-1.2.3.tar.gz;
@@ -28,6 +59,21 @@ let
2859 { url = http://xenbits.xensource.com/xen-extfiles/pciutils-2.2.9.tar.bz2;
2960 sha256 = "092v4q478i1gc7f3s2wz6p4xlf1wb4gs5shbkn21vnnmzcffc2pn";
3061 }
62+ { url = http://xenbits.xensource.com/xen-extfiles/tpm_emulator-0.7.4.tar.gz;
63+ sha256 = "0nd4vs48j0zfzv1g5jymakxbjqf9ss6b2jph3b64356xhc6ylj2f";
64+ }
65+ { url = http://xenbits.xensource.com/xen-extfiles/tboot-20090330.tar.gz;
66+ sha256 = "0rl1b53g019w2c268pyxhjqsj9ls37i4p74bdv1hdi2yvs0r1y81";
67+ }
68+ { url = http://xenbits.xensource.com/xen-extfiles/ipxe-git-9a93db3f0947484e30e753bbd61a10b17336e20e.tar.gz;
69+ sha256 = "0p206zaxlhda60ci33h9gipi5gm46fvvsm6k5c0w7b6cjg0yhb33";
70+ }
71+ { url = http://xenbits.xensource.com/xen-extfiles/polarssl-1.1.4-gpl.tgz;
72+ sha256 = "1dl4fprpwagv9akwqpb62qwqvh24i50znadxwvd2kfnhl02gsa9d";
73+ }
74+ { url = http://xenbits.xensource.com/xen-extfiles/gmp-4.3.2.tar.bz2;
75+ sha256 = "0x8prpqi9amfcmi7r4zrza609ai9529pjaq0h4aw51i867064qck";
76+ }
3177 ];
3278
3379in
@@ -37,27 +83,35 @@ stdenv.mkDerivation {
3783
3884 src = fetchurl {
3985 url = "http://bits.xensource.com/oss-xen/release/${version}/xen-${version}.tar.gz";
40− sha256 = "0p4i7mm8cdsr8i9z3dij6nriyvz6la2rhm7jkyk2n8h62nnxi1b5";
86+ sha256 = "09gaqydqmy64s5pqnwgjyzhd3wc61xyghpqjfl97kmvm8ly9vd2m";
4187 };
4288
43− patches =
44− [ # Xen looks for headers in /usr/include and for libraries using
45− # ldconfig. Don't do that.
46− ./has-header.patch
47−
48− # GCC 4.5 compatibility.
49− ./gcc-4.5.patch
50− ];
89+ dontUseCmakeConfigure = true;
5190
5291 buildInputs =
5392 [ which zlib pkgconfig SDL openssl libuuid gettext ncurses
54− dev86 iasl pciutils bzip2 xz texinfo perl
93+ dev86 iasl pciutils bzip2 xz texinfo perl yajl
5594 pythonPackages.python pythonPackages.wrapPython
95+ glib bridge_utils pixman iproute udev bison xlibs.libX11
96+ flex ocaml ocamlPackages.findlib figlet libaio
97+ checkpolicy pythonPackages.markdown transfig
98+ glusterfs cmake
5699 ];
57100
58101 pythonPath = [ pythonPackages.curses ];
59102
60− makeFlags = "PREFIX=$(out) CONFIG_DIR=/etc";
103+
104+ preConfigure = ''
105+ # Fake wget: copy prefetched downloads instead
106+ mkdir wget
107+ echo "#!/bin/sh" > wget/wget
108+ echo "echo ===== Not fetching \$*, copy pre-fetched file instead" >> wget/wget
109+ echo "cp \$4 \$3" >> wget/wget
110+ chmod +x wget/wget
111+ export PATH=$PATH:$PWD/wget
112+ '';
113+
114+ makeFlags = "PREFIX=$(out) CONFIG_DIR=/etc XEN_EXTFILES_URL=\\$(XEN_ROOT)/xen_ext_files ";
61115
62116 buildFlags = "xen tools stubdom";
63117
@@ -105,10 +159,22 @@ stdenv.mkDerivation {
105159 --replace 'XENDOM_CONFIG=/etc/sysconfig/xendomains' "" \
106160 --replace /bin/ls ls
107161
108− # Xen's stubdoms need various sources that it usually fetches at
109− # build time using wget. We can't have that.
110− ${flip concatMapStrings stubdomSrcs (x: let src = fetchurl x; in ''
111− cp ${src} stubdom/${src.name}
162+ # Xen's tools and firmares need various git repositories that it
163+ # usually checks out at time using git. We can't have that.
164+ ${flip concatMapStrings toolsGits (x: let src = fetchgit x; in ''
165+ cp -r ${src} tools/${src.name}-dir-remote
166+ chmod +w tools/${src.name}-dir-remote
167+ '')}
168+ ${flip concatMapStrings firmwareGits (x: let src = fetchgit x; in ''
169+ cp -r ${src} tools/firmware/${src.name}-dir-remote
170+ chmod +w tools/firmware/${src.name}-dir-remote
171+ '')}
172+
173+ # Xen's stubdoms and firmwares need various sources that are usually fetched
174+ # at build time using wget. We can't have that, so we prefetch Xen's ext_files.
175+ mkdir xen_ext_files
176+ ${flip concatMapStrings xenExtfiles (x: let src = fetchurl x; in ''
177+ cp ${src} xen_ext_files/${src.name}
112178 '')}
113179
114180 # Hack to get `gcc -m32' to work without having 32-bit Glibc headers.
@@ -135,7 +201,6 @@ stdenv.mkDerivation {
135201 homepage = http://www.xen.org/;
136202 description = "Xen hypervisor and management tools for Dom0";
137203 platforms = [ "i686-linux" "x86_64-linux" ];
138− maintainers = [ stdenv.lib.maintainers.eelco ];
139− broken = true; # bump to at least 4.1.6.1 to fix security issues
204+ maintainers = with stdenv.lib.maintainers; [ eelco tstrobel ];
140205 };
141206}
pkgs/applications/virtualization/xen/gcc-4.5.patchdeleted−39
@@ -1,39 +0,0 @@
1−http://lists.xensource.com/archives/html/xen-devel/2010-07/msg01276.html
2−
3−diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/arch/x86/mm.c xen-4.0.1//extras/mini-os/arch/x86/mm.c
4−--- xen-4.0.1-orig//extras/mini-os/arch/x86/mm.c 2010-08-25 12:22:07.000000000 +0200
5−+++ xen-4.0.1//extras/mini-os/arch/x86/mm.c 2010-12-22 20:10:05.000000000 +0100
6−@@ -281,7 +281,7 @@
7− /*
8− * Mark portion of the address space read only.
9− */
10−-extern void shared_info;
11−+extern char shared_info[PAGE_SIZE];
12− static void set_readonly(void *text, void *etext)
13− {
14− unsigned long start_address =
15−diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/minios.mk xen-4.0.1//extras/mini-os/minios.mk
16−--- xen-4.0.1-orig//extras/mini-os/minios.mk 2010-08-25 12:22:07.000000000 +0200
17−+++ xen-4.0.1//extras/mini-os/minios.mk 2010-12-22 20:03:11.000000000 +0100
18−@@ -10,6 +10,7 @@
19− DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
20− DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
21− DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
22−+DEF_CFLAGS += -Wno-uninitialized
23− DEF_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
24−
25− DEF_ASFLAGS += -D__ASSEMBLY__
26−diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/netfront.c xen-4.0.1//extras/mini-os/netfront.c
27−--- xen-4.0.1-orig//extras/mini-os/netfront.c 2010-08-25 12:22:07.000000000 +0200
28−+++ xen-4.0.1//extras/mini-os/netfront.c 2010-12-22 19:56:59.000000000 +0100
29−@@ -25,8 +25,8 @@
30−
31−
32−
33−-#define NET_TX_RING_SIZE __RING_SIZE((struct netif_tx_sring *)0, PAGE_SIZE)
34−-#define NET_RX_RING_SIZE __RING_SIZE((struct netif_rx_sring *)0, PAGE_SIZE)
35−+#define NET_TX_RING_SIZE __CONST_RING_SIZE(netif_tx, PAGE_SIZE)
36−+#define NET_RX_RING_SIZE __CONST_RING_SIZE(netif_rx, PAGE_SIZE)
37− #define GRANT_INVALID_REF 0
38−
39−
pkgs/applications/virtualization/xen/has-header.patchdeleted−40
@@ -1,40 +0,0 @@
1−diff -ru --exclude '*~' xen-4.0.1-orig/tools/check/funcs.sh xen-4.0.1/tools/check/funcs.sh
2−--- xen-4.0.1-orig/tools/check/funcs.sh 2010-08-25 12:22:07.000000000 +0200
3−+++ xen-4.0.1/tools/check/funcs.sh 2010-09-09 17:47:20.000000000 +0200
4−@@ -25,33 +25,13 @@
5− }
6−
7− has_header() {
8−- case $1 in
9−- /*) ;;
10−- *) set -- "/usr/include/$1" ;;
11−- esac
12−-
13−- check_sys_root || return 1
14−-
15−- test -r "$CROSS_SYS_ROOT$1"
16−- return $?
17−+ echo "#include <$1>" | gcc -E - > /dev/null && return 0
18−+ return 1
19− }
20−
21− has_lib() {
22− check_sys_root || return 1
23−-
24−- # subshell to prevent pollution of caller's environment
25−- (
26−- PATH=/sbin:$PATH # for ldconfig
27−-
28−- # This relatively common in a sys-root; libs are installed but
29−- # ldconfig hasn't run there, so ldconfig -p won't work.
30−- if [ "$OS" = Linux -a ! -f "$CROSS_SYS_ROOT/etc/ld.so.cache" ]; then
31−- echo "Please run ldconfig -r \"$CROSS_SYS_ROOT\" to generate ld.so.cache"
32−- # fall through; ldconfig test below should fail
33−- fi
34−- ldconfig -p ${CROSS_SYS_ROOT+-r "$CROSS_SYS_ROOT"} | grep -Fq "$1"
35−- return $?
36−- )
37−+ return 0
38− }
39−
40− test_link() {