1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,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 +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 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 )
71 # Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
72 # and user/softmmu targets (qemu-*, qemu-system-*).
74 # Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
76 # The attr lib isn't always linked in (although the USE flag is always
77 # respected). This is because qemu supports using the C library's API
78 # when available rather than always using the external library.
80 >=dev-libs/glib-2.0[static-libs(+)]
81 sys-libs/zlib[static-libs(+)]
82 python? ( ${PYTHON_DEPS} )
83 systemtap? ( dev-util/systemtap )
84 xattr? ( sys-apps/attr[static-libs(+)] )"
86 # Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
87 # softmmu targets (qemu-system-*).
88 SOFTMMU_TOOLS_DEPEND="
89 dev-libs/libxml2[static-libs(+)]
90 xkb? ( x11-libs/libxkbcommon[static-libs(+)] )
91 >=x11-libs/pixman-0.28.0[static-libs(+)]
93 app-accessibility/brltty[api]
94 app-accessibility/brltty[static-libs(+)]
96 aio? ( dev-libs/libaio[static-libs(+)] )
97 alsa? ( >=media-libs/alsa-lib-1.0.13 )
98 bzip2? ( app-arch/bzip2[static-libs(+)] )
99 capstone? ( dev-libs/capstone:= )
100 caps? ( sys-libs/libcap-ng[static-libs(+)] )
101 curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
102 fdt? ( >=sys-apps/dtc-1.5.0[static-libs(+)] )
103 glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
105 dev-libs/nettle:=[static-libs(+)]
106 >=net-libs/gnutls-3.0:=[static-libs(+)]
110 vte? ( x11-libs/vte:2.91 )
113 sys-fabric/libibumad:=[static-libs(+)]
114 sys-fabric/libibverbs:=[static-libs(+)]
115 sys-fabric/librdmacm:=[static-libs(+)]
117 iscsi? ( net-libs/libiscsi )
118 jemalloc? ( dev-libs/jemalloc )
119 jpeg? ( virtual/jpeg:0=[static-libs(+)] )
120 lzo? ( dev-libs/lzo:2[static-libs(+)] )
122 sys-libs/ncurses:0=[unicode]
123 sys-libs/ncurses:0=[static-libs(+)]
125 nfs? ( >=net-fs/libnfs-1.9.3:=[static-libs(+)] )
126 numa? ( sys-process/numactl[static-libs(+)] )
129 media-libs/libepoxy[static-libs(+)]
130 media-libs/mesa[static-libs(+)]
131 media-libs/mesa[egl,gbm]
133 png? ( media-libs/libpng:0=[static-libs(+)] )
134 pulseaudio? ( media-sound/pulseaudio )
135 rbd? ( sys-cluster/ceph[static-libs(+)] )
136 sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
138 media-libs/libsdl2[X]
139 media-libs/libsdl2[static-libs(+)]
141 seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
142 smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] )
143 snappy? ( app-arch/snappy:= )
145 >=app-emulation/spice-protocol-0.12.3
146 >=app-emulation/spice-0.12.0[static-libs(+)]
148 ssh? ( >=net-libs/libssh-0.8.6[static-libs(+)] )
149 usb? ( >=virtual/libusb-1-r2[static-libs(+)] )
150 usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] )
151 vde? ( net-misc/vde[static-libs(+)] )
152 virgl? ( media-libs/virglrenderer[static-libs(+)] )
153 virtfs? ( sys-libs/libcap )
154 xen? ( app-emulation/xen-tools:= )
155 xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
157 X86_FIRMWARE_DEPEND="
158 pin-upstream-blobs? (
159 ~sys-firmware/edk2-ovmf-201905[binary]
160 ~sys-firmware/ipxe-1.0.0_p20190728[binary]
161 ~sys-firmware/seabios-1.12.0[binary,seavgabios]
162 ~sys-firmware/sgabios-0.1_pre8[binary]
164 !pin-upstream-blobs? (
165 sys-firmware/edk2-ovmf
167 >=sys-firmware/seabios-1.10.2[seavgabios]
170 PPC64_FIRMWARE_DEPEND="
171 pin-upstream-blobs? (
172 ~sys-firmware/seabios-1.12.0[binary,seavgabios]
174 !pin-upstream-blobs? (
175 >=sys-firmware/seabios-1.10.2[seavgabios]
180 $(python_gen_impl_dep)
184 doc? ( dev-python/sphinx )
185 gtk? ( nls? ( sys-devel/gettext ) )
193 ${ALL_DEPEND//\[static-libs(+)]}
194 ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]}
196 qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
197 qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
198 qemu_softmmu_targets_ppc64? ( ${PPC64_FIRMWARE_DEPEND} )
201 kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
204 ${SOFTMMU_TOOLS_DEPEND}
206 static-user? ( ${ALL_DEPEND} )"
209 selinux? ( sec-policy/selinux-qemu )"
212 "${FILESDIR}"/${PN}-2.5.0-cflags.patch
213 "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
214 "${FILESDIR}"/${PN}-2.11.1-capstone_include_path.patch
215 "${FILESDIR}"/${PN}-4.0.0-sanitize-interp_info.patch
216 "${FILESDIR}"/${PN}-4.0.0-mkdir_systemtap.patch #684902
217 "${FILESDIR}"/${PN}-4.0.0-xkbcommon.patch
221 usr/share/qemu/hppa-firmware.img
222 usr/share/qemu/openbios-ppc
223 usr/share/qemu/openbios-sparc64
224 usr/share/qemu/openbios-sparc32
225 usr/share/qemu/palcode-clipper
226 usr/share/qemu/s390-ccw.img
227 usr/share/qemu/s390-netboot.img
228 usr/share/qemu/u-boot.e500"
230 QA_WX_LOAD="usr/bin/qemu-i386
236 usr/bin/qemu-microblaze
237 usr/bin/qemu-microblazeel
243 usr/bin/qemu-ppc64abi32
249 usr/bin/qemu-sparc32plus
251 usr/bin/qemu-unicore32"
253 DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the
254 kernel module loaded before running kvm. The easiest way to ensure that the
255 kernel module is loaded is to load it on boot.
256 For AMD CPUs the module is called 'kvm-amd'.
257 For Intel CPUs the module is called 'kvm-intel'.
258 Please review /etc/conf.d/modules for how to load these.
260 Make sure your user is in the 'kvm' group. Just run
261 $ gpasswd -a <USER> kvm
262 then have <USER> re-login.
264 For brand new installs, the default permissions on /dev/kvm might not let
265 you access it. You can tell udev to reset ownership/perms:
266 $ udevadm trigger -c add /dev/kvm
268 If you want to register binfmt handlers for qemu user targets:
270 # rc-update add qemu-binfmt
272 # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf"
275 if use kernel_linux && kernel_is lt 2 6 25; then
276 eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
277 elif use kernel_linux; then
278 if ! linux_config_exists; then
279 eerror "Unable to check your kernel for KVM support"
281 CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
282 ERROR_KVM="You must enable KVM in your kernel to continue"
283 ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
284 ERROR_KVM_AMD+=" your kernel configuration."
285 ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
286 ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
287 ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
288 ERROR_TUN+=" into your kernel or loaded as a module to use the"
289 ERROR_TUN+=" virtual network device if using -net tap."
290 ERROR_BRIDGE="You will also need support for 802.1d"
291 ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
292 use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
293 ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
294 ERROR_VHOST_NET+=" support"
296 if use amd64 || use x86 || use amd64-linux || use x86-linux; then
297 if grep -q AuthenticAMD /proc/cpuinfo; then
298 CONFIG_CHECK+=" ~KVM_AMD"
299 elif grep -q GenuineIntel /proc/cpuinfo; then
300 CONFIG_CHECK+=" ~KVM_INTEL"
304 use python && CONFIG_CHECK+=" ~DEBUG_FS"
305 ERROR_DEBUG_FS="debugFS support required for kvm_stat"
307 # Now do the actual checks setup above
312 if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
313 eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
314 eerror "instances are still pointing to it. Please update your"
315 eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
316 eerror "and the right system binary (e.g. qemu-system-x86_64)."
317 die "update your virt configs to not use qemu-kvm"
321 # Sanity check to make sure target lists are kept up-to-date.
324 local detected sorted
326 pushd "${S}"/default-configs >/dev/null || die
328 # Force C locale until glibc is updated. #564936
329 detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u))
330 sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u))
331 if [[ ${sorted} != "${detected}" ]] ; then
332 eerror "The ebuild needs to be kept in sync."
333 eerror "${var}: ${sorted}"
334 eerror "$(printf '%-*s' ${#var} configure): ${detected}"
335 die "sync ${var} to the list of targets"
342 # Make sure locale list is kept up-to-date.
343 local detected sorted
344 detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u))
345 sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u))
346 if [[ ${sorted} != "${detected}" ]] ; then
347 eerror "The ebuild needs to be kept in sync."
348 eerror "PLOCALES: ${sorted}"
349 eerror " po/*.po: ${detected}"
353 # Deal with selective install of locales.
355 # Delete locales the user does not want. #577814
356 rm_loc() { rm po/$1.po || die; }
357 l10n_for_each_disabled_locale_do rm_loc
359 # Cheap hack to disable gettext .mo generation.
365 check_targets IUSE_SOFTMMU_TARGETS softmmu
366 check_targets IUSE_USER_TARGETS linux-user
370 # Use correct toolchain to fix cross-compiling
371 tc-export AR LD NM OBJCOPY PKG_CONFIG
372 export WINDRES=${CHOST}-windres
377 # Run after we've applied all patches.
380 # Remove bundled copy of libfdt
385 # configures qemu based on the build directory and the build type
388 qemu_src_configure() {
389 debug-print-function ${FUNCNAME} "$@"
392 local builddir="${S}/${buildtype}-build"
400 --libdir=/usr/$(get_libdir)
402 --docdir=/usr/share/doc/${PF}/html
403 --mandir=/usr/share/man
404 --with-confsuffix=/qemu
407 --disable-guest-agent
410 # We support gnutls/nettle for crypto operations. It is possible
411 # to use gcrypt when gnutls/nettle are disabled (but not when they
412 # are enabled), but it's not really worth the hassle. Disable it
413 # all the time to avoid automatically detecting it. #568856
418 --host-cc="$(tc-getBUILD_CC)"
419 $(use_enable debug debug-info)
420 $(use_enable debug debug-tcg)
421 $(use_enable doc docs)
422 $(use_enable tci tcg-interpreter)
423 $(use_enable xattr attr)
426 # Disable options not used by user targets. This simplifies building
427 # static user targets (USE=static-user) considerably.
429 if [[ ${buildtype} == "user" ]] ; then
430 echo "--disable-${2:-$1}"
437 $(conf_notuser accessibility brlapi)
438 $(conf_notuser aio linux-aio)
439 $(conf_notuser bzip2)
440 $(conf_notuser capstone)
441 $(conf_notuser caps cap-ng)
444 $(conf_notuser glusterfs)
445 $(conf_notuser gnutls)
446 $(conf_notuser gnutls nettle)
448 $(conf_notuser infiniband rdma)
449 $(conf_notuser iscsi libiscsi)
450 $(conf_notuser jemalloc jemalloc)
451 $(conf_notuser jpeg vnc-jpeg)
452 $(conf_notuser kernel_linux kvm)
454 $(conf_notuser ncurses curses)
455 $(conf_notuser nfs libnfs)
457 $(conf_notuser opengl)
458 $(conf_notuser png vnc-png)
460 $(conf_notuser sasl vnc-sasl)
462 $(conf_notuser seccomp)
463 $(conf_notuser smartcard)
464 $(conf_notuser snappy)
465 $(conf_notuser spice)
466 $(conf_notuser ssh libssh)
467 $(conf_notuser usb libusb)
468 $(conf_notuser usbredir usb-redir)
470 $(conf_notuser vhost-net)
471 $(conf_notuser virgl virglrenderer)
472 $(conf_notuser virtfs)
476 $(conf_notuser xen xen-pci-passthrough)
477 $(conf_notuser xfs xfsctl)
478 $(conf_notuser xkb xkbcommon)
481 if [[ ${buildtype} == "user" ]] ; then
482 conf_opts+=( --disable-libxml2 )
484 conf_opts+=( --enable-libxml2 )
487 if [[ ! ${buildtype} == "user" ]] ; then
493 $(usex pulseaudio pa "")
496 --audio-drv-list=$(printf "%s," "${audio_opts[@]}")
508 local static_flag="static-user"
516 local static_flag="static"
525 local static_flag="static"
529 local targets="${buildtype}_targets"
530 [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" )
532 # Add support for SystemTAP
533 use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
535 # We always want to attempt to build with PIE support as it results
536 # in a more secure binary. But it doesn't work with static or if
537 # the current GCC doesn't have PIE support.
538 if use ${static_flag}; then
539 conf_opts+=( --static --disable-pie )
541 tc-enables-pie && conf_opts+=( --enable-pie )
544 echo "../configure ${conf_opts[*]}"
546 ../configure "${conf_opts[@]}" || die "configure failed"
548 # FreeBSD's kernel does not support QEMU assigning/grabbing
549 # host USB devices yet
550 use kernel_FreeBSD && \
551 sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
559 softmmu_targets= softmmu_bins=()
560 user_targets= user_bins=()
562 for target in ${IUSE_SOFTMMU_TARGETS} ; do
563 if use "qemu_softmmu_targets_${target}"; then
564 softmmu_targets+=",${target}-softmmu"
565 softmmu_bins+=( "qemu-system-${target}" )
569 for target in ${IUSE_USER_TARGETS} ; do
570 if use "qemu_user_targets_${target}"; then
571 user_targets+=",${target}-linux-user"
572 user_bins+=( "qemu-${target}" )
576 softmmu_targets=${softmmu_targets#,}
577 user_targets=${user_targets#,}
579 [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu"
580 [[ -n ${user_targets} ]] && qemu_src_configure "user"
581 qemu_src_configure "tools"
585 if [[ -n ${user_targets} ]]; then
590 if [[ -n ${softmmu_targets} ]]; then
591 cd "${S}/softmmu-build"
595 cd "${S}/tools-build"
600 if [[ -n ${softmmu_targets} ]]; then
601 cd "${S}/softmmu-build"
602 pax-mark m */qemu-system-* #515550
604 emake -j1 check-report.html
608 qemu_python_install() {
609 python_domodule "${S}/python/qemu"
611 python_doscript "${S}/scripts/kvm/vmxcap"
612 python_doscript "${S}/scripts/qmp/qmp-shell"
613 python_doscript "${S}/scripts/qmp/qemu-ga-client"
616 # Generate binfmt support files.
617 # - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc)
618 # - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt)
620 local out="${T}/qemu-binfmt"
621 local out_systemd="${T}/qemu.conf"
622 local d="${T}/binfmt.d"
624 einfo "Generating qemu binfmt scripts and configuration files"
626 # Generate the debian fragments first.
628 "${S}"/scripts/qemu-binfmt-conf.sh \
631 --qemu-path "${EPREFIX}/usr/bin" \
633 # Then turn the fragments into a shell script we can source.
635 -e 's:^([^ ]+) (.*)$:\1="\2":' \
638 # Generate the init.d script by assembling the fragments from above.
639 local f qcpu package interpreter magic mask
640 cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die
641 for f in "${d}"/qemu-* ; do
644 # Normalize the cpu logic like we do in the init.d for the native cpu.
645 qcpu=${package#qemu-}
652 sparc*) qcpu="sparc";;
655 # we use 'printf' here to be portable across 'sh'
656 # implementations: #679168
658 if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then
659 printf '%s\n' ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register
663 echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}"
666 cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die
670 if [[ -n ${user_targets} ]]; then
672 emake DESTDIR="${ED}" install
674 # Install binfmt handler init script for user targets.
676 doinitd "${T}/qemu-binfmt"
678 # Install binfmt/qemu.conf.
679 insinto "/usr/share/qemu/binfmt.d"
680 doins "${T}/qemu.conf"
683 if [[ -n ${softmmu_targets} ]]; then
684 cd "${S}/softmmu-build"
685 emake DESTDIR="${ED}" install
687 # This might not exist if the test failed. #512010
688 [[ -e check-report.html ]] && dodoc check-report.html
690 if use kernel_linux; then
691 udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules
695 python_foreach_impl qemu_python_install
699 cd "${S}/tools-build"
700 emake DESTDIR="${ED}" install
702 # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
703 pushd "${ED}"/usr/bin >/dev/null
704 pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
707 # Install config file example for qemu-bridge-helper
709 doins "${FILESDIR}/bridge.conf"
712 dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
713 newdoc pc-bios/README README.pc-bios
715 # Disallow stripping of prebuilt firmware files.
716 dostrip -x ${QA_PREBUILT}
718 if [[ -n ${softmmu_targets} ]]; then
719 # Remove SeaBIOS since we're using the SeaBIOS packaged one
720 rm "${ED}/usr/share/qemu/bios.bin"
721 rm "${ED}/usr/share/qemu/bios-256k.bin"
722 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
723 dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
724 dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
727 # Remove vgabios since we're using the seavgabios packaged one
728 rm "${ED}/usr/share/qemu/vgabios.bin"
729 rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
730 rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
731 rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
732 rm "${ED}/usr/share/qemu/vgabios-virtio.bin"
733 rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
734 # PPC64 loads vgabios-stdvga
735 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc64; then
736 dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin
737 dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
738 dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
739 dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
740 dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin
741 dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
744 # Remove sgabios since we're using the sgabios packaged one
745 rm "${ED}/usr/share/qemu/sgabios.bin"
746 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
747 dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
750 # Remove iPXE since we're using the iPXE packaged one
751 rm "${ED}"/usr/share/qemu/pxe-*.rom
752 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
753 dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
754 dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
755 dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
756 dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
757 dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
758 dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
762 DISABLE_AUTOFORMATTING=true
763 readme.gentoo_create_doc
766 firmware_abi_change() {
768 for pv in ${REPLACING_VERSIONS}; do
769 if ver_test $pv -lt ${FIRMWARE_ABI_VERSION}; then
777 if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
781 xdg_icon_cache_update
783 [[ -z ${EPREFIX} ]] && [[ -f ${EROOT}/usr/libexec/qemu-bridge-helper ]] && \
784 fcaps cap_net_admin ${EROOT}/usr/libexec/qemu-bridge-helper
786 DISABLE_AUTOFORMATTING=true
787 readme.gentoo_print_elog
789 if use pin-upstream-blobs && firmware_abi_change; then
790 ewarn "This version of qemu pins new versions of firmware blobs:"
791 ewarn " $(best_version sys-firmware/edk2-ovmf)"
792 ewarn " $(best_version sys-firmware/ipxe)"
793 ewarn " $(best_version sys-firmware/seabios)"
794 ewarn " $(best_version sys-firmware/sgabios)"
795 ewarn "This might break resume of hibernated guests (started with a different"
796 ewarn "firmware version) and live migration to/from qemu versions with different"
797 ewarn "firmware. Please (cold) restart all running guests. For functional"
798 ewarn "guest migration ensure that all"
799 ewarn "hosts run at least"
800 ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}."
806 echo " $(best_version app-emulation/spice-protocol)"
807 echo " $(best_version sys-firmware/edk2-ovmf)"
808 if has_version 'sys-firmware/edk2-ovmf[binary]'; then
813 echo " $(best_version sys-firmware/ipxe)"
814 echo " $(best_version sys-firmware/seabios)"
815 if has_version 'sys-firmware/seabios[binary]'; then
820 echo " $(best_version sys-firmware/sgabios)"
824 xdg_icon_cache_update