Gentoo Archives: gentoo-commits

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