1 |
vapier 14/10/31 00:17:46 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: qemu-2.1.2-r1.ebuild |
5 |
Log: |
6 |
Add fix from upstream for vnc arg sanitizing #527088 by Agostino Sarubbo. |
7 |
|
8 |
(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key D2E96200) |
9 |
|
10 |
Revision Changes Path |
11 |
1.301 app-emulation/qemu/ChangeLog |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/ChangeLog?rev=1.301&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/ChangeLog?rev=1.301&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/ChangeLog?r1=1.300&r2=1.301 |
16 |
|
17 |
Index: ChangeLog |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v |
20 |
retrieving revision 1.300 |
21 |
retrieving revision 1.301 |
22 |
diff -u -r1.300 -r1.301 |
23 |
--- ChangeLog 23 Oct 2014 14:53:45 -0000 1.300 |
24 |
+++ ChangeLog 31 Oct 2014 00:17:46 -0000 1.301 |
25 |
@@ -1,6 +1,12 @@ |
26 |
# ChangeLog for app-emulation/qemu |
27 |
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 |
28 |
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v 1.300 2014/10/23 14:53:45 ago Exp $ |
29 |
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v 1.301 2014/10/31 00:17:46 vapier Exp $ |
30 |
+ |
31 |
+*qemu-2.1.2-r1 (31 Oct 2014) |
32 |
+ |
33 |
+ 31 Oct 2014; Mike Frysinger <vapier@g.o> |
34 |
+ +files/qemu-2.1.2-vnc-sanitize-bits.patch, +qemu-2.1.2-r1.ebuild: |
35 |
+ Add fix from upstream for vnc arg sanitizing #527088 by Agostino Sarubbo. |
36 |
|
37 |
23 Oct 2014; Agostino Sarubbo <ago@g.o> qemu-2.1.1.ebuild: |
38 |
Stable for x86, wrt bug #522364 |
39 |
|
40 |
|
41 |
|
42 |
1.1 app-emulation/qemu/qemu-2.1.2-r1.ebuild |
43 |
|
44 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/qemu-2.1.2-r1.ebuild?rev=1.1&view=markup |
45 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/qemu-2.1.2-r1.ebuild?rev=1.1&content-type=text/plain |
46 |
|
47 |
Index: qemu-2.1.2-r1.ebuild |
48 |
=================================================================== |
49 |
# Copyright 1999-2014 Gentoo Foundation |
50 |
# Distributed under the terms of the GNU General Public License v2 |
51 |
# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-2.1.2-r1.ebuild,v 1.1 2014/10/31 00:17:46 vapier Exp $ |
52 |
|
53 |
EAPI=5 |
54 |
|
55 |
PYTHON_COMPAT=( python{2_6,2_7} ) |
56 |
PYTHON_REQ_USE="ncurses,readline" |
57 |
|
58 |
inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ |
59 |
user udev fcaps readme.gentoo pax-utils |
60 |
|
61 |
BACKPORTS= |
62 |
|
63 |
if [[ ${PV} = *9999* ]]; then |
64 |
EGIT_REPO_URI="git://git.qemu.org/qemu.git" |
65 |
inherit git-2 |
66 |
SRC_URI="" |
67 |
KEYWORDS="" |
68 |
else |
69 |
SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2 |
70 |
${BACKPORTS:+ |
71 |
http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}" |
72 |
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd" |
73 |
fi |
74 |
|
75 |
DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" |
76 |
HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" |
77 |
|
78 |
LICENSE="GPL-2 LGPL-2 BSD-2" |
79 |
SLOT="0" |
80 |
IUSE="accessibility +aio alsa bluetooth +caps +curl debug +fdt glusterfs \ |
81 |
gtk infiniband iscsi +jpeg \ |
82 |
kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs |
83 |
+png pulseaudio python \ |
84 |
rbd sasl +seccomp sdl selinux smartcard snappy spice ssh static static-softmmu \ |
85 |
static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net \ |
86 |
virtfs +vnc xattr xen xfs" |
87 |
|
88 |
COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips |
89 |
mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64 unicore32 |
90 |
x86_64" |
91 |
IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb xtensa xtensaeb" |
92 |
IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 sparc32plus" |
93 |
|
94 |
use_targets=" |
95 |
$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) |
96 |
$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) |
97 |
" |
98 |
IUSE+=" ${use_targets}" |
99 |
|
100 |
# Require at least one softmmu or user target. |
101 |
# Block USE flag configurations known to not work. |
102 |
REQUIRED_USE="|| ( ${use_targets} ) |
103 |
${PYTHON_REQUIRED_USE} |
104 |
qemu_softmmu_targets_arm? ( fdt ) |
105 |
qemu_softmmu_targets_microblaze? ( fdt ) |
106 |
qemu_softmmu_targets_ppc? ( fdt ) |
107 |
qemu_softmmu_targets_ppc64? ( fdt ) |
108 |
static? ( static-softmmu static-user ) |
109 |
static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk ) |
110 |
virtfs? ( xattr )" |
111 |
|
112 |
# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. |
113 |
# |
114 |
# The attr lib isn't always linked in (although the USE flag is always |
115 |
# respected). This is because qemu supports using the C library's API |
116 |
# when available rather than always using the extranl library. |
117 |
COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)] |
118 |
sys-libs/zlib[static-libs(+)] |
119 |
xattr? ( sys-apps/attr[static-libs(+)] )" |
120 |
SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND} |
121 |
>=x11-libs/pixman-0.28.0[static-libs(+)] |
122 |
aio? ( dev-libs/libaio[static-libs(+)] ) |
123 |
caps? ( sys-libs/libcap-ng[static-libs(+)] ) |
124 |
curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) |
125 |
fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] ) |
126 |
glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) |
127 |
infiniband? ( sys-infiniband/librdmacm[static-libs(+)] ) |
128 |
jpeg? ( virtual/jpeg[static-libs(+)] ) |
129 |
lzo? ( dev-libs/lzo:2[static-libs(+)] ) |
130 |
ncurses? ( sys-libs/ncurses[static-libs(+)] ) |
131 |
nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] ) |
132 |
numa? ( sys-process/numactl[static-libs(+)] ) |
133 |
png? ( media-libs/libpng[static-libs(+)] ) |
134 |
rbd? ( sys-cluster/ceph[static-libs(+)] ) |
135 |
sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) |
136 |
sdl? ( >=media-libs/libsdl-1.2.11[static-libs(+)] ) |
137 |
seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) |
138 |
snappy? ( app-arch/snappy[static-libs(+)] ) |
139 |
spice? ( >=app-emulation/spice-0.12.0[static-libs(+)] ) |
140 |
ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] ) |
141 |
tls? ( net-libs/gnutls[static-libs(+)] ) |
142 |
usb? ( >=dev-libs/libusb-1.0.18[static-libs(+)] ) |
143 |
uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] ) |
144 |
vde? ( net-misc/vde[static-libs(+)] ) |
145 |
xfs? ( sys-fs/xfsprogs[static-libs(+)] )" |
146 |
USER_LIB_DEPEND="${COMMON_LIB_DEPEND}" |
147 |
X86_FIRMWARE_DEPEND=" |
148 |
>=sys-firmware/ipxe-1.0.0_p20130624 |
149 |
pin-upstream-blobs? ( |
150 |
~sys-firmware/seabios-1.7.5 |
151 |
~sys-firmware/sgabios-0.1_pre8 |
152 |
~sys-firmware/vgabios-0.7a |
153 |
) |
154 |
!pin-upstream-blobs? ( |
155 |
sys-firmware/seabios |
156 |
sys-firmware/sgabios |
157 |
sys-firmware/vgabios |
158 |
)" |
159 |
RDEPEND="!static-softmmu? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} ) |
160 |
!static-user? ( ${USER_LIB_DEPEND//\[static-libs(+)]} ) |
161 |
qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) |
162 |
qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} ) |
163 |
accessibility? ( app-accessibility/brltty ) |
164 |
alsa? ( >=media-libs/alsa-lib-1.0.13 ) |
165 |
bluetooth? ( net-wireless/bluez ) |
166 |
gtk? ( |
167 |
x11-libs/gtk+:3 |
168 |
x11-libs/vte:2.90 |
169 |
) |
170 |
iscsi? ( net-libs/libiscsi ) |
171 |
opengl? ( virtual/opengl ) |
172 |
pulseaudio? ( media-sound/pulseaudio ) |
173 |
python? ( ${PYTHON_DEPS} ) |
174 |
sdl? ( media-libs/libsdl[X] ) |
175 |
selinux? ( sec-policy/selinux-qemu ) |
176 |
smartcard? ( dev-libs/nss !app-emulation/libcacard ) |
177 |
spice? ( >=app-emulation/spice-protocol-0.12.3 ) |
178 |
systemtap? ( dev-util/systemtap ) |
179 |
usbredir? ( >=sys-apps/usbredir-0.6 ) |
180 |
virtfs? ( sys-libs/libcap ) |
181 |
xen? ( app-emulation/xen-tools )" |
182 |
DEPEND="${RDEPEND} |
183 |
dev-lang/perl |
184 |
=dev-lang/python-2* |
185 |
sys-apps/texinfo |
186 |
virtual/pkgconfig |
187 |
kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) |
188 |
gtk? ( nls? ( sys-devel/gettext ) ) |
189 |
static-softmmu? ( ${SOFTMMU_LIB_DEPEND} ) |
190 |
static-user? ( ${USER_LIB_DEPEND} ) |
191 |
test? ( |
192 |
dev-libs/glib[utils] |
193 |
sys-devel/bc |
194 |
)" |
195 |
|
196 |
STRIP_MASK="/usr/share/qemu/palcode-clipper" |
197 |
|
198 |
QA_PREBUILT=" |
199 |
usr/share/qemu/openbios-ppc |
200 |
usr/share/qemu/openbios-sparc64 |
201 |
usr/share/qemu/openbios-sparc32 |
202 |
usr/share/qemu/palcode-clipper |
203 |
usr/share/qemu/s390-ccw.img |
204 |
usr/share/qemu/u-boot.e500 |
205 |
" |
206 |
|
207 |
QA_WX_LOAD="usr/bin/qemu-i386 |
208 |
usr/bin/qemu-x86_64 |
209 |
usr/bin/qemu-alpha |
210 |
usr/bin/qemu-arm |
211 |
usr/bin/qemu-cris |
212 |
usr/bin/qemu-m68k |
213 |
usr/bin/qemu-microblaze |
214 |
usr/bin/qemu-microblazeel |
215 |
usr/bin/qemu-mips |
216 |
usr/bin/qemu-mipsel |
217 |
usr/bin/qemu-or32 |
218 |
usr/bin/qemu-ppc |
219 |
usr/bin/qemu-ppc64 |
220 |
usr/bin/qemu-ppc64abi32 |
221 |
usr/bin/qemu-sh4 |
222 |
usr/bin/qemu-sh4eb |
223 |
usr/bin/qemu-sparc |
224 |
usr/bin/qemu-sparc64 |
225 |
usr/bin/qemu-armeb |
226 |
usr/bin/qemu-sparc32plus |
227 |
usr/bin/qemu-s390x |
228 |
usr/bin/qemu-unicore32" |
229 |
|
230 |
DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure |
231 |
you have the kernel module loaded before running kvm. The easiest way to |
232 |
ensure that the kernel module is loaded is to load it on boot.\n |
233 |
For AMD CPUs the module is called 'kvm-amd'\n |
234 |
For Intel CPUs the module is called 'kvm-intel'\n |
235 |
Please review /etc/conf.d/modules for how to load these\n\n |
236 |
Make sure your user is in the 'kvm' group\n |
237 |
Just run 'gpasswd -a <USER> kvm', then have <USER> re-login." |
238 |
|
239 |
qemu_support_kvm() { |
240 |
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \ |
241 |
use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \ |
242 |
use qemu_softmmu_targets_s390x; then |
243 |
return 0 |
244 |
fi |
245 |
|
246 |
return 1 |
247 |
} |
248 |
|
249 |
pkg_pretend() { |
250 |
if use kernel_linux && kernel_is lt 2 6 25; then |
251 |
eerror "This version of KVM requres a host kernel of 2.6.25 or higher." |
252 |
elif use kernel_linux; then |
253 |
if ! linux_config_exists; then |
254 |
eerror "Unable to check your kernel for KVM support" |
255 |
else |
256 |
CONFIG_CHECK="~KVM ~TUN ~BRIDGE" |
257 |
ERROR_KVM="You must enable KVM in your kernel to continue" |
258 |
ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" |
259 |
ERROR_KVM_AMD+=" your kernel configuration." |
260 |
ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" |
261 |
ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." |
262 |
ERROR_TUN="You will need the Universal TUN/TAP driver compiled" |
263 |
ERROR_TUN+=" into your kernel or loaded as a module to use the" |
264 |
ERROR_TUN+=" virtual network device if using -net tap." |
265 |
ERROR_BRIDGE="You will also need support for 802.1d" |
266 |
ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." |
267 |
use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" |
268 |
ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" |
269 |
ERROR_VHOST_NET+=" support" |
270 |
|
271 |
if use amd64 || use x86 || use amd64-linux || use x86-linux; then |
272 |
CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL" |
273 |
fi |
274 |
|
275 |
use python && CONFIG_CHECK+=" ~DEBUG_FS" |
276 |
ERROR_DEBUG_FS="debugFS support required for kvm_stat" |
277 |
|
278 |
# Now do the actual checks setup above |
279 |
check_extra_config |
280 |
fi |
281 |
fi |
282 |
|
283 |
if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then |
284 |
eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" |
285 |
eerror "instances are still pointing to it. Please update your" |
286 |
eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" |
287 |
eerror "and the right system binary (e.g. qemu-system-x86_64)." |
288 |
die "update your virt configs to not use qemu-kvm" |
289 |
fi |
290 |
} |
291 |
|
292 |
pkg_setup() { |
293 |
enewgroup kvm 78 |
294 |
} |
295 |
|
296 |
src_prepare() { |
297 |
# Alter target makefiles to accept CFLAGS set via flag-o |
298 |
sed -i -r \ |
299 |
-e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ |
300 |
Makefile Makefile.target || die |
301 |
|
302 |
# Cheap hack to disable gettext .mo generation. |
303 |
use nls || rm -f po/*.po |
304 |
|
305 |
epatch "${FILESDIR}"/qemu-1.7.0-cflags.patch |
306 |
epatch "${FILESDIR}"/${PN}-2.1.1-readlink-self.patch |
307 |
epatch "${FILESDIR}"/${PN}-2.1.2-vnc-sanitize-bits.patch #527088 |
308 |
[[ -n ${BACKPORTS} ]] && \ |
309 |
EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \ |
310 |
epatch |
311 |
|
312 |
# Fix ld and objcopy being called directly |
313 |
tc-export AR LD OBJCOPY |
314 |
|
315 |
# Verbose builds |
316 |
MAKEOPTS+=" V=1" |
317 |
|
318 |
epatch_user |
319 |
} |
320 |
|
321 |
## |
322 |
# configures qemu based on the build directory and the build type |
323 |
# we are using. |
324 |
# |
325 |
qemu_src_configure() { |
326 |
debug-print-function ${FUNCNAME} "$@" |
327 |
|
328 |
local buildtype=$1 |
329 |
local builddir=$2 |
330 |
local static_flag="static-${buildtype}" |
331 |
|
332 |
# audio options |
333 |
local audio_opts="oss" |
334 |
use alsa && audio_opts="alsa,${audio_opts}" |
335 |
use sdl && audio_opts="sdl,${audio_opts}" |
336 |
use pulseaudio && audio_opts="pa,${audio_opts}" |
337 |
|
338 |
local conf_opts=( |
339 |
--prefix=/usr |
340 |
--sysconfdir=/etc |
341 |
--libdir=/usr/$(get_libdir) |
342 |
--docdir=/usr/share/doc/${PF}/html |
343 |
--disable-bsd-user |
344 |
--disable-guest-agent |
345 |
--disable-strip |
346 |
--disable-werror |
347 |
--python="${PYTHON}" |
348 |
--cc="$(tc-getCC)" |
349 |
--cxx="$(tc-getCXX)" |
350 |
--host-cc="$(tc-getBUILD_CC)" |
351 |
$(use_enable debug debug-info) |
352 |
$(use_enable debug debug-tcg) |
353 |
--enable-docs |
354 |
$(use_enable tci tcg-interpreter) |
355 |
$(use_enable xattr attr) |
356 |
) |
357 |
|
358 |
# Disable options not used by user targets as the default configure |
359 |
# options will autoprobe and try to link in a bunch of unused junk. |
360 |
conf_softmmu() { |
361 |
if [[ ${buildtype} == "user" ]] ; then |
362 |
echo "--disable-${2:-$1}" |
363 |
else |
364 |
use_enable "$@" |
365 |
fi |
366 |
} |
367 |
conf_opts+=( |
368 |
$(conf_softmmu accessibility brlapi) |
369 |
$(conf_softmmu aio linux-aio) |
370 |
$(conf_softmmu bluetooth bluez) |
371 |
$(conf_softmmu caps cap-ng) |
372 |
$(conf_softmmu curl) |
373 |
$(conf_softmmu fdt) |
374 |
$(conf_softmmu glusterfs) |
375 |
$(conf_softmmu gtk) |
376 |
$(conf_softmmu infiniband rdma) |
377 |
$(conf_softmmu iscsi libiscsi) |
378 |
$(conf_softmmu jpeg vnc-jpeg) |
379 |
$(conf_softmmu kernel_linux kvm) |
380 |
$(conf_softmmu lzo) |
381 |
$(conf_softmmu ncurses curses) |
382 |
$(conf_softmmu nfs libnfs) |
383 |
$(conf_softmmu numa) |
384 |
$(conf_softmmu opengl glx) |
385 |
$(conf_softmmu png vnc-png) |
386 |
$(conf_softmmu rbd) |
387 |
$(conf_softmmu sasl vnc-sasl) |
388 |
$(conf_softmmu sdl) |
389 |
$(conf_softmmu seccomp) |
390 |
$(conf_softmmu smartcard smartcard-nss) |
391 |
$(conf_softmmu snappy) |
392 |
$(conf_softmmu spice) |
393 |
$(conf_softmmu ssh libssh2) |
394 |
$(conf_softmmu tls quorum) |
395 |
$(conf_softmmu tls vnc-tls) |
396 |
$(conf_softmmu tls vnc-ws) |
397 |
$(conf_softmmu usb libusb) |
398 |
$(conf_softmmu usbredir usb-redir) |
399 |
$(conf_softmmu uuid) |
400 |
$(conf_softmmu vde) |
401 |
$(conf_softmmu vhost-net) |
402 |
$(conf_softmmu virtfs) |
403 |
$(conf_softmmu vnc) |
404 |
$(conf_softmmu xen) |
405 |
$(conf_softmmu xen xen-pci-passthrough) |
406 |
$(conf_softmmu xfs xfsctl) |
407 |
) |
408 |
|
409 |
case ${buildtype} in |
410 |
user) |
411 |
conf_opts+=( |
412 |
--enable-linux-user |
413 |
--disable-system |
414 |
--target-list="${user_targets}" |
415 |
--disable-blobs |
416 |
--disable-tools |
417 |
) |
418 |
;; |
419 |
softmmu) |
420 |
conf_opts+=( |
421 |
--disable-linux-user |
422 |
--enable-system |
423 |
--target-list="${softmmu_targets}" |
424 |
--with-system-pixman |
425 |
--audio-drv-list="${audio_opts}" |
426 |
) |
427 |
use gtk && conf_opts+=( --with-gtkabi=3.0 ) |
428 |
;; |
429 |
esac |
430 |
|
431 |
# Add support for SystemTAP |
432 |
use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) |
433 |
|
434 |
# We always want to attempt to build with PIE support as it results |
435 |
# in a more secure binary. But it doesn't work with static or if |
436 |
# the current GCC doesn't have PIE support. |
437 |
if use ${static_flag}; then |
438 |
conf_opts+=( --static --disable-pie ) |
439 |
else |
440 |
gcc-specs-pie && conf_opts+=( --enable-pie ) |
441 |
fi |
442 |
|
443 |
einfo "./configure ${conf_opts[*]}" |
444 |
cd "${builddir}" |
445 |
../configure "${conf_opts[@]}" || die "configure failed" |
446 |
|
447 |
# FreeBSD's kernel does not support QEMU assigning/grabbing |
448 |
# host USB devices yet |
449 |
use kernel_FreeBSD && \ |
450 |
sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak |
451 |
} |
452 |
|
453 |
src_configure() { |
454 |
local target |
455 |
|
456 |
python_export_best |
457 |
|
458 |
softmmu_targets= softmmu_bins=() |
459 |
user_targets= user_bins=() |
460 |
|
461 |
for target in ${IUSE_SOFTMMU_TARGETS} ; do |
462 |
if use "qemu_softmmu_targets_${target}"; then |
463 |
softmmu_targets+=",${target}-softmmu" |
464 |
softmmu_bins+=( "qemu-system-${target}" ) |
465 |
fi |
466 |
done |
467 |
|
468 |
for target in ${IUSE_USER_TARGETS} ; do |
469 |
if use "qemu_user_targets_${target}"; then |
470 |
user_targets+=",${target}-linux-user" |
471 |
user_bins+=( "qemu-${target}" ) |
472 |
fi |
473 |
done |
474 |
|
475 |
[[ -n ${softmmu_targets} ]] && \ |
476 |
einfo "Building the following softmmu targets: ${softmmu_targets}" |
477 |
|
478 |
[[ -n ${user_targets} ]] && \ |
479 |
einfo "Building the following user targets: ${user_targets}" |
480 |
|
481 |
if [[ -n ${softmmu_targets} ]]; then |
482 |
mkdir "${S}/softmmu-build" |
483 |
qemu_src_configure "softmmu" "${S}/softmmu-build" |
484 |
fi |
485 |
|
486 |
if [[ -n ${user_targets} ]]; then |
487 |
mkdir "${S}/user-build" |
488 |
qemu_src_configure "user" "${S}/user-build" |
489 |
fi |
490 |
} |
491 |
|
492 |
src_compile() { |
493 |
if [[ -n ${user_targets} ]]; then |
494 |
cd "${S}/user-build" |
495 |
default |
496 |
fi |
497 |
|
498 |
if [[ -n ${softmmu_targets} ]]; then |
499 |
cd "${S}/softmmu-build" |
500 |
default |
501 |
fi |
502 |
} |
503 |
|
504 |
src_test() { |
505 |
if [[ -n ${softmmu_targets} ]]; then |
506 |
cd "${S}/softmmu-build" |
507 |
pax-mark m */qemu-system-* #515550 |
508 |
emake -j1 check |
509 |
emake -j1 check-report.html |
510 |
fi |
511 |
} |
512 |
|
513 |
qemu_python_install() { |
514 |
python_domodule "${S}/scripts/qmp/qmp.py" |
515 |
|
516 |
python_doscript "${S}/scripts/kvm/kvm_stat" |
517 |
python_doscript "${S}/scripts/kvm/vmxcap" |
518 |
python_doscript "${S}/scripts/qmp/qmp-shell" |
519 |
python_doscript "${S}/scripts/qmp/qemu-ga-client" |
520 |
} |
521 |
|
522 |
src_install() { |
523 |
if [[ -n ${user_targets} ]]; then |
524 |
cd "${S}/user-build" |
525 |
emake DESTDIR="${ED}" install |
526 |
|
527 |
# Install binfmt handler init script for user targets |
528 |
newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt |
529 |
fi |
530 |
|
531 |
if [[ -n ${softmmu_targets} ]]; then |
532 |
cd "${S}/softmmu-build" |
533 |
emake DESTDIR="${ED}" install |
534 |
|
535 |
# This might not exist if the test failed. #512010 |
536 |
[[ -e check-report.html ]] && dohtml check-report.html |
537 |
|
538 |
if use kernel_linux; then |
539 |
udev_dorules "${FILESDIR}"/65-kvm.rules |
540 |
fi |
541 |
|
542 |
if use python; then |
543 |
python_foreach_impl qemu_python_install |
544 |
fi |
545 |
fi |
546 |
|
547 |
# Disable mprotect on the qemu binaries as they use JITs to be fast #459348 |
548 |
pushd "${ED}"/usr/bin >/dev/null |
549 |
pax-mark m "${softmmu_bins[@]}" "${user_bins[@]}" |
550 |
popd >/dev/null |
551 |
|
552 |
# Install config file example for qemu-bridge-helper |
553 |
insinto "/etc/qemu" |
554 |
doins "${FILESDIR}/bridge.conf" |
555 |
|
556 |
# Remove the docdir placed qmp-commands.txt |
557 |
mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/docs/qmp/" |
558 |
|
559 |
cd "${S}" |
560 |
dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt |
561 |
newdoc pc-bios/README README.pc-bios |
562 |
dodoc docs/qmp/*.txt |
563 |
|
564 |
# Remove SeaBIOS since we're using the SeaBIOS packaged one |
565 |
rm "${ED}/usr/share/qemu/bios.bin" |
566 |
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
567 |
dosym ../seabios/bios.bin /usr/share/qemu/bios.bin |
568 |
fi |
569 |
|
570 |
# Remove vgabios since we're using the vgabios packaged one |
571 |
if [[ -n ${softmmu_targets} ]]; then |
572 |
rm "${ED}/usr/share/qemu/vgabios.bin" |
573 |
rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" |
574 |
rm "${ED}/usr/share/qemu/vgabios-qxl.bin" |
575 |
rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" |
576 |
rm "${ED}/usr/share/qemu/vgabios-vmware.bin" |
577 |
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
578 |
dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin |
579 |
dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin |
580 |
dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin |
581 |
dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin |
582 |
dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin |
583 |
fi |
584 |
|
585 |
# Remove sgabios since we're using the sgabios packaged one |
586 |
rm "${ED}/usr/share/qemu/sgabios.bin" |
587 |
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
588 |
dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin |
589 |
fi |
590 |
|
591 |
# Remove iPXE since we're using the iPXE packaged one |
592 |
rm "${ED}"/usr/share/qemu/pxe-*.rom |
593 |
if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
594 |
dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom |
595 |
dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom |
596 |
dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom |
597 |
dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom |
598 |
dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom |
599 |
dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom |
600 |
fi |
601 |
fi |
602 |
|
603 |
qemu_support_kvm && readme.gentoo_create_doc |
604 |
} |
605 |
|
606 |
pkg_postinst() { |
607 |
if qemu_support_kvm; then |
608 |
readme.gentoo_print_elog |
609 |
ewarn "Migration from qemu-kvm instances and loading qemu-kvm created" |
610 |
ewarn "save states has been removed starting with the 1.6.2 release" |
611 |
ewarn |
612 |
ewarn "It is recommended that you migrate any VMs that may be running" |
613 |
ewarn "on qemu-kvm to a host with a newer qemu and regenerate" |
614 |
ewarn "any saved states with a newer qemu." |
615 |
ewarn |
616 |
ewarn "qemu-kvm was the primary qemu provider in Gentoo through 1.2.x" |
617 |
|
618 |
if use x86 || use amd64; then |
619 |
ewarn |
620 |
ewarn "The /usr/bin/kvm and /usr/bin/qemu-kvm wrappers are no longer" |
621 |
ewarn "installed. In order to use kvm acceleration, pass the flag" |
622 |
ewarn "-enable-kvm when running your system target." |
623 |
fi |
624 |
fi |
625 |
|
626 |
fcaps cap_net_admin /usr/libexec/qemu-bridge-helper |
627 |
if use virtfs && [ -n "${softmmu_targets}" ]; then |
628 |
local virtfs_caps="cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_setgid,cap_mknod,cap_setuid" |
629 |
fcaps ${virtfs_caps} /usr/bin/virtfs-proxy-helper |
630 |
fi |
631 |
} |
632 |
|
633 |
pkg_info() { |
634 |
echo "Using:" |
635 |
echo " $(best_version app-emulation/spice-protocol)" |
636 |
echo " $(best_version sys-firmware/ipxe)" |
637 |
echo " $(best_version sys-firmware/seabios)" |
638 |
if has_version sys-firmware/seabios[binary]; then |
639 |
echo " USE=binary" |
640 |
else |
641 |
echo " USE=''" |
642 |
fi |
643 |
echo " $(best_version sys-firmware/vgabios)" |
644 |
} |