1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
7 PYTHON_REQ_USE="ncurses,readline"
9 PLOCALES="bg de_DE fr_FR hu it tr zh_CN"
11 FIRMWARE_ABI_VERSION="4.0.0-r50"
13 inherit eutils linux-info toolchain-funcs multilib python-r1 \
14 udev fcaps readme.gentoo-r1 pax-utils l10n xdg-utils
16 if [[ ${PV} = *9999* ]]; then
17 EGIT_REPO_URI="git://git.qemu.org/qemu.git"
20 tests/fp/berkeley-{test,soft}float-3
26 SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.xz"
27 KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86"
30 DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
31 HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
33 LICENSE="GPL-2 LGPL-2 BSD-2"
36 IUSE="accessibility +aio alsa bzip2 capstone +caps +curl debug doc
37 +fdt glusterfs gnutls gtk infiniband iscsi jemalloc +jpeg kernel_linux
38 kernel_FreeBSD lzo ncurses nfs nls numa opengl +oss +pin-upstream-blobs
39 plugins +png pulseaudio python rbd sasl +seccomp sdl selinux smartcard snappy
40 spice ssh static static-user systemtap tci test usb usbredir vde
41 +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen xfs +xkb"
43 COMMON_TARGETS="aarch64 alpha arm cris hppa i386 m68k microblaze microblazeel
44 mips mips64 mips64el mipsel nios2 or1k ppc ppc64 riscv32 riscv64 s390x
45 sh4 sh4eb sparc sparc64 x86_64 xtensa xtensaeb"
46 IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS}
47 lm32 moxie tricore unicore32"
48 IUSE_USER_TARGETS="${COMMON_TARGETS}
49 aarch64_be armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus
52 use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
53 use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
54 IUSE+=" ${use_softmmu_targets} ${use_user_targets}"
56 RESTRICT="!test? ( test )"
57 # Allow no targets to be built so that people can get a tools-only build.
58 # Block USE flag configurations known to not work.
59 REQUIRED_USE="${PYTHON_REQUIRED_USE}
60 qemu_softmmu_targets_arm? ( fdt )
61 qemu_softmmu_targets_microblaze? ( fdt )
62 qemu_softmmu_targets_mips64el? ( fdt )
63 qemu_softmmu_targets_ppc64? ( fdt )
64 qemu_softmmu_targets_ppc? ( fdt )
65 qemu_softmmu_targets_riscv32? ( fdt )
66 qemu_softmmu_targets_riscv64? ( fdt )
67 static? ( static-user !alsa !gtk !opengl !pulseaudio !snappy !plugins )
68 static-user? ( !plugins )
71 plugins? ( !static !static-user )
74 # Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
75 # and user/softmmu targets (qemu-*, qemu-system-*).
77 # Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
79 # The attr lib isn't always linked in (although the USE flag is always
80 # respected). This is because qemu supports using the C library's API
81 # when available rather than always using the external library.
83 >=dev-libs/glib-2.0[static-libs(+)]
84 sys-libs/zlib[static-libs(+)]
85 python? ( ${PYTHON_DEPS} )
86 systemtap? ( dev-util/systemtap )
87 xattr? ( sys-apps/attr[static-libs(+)] )"
89 # Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
90 # softmmu targets (qemu-system-*).
91 SOFTMMU_TOOLS_DEPEND="
92 dev-libs/libxml2[static-libs(+)]
93 xkb? ( x11-libs/libxkbcommon[static-libs(+)] )
94 >=x11-libs/pixman-0.28.0[static-libs(+)]
96 app-accessibility/brltty[api]
97 app-accessibility/brltty[static-libs(+)]
99 aio? ( dev-libs/libaio[static-libs(+)] )
100 alsa? ( >=media-libs/alsa-lib-1.0.13 )
101 bzip2? ( app-arch/bzip2[static-libs(+)] )
102 capstone? ( dev-libs/capstone:= )
103 caps? ( sys-libs/libcap-ng[static-libs(+)] )
104 curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
105 fdt? ( >=sys-apps/dtc-1.5.0[static-libs(+)] )
106 glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
108 dev-libs/nettle:=[static-libs(+)]
109 >=net-libs/gnutls-3.0:=[static-libs(+)]
113 vte? ( x11-libs/vte:2.91 )
116 sys-fabric/libibumad:=[static-libs(+)]
117 sys-fabric/libibverbs:=[static-libs(+)]
118 sys-fabric/librdmacm:=[static-libs(+)]
120 iscsi? ( net-libs/libiscsi )
121 jemalloc? ( dev-libs/jemalloc )
122 jpeg? ( virtual/jpeg:0=[static-libs(+)] )
123 lzo? ( dev-libs/lzo:2[static-libs(+)] )
125 sys-libs/ncurses:0=[unicode]
126 sys-libs/ncurses:0=[static-libs(+)]
128 nfs? ( >=net-fs/libnfs-1.9.3:=[static-libs(+)] )
129 numa? ( sys-process/numactl[static-libs(+)] )
132 media-libs/libepoxy[static-libs(+)]
133 media-libs/mesa[static-libs(+)]
134 media-libs/mesa[egl,gbm]
136 png? ( media-libs/libpng:0=[static-libs(+)] )
137 pulseaudio? ( media-sound/pulseaudio )
138 rbd? ( sys-cluster/ceph[static-libs(+)] )
139 sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
141 media-libs/libsdl2[X]
142 media-libs/libsdl2[static-libs(+)]
144 seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
145 smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] )
146 snappy? ( app-arch/snappy:= )
148 >=app-emulation/spice-protocol-0.12.3
149 >=app-emulation/spice-0.12.0[static-libs(+)]
151 ssh? ( >=net-libs/libssh-0.8.6[static-libs(+)] )
152 usb? ( >=virtual/libusb-1-r2[static-libs(+)] )
153 usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] )
154 vde? ( net-misc/vde[static-libs(+)] )
155 virgl? ( media-libs/virglrenderer[static-libs(+)] )
156 virtfs? ( sys-libs/libcap )
157 xen? ( app-emulation/xen-tools:= )
158 xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
160 X86_FIRMWARE_DEPEND="
161 pin-upstream-blobs? (
162 ~sys-firmware/edk2-ovmf-201905[binary]
163 ~sys-firmware/ipxe-1.0.0_p20190728[binary]
164 ~sys-firmware/seabios-1.12.0[binary,seavgabios]
165 ~sys-firmware/sgabios-0.1_pre8[binary]
167 !pin-upstream-blobs? (
168 sys-firmware/edk2-ovmf
170 >=sys-firmware/seabios-1.10.2[seavgabios]
173 PPC64_FIRMWARE_DEPEND="
174 pin-upstream-blobs? (
175 ~sys-firmware/seabios-1.12.0[binary,seavgabios]
177 !pin-upstream-blobs? (
178 >=sys-firmware/seabios-1.10.2[seavgabios]
183 $(python_gen_impl_dep)
187 doc? ( dev-python/sphinx )
188 gtk? ( nls? ( sys-devel/gettext ) )
196 ${ALL_DEPEND//\[static-libs(+)]}
197 ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]}
199 qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
200 qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
201 qemu_softmmu_targets_ppc64? ( ${PPC64_FIRMWARE_DEPEND} )
204 kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
207 ${SOFTMMU_TOOLS_DEPEND}
209 static-user? ( ${ALL_DEPEND} )"
212 selinux? ( sec-policy/selinux-qemu )"
215 "${FILESDIR}"/${PN}-2.5.0-cflags.patch
216 "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
217 "${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch
218 "${FILESDIR}"/${PN}-4.0.0-mkdir_systemtap.patch #684902
222 usr/share/qemu/hppa-firmware.img
223 usr/share/qemu/openbios-ppc
224 usr/share/qemu/openbios-sparc64
225 usr/share/qemu/openbios-sparc32
226 usr/share/qemu/palcode-clipper
227 usr/share/qemu/s390-ccw.img
228 usr/share/qemu/s390-netboot.img
229 usr/share/qemu/u-boot.e500"
231 QA_WX_LOAD="usr/bin/qemu-i386
237 usr/bin/qemu-microblaze
238 usr/bin/qemu-microblazeel
244 usr/bin/qemu-ppc64abi32
250 usr/bin/qemu-sparc32plus
252 usr/bin/qemu-unicore32"
254 DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the
255 kernel module loaded before running kvm. The easiest way to ensure that the
256 kernel module is loaded is to load it on boot.
257 For AMD CPUs the module is called 'kvm-amd'.
258 For Intel CPUs the module is called 'kvm-intel'.
259 Please review /etc/conf.d/modules for how to load these.
261 Make sure your user is in the 'kvm' group. Just run
262 $ gpasswd -a <USER> kvm
263 then have <USER> re-login.
265 For brand new installs, the default permissions on /dev/kvm might not let
266 you access it. You can tell udev to reset ownership/perms:
267 $ udevadm trigger -c add /dev/kvm
269 If you want to register binfmt handlers for qemu user targets:
271 # rc-update add qemu-binfmt
273 # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf"
276 if use kernel_linux && kernel_is lt 2 6 25; then
277 eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
278 elif use kernel_linux; then
279 if ! linux_config_exists; then
280 eerror "Unable to check your kernel for KVM support"
282 CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
283 ERROR_KVM="You must enable KVM in your kernel to continue"
284 ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
285 ERROR_KVM_AMD+=" your kernel configuration."
286 ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
287 ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
288 ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
289 ERROR_TUN+=" into your kernel or loaded as a module to use the"
290 ERROR_TUN+=" virtual network device if using -net tap."
291 ERROR_BRIDGE="You will also need support for 802.1d"
292 ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
293 use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
294 ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
295 ERROR_VHOST_NET+=" support"
297 if use amd64 || use x86 || use amd64-linux || use x86-linux; then
298 if grep -q AuthenticAMD /proc/cpuinfo; then
299 CONFIG_CHECK+=" ~KVM_AMD"
300 elif grep -q GenuineIntel /proc/cpuinfo; then
301 CONFIG_CHECK+=" ~KVM_INTEL"
305 use python && CONFIG_CHECK+=" ~DEBUG_FS"
306 ERROR_DEBUG_FS="debugFS support required for kvm_stat"
308 # Now do the actual checks setup above
313 if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
314 eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
315 eerror "instances are still pointing to it. Please update your"
316 eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
317 eerror "and the right system binary (e.g. qemu-system-x86_64)."
318 die "update your virt configs to not use qemu-kvm"
322 # Sanity check to make sure target lists are kept up-to-date.
325 local detected sorted
327 pushd "${S}"/default-configs >/dev/null || die
329 # Force C locale until glibc is updated. #564936
330 detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u))
331 sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u))
332 if [[ ${sorted} != "${detected}" ]] ; then
333 eerror "The ebuild needs to be kept in sync."
334 eerror "${var}: ${sorted}"
335 eerror "$(printf '%-*s' ${#var} configure): ${detected}"
336 die "sync ${var} to the list of targets"
343 # Make sure locale list is kept up-to-date.
344 local detected sorted
345 detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u))
346 sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u))
347 if [[ ${sorted} != "${detected}" ]] ; then
348 eerror "The ebuild needs to be kept in sync."
349 eerror "PLOCALES: ${sorted}"
350 eerror " po/*.po: ${detected}"
354 # Deal with selective install of locales.
356 # Delete locales the user does not want. #577814
357 rm_loc() { rm po/$1.po || die; }
358 l10n_for_each_disabled_locale_do rm_loc
360 # Cheap hack to disable gettext .mo generation.
366 check_targets IUSE_SOFTMMU_TARGETS softmmu
367 check_targets IUSE_USER_TARGETS linux-user
371 # Use correct toolchain to fix cross-compiling
372 tc-export AR LD NM OBJCOPY PKG_CONFIG
373 export WINDRES=${CHOST}-windres
378 # Run after we've applied all patches.
381 # Remove bundled copy of libfdt
386 # configures qemu based on the build directory and the build type
389 qemu_src_configure() {
390 debug-print-function ${FUNCNAME} "$@"
393 local builddir="${S}/${buildtype}-build"
401 --libdir=/usr/$(get_libdir)
403 --docdir=/usr/share/doc/${PF}/html
404 --mandir=/usr/share/man
405 --with-confsuffix=/qemu
408 --disable-guest-agent
411 # We support gnutls/nettle for crypto operations. It is possible
412 # to use gcrypt when gnutls/nettle are disabled (but not when they
413 # are enabled), but it's not really worth the hassle. Disable it
414 # all the time to avoid automatically detecting it. #568856
419 --host-cc="$(tc-getBUILD_CC)"
420 $(use_enable debug debug-info)
421 $(use_enable debug debug-tcg)
422 $(use_enable doc docs)
423 $(use_enable plugins)
424 $(use_enable tci tcg-interpreter)
425 $(use_enable xattr attr)
428 # Disable options not used by user targets. This simplifies building
429 # static user targets (USE=static-user) considerably.
431 if [[ ${buildtype} == "user" ]] ; then
432 echo "--disable-${2:-$1}"
438 $(conf_notuser accessibility brlapi)
439 $(conf_notuser aio linux-aio)
440 $(conf_notuser bzip2)
441 $(conf_notuser capstone)
442 $(conf_notuser caps cap-ng)
445 $(conf_notuser glusterfs)
446 $(conf_notuser gnutls)
447 $(conf_notuser gnutls nettle)
449 $(conf_notuser infiniband rdma)
450 $(conf_notuser iscsi libiscsi)
451 $(conf_notuser jemalloc jemalloc)
452 $(conf_notuser jpeg vnc-jpeg)
453 $(conf_notuser kernel_linux kvm)
455 $(conf_notuser ncurses curses)
456 $(conf_notuser nfs libnfs)
458 $(conf_notuser opengl)
459 $(conf_notuser png vnc-png)
461 $(conf_notuser sasl vnc-sasl)
463 $(conf_notuser seccomp)
464 $(conf_notuser smartcard)
465 $(conf_notuser snappy)
466 $(conf_notuser spice)
467 $(conf_notuser ssh libssh)
468 $(conf_notuser usb libusb)
469 $(conf_notuser usbredir usb-redir)
471 $(conf_notuser vhost-net)
472 $(conf_notuser vhost-user-fs)
473 $(conf_notuser virgl virglrenderer)
474 $(conf_notuser virtfs)
478 $(conf_notuser xen xen-pci-passthrough)
479 $(conf_notuser xfs xfsctl)
480 $(conf_notuser xkb xkbcommon)
483 if [[ ${buildtype} == "user" ]] ; then
484 conf_opts+=( --disable-libxml2 )
486 conf_opts+=( --enable-libxml2 )
489 if [[ ! ${buildtype} == "user" ]] ; then
495 $(usex pulseaudio pa "")
498 --audio-drv-list=$(printf "%s," "${audio_opts[@]}")
510 local static_flag="static-user"
518 local static_flag="static"
527 local static_flag="static"
531 local targets="${buildtype}_targets"
532 [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" )
534 # Add support for SystemTAP
535 use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
537 # We always want to attempt to build with PIE support as it results
538 # in a more secure binary. But it doesn't work with static or if
539 # the current GCC doesn't have PIE support.
540 if use ${static_flag}; then
541 conf_opts+=( --static --disable-pie )
543 tc-enables-pie && conf_opts+=( --enable-pie )
546 echo "../configure ${conf_opts[*]}"
548 ../configure "${conf_opts[@]}" || die "configure failed"
550 # FreeBSD's kernel does not support QEMU assigning/grabbing
551 # host USB devices yet
552 use kernel_FreeBSD && \
553 sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
561 softmmu_targets= softmmu_bins=()
562 user_targets= user_bins=()
564 for target in ${IUSE_SOFTMMU_TARGETS} ; do
565 if use "qemu_softmmu_targets_${target}"; then
566 softmmu_targets+=",${target}-softmmu"
567 softmmu_bins+=( "qemu-system-${target}" )
571 for target in ${IUSE_USER_TARGETS} ; do
572 if use "qemu_user_targets_${target}"; then
573 user_targets+=",${target}-linux-user"
574 user_bins+=( "qemu-${target}" )
578 softmmu_targets=${softmmu_targets#,}
579 user_targets=${user_targets#,}
581 [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu"
582 [[ -n ${user_targets} ]] && qemu_src_configure "user"
583 qemu_src_configure "tools"
587 if [[ -n ${user_targets} ]]; then
592 if [[ -n ${softmmu_targets} ]]; then
593 cd "${S}/softmmu-build"
597 cd "${S}/tools-build"
602 if [[ -n ${softmmu_targets} ]]; then
603 cd "${S}/softmmu-build"
604 pax-mark m */qemu-system-* #515550
606 emake -j1 check-report.html
610 qemu_python_install() {
611 python_domodule "${S}/python/qemu"
613 python_doscript "${S}/scripts/kvm/vmxcap"
614 python_doscript "${S}/scripts/qmp/qmp-shell"
615 python_doscript "${S}/scripts/qmp/qemu-ga-client"
618 # Generate binfmt support files.
619 # - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc)
620 # - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt)
622 local out="${T}/qemu-binfmt"
623 local out_systemd="${T}/qemu.conf"
624 local d="${T}/binfmt.d"
626 einfo "Generating qemu binfmt scripts and configuration files"
628 # Generate the debian fragments first.
630 "${S}"/scripts/qemu-binfmt-conf.sh \
633 --qemu-path "${EPREFIX}/usr/bin" \
635 # Then turn the fragments into a shell script we can source.
637 -e 's:^([^ ]+) (.*)$:\1="\2":' \
640 # Generate the init.d script by assembling the fragments from above.
641 local f qcpu package interpreter magic mask
642 cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die
643 for f in "${d}"/qemu-* ; do
646 # Normalize the cpu logic like we do in the init.d for the native cpu.
647 qcpu=${package#qemu-}
654 sparc*) qcpu="sparc";;
657 # we use 'printf' here to be portable across 'sh'
658 # implementations: #679168
660 if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then
661 printf '%s\n' ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register
665 echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}"
668 cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die
672 if [[ -n ${user_targets} ]]; then
674 emake DESTDIR="${ED}" install
676 # Install binfmt handler init script for user targets.
678 doinitd "${T}/qemu-binfmt"
680 # Install binfmt/qemu.conf.
681 insinto "/usr/share/qemu/binfmt.d"
682 doins "${T}/qemu.conf"
685 if [[ -n ${softmmu_targets} ]]; then
686 cd "${S}/softmmu-build"
687 emake DESTDIR="${ED}" install
689 # This might not exist if the test failed. #512010
690 [[ -e check-report.html ]] && dodoc check-report.html
692 if use kernel_linux; then
693 udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules
697 python_foreach_impl qemu_python_install
701 cd "${S}/tools-build"
702 emake DESTDIR="${ED}" install
704 # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
705 pushd "${ED}"/usr/bin >/dev/null
706 pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
709 # Install config file example for qemu-bridge-helper
711 doins "${FILESDIR}/bridge.conf"
714 dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
715 newdoc pc-bios/README README.pc-bios
717 # Disallow stripping of prebuilt firmware files.
718 dostrip -x ${QA_PREBUILT}
720 if [[ -n ${softmmu_targets} ]]; then
721 # Remove SeaBIOS since we're using the SeaBIOS packaged one
722 rm "${ED}/usr/share/qemu/bios.bin"
723 rm "${ED}/usr/share/qemu/bios-256k.bin"
724 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
725 dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
726 dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
729 # Remove vgabios since we're using the seavgabios packaged one
730 rm "${ED}/usr/share/qemu/vgabios.bin"
731 rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
732 rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
733 rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
734 rm "${ED}/usr/share/qemu/vgabios-virtio.bin"
735 rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
736 # PPC64 loads vgabios-stdvga
737 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc64; then
738 dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin
739 dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
740 dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
741 dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
742 dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin
743 dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
746 # Remove sgabios since we're using the sgabios packaged one
747 rm "${ED}/usr/share/qemu/sgabios.bin"
748 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
749 dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
752 # Remove iPXE since we're using the iPXE packaged one
753 rm "${ED}"/usr/share/qemu/pxe-*.rom
754 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
755 dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
756 dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
757 dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
758 dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
759 dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
760 dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
764 DISABLE_AUTOFORMATTING=true
765 readme.gentoo_create_doc
768 firmware_abi_change() {
770 for pv in ${REPLACING_VERSIONS}; do
771 if ver_test $pv -lt ${FIRMWARE_ABI_VERSION}; then
779 if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
783 xdg_icon_cache_update
785 [[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \
786 fcaps cap_net_admin ${EROOT}/usr/libexec/qemu-bridge-helper
788 DISABLE_AUTOFORMATTING=true
789 readme.gentoo_print_elog
791 if use pin-upstream-blobs && firmware_abi_change; then
792 ewarn "This version of qemu pins new versions of firmware blobs:"
793 ewarn " $(best_version sys-firmware/edk2-ovmf)"
794 ewarn " $(best_version sys-firmware/ipxe)"
795 ewarn " $(best_version sys-firmware/seabios)"
796 ewarn " $(best_version sys-firmware/sgabios)"
797 ewarn "This might break resume of hibernated guests (started with a different"
798 ewarn "firmware version) and live migration to/from qemu versions with different"
799 ewarn "firmware. Please (cold) restart all running guests. For functional"
800 ewarn "guest migration ensure that all"
801 ewarn "hosts run at least"
802 ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}."
808 echo " $(best_version app-emulation/spice-protocol)"
809 echo " $(best_version sys-firmware/edk2-ovmf)"
810 if has_version 'sys-firmware/edk2-ovmf[binary]'; then
815 echo " $(best_version sys-firmware/ipxe)"
816 echo " $(best_version sys-firmware/seabios)"
817 if has_version 'sys-firmware/seabios[binary]'; then
822 echo " $(best_version sys-firmware/sgabios)"
826 xdg_icon_cache_update