1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
7 PYTHON_REQ_USE="ncurses,readline"
9 PLOCALES="bg de_DE fr_FR hu it tr zh_CN"
11 FIRMWARE_ABI_VERSION="2.9.0-r52"
13 inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
14 user udev fcaps readme.gentoo-r1 pax-utils l10n
16 if [[ ${PV} = *9999* ]]; then
17 EGIT_REPO_URI="git://git.qemu.org/qemu.git"
21 SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2"
22 KEYWORDS="amd64 ~arm64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
24 # Gentoo specific patchsets:
25 SRC_URI+=" https://dev.gentoo.org/~tamiko/distfiles/${P}-patches-r1.tar.xz"
28 DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
29 HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
31 LICENSE="GPL-2 LGPL-2 BSD-2"
33 IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt
34 glusterfs gnutls gtk gtk2 infiniband iscsi +jpeg kernel_linux
35 kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png
36 pulseaudio python rbd sasl +seccomp sdl sdl2 selinux smartcard snappy
37 spice ssh static static-user systemtap tci test usb usbredir vde
38 +vhost-net virgl virtfs +vnc vte xattr xen xfs"
40 COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel
41 mips mips64 mips64el mipsel nios2 or1k ppc ppc64 s390x sh4 sh4eb sparc
43 IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS}
44 lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb"
45 IUSE_USER_TARGETS="${COMMON_TARGETS}
46 armeb hppa mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx"
48 use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
49 use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
50 IUSE+=" ${use_softmmu_targets} ${use_user_targets}"
52 # Allow no targets to be built so that people can get a tools-only build.
53 # Block USE flag configurations known to not work.
54 REQUIRED_USE="${PYTHON_REQUIRED_USE}
56 qemu_softmmu_targets_arm? ( fdt )
57 qemu_softmmu_targets_microblaze? ( fdt )
58 qemu_softmmu_targets_mips64el? ( fdt )
59 qemu_softmmu_targets_ppc? ( fdt )
60 qemu_softmmu_targets_ppc64? ( fdt )
62 static? ( static-user !alsa !bluetooth !gtk !gtk2 !opengl !pulseaudio )
66 # Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
67 # and user/softmmu targets (qemu-*, qemu-system-*).
69 # Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
71 # The attr lib isn't always linked in (although the USE flag is always
72 # respected). This is because qemu supports using the C library's API
73 # when available rather than always using the extranl library.
75 >=dev-libs/glib-2.0[static-libs(+)]
76 sys-libs/zlib[static-libs(+)]
77 python? ( ${PYTHON_DEPS} )
78 systemtap? ( dev-util/systemtap )
79 xattr? ( sys-apps/attr[static-libs(+)] )"
81 # Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...)
82 # softmmu targets (qemu-system-*).
83 SOFTMMU_TOOLS_DEPEND="
84 >=x11-libs/pixman-0.28.0[static-libs(+)]
86 app-accessibility/brltty[api]
87 app-accessibility/brltty[static-libs(+)]
89 aio? ( dev-libs/libaio[static-libs(+)] )
90 alsa? ( >=media-libs/alsa-lib-1.0.13 )
91 bluetooth? ( net-wireless/bluez )
92 bzip2? ( app-arch/bzip2[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.2[static-libs(+)] )
96 glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
98 dev-libs/nettle:=[static-libs(+)]
99 >=net-libs/gnutls-3.0:=[static-libs(+)]
104 vte? ( x11-libs/vte:0 )
108 vte? ( x11-libs/vte:2.91 )
111 infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] )
112 iscsi? ( net-libs/libiscsi )
113 jpeg? ( virtual/jpeg:0=[static-libs(+)] )
114 lzo? ( dev-libs/lzo:2[static-libs(+)] )
116 sys-libs/ncurses:0=[unicode]
117 sys-libs/ncurses:0=[static-libs(+)]
119 nfs? ( >=net-fs/libnfs-1.9.3:=[static-libs(+)] )
120 numa? ( sys-process/numactl[static-libs(+)] )
123 media-libs/libepoxy[static-libs(+)]
124 media-libs/mesa[static-libs(+)]
125 media-libs/mesa[egl,gbm]
127 png? ( media-libs/libpng:0=[static-libs(+)] )
128 pulseaudio? ( media-sound/pulseaudio )
129 rbd? ( sys-cluster/ceph[static-libs(+)] )
130 sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
134 >=media-libs/libsdl-1.2.11[static-libs(+)]
137 media-libs/libsdl2[X]
138 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:=[static-libs(+)] )
145 >=app-emulation/spice-protocol-0.12.3
146 >=app-emulation/spice-0.12.0[static-libs(+)]
148 ssh? ( >=net-libs/libssh2-1.2.8[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-2017_pre20170505[binary]
160 ~sys-firmware/ipxe-1.0.0_p20160620
161 ~sys-firmware/seabios-1.10.2[binary,seavgabios]
162 ~sys-firmware/sgabios-0.1_pre8
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.10.2[binary,seavgabios]
174 !pin-upstream-blobs? (
175 >=sys-firmware/seabios-1.10.2[seavgabios]
181 ${ALL_DEPEND//\[static-libs(+)]}
182 ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]}
184 qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
185 qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
186 qemu_softmmu_targets_ppc64? ( ${PPC64_FIRMWARE_DEPEND} )
193 kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
194 gtk? ( nls? ( sys-devel/gettext ) )
197 ${SOFTMMU_TOOLS_DEPEND}
199 static-user? ( ${ALL_DEPEND} )
205 selinux? ( sec-policy/selinux-qemu )"
208 "${FILESDIR}"/${PN}-2.5.0-cflags.patch
209 "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch
210 "${FILESDIR}"/${PN}-2.11.0-glibc-2.27.patch
214 STRIP_MASK="/usr/share/qemu/palcode-clipper"
217 usr/share/qemu/openbios-ppc
218 usr/share/qemu/openbios-sparc64
219 usr/share/qemu/openbios-sparc32
220 usr/share/qemu/palcode-clipper
221 usr/share/qemu/s390-ccw.img
222 usr/share/qemu/s390-netboot.img
223 usr/share/qemu/u-boot.e500"
225 QA_WX_LOAD="usr/bin/qemu-i386
231 usr/bin/qemu-microblaze
232 usr/bin/qemu-microblazeel
238 usr/bin/qemu-ppc64abi32
244 usr/bin/qemu-sparc32plus
246 usr/bin/qemu-unicore32"
248 DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the
249 kernel module loaded before running kvm. The easiest way to ensure that the
250 kernel module is loaded is to load it on boot.
251 For AMD CPUs the module is called 'kvm-amd'.
252 For Intel CPUs the module is called 'kvm-intel'.
253 Please review /etc/conf.d/modules for how to load these.
255 Make sure your user is in the 'kvm' group. Just run
256 $ gpasswd -a <USER> kvm
257 then have <USER> re-login.
259 For brand new installs, the default permissions on /dev/kvm might not let
260 you access it. You can tell udev to reset ownership/perms:
261 $ udevadm trigger -c add /dev/kvm
263 If you want to register binfmt handlers for qemu user targets:
265 # rc-update add qemu-binfmt
267 # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf"
270 if use kernel_linux && kernel_is lt 2 6 25; then
271 eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
272 elif use kernel_linux; then
273 if ! linux_config_exists; then
274 eerror "Unable to check your kernel for KVM support"
276 CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
277 ERROR_KVM="You must enable KVM in your kernel to continue"
278 ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
279 ERROR_KVM_AMD+=" your kernel configuration."
280 ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
281 ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
282 ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
283 ERROR_TUN+=" into your kernel or loaded as a module to use the"
284 ERROR_TUN+=" virtual network device if using -net tap."
285 ERROR_BRIDGE="You will also need support for 802.1d"
286 ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
287 use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
288 ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
289 ERROR_VHOST_NET+=" support"
291 if use amd64 || use x86 || use amd64-linux || use x86-linux; then
292 if grep -q AuthenticAMD /proc/cpuinfo; then
293 CONFIG_CHECK+=" ~KVM_AMD"
294 elif grep -q GenuineIntel /proc/cpuinfo; then
295 CONFIG_CHECK+=" ~KVM_INTEL"
299 use python && CONFIG_CHECK+=" ~DEBUG_FS"
300 ERROR_DEBUG_FS="debugFS support required for kvm_stat"
302 # Now do the actual checks setup above
307 if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
308 eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
309 eerror "instances are still pointing to it. Please update your"
310 eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
311 eerror "and the right system binary (e.g. qemu-system-x86_64)."
312 die "update your virt configs to not use qemu-kvm"
320 # Sanity check to make sure target lists are kept up-to-date.
323 local detected sorted
325 pushd "${S}"/default-configs >/dev/null || die
327 # Force C locale until glibc is updated. #564936
328 detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u))
329 sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u))
330 if [[ ${sorted} != "${detected}" ]] ; then
331 eerror "The ebuild needs to be kept in sync."
332 eerror "${var}: ${sorted}"
333 eerror "$(printf '%-*s' ${#var} configure): ${detected}"
334 die "sync ${var} to the list of targets"
341 # Make sure locale list is kept up-to-date.
342 local detected sorted
343 detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u))
344 sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u))
345 if [[ ${sorted} != "${detected}" ]] ; then
346 eerror "The ebuild needs to be kept in sync."
347 eerror "PLOCALES: ${sorted}"
348 eerror " po/*.po: ${detected}"
352 # Deal with selective install of locales.
354 # Delete locales the user does not want. #577814
355 rm_loc() { rm po/$1.po || die; }
356 l10n_for_each_disabled_locale_do rm_loc
358 # Cheap hack to disable gettext .mo generation.
364 check_targets IUSE_SOFTMMU_TARGETS softmmu
365 check_targets IUSE_USER_TARGETS linux-user
367 # Alter target makefiles to accept CFLAGS set via flag-o
369 -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
370 Makefile Makefile.target || die
374 # Fix ld and objcopy being called directly
375 tc-export AR LD OBJCOPY
380 # Run after we've applied all patches.
383 # Remove bundled copy of libfdt
388 # configures qemu based on the build directory and the build type
391 qemu_src_configure() {
392 debug-print-function ${FUNCNAME} "$@"
395 local builddir="${S}/${buildtype}-build"
402 --libdir=/usr/$(get_libdir)
403 --docdir=/usr/share/doc/${PF}/html
405 --disable-guest-agent
408 # We support gnutls/nettle for crypto operations. It is possible
409 # to use gcrypt when gnutls/nettle are disabled (but not when they
410 # are enabled), but it's not really worth the hassle. Disable it
411 # all the time to avoid automatically detecting it. #568856
416 --host-cc="$(tc-getBUILD_CC)"
417 $(use_enable debug debug-info)
418 $(use_enable debug debug-tcg)
420 $(use_enable tci tcg-interpreter)
421 $(use_enable xattr attr)
424 # Disable options not used by user targets. This simplifies building
425 # static user targets (USE=static-user) considerably.
427 if [[ ${buildtype} == "user" ]] ; then
428 echo "--disable-${2:-$1}"
434 $(conf_notuser accessibility brlapi)
435 $(conf_notuser aio linux-aio)
436 $(conf_notuser bzip2)
437 $(conf_notuser bluetooth bluez)
438 $(conf_notuser caps cap-ng)
441 $(conf_notuser glusterfs)
442 $(conf_notuser gnutls)
443 $(conf_notuser gnutls nettle)
445 $(conf_notuser infiniband rdma)
446 $(conf_notuser iscsi libiscsi)
447 $(conf_notuser jpeg vnc-jpeg)
448 $(conf_notuser kernel_linux kvm)
450 $(conf_notuser ncurses curses)
451 $(conf_notuser nfs libnfs)
453 $(conf_notuser opengl)
454 $(conf_notuser png vnc-png)
456 $(conf_notuser sasl vnc-sasl)
458 $(conf_notuser seccomp)
459 $(conf_notuser smartcard)
460 $(conf_notuser snappy)
461 $(conf_notuser spice)
462 $(conf_notuser ssh libssh2)
463 $(conf_notuser usb libusb)
464 $(conf_notuser usbredir usb-redir)
466 $(conf_notuser vhost-net)
467 $(conf_notuser virgl virglrenderer)
468 $(conf_notuser virtfs)
472 $(conf_notuser xen xen-pci-passthrough)
473 $(conf_notuser xfs xfsctl)
476 if [[ ! ${buildtype} == "user" ]] ; then
478 local audio_opts="oss"
479 use alsa && audio_opts="alsa,${audio_opts}"
480 use sdl && audio_opts="sdl,${audio_opts}"
481 use pulseaudio && audio_opts="pa,${audio_opts}"
483 --audio-drv-list="${audio_opts}"
485 use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) )
486 use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) )
497 local static_flag="static-user"
505 local static_flag="static"
514 local static_flag="static"
518 local targets="${buildtype}_targets"
519 [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" )
521 # Add support for SystemTAP
522 use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
524 # We always want to attempt to build with PIE support as it results
525 # in a more secure binary. But it doesn't work with static or if
526 # the current GCC doesn't have PIE support.
527 if use ${static_flag}; then
528 conf_opts+=( --static --disable-pie )
530 tc-enables-pie && conf_opts+=( --enable-pie )
534 conf_opts+=( --disable-capstone )
536 echo "../configure ${conf_opts[*]}"
538 ../configure "${conf_opts[@]}" || die "configure failed"
540 # FreeBSD's kernel does not support QEMU assigning/grabbing
541 # host USB devices yet
542 use kernel_FreeBSD && \
543 sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
551 softmmu_targets= softmmu_bins=()
552 user_targets= user_bins=()
554 for target in ${IUSE_SOFTMMU_TARGETS} ; do
555 if use "qemu_softmmu_targets_${target}"; then
556 softmmu_targets+=",${target}-softmmu"
557 softmmu_bins+=( "qemu-system-${target}" )
561 for target in ${IUSE_USER_TARGETS} ; do
562 if use "qemu_user_targets_${target}"; then
563 user_targets+=",${target}-linux-user"
564 user_bins+=( "qemu-${target}" )
568 softmmu_targets=${softmmu_targets#,}
569 user_targets=${user_targets#,}
571 [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu"
572 [[ -n ${user_targets} ]] && qemu_src_configure "user"
573 qemu_src_configure "tools"
577 if [[ -n ${user_targets} ]]; then
582 if [[ -n ${softmmu_targets} ]]; then
583 cd "${S}/softmmu-build"
587 cd "${S}/tools-build"
592 if [[ -n ${softmmu_targets} ]]; then
593 cd "${S}/softmmu-build"
594 pax-mark m */qemu-system-* #515550
596 emake -j1 check-report.html
600 qemu_python_install() {
601 python_domodule "${S}/scripts/qmp/qmp.py"
603 python_doscript "${S}/scripts/kvm/vmxcap"
604 python_doscript "${S}/scripts/qmp/qmp-shell"
605 python_doscript "${S}/scripts/qmp/qemu-ga-client"
608 # Generate binfmt support files.
609 # - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc)
610 # - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt)
612 local out="${T}/qemu-binfmt"
613 local out_systemd="${T}/qemu.conf"
614 local d="${T}/binfmt.d"
616 einfo "Generating qemu binfmt scripts and configuration files"
618 # Generate the debian fragments first.
620 "${S}"/scripts/qemu-binfmt-conf.sh \
623 --qemu-path "${EPREFIX}/usr/bin" \
625 # Then turn the fragments into a shell script we can source.
627 -e 's:^([^ ]+) (.*)$:\1="\2":' \
630 # Generate the init.d script by assembling the fragments from above.
631 local f qcpu package interpreter magic mask
632 cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die
633 for f in "${d}"/qemu-* ; do
636 # Normalize the cpu logic like we do in the init.d for the native cpu.
637 qcpu=${package#qemu-}
644 sparc*) qcpu="sparc";;
648 if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then
649 echo ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register
653 echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}"
656 cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die
660 if [[ -n ${user_targets} ]]; then
662 emake DESTDIR="${ED}" install
664 # Install binfmt handler init script for user targets.
666 doinitd "${T}/qemu-binfmt"
668 # Install binfmt/qemu.conf.
669 insinto "/usr/share/qemu/binfmt.d"
670 doins "${T}/qemu.conf"
673 if [[ -n ${softmmu_targets} ]]; then
674 cd "${S}/softmmu-build"
675 emake DESTDIR="${ED}" install
677 # This might not exist if the test failed. #512010
678 [[ -e check-report.html ]] && dohtml check-report.html
680 if use kernel_linux; then
681 udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules
685 python_foreach_impl qemu_python_install
689 cd "${S}/tools-build"
690 emake DESTDIR="${ED}" install
692 # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
693 pushd "${ED}"/usr/bin >/dev/null
694 pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594
697 # Install config file example for qemu-bridge-helper
699 doins "${FILESDIR}/bridge.conf"
702 dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
703 newdoc pc-bios/README README.pc-bios
705 if [[ -n ${softmmu_targets} ]]; then
706 # Remove SeaBIOS since we're using the SeaBIOS packaged one
707 rm "${ED}/usr/share/qemu/bios.bin"
708 rm "${ED}/usr/share/qemu/bios-256k.bin"
709 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
710 dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
711 dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin
714 # Remove vgabios since we're using the seavgabios packaged one
715 rm "${ED}/usr/share/qemu/vgabios.bin"
716 rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
717 rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
718 rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
719 rm "${ED}/usr/share/qemu/vgabios-virtio.bin"
720 rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
721 # PPC64 loads vgabios-stdvga
722 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc64; then
723 dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin
724 dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
725 dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
726 dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
727 dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin
728 dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
731 # Remove sgabios since we're using the sgabios packaged one
732 rm "${ED}/usr/share/qemu/sgabios.bin"
733 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
734 dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
737 # Remove iPXE since we're using the iPXE packaged one
738 rm "${ED}"/usr/share/qemu/pxe-*.rom
739 if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
740 dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
741 dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
742 dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
743 dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
744 dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
745 dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
749 DISABLE_AUTOFORMATTING=true
750 readme.gentoo_create_doc
753 firmware_abi_change() {
755 for pv in ${REPLACING_VERSIONS}; do
756 if ! version_is_at_least ${FIRMWARE_ABI_VERSION} ${pv}; then
764 if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
768 fcaps cap_net_admin /usr/libexec/qemu-bridge-helper
770 DISABLE_AUTOFORMATTING=true
771 readme.gentoo_print_elog
773 if use pin-upstream-blobs && firmware_abi_change; then
774 ewarn "This version of qemu pins new versions of firmware blobs:"
775 ewarn " $(best_version sys-firmware/edk2-ovmf)"
776 ewarn " $(best_version sys-firmware/ipxe)"
777 ewarn " $(best_version sys-firmware/seabios)"
778 ewarn " $(best_version sys-firmware/sgabios)"
779 ewarn "This might break resume of hibernated guests (started with a different"
780 ewarn "firmware version) and live migration to/from qemu versions with different"
781 ewarn "firmware. Please (cold) restart all running guests. For functional"
782 ewarn "guest migration ensure that all"
783 ewarn "hosts run at least"
784 ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}."
790 echo " $(best_version app-emulation/spice-protocol)"
791 echo " $(best_version sys-firmware/edk2-ovmf)"
792 if has_version 'sys-firmware/edk2-ovmf[binary]'; then
797 echo " $(best_version sys-firmware/ipxe)"
798 echo " $(best_version sys-firmware/seabios)"
799 if has_version 'sys-firmware/seabios[binary]'; then
804 echo " $(best_version sys-firmware/sgabios)"