Gentoo Archives: gentoo-commits

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