1 |
commit: 6211e2c38becf2b05e87d8f4cf2c6e5506738f03 |
2 |
Author: Felix Janda <felix.janda <AT> posteo <DOT> de> |
3 |
AuthorDate: Wed Feb 19 19:19:49 2014 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 22 14:28:08 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=6211e2c3 |
7 |
|
8 |
app-emulation/qemu: add to tree |
9 |
|
10 |
--- |
11 |
app-emulation/qemu/files/65-kvm.rules | 1 + |
12 |
app-emulation/qemu/files/bridge.conf | 14 + |
13 |
app-emulation/qemu/files/qemu-1.5.3-openpty.patch | 12 + |
14 |
app-emulation/qemu/files/qemu-1.7.0-ffsll.patch | 19 + |
15 |
app-emulation/qemu/files/qemu-1.7.0-sigset_t.patch | 12 + |
16 |
app-emulation/qemu/files/qemu-9999-cflags.patch | 13 + |
17 |
app-emulation/qemu/files/qemu-binfmt.initd-r1 | 129 +++++ |
18 |
app-emulation/qemu/files/qemu-kvm-1.4 | 3 + |
19 |
app-emulation/qemu/metadata.xml | 52 ++ |
20 |
app-emulation/qemu/qemu-1.5.3-r99.ebuild | 552 +++++++++++++++++++++ |
21 |
10 files changed, 807 insertions(+) |
22 |
|
23 |
diff --git a/app-emulation/qemu/files/65-kvm.rules b/app-emulation/qemu/files/65-kvm.rules |
24 |
new file mode 100644 |
25 |
index 0000000..c2f7317 |
26 |
--- /dev/null |
27 |
+++ b/app-emulation/qemu/files/65-kvm.rules |
28 |
@@ -0,0 +1 @@ |
29 |
+KERNEL=="kvm", GROUP="kvm", MODE="0660" |
30 |
|
31 |
diff --git a/app-emulation/qemu/files/bridge.conf b/app-emulation/qemu/files/bridge.conf |
32 |
new file mode 100644 |
33 |
index 0000000..2bde37e |
34 |
--- /dev/null |
35 |
+++ b/app-emulation/qemu/files/bridge.conf |
36 |
@@ -0,0 +1,14 @@ |
37 |
+# This should have the following permissions: root:qemu 0640 |
38 |
+ |
39 |
+# allow br0 |
40 |
+# Uncommenting the above would allow users in the 'qemu' group |
41 |
+# to add devices to 'br0' |
42 |
+ |
43 |
+# allow virbr0 |
44 |
+# Uncommenting the above would allow users in the 'qemu' group |
45 |
+# to add devices to 'virbr0' |
46 |
+ |
47 |
+# include /etc/qemu/bob.conf |
48 |
+# Uncommenting the above would allow users in the 'bob' group |
49 |
+# to have permissions defined in it, iff it has the following |
50 |
+# permissions: root:bob 0640 |
51 |
|
52 |
diff --git a/app-emulation/qemu/files/qemu-1.5.3-openpty.patch b/app-emulation/qemu/files/qemu-1.5.3-openpty.patch |
53 |
new file mode 100644 |
54 |
index 0000000..5c71c5b |
55 |
--- /dev/null |
56 |
+++ b/app-emulation/qemu/files/qemu-1.5.3-openpty.patch |
57 |
@@ -0,0 +1,12 @@ |
58 |
+Patch taken from sabotage linux |
59 |
+--- qemu-1.7.0.org/util/qemu-openpty.c |
60 |
++++ qemu-1.7.0/util/qemu-openpty.c |
61 |
+@@ -47,6 +47,8 @@ |
62 |
+ #elif defined CONFIG_SOLARIS |
63 |
+ # include <termios.h> |
64 |
+ # include <stropts.h> |
65 |
++#else |
66 |
++# include <termios.h> |
67 |
+ #endif |
68 |
+ |
69 |
+ #ifdef __sun__ |
70 |
|
71 |
diff --git a/app-emulation/qemu/files/qemu-1.7.0-ffsll.patch b/app-emulation/qemu/files/qemu-1.7.0-ffsll.patch |
72 |
new file mode 100644 |
73 |
index 0000000..481bd72 |
74 |
--- /dev/null |
75 |
+++ b/app-emulation/qemu/files/qemu-1.7.0-ffsll.patch |
76 |
@@ -0,0 +1,19 @@ |
77 |
+taken from sabotage linux |
78 |
+--- qemu-1.7.0.org/hw/virtio/vhost.c |
79 |
++++ qemu-1.7.0/hw/virtio/vhost.c |
80 |
+@@ -22,6 +22,15 @@ |
81 |
+ #include "exec/address-spaces.h" |
82 |
+ #include "hw/virtio/virtio-bus.h" |
83 |
+ |
84 |
++#ifndef HAVE_FFSLL |
85 |
++static int ffsll(long long i) { |
86 |
++ unsigned long long x = i & -i; |
87 |
++ if (x <= 0xffffffff) return ffs (i); |
88 |
++ else return 32 + ffs (i >> 32); |
89 |
++} |
90 |
++#endif |
91 |
++ |
92 |
++ |
93 |
+ static void vhost_dev_sync_region(struct vhost_dev *dev, |
94 |
+ MemoryRegionSection *section, |
95 |
+ uint64_t mfirst, uint64_t mlast, |
96 |
|
97 |
diff --git a/app-emulation/qemu/files/qemu-1.7.0-sigset_t.patch b/app-emulation/qemu/files/qemu-1.7.0-sigset_t.patch |
98 |
new file mode 100644 |
99 |
index 0000000..1d5d173 |
100 |
--- /dev/null |
101 |
+++ b/app-emulation/qemu/files/qemu-1.7.0-sigset_t.patch |
102 |
@@ -0,0 +1,12 @@ |
103 |
+taken from sabotage linux |
104 |
+--- qemu-1.7.0.org/linux-user/syscall.c |
105 |
++++ qemu-1.7.0/linux-user/syscall.c |
106 |
+@@ -400,7 +400,7 @@ |
107 |
+ #endif |
108 |
+ #define __NR_sys_ppoll __NR_ppoll |
109 |
+ _syscall5(int, sys_ppoll, struct pollfd *, fds, nfds_t, nfds, |
110 |
+- struct timespec *, timeout, const __sigset_t *, sigmask, |
111 |
++ struct timespec *, timeout, const sigset_t *, sigmask, |
112 |
+ size_t, sigsetsize) |
113 |
+ #endif |
114 |
+ |
115 |
|
116 |
diff --git a/app-emulation/qemu/files/qemu-9999-cflags.patch b/app-emulation/qemu/files/qemu-9999-cflags.patch |
117 |
new file mode 100644 |
118 |
index 0000000..08a6c9f |
119 |
--- /dev/null |
120 |
+++ b/app-emulation/qemu/files/qemu-9999-cflags.patch |
121 |
@@ -0,0 +1,13 @@ |
122 |
+diff --git a/configure b/configure |
123 |
+index 82f6e71..7e19aaf 100755 |
124 |
+--- a/configure |
125 |
++++ b/configure |
126 |
+@@ -3131,8 +3131,6 @@ fi |
127 |
+ if test "$gcov" = "yes" ; then |
128 |
+ CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS" |
129 |
+ LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS" |
130 |
+-elif test "$debug" = "no" ; then |
131 |
+- CFLAGS="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS" |
132 |
+ fi |
133 |
+ |
134 |
+ |
135 |
|
136 |
diff --git a/app-emulation/qemu/files/qemu-binfmt.initd-r1 b/app-emulation/qemu/files/qemu-binfmt.initd-r1 |
137 |
new file mode 100644 |
138 |
index 0000000..4b1dba5 |
139 |
--- /dev/null |
140 |
+++ b/app-emulation/qemu/files/qemu-binfmt.initd-r1 |
141 |
@@ -0,0 +1,129 @@ |
142 |
+#!/sbin/runscript |
143 |
+# Copyright 1999-2013 Gentoo Foundation |
144 |
+# Distributed under the terms of the GNU General Public License v2 |
145 |
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/files/qemu-binfmt.initd-r1,v 1.3 2013/02/17 22:05:22 vapier Exp $ |
146 |
+ |
147 |
+# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390 program execution by the kernel |
148 |
+ |
149 |
+depend() { |
150 |
+ after procfs |
151 |
+} |
152 |
+ |
153 |
+start() { |
154 |
+ ebegin "Registering qemu-user binaries" |
155 |
+ |
156 |
+ if [ ! -d /proc/sys/fs/binfmt_misc ] ; then |
157 |
+ modprobe -q binfmt_misc |
158 |
+ fi |
159 |
+ |
160 |
+ if [ ! -d /proc/sys/fs/binfmt_misc ] ; then |
161 |
+ eend $? "You need support for 'misc binaries' in your kernel!" || return |
162 |
+ fi |
163 |
+ |
164 |
+ if [ ! -f /proc/sys/fs/binfmt_misc/register ] ; then |
165 |
+ mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc >/dev/null 2>&1 |
166 |
+ eend $? || return |
167 |
+ fi |
168 |
+ |
169 |
+ # probe cpu type |
170 |
+ cpu=`uname -m` |
171 |
+ case "$cpu" in |
172 |
+ i386|i486|i586|i686|i86pc|BePC|x86_64) |
173 |
+ cpu="i386" |
174 |
+ ;; |
175 |
+ m68k) |
176 |
+ cpu="m68k" |
177 |
+ ;; |
178 |
+ mips*) |
179 |
+ cpu="mips" |
180 |
+ ;; |
181 |
+ "Power Macintosh"|ppc|ppc64) |
182 |
+ cpu="ppc" |
183 |
+ ;; |
184 |
+ armv[4-9]*) |
185 |
+ cpu="arm" |
186 |
+ ;; |
187 |
+ sparc*) |
188 |
+ cpu="sparc" |
189 |
+ ;; |
190 |
+ esac |
191 |
+ |
192 |
+ # register the interpreter for each cpu except for the native one |
193 |
+ if [ $cpu != "i386" -a -x "/usr/bin/qemu-i386" ] ; then |
194 |
+ echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:P' > /proc/sys/fs/binfmt_misc/register |
195 |
+ echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:P' > /proc/sys/fs/binfmt_misc/register |
196 |
+ fi |
197 |
+ if [ $cpu != "alpha" -a -x "/usr/bin/qemu-alpha" ] ; then |
198 |
+ echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha:P' > /proc/sys/fs/binfmt_misc/register |
199 |
+ fi |
200 |
+ if [ $cpu != "arm" -a -x "/usr/bin/qemu-arm" ] ; then |
201 |
+ echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x00\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:P' > /proc/sys/fs/binfmt_misc/register |
202 |
+ fi |
203 |
+ if [ $cpu != "arm" -a -x "/usr/bin/qemu-armeb" ] ; then |
204 |
+ echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:P' > /proc/sys/fs/binfmt_misc/register |
205 |
+ fi |
206 |
+ if [ $cpu != "sparc" -a -x "/usr/bin/qemu-sparc" ] ; then |
207 |
+ echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc:P' > /proc/sys/fs/binfmt_misc/register |
208 |
+ fi |
209 |
+ if [ $cpu != "ppc" -a -x "/usr/bin/qemu-ppc" ] ; then |
210 |
+ echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:P' > /proc/sys/fs/binfmt_misc/register |
211 |
+ fi |
212 |
+ if [ $cpu != "m68k" -a -x "/usr/bin/qemu-m68k" ] ; then |
213 |
+ echo 'Please check cpu value and header information for m68k!' |
214 |
+ echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k:P' > /proc/sys/fs/binfmt_misc/register |
215 |
+ fi |
216 |
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips" ] ; then |
217 |
+ # FIXME: We could use the other endianness on a MIPS host. |
218 |
+ echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips:P' > /proc/sys/fs/binfmt_misc/register |
219 |
+ fi |
220 |
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsel" ] ; then |
221 |
+ echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel:P' > /proc/sys/fs/binfmt_misc/register |
222 |
+ fi |
223 |
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsn32" ] ; then |
224 |
+ echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32:P' > /proc/sys/fs/binfmt_misc/register |
225 |
+ fi |
226 |
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsn32el" ] ; then |
227 |
+ echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el:P' > /proc/sys/fs/binfmt_misc/register |
228 |
+ fi |
229 |
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips64" ] ; then |
230 |
+ echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64:P' > /proc/sys/fs/binfmt_misc/register |
231 |
+ fi |
232 |
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips64el" ] ; then |
233 |
+ echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el:P' > /proc/sys/fs/binfmt_misc/register |
234 |
+ fi |
235 |
+ if [ $cpu != "sh" -a -x "/usr/bin/qemu-sh4" ] ; then |
236 |
+ echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:P' > /proc/sys/fs/binfmt_misc/register |
237 |
+ fi |
238 |
+ if [ $cpu != "sh" -a -x "/usr/bin/qemu-sh4eb" ] ; then |
239 |
+ echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:P' > /proc/sys/fs/binfmt_misc/register |
240 |
+ fi |
241 |
+ if [ $cpu != "s390x" -a -x "/usr/local/bin/qemu-s390x" ] ; then |
242 |
+ echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-s390x:P' > /proc/sys/fs/binfmt_misc/register |
243 |
+ fi |
244 |
+ eend $? |
245 |
+} |
246 |
+ |
247 |
+stop() { |
248 |
+ ebegin "Unregistering qemu-user binaries" |
249 |
+ local arches |
250 |
+ |
251 |
+ arches="${arches} i386 i486" |
252 |
+ arches="${arches} alpha" |
253 |
+ arches="${arches} arm armeb" |
254 |
+ arches="${arches} sparc" |
255 |
+ arches="${arches} ppc" |
256 |
+ arches="${arches} m68k" |
257 |
+ arches="${arches} mips mipsel mipsn32 mipsn32el mips64 mips64el" |
258 |
+ arches="${arches} sh4 sh4eb" |
259 |
+ arches="${arches} s390x" |
260 |
+ |
261 |
+ for a in ${arches}; do |
262 |
+ if [ -f /proc/sys/fs/binfmt_misc/$a ] ; then |
263 |
+ echo '-1' > /proc/sys/fs/binfmt_misc/$a |
264 |
+ fi |
265 |
+ done |
266 |
+ |
267 |
+ eend $? |
268 |
+} |
269 |
+ |
270 |
+# vim: ts=4 : |
271 |
|
272 |
diff --git a/app-emulation/qemu/files/qemu-kvm-1.4 b/app-emulation/qemu/files/qemu-kvm-1.4 |
273 |
new file mode 100644 |
274 |
index 0000000..08da00b |
275 |
--- /dev/null |
276 |
+++ b/app-emulation/qemu/files/qemu-kvm-1.4 |
277 |
@@ -0,0 +1,3 @@ |
278 |
+#!/bin/sh |
279 |
+ |
280 |
+exec /usr/bin/qemu-system-x86_64 -machine accel=kvm "$@" |
281 |
|
282 |
diff --git a/app-emulation/qemu/metadata.xml b/app-emulation/qemu/metadata.xml |
283 |
new file mode 100644 |
284 |
index 0000000..b80eaf7 |
285 |
--- /dev/null |
286 |
+++ b/app-emulation/qemu/metadata.xml |
287 |
@@ -0,0 +1,52 @@ |
288 |
+<?xml version="1.0" encoding="UTF-8"?> |
289 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
290 |
+<pkgmetadata> |
291 |
+ <herd>qemu</herd> |
292 |
+ <maintainer> |
293 |
+ <email>cardoe@g.o</email> |
294 |
+ <name>Doug Goldstein</name> |
295 |
+ </maintainer> |
296 |
+ <use> |
297 |
+ <flag name='accessibility'>Adds support for braille displays using brltty</flag> |
298 |
+ <flag name='aio'>Enables support for Linux's Async IO</flag> |
299 |
+ <flag name='alsa'>Enable alsa output for sound emulation</flag> |
300 |
+ <flag name='curl'>Support ISOs / -cdrom directives vis HTTP or HTTPS.</flag> |
301 |
+ <flag name='fdt'>Enables firmware device tree support</flag> |
302 |
+ <flag name='glusterfs'>Enables GlusterFS cluster fileystem via |
303 |
+ <pkg>sys-cluster/glusterfs</pkg></flag> |
304 |
+ <flag name='iscsi'>Enable direct iSCSI support via |
305 |
+ <pkg>net-libs/libiscsi</pkg> instead of indirectly via the Linux |
306 |
+ block layer that <pkg>sys-block/open-iscsi</pkg> does.</flag> |
307 |
+ <flag name='mixemu'>Enable audio mixer emulation. On Fedora, known to cause performance problems when using SDL output and ALSA. For OSS, locks the sound device from other applications.</flag> |
308 |
+ <flag name='ncurses'>Enable the ncurses-based console</flag> |
309 |
+ <flag name='pulseaudio'>Enable pulseaudio output for sound emulation</flag> |
310 |
+ <flag name='rbd'>Enable rados block device backend support, see http://ceph.newdream.net/wiki/QEMU-RBD</flag> |
311 |
+ <flag name='sdl'>Enable the SDL-based console</flag> |
312 |
+ <flag name='seccomp'>Utilize <pkg>sys-libs/libseccomp</pkg> to enable kernel filtering of system calls to prevent malicious guests from doing damage.</flag> |
313 |
+ <flag name='spice'>Enable Spice protocol support via <pkg>app-emulation/spice</pkg></flag> |
314 |
+ <flag name='ssh'>Enable SSH based block device support via <pkg>net-libs/libssh2</pkg></flag> |
315 |
+ <flag name='static-softmmu'>Builds the Software MMU (system) targets as static binaries</flag> |
316 |
+ <flag name='static-user'>Build the User targets as static binaries</flag> |
317 |
+ <flag name='static'>Enables both 'static-softmmu' and 'static-user'</flag> |
318 |
+ <flag name='systemtap'>Enable SystemTAP/DTrace tracing</flag> |
319 |
+ <flag name='tci'>Enable the TCG Interpreter which can speed up or slowdown workloads depending on the host and guest CPUs being emulated. In the future it will be a runtime option but for now its compile time.</flag> |
320 |
+ <flag name='tls'>Enable TLS support for the VNC console server. |
321 |
+ For 1.4 and newer this also enables WebSocket support.</flag> |
322 |
+ <flag name='jpeg'>Enable jpeg image support for the VNC console server</flag> |
323 |
+ <flag name='png'>Enable png image support for the VNC console server</flag> |
324 |
+ <flag name='usb'>Enable USB passthrough via <pkg>dev-libs/libusbx</pkg></flag> |
325 |
+ <flag name="usbredir">Use <pkg>sys-apps/usbredir</pkg> to redirect USB |
326 |
+ devices to another machine over TCP</flag> |
327 |
+ <flag name='uuid'>Enable UUID support in the vdi block driver</flag> |
328 |
+ <flag name='vde'>Enable VDE-based networking</flag> |
329 |
+ <flag name='vhost-net'>Enable accelerated networking using vhost-net, see http://www.linux-kvm.org/page/VhostNet</flag> |
330 |
+ <flag name='virtfs'>Enable VirtFS via virtio-9p-pci / fsdev. See http://wiki.qemu.org/Documentation/9psetup</flag> |
331 |
+ <flag name='xattr'> |
332 |
+ Add support for getting and setting POSIX extended attributes, through |
333 |
+ <pkg>sys-apps/attr</pkg>. Requisite for the virtfs backend. |
334 |
+ </flag> |
335 |
+ <flag name='xen'>Enables support for Xen backends</flag> |
336 |
+ <flag name='xfs'>Support xfsctl() notification and syncing for XFS backed |
337 |
+ virtual disks.</flag> |
338 |
+ </use> |
339 |
+</pkgmetadata> |
340 |
|
341 |
diff --git a/app-emulation/qemu/qemu-1.5.3-r99.ebuild b/app-emulation/qemu/qemu-1.5.3-r99.ebuild |
342 |
new file mode 100644 |
343 |
index 0000000..e6adfb1 |
344 |
--- /dev/null |
345 |
+++ b/app-emulation/qemu/qemu-1.5.3-r99.ebuild |
346 |
@@ -0,0 +1,552 @@ |
347 |
+# Copyright 1999-2013 Gentoo Foundation |
348 |
+# Distributed under the terms of the GNU General Public License v2 |
349 |
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-1.5.3.ebuild,v 1.3 2013/09/15 09:29:18 ago Exp $ |
350 |
+ |
351 |
+EAPI=5 |
352 |
+ |
353 |
+PYTHON_COMPAT=( python{2_6,2_7} ) |
354 |
+PYTHON_REQ_USE="ncurses,readline" |
355 |
+ |
356 |
+inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ |
357 |
+ user udev fcaps readme.gentoo |
358 |
+ |
359 |
+BACKPORTS=25d93791 |
360 |
+ |
361 |
+if [[ ${PV} = *9999* ]]; then |
362 |
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git" |
363 |
+ inherit git-2 |
364 |
+ SRC_URI="" |
365 |
+ KEYWORDS="" |
366 |
+else |
367 |
+ SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2 |
368 |
+ ${BACKPORTS:+ |
369 |
+ http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}" |
370 |
+ KEYWORDS="amd64 x86" |
371 |
+fi |
372 |
+ |
373 |
+DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" |
374 |
+HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" |
375 |
+ |
376 |
+LICENSE="GPL-2 LGPL-2 BSD-2" |
377 |
+SLOT="0" |
378 |
+IUSE="accessibility +aio alsa bluetooth +caps +curl debug fdt glusterfs \ |
379 |
+gtk iscsi +jpeg \ |
380 |
+kernel_linux kernel_FreeBSD mixemu ncurses opengl +png pulseaudio python \ |
381 |
+rbd sasl +seccomp sdl selinux smartcard spice static static-softmmu \ |
382 |
+static-user systemtap tci test +threads tls usbredir +uuid vde +vhost-net \ |
383 |
+virtfs +vnc xattr xen xfs" |
384 |
+ |
385 |
+COMMON_TARGETS="i386 x86_64 alpha arm cris m68k microblaze microblazeel mips |
386 |
+mipsel mips64 mips64el or32 ppc ppc64 sh4 sh4eb sparc sparc64 s390x unicore32" |
387 |
+IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb xtensa xtensaeb" |
388 |
+IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 sparc32plus" |
389 |
+ |
390 |
+# Setup the default SoftMMU targets, while using the loops |
391 |
+# below to setup the other targets. |
392 |
+REQUIRED_USE="|| (" |
393 |
+ |
394 |
+for target in ${IUSE_SOFTMMU_TARGETS}; do |
395 |
+ IUSE="${IUSE} qemu_softmmu_targets_${target}" |
396 |
+ REQUIRED_USE="${REQUIRED_USE} qemu_softmmu_targets_${target}" |
397 |
+done |
398 |
+ |
399 |
+for target in ${IUSE_USER_TARGETS}; do |
400 |
+ IUSE="${IUSE} qemu_user_targets_${target}" |
401 |
+ REQUIRED_USE="${REQUIRED_USE} qemu_user_targets_${target}" |
402 |
+done |
403 |
+REQUIRED_USE="${REQUIRED_USE} )" |
404 |
+ |
405 |
+# Block USE flag configurations known to not work |
406 |
+REQUIRED_USE="${REQUIRED_USE} |
407 |
+ python? ( ${PYTHON_REQUIRED_USE} ) |
408 |
+ static? ( static-softmmu static-user ) |
409 |
+ static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk ) |
410 |
+ virtfs? ( xattr )" |
411 |
+ |
412 |
+# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. |
413 |
+LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)] |
414 |
+ sys-apps/pciutils[static-libs(+)] |
415 |
+ sys-libs/zlib[static-libs(+)] |
416 |
+ >=x11-libs/pixman-0.28.0[static-libs(+)] |
417 |
+ aio? ( dev-libs/libaio[static-libs(+)] ) |
418 |
+ caps? ( sys-libs/libcap-ng[static-libs(+)] ) |
419 |
+ curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) |
420 |
+ fdt? ( >=sys-apps/dtc-1.2.0[static-libs(+)] <sys-apps/dtc-1.4.0[static-libs(+)] ) |
421 |
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) |
422 |
+ jpeg? ( virtual/jpeg[static-libs(+)] ) |
423 |
+ ncurses? ( sys-libs/ncurses[static-libs(+)] ) |
424 |
+ png? ( media-libs/libpng[static-libs(+)] ) |
425 |
+ rbd? ( sys-cluster/ceph[static-libs(+)] ) |
426 |
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) |
427 |
+ sdl? ( >=media-libs/libsdl-1.2.11[static-libs(+)] ) |
428 |
+ seccomp? ( >=sys-libs/libseccomp-1.0.1[static-libs(+)] ) |
429 |
+ spice? ( >=app-emulation/spice-0.12.0[static-libs(+)] ) |
430 |
+ tls? ( net-libs/gnutls[static-libs(+)] ) |
431 |
+ uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] ) |
432 |
+ vde? ( net-misc/vde[static-libs(+)] ) |
433 |
+ xattr? ( sys-apps/attr[static-libs(+)] ) |
434 |
+ xfs? ( sys-fs/xfsprogs[static-libs(+)] )" |
435 |
+RDEPEND="!static-softmmu? ( ${LIB_DEPEND//\[static-libs(+)]} ) |
436 |
+ static-user? ( >=dev-libs/glib-2.0[static-libs(+)] ) |
437 |
+ qemu_softmmu_targets_i386? ( |
438 |
+ >=sys-firmware/ipxe-1.0.0_p20130624 |
439 |
+ ~sys-firmware/seabios-1.7.2.2 |
440 |
+ ~sys-firmware/sgabios-0.1_pre8 |
441 |
+ ~sys-firmware/vgabios-0.7a |
442 |
+ ) |
443 |
+ qemu_softmmu_targets_x86_64? ( |
444 |
+ >=sys-firmware/ipxe-1.0.0_p20130624 |
445 |
+ ~sys-firmware/seabios-1.7.2.2 |
446 |
+ ~sys-firmware/sgabios-0.1_pre8 |
447 |
+ ~sys-firmware/vgabios-0.7a |
448 |
+ ) |
449 |
+ accessibility? ( app-accessibility/brltty ) |
450 |
+ alsa? ( >=media-libs/alsa-lib-1.0.13 ) |
451 |
+ bluetooth? ( net-wireless/bluez ) |
452 |
+ gtk? ( |
453 |
+ x11-libs/gtk+:3 |
454 |
+ x11-libs/vte:2.90 |
455 |
+ ) |
456 |
+ iscsi? ( net-libs/libiscsi ) |
457 |
+ opengl? ( virtual/opengl ) |
458 |
+ pulseaudio? ( media-sound/pulseaudio ) |
459 |
+ python? ( ${PYTHON_DEPS} ) |
460 |
+ sdl? ( media-libs/libsdl[X] ) |
461 |
+ selinux? ( sec-policy/selinux-qemu ) |
462 |
+ smartcard? ( dev-libs/nss !app-emulation/libcacard ) |
463 |
+ spice? ( >=app-emulation/spice-protocol-0.12.3 ) |
464 |
+ systemtap? ( dev-util/systemtap ) |
465 |
+ usbredir? ( >=sys-apps/usbredir-0.6 ) |
466 |
+ virtfs? ( sys-libs/libcap ) |
467 |
+ xen? ( app-emulation/xen-tools )" |
468 |
+ |
469 |
+DEPEND="${RDEPEND} |
470 |
+ dev-lang/perl |
471 |
+ =dev-lang/python-2* |
472 |
+ sys-apps/texinfo |
473 |
+ virtual/pkgconfig |
474 |
+ kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) |
475 |
+ static-softmmu? ( ${LIB_DEPEND} ) |
476 |
+ test? ( |
477 |
+ dev-libs/glib[utils] |
478 |
+ sys-devel/bc |
479 |
+ )" |
480 |
+ |
481 |
+STRIP_MASK="/usr/share/qemu/palcode-clipper" |
482 |
+ |
483 |
+QA_PREBUILT=" |
484 |
+ usr/share/qemu/openbios-ppc |
485 |
+ usr/share/qemu/openbios-sparc64 |
486 |
+ usr/share/qemu/openbios-sparc32 |
487 |
+ usr/share/qemu/palcode-clipper |
488 |
+ usr/share/qemu/s390-ccw.img" |
489 |
+ |
490 |
+QA_WX_LOAD="usr/bin/qemu-i386 |
491 |
+ usr/bin/qemu-x86_64 |
492 |
+ usr/bin/qemu-alpha |
493 |
+ usr/bin/qemu-arm |
494 |
+ usr/bin/qemu-cris |
495 |
+ usr/bin/qemu-m68k |
496 |
+ usr/bin/qemu-microblaze |
497 |
+ usr/bin/qemu-microblazeel |
498 |
+ usr/bin/qemu-mips |
499 |
+ usr/bin/qemu-mipsel |
500 |
+ usr/bin/qemu-or32 |
501 |
+ usr/bin/qemu-ppc |
502 |
+ usr/bin/qemu-ppc64 |
503 |
+ usr/bin/qemu-ppc64abi32 |
504 |
+ usr/bin/qemu-sh4 |
505 |
+ usr/bin/qemu-sh4eb |
506 |
+ usr/bin/qemu-sparc |
507 |
+ usr/bin/qemu-sparc64 |
508 |
+ usr/bin/qemu-armeb |
509 |
+ usr/bin/qemu-sparc32plus |
510 |
+ usr/bin/qemu-s390x |
511 |
+ usr/bin/qemu-unicore32" |
512 |
+ |
513 |
+DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure |
514 |
+you have the kernel module loaded before running kvm. The easiest way to |
515 |
+ensure that the kernel module is loaded is to load it on boot.\n |
516 |
+For AMD CPUs the module is called 'kvm-amd'\n |
517 |
+For Intel CPUs the module is called 'kvm-intel'\n |
518 |
+Please review /etc/conf.d/modules for how to load these\n\n |
519 |
+Make sure your user is in the 'kvm' group\n |
520 |
+Just run 'gpasswd -a <USER> kvm', then have <USER> re-login." |
521 |
+ |
522 |
+qemu_support_kvm() { |
523 |
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \ |
524 |
+ use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \ |
525 |
+ use qemu_softmmu_targets_s390x; then |
526 |
+ return 0 |
527 |
+ fi |
528 |
+ |
529 |
+ return 1 |
530 |
+} |
531 |
+ |
532 |
+pkg_pretend() { |
533 |
+ if use kernel_linux && kernel_is lt 2 6 25; then |
534 |
+ eerror "This version of KVM requres a host kernel of 2.6.25 or higher." |
535 |
+ elif use kernel_linux; then |
536 |
+ if ! linux_config_exists; then |
537 |
+ eerror "Unable to check your kernel for KVM support" |
538 |
+ else |
539 |
+ CONFIG_CHECK="~KVM ~TUN ~BRIDGE" |
540 |
+ ERROR_KVM="You must enable KVM in your kernel to continue" |
541 |
+ ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" |
542 |
+ ERROR_KVM_AMD+=" your kernel configuration." |
543 |
+ ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" |
544 |
+ ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." |
545 |
+ ERROR_TUN="You will need the Universal TUN/TAP driver compiled" |
546 |
+ ERROR_TUN+=" into your kernel or loaded as a module to use the" |
547 |
+ ERROR_TUN+=" virtual network device if using -net tap." |
548 |
+ ERROR_BRIDGE="You will also need support for 802.1d" |
549 |
+ ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." |
550 |
+ use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" |
551 |
+ ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" |
552 |
+ ERROR_VHOST_NET+=" support" |
553 |
+ |
554 |
+ if use amd64 || use x86 || use amd64-linux || use x86-linux; then |
555 |
+ CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL" |
556 |
+ fi |
557 |
+ |
558 |
+ use python && CONFIG_CHECK+=" ~DEBUG_FS" |
559 |
+ ERROR_DEBUG_FS="debugFS support required for kvm_stat" |
560 |
+ |
561 |
+ # Now do the actual checks setup above |
562 |
+ check_extra_config |
563 |
+ fi |
564 |
+ fi |
565 |
+} |
566 |
+ |
567 |
+pkg_setup() { |
568 |
+ enewgroup kvm 78 |
569 |
+ |
570 |
+ python_export_best |
571 |
+} |
572 |
+ |
573 |
+src_prepare() { |
574 |
+ # Alter target makefiles to accept CFLAGS set via flag-o |
575 |
+ sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \ |
576 |
+ Makefile Makefile.target || die |
577 |
+ |
578 |
+ epatch "${FILESDIR}"/qemu-9999-cflags.patch |
579 |
+ epatch "${FILESDIR}"/qemu-1.5.3-openpty.patch |
580 |
+ epatch "${FILESDIR}"/qemu-1.7.0-sigset_t.patch |
581 |
+ epatch "${FILESDIR}"/qemu-1.7.0-ffsll.patch |
582 |
+ [[ -n ${BACKPORTS} ]] && \ |
583 |
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \ |
584 |
+ epatch |
585 |
+ |
586 |
+ append-flags "-Dflock64=flock -D__SIGRTMIN=32 -D__SIGRTMAX=\(NSIG-1\)" |
587 |
+ append-flags "-DF_EXLCK=4 -DF_SHLCK=8" |
588 |
+ |
589 |
+ # Fix ld and objcopy being called directly |
590 |
+ tc-export LD OBJCOPY |
591 |
+ |
592 |
+ # Verbose builds |
593 |
+ MAKEOPTS+=" V=1" |
594 |
+ |
595 |
+ epatch_user |
596 |
+} |
597 |
+ |
598 |
+## |
599 |
+# configures qemu based on the build directory and the build type |
600 |
+# we are using. |
601 |
+# |
602 |
+qemu_src_configure() { |
603 |
+ debug-print-function $FUNCNAME "$@" |
604 |
+ |
605 |
+ local buildtype=$1 |
606 |
+ local builddir=$2 |
607 |
+ local conf_opts audio_opts |
608 |
+ local static_flag="static-${buildtype}" |
609 |
+ |
610 |
+ conf_opts="--prefix=/usr" |
611 |
+ conf_opts+=" --sysconfdir=/etc" |
612 |
+ conf_opts+=" --libdir=/usr/$(get_libdir)" |
613 |
+ conf_opts+=" --docdir=/usr/share/doc/${PF}/html" |
614 |
+ conf_opts+=" --disable-bsd-user" |
615 |
+ conf_opts+=" --disable-guest-agent" |
616 |
+ conf_opts+=" --disable-strip" |
617 |
+ conf_opts+=" --disable-werror" |
618 |
+ conf_opts+=" --python=${PYTHON}" |
619 |
+ |
620 |
+ # audio options |
621 |
+ audio_opts="oss" |
622 |
+ use alsa && audio_opts="alsa,${audio_opts}" |
623 |
+ use sdl && audio_opts="sdl,${audio_opts}" |
624 |
+ use pulseaudio && audio_opts="pa,${audio_opts}" |
625 |
+ |
626 |
+ if [[ ${buildtype} == "user" ]]; then |
627 |
+ conf_opts+=" --enable-linux-user" |
628 |
+ conf_opts+=" --disable-system" |
629 |
+ conf_opts+=" --target-list=${user_targets}" |
630 |
+ conf_opts+=" --disable-blobs" |
631 |
+ conf_opts+=" --disable-bluez" |
632 |
+ conf_opts+=" --disable-curses" |
633 |
+ conf_opts+=" --disable-kvm" |
634 |
+ conf_opts+=" --disable-libiscsi" |
635 |
+ conf_opts+=" --disable-glusterfs" |
636 |
+ conf_opts+=" $(use_enable seccomp)" |
637 |
+ conf_opts+=" --disable-sdl" |
638 |
+ conf_opts+=" --disable-smartcard-nss" |
639 |
+ conf_opts+=" --disable-tools" |
640 |
+ conf_opts+=" --disable-vde" |
641 |
+ fi |
642 |
+ |
643 |
+ if [[ ${buildtype} == "softmmu" ]]; then |
644 |
+ conf_opts+=" --disable-linux-user" |
645 |
+ conf_opts+=" --enable-system" |
646 |
+ conf_opts+=" --with-system-pixman" |
647 |
+ conf_opts+=" --target-list=${softmmu_targets}" |
648 |
+ conf_opts+=" $(use_enable bluetooth bluez)" |
649 |
+ conf_opts+=" $(use_enable gtk)" |
650 |
+ use gtk && conf_opts+=" --with-gtkabi=3.0" |
651 |
+ conf_opts+=" $(use_enable sdl)" |
652 |
+ conf_opts+=" $(use_enable aio linux-aio)" |
653 |
+ conf_opts+=" $(use_enable accessibility brlapi)" |
654 |
+ conf_opts+=" $(use_enable caps cap-ng)" |
655 |
+ conf_opts+=" $(use_enable curl)" |
656 |
+ conf_opts+=" $(use_enable fdt)" |
657 |
+ conf_opts+=" $(use_enable glusterfs)" |
658 |
+ conf_opts+=" $(use_enable iscsi libiscsi)" |
659 |
+ conf_opts+=" $(use_enable jpeg vnc-jpeg)" |
660 |
+ conf_opts+=" $(use_enable kernel_linux kvm)" |
661 |
+ conf_opts+=" $(use_enable kernel_linux nptl)" |
662 |
+ conf_opts+=" $(use_enable ncurses curses)" |
663 |
+ conf_opts+=" $(use_enable opengl glx)" |
664 |
+ conf_opts+=" $(use_enable png vnc-png)" |
665 |
+ conf_opts+=" $(use_enable rbd)" |
666 |
+ conf_opts+=" $(use_enable sasl vnc-sasl)" |
667 |
+ conf_opts+=" $(use_enable seccomp)" |
668 |
+ conf_opts+=" $(use_enable smartcard smartcard-nss)" |
669 |
+ conf_opts+=" $(use_enable spice)" |
670 |
+ conf_opts+=" $(use_enable tls vnc-tls)" |
671 |
+ conf_opts+=" $(use_enable tls vnc-ws)" |
672 |
+ conf_opts+=" $(use_enable usbredir usb-redir)" |
673 |
+ conf_opts+=" $(use_enable uuid)" |
674 |
+ conf_opts+=" $(use_enable vde)" |
675 |
+ conf_opts+=" $(use_enable vhost-net)" |
676 |
+ conf_opts+=" $(use_enable virtfs)" |
677 |
+ conf_opts+=" $(use_enable vnc)" |
678 |
+ conf_opts+=" $(use_enable xattr attr)" |
679 |
+ conf_opts+=" $(use_enable xen)" |
680 |
+ conf_opts+=" $(use_enable xen xen-pci-passthrough)" |
681 |
+ conf_opts+=" $(use_enable xfs xfsctl)" |
682 |
+ use mixemu && conf_opts+=" --enable-mixemu" |
683 |
+ conf_opts+=" --audio-drv-list=${audio_opts}" |
684 |
+ conf_opts+=" --enable-migration-from-qemu-kvm" |
685 |
+ fi |
686 |
+ |
687 |
+ conf_opts+=" $(use_enable debug debug-info)" |
688 |
+ conf_opts+=" $(use_enable debug debug-tcg)" |
689 |
+ conf_opts+=" --enable-docs" |
690 |
+ conf_opts+=" $(use_enable tci tcg-interpreter)" |
691 |
+ |
692 |
+ # Add support for SystemTAP |
693 |
+ use systemtap && conf_opts="${conf_opts} --enable-trace-backend=dtrace" |
694 |
+ |
695 |
+ # Add support for static builds |
696 |
+ use ${static_flag} && conf_opts="${conf_opts} --static --disable-pie" |
697 |
+ |
698 |
+ # We always want to attempt to build with PIE support as it results |
699 |
+ # in a more secure binary. But it doesn't work with static or if |
700 |
+ # the current GCC doesn't have PIE support. |
701 |
+ if ! use ${static_flag} && gcc-specs-pie; then |
702 |
+ conf_opts="${conf_opts} --enable-pie" |
703 |
+ fi |
704 |
+ |
705 |
+ einfo "./configure ${conf_opts}" |
706 |
+ cd ${builddir} |
707 |
+ ../configure \ |
708 |
+ --cc="$(tc-getCC)" \ |
709 |
+ --host-cc="$(tc-getBUILD_CC)" \ |
710 |
+ ${conf_opts} \ |
711 |
+ || die "configure failed" |
712 |
+ |
713 |
+ # FreeBSD's kernel does not support QEMU assigning/grabbing |
714 |
+ # host USB devices yet |
715 |
+ use kernel_FreeBSD && \ |
716 |
+ sed -E -e "s|^(HOST_USB=)bsd|\1stub|" -i "${S}"/config-host.mak |
717 |
+} |
718 |
+ |
719 |
+src_configure() { |
720 |
+ softmmu_targets= |
721 |
+ user_targets= |
722 |
+ |
723 |
+ for target in ${IUSE_SOFTMMU_TARGETS} ; do |
724 |
+ use "qemu_softmmu_targets_${target}" && \ |
725 |
+ softmmu_targets="${softmmu_targets},${target}-softmmu" |
726 |
+ done |
727 |
+ |
728 |
+ for target in ${IUSE_USER_TARGETS} ; do |
729 |
+ use "qemu_user_targets_${target}" && \ |
730 |
+ user_targets="${user_targets},${target}-linux-user" |
731 |
+ done |
732 |
+ |
733 |
+ [[ -n ${softmmu_targets} ]] && \ |
734 |
+ einfo "Building the following softmmu targets: ${softmmu_targets}" |
735 |
+ |
736 |
+ [[ -n ${user_targets} ]] && \ |
737 |
+ einfo "Building the following user targets: ${user_targets}" |
738 |
+ |
739 |
+ if [[ -n ${softmmu_targets} ]]; then |
740 |
+ mkdir "${S}/softmmu-build" |
741 |
+ qemu_src_configure "softmmu" "${S}/softmmu-build" |
742 |
+ fi |
743 |
+ |
744 |
+ if [[ -n ${user_targets} ]]; then |
745 |
+ mkdir "${S}/user-build" |
746 |
+ qemu_src_configure "user" "${S}/user-build" |
747 |
+ fi |
748 |
+} |
749 |
+ |
750 |
+src_compile() { |
751 |
+ if [[ -n ${user_targets} ]]; then |
752 |
+ cd "${S}/user-build" |
753 |
+ default |
754 |
+ fi |
755 |
+ |
756 |
+ if [[ -n ${softmmu_targets} ]]; then |
757 |
+ cd "${S}/softmmu-build" |
758 |
+ default |
759 |
+ fi |
760 |
+} |
761 |
+ |
762 |
+src_test() { |
763 |
+ cd "${S}/softmmu-build" |
764 |
+ emake -j1 check |
765 |
+ emake -j1 check-report.html |
766 |
+} |
767 |
+ |
768 |
+qemu_python_install() { |
769 |
+ python_domodule "${S}/QMP/qmp.py" |
770 |
+ |
771 |
+ python_doscript "${S}/scripts/kvm/kvm_stat" |
772 |
+ python_doscript "${S}/scripts/kvm/vmxcap" |
773 |
+ python_doscript "${S}/QMP/qmp-shell" |
774 |
+ python_doscript "${S}/QMP/qemu-ga-client" |
775 |
+} |
776 |
+ |
777 |
+src_install() { |
778 |
+ if [[ -n ${user_targets} ]]; then |
779 |
+ cd "${S}/user-build" |
780 |
+ emake DESTDIR="${ED}" install |
781 |
+ |
782 |
+ # Install binfmt handler init script for user targets |
783 |
+ newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt |
784 |
+ fi |
785 |
+ |
786 |
+ if [[ -n ${softmmu_targets} ]]; then |
787 |
+ cd "${S}/softmmu-build" |
788 |
+ emake DESTDIR="${ED}" install |
789 |
+ |
790 |
+ if use test; then |
791 |
+ dohtml check-report.html |
792 |
+ fi |
793 |
+ |
794 |
+ if use kernel_linux; then |
795 |
+ udev_dorules "${FILESDIR}"/65-kvm.rules |
796 |
+ fi |
797 |
+ |
798 |
+ if use qemu_softmmu_targets_x86_64 ; then |
799 |
+ newbin "${FILESDIR}/qemu-kvm-1.4" qemu-kvm |
800 |
+ ewarn "The deprecated '/usr/bin/kvm' symlink is no longer installed" |
801 |
+ ewarn "You should use '/usr/bin/qemu-kvm', you may need to edit" |
802 |
+ ewarn "your libvirt configs or other wrappers for ${PN}" |
803 |
+ elif use x86 || use amd64; then |
804 |
+ elog "You disabled QEMU_SOFTMMU_TARGETS=x86_64, this disables install" |
805 |
+ elog "of the /usr/bin/qemu-kvm script." |
806 |
+ fi |
807 |
+ |
808 |
+ if use python; then |
809 |
+ python_foreach_impl qemu_python_install |
810 |
+ fi |
811 |
+ fi |
812 |
+ |
813 |
+ # Install config file example for qemu-bridge-helper |
814 |
+ insinto "/etc/qemu" |
815 |
+ doins "${FILESDIR}/bridge.conf" |
816 |
+ |
817 |
+ # Remove the docdir placed qmp-commands.txt |
818 |
+ mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/QMP/" |
819 |
+ |
820 |
+ cd "${S}" |
821 |
+ dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt |
822 |
+ newdoc pc-bios/README README.pc-bios |
823 |
+ dodoc QMP/qmp-commands.txt QMP/qmp-events.txt QMP/qmp-spec.txt |
824 |
+ |
825 |
+ # Remove SeaBIOS since we're using the SeaBIOS packaged one |
826 |
+ rm "${ED}/usr/share/qemu/bios.bin" |
827 |
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
828 |
+ dosym ../seabios/bios.bin /usr/share/qemu/bios.bin |
829 |
+ fi |
830 |
+ |
831 |
+ # Remove vgabios since we're using the vgabios packaged one |
832 |
+ rm "${ED}/usr/share/qemu/vgabios.bin" |
833 |
+ rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" |
834 |
+ rm "${ED}/usr/share/qemu/vgabios-qxl.bin" |
835 |
+ rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" |
836 |
+ rm "${ED}/usr/share/qemu/vgabios-vmware.bin" |
837 |
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
838 |
+ dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin |
839 |
+ dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin |
840 |
+ dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin |
841 |
+ dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin |
842 |
+ dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin |
843 |
+ fi |
844 |
+ |
845 |
+ # Remove sgabios since we're using the sgabios packaged one |
846 |
+ rm "${ED}/usr/share/qemu/sgabios.bin" |
847 |
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
848 |
+ dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin |
849 |
+ fi |
850 |
+ |
851 |
+ # Remove iPXE since we're using the iPXE packaged one |
852 |
+ rm "${ED}"/usr/share/qemu/pxe-*.rom |
853 |
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
854 |
+ dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom |
855 |
+ dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom |
856 |
+ dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom |
857 |
+ dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom |
858 |
+ dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom |
859 |
+ dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom |
860 |
+ fi |
861 |
+ |
862 |
+ qemu_support_kvm && readme.gentoo_create_doc |
863 |
+} |
864 |
+ |
865 |
+pkg_postinst() { |
866 |
+ local virtfs_caps= |
867 |
+ |
868 |
+ if qemu_support_kvm; then |
869 |
+ readme.gentoo_print_elog |
870 |
+ ewarn "Migration from qemu-kvm instances and loading qemu-kvm created" |
871 |
+ ewarn "save states will be removed in the next release (1.6.x)" |
872 |
+ ewarn |
873 |
+ ewarn "It is recommended that you migrate any VMs that may be running" |
874 |
+ ewarn "on qemu-kvm to a host with a newer qemu and regenerate" |
875 |
+ ewarn "any saved states with a newer qemu." |
876 |
+ ewarn |
877 |
+ ewarn "qemu-kvm was the primary qemu provider in Gentoo through 1.2.x" |
878 |
+ fi |
879 |
+ |
880 |
+ virtfs_caps+="cap_chown,cap_dac_override,cap_fowner,cap_fsetid," |
881 |
+ virtfs_caps+="cap_setgid,cap_mknod,cap_setuid" |
882 |
+ |
883 |
+ fcaps cap_net_admin /usr/libexec/qemu-bridge-helper |
884 |
+ use virtfs && fcaps ${virtfs_caps} /usr/bin/virtfs-proxy-helper |
885 |
+} |
886 |
+ |
887 |
+pkg_info() { |
888 |
+ echo "Using:" |
889 |
+ echo " $(best_version app-emulation/spice-protocol)" |
890 |
+ echo " $(best_version sys-firmware/ipxe)" |
891 |
+ echo " $(best_version sys-firmware/seabios)" |
892 |
+ if has_version sys-firmware/seabios[binary]; then |
893 |
+ echo " USE=binary" |
894 |
+ else |
895 |
+ echo " USE=''" |
896 |
+ fi |
897 |
+ echo " $(best_version sys-firmware/vgabios)" |
898 |
+} |