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