1 |
commit: d18e62cc49c851c9d5cd857913318f8c90488f50 |
2 |
Author: Matthias Maier <tamiko <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 12 19:42:32 2017 +0000 |
4 |
Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Nov 12 19:43:52 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d18e62cc |
7 |
|
8 |
app-emulation/qemu: drop vulnerable, bug #629350 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/629350 |
11 |
Package-Manager: Portage-2.3.8, Repoman-2.3.4 |
12 |
|
13 |
app-emulation/qemu/Manifest | 1 - |
14 |
app-emulation/qemu/qemu-2.9.0-r56.ebuild | 793 ------------------------------ |
15 |
app-emulation/qemu/qemu-2.9.0-r57.ebuild | 796 ------------------------------- |
16 |
3 files changed, 1590 deletions(-) |
17 |
|
18 |
diff --git a/app-emulation/qemu/Manifest b/app-emulation/qemu/Manifest |
19 |
index 0c8db490a09..156b9a616ac 100644 |
20 |
--- a/app-emulation/qemu/Manifest |
21 |
+++ b/app-emulation/qemu/Manifest |
22 |
@@ -1,2 +1 @@ |
23 |
DIST qemu-2.10.0.tar.bz2 30955656 SHA256 7e9f39e1306e6dcc595494e91c1464d4b03f55ddd2053183e0e1b69f7f776d48 SHA512 ea21c014030f8a902df159641e6ccb45f0850ac5cb1cb8ab6845124c44ea5def54845e7bc66a6e80d624c78069f9baa913ee5119704076ae4ff47ab018ace9f9 WHIRLPOOL 58f846788fdf2b0c90e6d17ce921a1fe02556968d38ffc11be7e32b81ebc723dfeaa790f22d8085d4f388eb01fe0daa3ddbc00630c5ecba083df33cc9709fb39 |
24 |
-DIST qemu-2.9.0.tar.bz2 28720490 SHA256 00bfb217b1bb03c7a6c3261b819cfccbfb5a58e3e2ceff546327d271773c6c14 SHA512 4b28966eec0ca44681e35fcfb64a4eaef7c280b8d65c91d03f2efa37f76278fd8c1680e5798c7a30dbfcc8f3c05f4a803f48b8a2dfec3a4181bac079b2a5e422 WHIRLPOOL d79fe89eb271a56aee0cbd328e5f96999176b711afb5683d164b7b99d91e6dd2bfaf6e2ff4cd820a941c94f28116765cb07ffd5809d75c2f9654a67d56bfc0c1 |
25 |
|
26 |
diff --git a/app-emulation/qemu/qemu-2.9.0-r56.ebuild b/app-emulation/qemu/qemu-2.9.0-r56.ebuild |
27 |
deleted file mode 100644 |
28 |
index f9ba26cbc93..00000000000 |
29 |
--- a/app-emulation/qemu/qemu-2.9.0-r56.ebuild |
30 |
+++ /dev/null |
31 |
@@ -1,793 +0,0 @@ |
32 |
-# Copyright 1999-2017 Gentoo Foundation |
33 |
-# Distributed under the terms of the GNU General Public License v2 |
34 |
- |
35 |
-EAPI="6" |
36 |
- |
37 |
-PYTHON_COMPAT=( python2_7 ) |
38 |
-PYTHON_REQ_USE="ncurses,readline" |
39 |
- |
40 |
-PLOCALES="bg de_DE fr_FR hu it tr zh_CN" |
41 |
- |
42 |
-FIRMWARE_ABI_VERSION="2.9.0-r52" |
43 |
- |
44 |
-inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ |
45 |
- user udev fcaps readme.gentoo-r1 pax-utils l10n |
46 |
- |
47 |
-if [[ ${PV} = *9999* ]]; then |
48 |
- EGIT_REPO_URI="git://git.qemu.org/qemu.git" |
49 |
- inherit git-r3 |
50 |
- SRC_URI="" |
51 |
-else |
52 |
- SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2" |
53 |
- KEYWORDS="amd64 ~arm64 ~ppc ~ppc64 x86 ~x86-fbsd" |
54 |
-fi |
55 |
- |
56 |
-DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" |
57 |
-HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" |
58 |
- |
59 |
-LICENSE="GPL-2 LGPL-2 BSD-2" |
60 |
-SLOT="0" |
61 |
-IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt |
62 |
- glusterfs gnutls gtk gtk2 infiniband iscsi +jpeg kernel_linux |
63 |
- kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png |
64 |
- pulseaudio python rbd sasl +seccomp sdl sdl2 selinux smartcard snappy |
65 |
- spice ssh static static-user systemtap tci test usb usbredir vde |
66 |
- +vhost-net virgl virtfs +vnc vte xattr xen xfs" |
67 |
- |
68 |
-COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel |
69 |
- mips mips64 mips64el mipsel nios2 or1k ppc ppc64 s390x sh4 sh4eb sparc |
70 |
- sparc64 x86_64" |
71 |
-IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} |
72 |
- lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb" |
73 |
-IUSE_USER_TARGETS="${COMMON_TARGETS} |
74 |
- armeb hppa mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx" |
75 |
- |
76 |
-use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) |
77 |
-use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) |
78 |
-IUSE+=" ${use_softmmu_targets} ${use_user_targets}" |
79 |
- |
80 |
-# Allow no targets to be built so that people can get a tools-only build. |
81 |
-# Block USE flag configurations known to not work. |
82 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE} |
83 |
- gtk2? ( gtk ) |
84 |
- qemu_softmmu_targets_arm? ( fdt ) |
85 |
- qemu_softmmu_targets_microblaze? ( fdt ) |
86 |
- qemu_softmmu_targets_mips64el? ( fdt ) |
87 |
- qemu_softmmu_targets_ppc? ( fdt ) |
88 |
- qemu_softmmu_targets_ppc64? ( fdt ) |
89 |
- sdl2? ( sdl ) |
90 |
- static? ( static-user !alsa !bluetooth !gtk !gtk2 !opengl !pulseaudio ) |
91 |
- virtfs? ( xattr ) |
92 |
- vte? ( gtk )" |
93 |
- |
94 |
-# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) |
95 |
-# and user/softmmu targets (qemu-*, qemu-system-*). |
96 |
-# |
97 |
-# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. |
98 |
-# |
99 |
-# The attr lib isn't always linked in (although the USE flag is always |
100 |
-# respected). This is because qemu supports using the C library's API |
101 |
-# when available rather than always using the extranl library. |
102 |
-ALL_DEPEND=" |
103 |
- >=dev-libs/glib-2.0[static-libs(+)] |
104 |
- sys-libs/zlib[static-libs(+)] |
105 |
- python? ( ${PYTHON_DEPS} ) |
106 |
- systemtap? ( dev-util/systemtap ) |
107 |
- xattr? ( sys-apps/attr[static-libs(+)] )" |
108 |
- |
109 |
-# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) |
110 |
-# softmmu targets (qemu-system-*). |
111 |
-SOFTMMU_TOOLS_DEPEND=" |
112 |
- >=x11-libs/pixman-0.28.0[static-libs(+)] |
113 |
- accessibility? ( |
114 |
- app-accessibility/brltty[api] |
115 |
- app-accessibility/brltty[static-libs(+)] |
116 |
- ) |
117 |
- aio? ( dev-libs/libaio[static-libs(+)] ) |
118 |
- alsa? ( >=media-libs/alsa-lib-1.0.13 ) |
119 |
- bluetooth? ( net-wireless/bluez ) |
120 |
- bzip2? ( app-arch/bzip2[static-libs(+)] ) |
121 |
- caps? ( sys-libs/libcap-ng[static-libs(+)] ) |
122 |
- curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) |
123 |
- fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] ) |
124 |
- glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) |
125 |
- gnutls? ( |
126 |
- dev-libs/nettle:=[static-libs(+)] |
127 |
- >=net-libs/gnutls-3.0:=[static-libs(+)] |
128 |
- ) |
129 |
- gtk? ( |
130 |
- gtk2? ( |
131 |
- x11-libs/gtk+:2 |
132 |
- vte? ( x11-libs/vte:0 ) |
133 |
- ) |
134 |
- !gtk2? ( |
135 |
- x11-libs/gtk+:3 |
136 |
- vte? ( x11-libs/vte:2.91 ) |
137 |
- ) |
138 |
- ) |
139 |
- infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] ) |
140 |
- iscsi? ( net-libs/libiscsi ) |
141 |
- jpeg? ( virtual/jpeg:0=[static-libs(+)] ) |
142 |
- lzo? ( dev-libs/lzo:2[static-libs(+)] ) |
143 |
- ncurses? ( |
144 |
- sys-libs/ncurses:0=[unicode] |
145 |
- sys-libs/ncurses:0=[static-libs(+)] |
146 |
- ) |
147 |
- nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] ) |
148 |
- numa? ( sys-process/numactl[static-libs(+)] ) |
149 |
- opengl? ( |
150 |
- virtual/opengl |
151 |
- media-libs/libepoxy[static-libs(+)] |
152 |
- media-libs/mesa[static-libs(+)] |
153 |
- media-libs/mesa[egl,gbm] |
154 |
- ) |
155 |
- png? ( media-libs/libpng:0=[static-libs(+)] ) |
156 |
- pulseaudio? ( media-sound/pulseaudio ) |
157 |
- rbd? ( sys-cluster/ceph[static-libs(+)] ) |
158 |
- sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) |
159 |
- sdl? ( |
160 |
- !sdl2? ( |
161 |
- media-libs/libsdl[X] |
162 |
- >=media-libs/libsdl-1.2.11[static-libs(+)] |
163 |
- ) |
164 |
- sdl2? ( |
165 |
- media-libs/libsdl2[X] |
166 |
- media-libs/libsdl2[static-libs(+)] |
167 |
- ) |
168 |
- ) |
169 |
- seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) |
170 |
- smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) |
171 |
- snappy? ( app-arch/snappy:=[static-libs(+)] ) |
172 |
- spice? ( |
173 |
- >=app-emulation/spice-protocol-0.12.3 |
174 |
- >=app-emulation/spice-0.12.0[static-libs(+)] |
175 |
- ) |
176 |
- ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] ) |
177 |
- usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) |
178 |
- usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) |
179 |
- vde? ( net-misc/vde[static-libs(+)] ) |
180 |
- virgl? ( media-libs/virglrenderer[static-libs(+)] ) |
181 |
- virtfs? ( sys-libs/libcap ) |
182 |
- xen? ( app-emulation/xen-tools:= ) |
183 |
- xfs? ( sys-fs/xfsprogs[static-libs(+)] )" |
184 |
- |
185 |
-X86_FIRMWARE_DEPEND=" |
186 |
- pin-upstream-blobs? ( |
187 |
- ~sys-firmware/edk2-ovmf-2017_pre20170505[binary] |
188 |
- ~sys-firmware/ipxe-1.0.0_p20160620 |
189 |
- ~sys-firmware/seabios-1.10.2[binary,seavgabios] |
190 |
- ~sys-firmware/sgabios-0.1_pre8 |
191 |
- ) |
192 |
- !pin-upstream-blobs? ( |
193 |
- sys-firmware/edk2-ovmf |
194 |
- sys-firmware/ipxe |
195 |
- >=sys-firmware/seabios-1.10.2[seavgabios] |
196 |
- sys-firmware/sgabios |
197 |
- )" |
198 |
- |
199 |
-CDEPEND=" |
200 |
- !static? ( |
201 |
- ${ALL_DEPEND//\[static-libs(+)]} |
202 |
- ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} |
203 |
- ) |
204 |
- qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) |
205 |
- qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )" |
206 |
-DEPEND="${CDEPEND} |
207 |
- dev-lang/perl |
208 |
- =dev-lang/python-2* |
209 |
- sys-apps/texinfo |
210 |
- virtual/pkgconfig |
211 |
- kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) |
212 |
- gtk? ( nls? ( sys-devel/gettext ) ) |
213 |
- static? ( |
214 |
- ${ALL_DEPEND} |
215 |
- ${SOFTMMU_TOOLS_DEPEND} |
216 |
- ) |
217 |
- static-user? ( ${ALL_DEPEND} ) |
218 |
- test? ( |
219 |
- dev-libs/glib[utils] |
220 |
- sys-devel/bc |
221 |
- )" |
222 |
-RDEPEND="${CDEPEND} |
223 |
- selinux? ( sec-policy/selinux-qemu )" |
224 |
- |
225 |
-PATCHES=( |
226 |
- "${FILESDIR}"/${PN}-2.5.0-cflags.patch |
227 |
- "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch |
228 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8309.patch # bug 616870 |
229 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8379.patch # bug 616872 |
230 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8380.patch # bug 616874 |
231 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8112.patch # bug 616636 |
232 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-7493.patch # bug 618808 |
233 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-11434.patch # bug 625614 |
234 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-11334.patch # bug 621292 |
235 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9524-1.patch # bug 621292 |
236 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9524-2.patch |
237 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9503-1.patch # bug 621184 |
238 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9503-2.patch |
239 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-10664.patch # bug 623016 |
240 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-10806.patch # bug 624088 |
241 |
-) |
242 |
- |
243 |
-STRIP_MASK="/usr/share/qemu/palcode-clipper" |
244 |
- |
245 |
-QA_PREBUILT=" |
246 |
- usr/share/qemu/openbios-ppc |
247 |
- usr/share/qemu/openbios-sparc64 |
248 |
- usr/share/qemu/openbios-sparc32 |
249 |
- usr/share/qemu/palcode-clipper |
250 |
- usr/share/qemu/s390-ccw.img |
251 |
- usr/share/qemu/u-boot.e500" |
252 |
- |
253 |
-QA_WX_LOAD="usr/bin/qemu-i386 |
254 |
- usr/bin/qemu-x86_64 |
255 |
- usr/bin/qemu-alpha |
256 |
- usr/bin/qemu-arm |
257 |
- usr/bin/qemu-cris |
258 |
- usr/bin/qemu-m68k |
259 |
- usr/bin/qemu-microblaze |
260 |
- usr/bin/qemu-microblazeel |
261 |
- usr/bin/qemu-mips |
262 |
- usr/bin/qemu-mipsel |
263 |
- usr/bin/qemu-or1k |
264 |
- usr/bin/qemu-ppc |
265 |
- usr/bin/qemu-ppc64 |
266 |
- usr/bin/qemu-ppc64abi32 |
267 |
- usr/bin/qemu-sh4 |
268 |
- usr/bin/qemu-sh4eb |
269 |
- usr/bin/qemu-sparc |
270 |
- usr/bin/qemu-sparc64 |
271 |
- usr/bin/qemu-armeb |
272 |
- usr/bin/qemu-sparc32plus |
273 |
- usr/bin/qemu-s390x |
274 |
- usr/bin/qemu-unicore32" |
275 |
- |
276 |
-DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the |
277 |
-kernel module loaded before running kvm. The easiest way to ensure that the |
278 |
-kernel module is loaded is to load it on boot. |
279 |
- For AMD CPUs the module is called 'kvm-amd'. |
280 |
- For Intel CPUs the module is called 'kvm-intel'. |
281 |
-Please review /etc/conf.d/modules for how to load these. |
282 |
- |
283 |
-Make sure your user is in the 'kvm' group. Just run |
284 |
- $ gpasswd -a <USER> kvm |
285 |
-then have <USER> re-login. |
286 |
- |
287 |
-For brand new installs, the default permissions on /dev/kvm might not let |
288 |
-you access it. You can tell udev to reset ownership/perms: |
289 |
- $ udevadm trigger -c add /dev/kvm |
290 |
- |
291 |
-If you want to register binfmt handlers for qemu user targets: |
292 |
-For openrc: |
293 |
- # rc-update add qemu-binfmt |
294 |
-For systemd: |
295 |
- # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" |
296 |
- |
297 |
-pkg_pretend() { |
298 |
- if use kernel_linux && kernel_is lt 2 6 25; then |
299 |
- eerror "This version of KVM requres a host kernel of 2.6.25 or higher." |
300 |
- elif use kernel_linux; then |
301 |
- if ! linux_config_exists; then |
302 |
- eerror "Unable to check your kernel for KVM support" |
303 |
- else |
304 |
- CONFIG_CHECK="~KVM ~TUN ~BRIDGE" |
305 |
- ERROR_KVM="You must enable KVM in your kernel to continue" |
306 |
- ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" |
307 |
- ERROR_KVM_AMD+=" your kernel configuration." |
308 |
- ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" |
309 |
- ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." |
310 |
- ERROR_TUN="You will need the Universal TUN/TAP driver compiled" |
311 |
- ERROR_TUN+=" into your kernel or loaded as a module to use the" |
312 |
- ERROR_TUN+=" virtual network device if using -net tap." |
313 |
- ERROR_BRIDGE="You will also need support for 802.1d" |
314 |
- ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." |
315 |
- use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" |
316 |
- ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" |
317 |
- ERROR_VHOST_NET+=" support" |
318 |
- |
319 |
- if use amd64 || use x86 || use amd64-linux || use x86-linux; then |
320 |
- CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL" |
321 |
- fi |
322 |
- |
323 |
- use python && CONFIG_CHECK+=" ~DEBUG_FS" |
324 |
- ERROR_DEBUG_FS="debugFS support required for kvm_stat" |
325 |
- |
326 |
- # Now do the actual checks setup above |
327 |
- check_extra_config |
328 |
- fi |
329 |
- fi |
330 |
- |
331 |
- if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then |
332 |
- eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" |
333 |
- eerror "instances are still pointing to it. Please update your" |
334 |
- eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" |
335 |
- eerror "and the right system binary (e.g. qemu-system-x86_64)." |
336 |
- die "update your virt configs to not use qemu-kvm" |
337 |
- fi |
338 |
-} |
339 |
- |
340 |
-pkg_setup() { |
341 |
- enewgroup kvm 78 |
342 |
-} |
343 |
- |
344 |
-# Sanity check to make sure target lists are kept up-to-date. |
345 |
-check_targets() { |
346 |
- local var=$1 mak=$2 |
347 |
- local detected sorted |
348 |
- |
349 |
- pushd "${S}"/default-configs >/dev/null || die |
350 |
- |
351 |
- # Force C locale until glibc is updated. #564936 |
352 |
- detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) |
353 |
- sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) |
354 |
- if [[ ${sorted} != "${detected}" ]] ; then |
355 |
- eerror "The ebuild needs to be kept in sync." |
356 |
- eerror "${var}: ${sorted}" |
357 |
- eerror "$(printf '%-*s' ${#var} configure): ${detected}" |
358 |
- die "sync ${var} to the list of targets" |
359 |
- fi |
360 |
- |
361 |
- popd >/dev/null |
362 |
-} |
363 |
- |
364 |
-handle_locales() { |
365 |
- # Make sure locale list is kept up-to-date. |
366 |
- local detected sorted |
367 |
- detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u)) |
368 |
- sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u)) |
369 |
- if [[ ${sorted} != "${detected}" ]] ; then |
370 |
- eerror "The ebuild needs to be kept in sync." |
371 |
- eerror "PLOCALES: ${sorted}" |
372 |
- eerror " po/*.po: ${detected}" |
373 |
- die "sync PLOCALES" |
374 |
- fi |
375 |
- |
376 |
- # Deal with selective install of locales. |
377 |
- if use nls ; then |
378 |
- # Delete locales the user does not want. #577814 |
379 |
- rm_loc() { rm po/$1.po || die; } |
380 |
- l10n_for_each_disabled_locale_do rm_loc |
381 |
- else |
382 |
- # Cheap hack to disable gettext .mo generation. |
383 |
- rm -f po/*.po |
384 |
- fi |
385 |
-} |
386 |
- |
387 |
-src_prepare() { |
388 |
- check_targets IUSE_SOFTMMU_TARGETS softmmu |
389 |
- check_targets IUSE_USER_TARGETS linux-user |
390 |
- |
391 |
- # Alter target makefiles to accept CFLAGS set via flag-o |
392 |
- sed -i -r \ |
393 |
- -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ |
394 |
- Makefile Makefile.target || die |
395 |
- |
396 |
- default |
397 |
- |
398 |
- # Fix ld and objcopy being called directly |
399 |
- tc-export AR LD OBJCOPY |
400 |
- |
401 |
- # Verbose builds |
402 |
- MAKEOPTS+=" V=1" |
403 |
- |
404 |
- # Run after we've applied all patches. |
405 |
- handle_locales |
406 |
-} |
407 |
- |
408 |
-## |
409 |
-# configures qemu based on the build directory and the build type |
410 |
-# we are using. |
411 |
-# |
412 |
-qemu_src_configure() { |
413 |
- debug-print-function ${FUNCNAME} "$@" |
414 |
- |
415 |
- local buildtype=$1 |
416 |
- local builddir="${S}/${buildtype}-build" |
417 |
- |
418 |
- mkdir "${builddir}" |
419 |
- |
420 |
- local conf_opts=( |
421 |
- --prefix=/usr |
422 |
- --sysconfdir=/etc |
423 |
- --libdir=/usr/$(get_libdir) |
424 |
- --docdir=/usr/share/doc/${PF}/html |
425 |
- --disable-bsd-user |
426 |
- --disable-guest-agent |
427 |
- --disable-strip |
428 |
- --disable-werror |
429 |
- # We support gnutls/nettle for crypto operations. It is possible |
430 |
- # to use gcrypt when gnutls/nettle are disabled (but not when they |
431 |
- # are enabled), but it's not really worth the hassle. Disable it |
432 |
- # all the time to avoid automatically detecting it. #568856 |
433 |
- --disable-gcrypt |
434 |
- --python="${PYTHON}" |
435 |
- --cc="$(tc-getCC)" |
436 |
- --cxx="$(tc-getCXX)" |
437 |
- --host-cc="$(tc-getBUILD_CC)" |
438 |
- $(use_enable debug debug-info) |
439 |
- $(use_enable debug debug-tcg) |
440 |
- --enable-docs |
441 |
- $(use_enable tci tcg-interpreter) |
442 |
- $(use_enable xattr attr) |
443 |
- ) |
444 |
- |
445 |
- # Disable options not used by user targets. This simplifies building |
446 |
- # static user targets (USE=static-user) considerably. |
447 |
- conf_notuser() { |
448 |
- if [[ ${buildtype} == "user" ]] ; then |
449 |
- echo "--disable-${2:-$1}" |
450 |
- else |
451 |
- use_enable "$@" |
452 |
- fi |
453 |
- } |
454 |
- conf_opts+=( |
455 |
- $(conf_notuser accessibility brlapi) |
456 |
- $(conf_notuser aio linux-aio) |
457 |
- $(conf_notuser bzip2) |
458 |
- $(conf_notuser bluetooth bluez) |
459 |
- $(conf_notuser caps cap-ng) |
460 |
- $(conf_notuser curl) |
461 |
- $(conf_notuser fdt) |
462 |
- $(conf_notuser glusterfs) |
463 |
- $(conf_notuser gnutls) |
464 |
- $(conf_notuser gnutls nettle) |
465 |
- $(conf_notuser gtk) |
466 |
- $(conf_notuser infiniband rdma) |
467 |
- $(conf_notuser iscsi libiscsi) |
468 |
- $(conf_notuser jpeg vnc-jpeg) |
469 |
- $(conf_notuser kernel_linux kvm) |
470 |
- $(conf_notuser lzo) |
471 |
- $(conf_notuser ncurses curses) |
472 |
- $(conf_notuser nfs libnfs) |
473 |
- $(conf_notuser numa) |
474 |
- $(conf_notuser opengl) |
475 |
- $(conf_notuser png vnc-png) |
476 |
- $(conf_notuser rbd) |
477 |
- $(conf_notuser sasl vnc-sasl) |
478 |
- $(conf_notuser sdl) |
479 |
- $(conf_notuser seccomp) |
480 |
- $(conf_notuser smartcard) |
481 |
- $(conf_notuser snappy) |
482 |
- $(conf_notuser spice) |
483 |
- $(conf_notuser ssh libssh2) |
484 |
- $(conf_notuser usb libusb) |
485 |
- $(conf_notuser usbredir usb-redir) |
486 |
- $(conf_notuser vde) |
487 |
- $(conf_notuser vhost-net) |
488 |
- $(conf_notuser virgl virglrenderer) |
489 |
- $(conf_notuser virtfs) |
490 |
- $(conf_notuser vnc) |
491 |
- $(conf_notuser vte) |
492 |
- $(conf_notuser xen) |
493 |
- $(conf_notuser xen xen-pci-passthrough) |
494 |
- $(conf_notuser xfs xfsctl) |
495 |
- ) |
496 |
- |
497 |
- if [[ ! ${buildtype} == "user" ]] ; then |
498 |
- # audio options |
499 |
- local audio_opts="oss" |
500 |
- use alsa && audio_opts="alsa,${audio_opts}" |
501 |
- use sdl && audio_opts="sdl,${audio_opts}" |
502 |
- use pulseaudio && audio_opts="pa,${audio_opts}" |
503 |
- conf_opts+=( |
504 |
- --audio-drv-list="${audio_opts}" |
505 |
- ) |
506 |
- use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) ) |
507 |
- use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) ) |
508 |
- fi |
509 |
- |
510 |
- case ${buildtype} in |
511 |
- user) |
512 |
- conf_opts+=( |
513 |
- --enable-linux-user |
514 |
- --disable-system |
515 |
- --disable-blobs |
516 |
- --disable-tools |
517 |
- ) |
518 |
- local static_flag="static-user" |
519 |
- ;; |
520 |
- softmmu) |
521 |
- conf_opts+=( |
522 |
- --disable-linux-user |
523 |
- --enable-system |
524 |
- --disable-tools |
525 |
- --with-system-pixman |
526 |
- ) |
527 |
- local static_flag="static" |
528 |
- ;; |
529 |
- tools) |
530 |
- conf_opts+=( |
531 |
- --disable-linux-user |
532 |
- --disable-system |
533 |
- --disable-blobs |
534 |
- --enable-tools |
535 |
- ) |
536 |
- local static_flag="static" |
537 |
- ;; |
538 |
- esac |
539 |
- |
540 |
- local targets="${buildtype}_targets" |
541 |
- [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) |
542 |
- |
543 |
- # Add support for SystemTAP |
544 |
- use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) |
545 |
- |
546 |
- # We always want to attempt to build with PIE support as it results |
547 |
- # in a more secure binary. But it doesn't work with static or if |
548 |
- # the current GCC doesn't have PIE support. |
549 |
- if use ${static_flag}; then |
550 |
- conf_opts+=( --static --disable-pie ) |
551 |
- else |
552 |
- tc-enables-pie && conf_opts+=( --enable-pie ) |
553 |
- fi |
554 |
- |
555 |
- echo "../configure ${conf_opts[*]}" |
556 |
- cd "${builddir}" |
557 |
- ../configure "${conf_opts[@]}" || die "configure failed" |
558 |
- |
559 |
- # FreeBSD's kernel does not support QEMU assigning/grabbing |
560 |
- # host USB devices yet |
561 |
- use kernel_FreeBSD && \ |
562 |
- sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak |
563 |
-} |
564 |
- |
565 |
-src_configure() { |
566 |
- local target |
567 |
- |
568 |
- python_setup |
569 |
- |
570 |
- softmmu_targets= softmmu_bins=() |
571 |
- user_targets= user_bins=() |
572 |
- |
573 |
- for target in ${IUSE_SOFTMMU_TARGETS} ; do |
574 |
- if use "qemu_softmmu_targets_${target}"; then |
575 |
- softmmu_targets+=",${target}-softmmu" |
576 |
- softmmu_bins+=( "qemu-system-${target}" ) |
577 |
- fi |
578 |
- done |
579 |
- |
580 |
- for target in ${IUSE_USER_TARGETS} ; do |
581 |
- if use "qemu_user_targets_${target}"; then |
582 |
- user_targets+=",${target}-linux-user" |
583 |
- user_bins+=( "qemu-${target}" ) |
584 |
- fi |
585 |
- done |
586 |
- |
587 |
- softmmu_targets=${softmmu_targets#,} |
588 |
- user_targets=${user_targets#,} |
589 |
- |
590 |
- [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" |
591 |
- [[ -n ${user_targets} ]] && qemu_src_configure "user" |
592 |
- qemu_src_configure "tools" |
593 |
-} |
594 |
- |
595 |
-src_compile() { |
596 |
- if [[ -n ${user_targets} ]]; then |
597 |
- cd "${S}/user-build" |
598 |
- default |
599 |
- fi |
600 |
- |
601 |
- if [[ -n ${softmmu_targets} ]]; then |
602 |
- cd "${S}/softmmu-build" |
603 |
- default |
604 |
- fi |
605 |
- |
606 |
- cd "${S}/tools-build" |
607 |
- default |
608 |
-} |
609 |
- |
610 |
-src_test() { |
611 |
- if [[ -n ${softmmu_targets} ]]; then |
612 |
- cd "${S}/softmmu-build" |
613 |
- pax-mark m */qemu-system-* #515550 |
614 |
- emake -j1 check |
615 |
- emake -j1 check-report.html |
616 |
- fi |
617 |
-} |
618 |
- |
619 |
-qemu_python_install() { |
620 |
- python_domodule "${S}/scripts/qmp/qmp.py" |
621 |
- |
622 |
- python_doscript "${S}/scripts/kvm/vmxcap" |
623 |
- python_doscript "${S}/scripts/qmp/qmp-shell" |
624 |
- python_doscript "${S}/scripts/qmp/qemu-ga-client" |
625 |
-} |
626 |
- |
627 |
-# Generate binfmt support files. |
628 |
-# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) |
629 |
-# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) |
630 |
-generate_initd() { |
631 |
- local out="${T}/qemu-binfmt" |
632 |
- local out_systemd="${T}/qemu.conf" |
633 |
- local d="${T}/binfmt.d" |
634 |
- |
635 |
- einfo "Generating qemu binfmt scripts and configuration files" |
636 |
- |
637 |
- # Generate the debian fragments first. |
638 |
- mkdir -p "${d}" |
639 |
- "${S}"/scripts/qemu-binfmt-conf.sh \ |
640 |
- --debian \ |
641 |
- --exportdir "${d}" \ |
642 |
- --qemu-path "${EPREFIX}/usr/bin" \ |
643 |
- || die |
644 |
- # Then turn the fragments into a shell script we can source. |
645 |
- sed -E -i \ |
646 |
- -e 's:^([^ ]+) (.*)$:\1="\2":' \ |
647 |
- "${d}"/* || die |
648 |
- |
649 |
- # Generate the init.d script by assembling the fragments from above. |
650 |
- local f qcpu package interpreter magic mask |
651 |
- cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die |
652 |
- for f in "${d}"/qemu-* ; do |
653 |
- source "${f}" |
654 |
- |
655 |
- # Normalize the cpu logic like we do in the init.d for the native cpu. |
656 |
- qcpu=${package#qemu-} |
657 |
- case ${qcpu} in |
658 |
- arm*) qcpu="arm";; |
659 |
- mips*) qcpu="mips";; |
660 |
- ppc*) qcpu="ppc";; |
661 |
- s390*) qcpu="s390";; |
662 |
- sh*) qcpu="sh";; |
663 |
- sparc*) qcpu="sparc";; |
664 |
- esac |
665 |
- |
666 |
- cat <<EOF >>"${out}" |
667 |
- if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then |
668 |
- echo ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register |
669 |
- fi |
670 |
-EOF |
671 |
- |
672 |
- echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" |
673 |
- |
674 |
- done |
675 |
- cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die |
676 |
-} |
677 |
- |
678 |
-src_install() { |
679 |
- if [[ -n ${user_targets} ]]; then |
680 |
- cd "${S}/user-build" |
681 |
- emake DESTDIR="${ED}" install |
682 |
- |
683 |
- # Install binfmt handler init script for user targets. |
684 |
- generate_initd |
685 |
- doinitd "${T}/qemu-binfmt" |
686 |
- |
687 |
- # Install binfmt/qemu.conf. |
688 |
- insinto "/usr/share/qemu/binfmt.d" |
689 |
- doins "${T}/qemu.conf" |
690 |
- fi |
691 |
- |
692 |
- if [[ -n ${softmmu_targets} ]]; then |
693 |
- cd "${S}/softmmu-build" |
694 |
- emake DESTDIR="${ED}" install |
695 |
- |
696 |
- # This might not exist if the test failed. #512010 |
697 |
- [[ -e check-report.html ]] && dohtml check-report.html |
698 |
- |
699 |
- if use kernel_linux; then |
700 |
- udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules |
701 |
- fi |
702 |
- |
703 |
- if use python; then |
704 |
- python_foreach_impl qemu_python_install |
705 |
- fi |
706 |
- fi |
707 |
- |
708 |
- cd "${S}/tools-build" |
709 |
- emake DESTDIR="${ED}" install |
710 |
- |
711 |
- # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 |
712 |
- pushd "${ED}"/usr/bin >/dev/null |
713 |
- pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 |
714 |
- popd >/dev/null |
715 |
- |
716 |
- # Install config file example for qemu-bridge-helper |
717 |
- insinto "/etc/qemu" |
718 |
- doins "${FILESDIR}/bridge.conf" |
719 |
- |
720 |
- cd "${S}" |
721 |
- dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt |
722 |
- newdoc pc-bios/README README.pc-bios |
723 |
- dodoc docs/qmp-*.txt |
724 |
- |
725 |
- if [[ -n ${softmmu_targets} ]]; then |
726 |
- # Remove SeaBIOS since we're using the SeaBIOS packaged one |
727 |
- rm "${ED}/usr/share/qemu/bios.bin" |
728 |
- rm "${ED}/usr/share/qemu/bios-256k.bin" |
729 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
730 |
- dosym ../seabios/bios.bin /usr/share/qemu/bios.bin |
731 |
- dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin |
732 |
- fi |
733 |
- |
734 |
- # Remove vgabios since we're using the seavgabios packaged one |
735 |
- rm "${ED}/usr/share/qemu/vgabios.bin" |
736 |
- rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" |
737 |
- rm "${ED}/usr/share/qemu/vgabios-qxl.bin" |
738 |
- rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" |
739 |
- rm "${ED}/usr/share/qemu/vgabios-virtio.bin" |
740 |
- rm "${ED}/usr/share/qemu/vgabios-vmware.bin" |
741 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
742 |
- dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin |
743 |
- dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin |
744 |
- dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin |
745 |
- dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin |
746 |
- dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin |
747 |
- dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin |
748 |
- fi |
749 |
- |
750 |
- # Remove sgabios since we're using the sgabios packaged one |
751 |
- rm "${ED}/usr/share/qemu/sgabios.bin" |
752 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
753 |
- dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin |
754 |
- fi |
755 |
- |
756 |
- # Remove iPXE since we're using the iPXE packaged one |
757 |
- rm "${ED}"/usr/share/qemu/pxe-*.rom |
758 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
759 |
- dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom |
760 |
- dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom |
761 |
- dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom |
762 |
- dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom |
763 |
- dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom |
764 |
- dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom |
765 |
- fi |
766 |
- fi |
767 |
- |
768 |
- DISABLE_AUTOFORMATTING=true |
769 |
- readme.gentoo_create_doc |
770 |
-} |
771 |
- |
772 |
-firmware_abi_change() { |
773 |
- local pv |
774 |
- for pv in ${REPLACING_VERSIONS}; do |
775 |
- if ! version_is_at_least ${FIRMWARE_ABI_VERSION} ${pv}; then |
776 |
- return 0 |
777 |
- fi |
778 |
- done |
779 |
- return 1 |
780 |
-} |
781 |
- |
782 |
-pkg_postinst() { |
783 |
- if [[ -n ${softmmu_targets} ]] && use kernel_linux; then |
784 |
- udev_reload |
785 |
- fi |
786 |
- |
787 |
- fcaps cap_net_admin /usr/libexec/qemu-bridge-helper |
788 |
- |
789 |
- DISABLE_AUTOFORMATTING=true |
790 |
- readme.gentoo_print_elog |
791 |
- |
792 |
- if use pin-upstream-blobs && firmware_abi_change; then |
793 |
- ewarn "This version of qemu pins new versions of firmware blobs:" |
794 |
- ewarn " $(best_version sys-firmware/edk2-ovmf)" |
795 |
- ewarn " $(best_version sys-firmware/ipxe)" |
796 |
- ewarn " $(best_version sys-firmware/seabios)" |
797 |
- ewarn " $(best_version sys-firmware/sgabios)" |
798 |
- ewarn "This might break resume of hibernated guests (started with a different" |
799 |
- ewarn "firmware version) and live migration to/from qemu versions with different" |
800 |
- ewarn "firmware. Please (cold) restart all running guests. For functional" |
801 |
- ewarn "guest migration ensure that all" |
802 |
- ewarn "hosts run at least" |
803 |
- ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." |
804 |
- fi |
805 |
-} |
806 |
- |
807 |
-pkg_info() { |
808 |
- echo "Using:" |
809 |
- echo " $(best_version app-emulation/spice-protocol)" |
810 |
- echo " $(best_version sys-firmware/edk2-ovmf)" |
811 |
- if has_version 'sys-firmware/edk2-ovmf[binary]'; then |
812 |
- echo " USE=binary" |
813 |
- else |
814 |
- echo " USE=''" |
815 |
- fi |
816 |
- echo " $(best_version sys-firmware/ipxe)" |
817 |
- echo " $(best_version sys-firmware/seabios)" |
818 |
- if has_version 'sys-firmware/seabios[binary]'; then |
819 |
- echo " USE=binary" |
820 |
- else |
821 |
- echo " USE=''" |
822 |
- fi |
823 |
- echo " $(best_version sys-firmware/sgabios)" |
824 |
-} |
825 |
|
826 |
diff --git a/app-emulation/qemu/qemu-2.9.0-r57.ebuild b/app-emulation/qemu/qemu-2.9.0-r57.ebuild |
827 |
deleted file mode 100644 |
828 |
index a63311cba20..00000000000 |
829 |
--- a/app-emulation/qemu/qemu-2.9.0-r57.ebuild |
830 |
+++ /dev/null |
831 |
@@ -1,796 +0,0 @@ |
832 |
-# Copyright 1999-2017 Gentoo Foundation |
833 |
-# Distributed under the terms of the GNU General Public License v2 |
834 |
- |
835 |
-EAPI="6" |
836 |
- |
837 |
-PYTHON_COMPAT=( python2_7 ) |
838 |
-PYTHON_REQ_USE="ncurses,readline" |
839 |
- |
840 |
-PLOCALES="bg de_DE fr_FR hu it tr zh_CN" |
841 |
- |
842 |
-FIRMWARE_ABI_VERSION="2.9.0-r52" |
843 |
- |
844 |
-inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ |
845 |
- user udev fcaps readme.gentoo-r1 pax-utils l10n |
846 |
- |
847 |
-if [[ ${PV} = *9999* ]]; then |
848 |
- EGIT_REPO_URI="git://git.qemu.org/qemu.git" |
849 |
- inherit git-r3 |
850 |
- SRC_URI="" |
851 |
-else |
852 |
- SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2" |
853 |
- KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86 ~x86-fbsd" |
854 |
-fi |
855 |
- |
856 |
-DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" |
857 |
-HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" |
858 |
- |
859 |
-LICENSE="GPL-2 LGPL-2 BSD-2" |
860 |
-SLOT="0" |
861 |
-IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt |
862 |
- glusterfs gnutls gtk gtk2 infiniband iscsi +jpeg kernel_linux |
863 |
- kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png |
864 |
- pulseaudio python rbd sasl +seccomp sdl sdl2 selinux smartcard snappy |
865 |
- spice ssh static static-user systemtap tci test usb usbredir vde |
866 |
- +vhost-net virgl virtfs +vnc vte xattr xen xfs" |
867 |
- |
868 |
-COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel |
869 |
- mips mips64 mips64el mipsel nios2 or1k ppc ppc64 s390x sh4 sh4eb sparc |
870 |
- sparc64 x86_64" |
871 |
-IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} |
872 |
- lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb" |
873 |
-IUSE_USER_TARGETS="${COMMON_TARGETS} |
874 |
- armeb hppa mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx" |
875 |
- |
876 |
-use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) |
877 |
-use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) |
878 |
-IUSE+=" ${use_softmmu_targets} ${use_user_targets}" |
879 |
- |
880 |
-# Allow no targets to be built so that people can get a tools-only build. |
881 |
-# Block USE flag configurations known to not work. |
882 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE} |
883 |
- gtk2? ( gtk ) |
884 |
- qemu_softmmu_targets_arm? ( fdt ) |
885 |
- qemu_softmmu_targets_microblaze? ( fdt ) |
886 |
- qemu_softmmu_targets_mips64el? ( fdt ) |
887 |
- qemu_softmmu_targets_ppc? ( fdt ) |
888 |
- qemu_softmmu_targets_ppc64? ( fdt ) |
889 |
- sdl2? ( sdl ) |
890 |
- static? ( static-user !alsa !bluetooth !gtk !gtk2 !opengl !pulseaudio ) |
891 |
- virtfs? ( xattr ) |
892 |
- vte? ( gtk )" |
893 |
- |
894 |
-# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) |
895 |
-# and user/softmmu targets (qemu-*, qemu-system-*). |
896 |
-# |
897 |
-# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. |
898 |
-# |
899 |
-# The attr lib isn't always linked in (although the USE flag is always |
900 |
-# respected). This is because qemu supports using the C library's API |
901 |
-# when available rather than always using the extranl library. |
902 |
-ALL_DEPEND=" |
903 |
- >=dev-libs/glib-2.0[static-libs(+)] |
904 |
- sys-libs/zlib[static-libs(+)] |
905 |
- python? ( ${PYTHON_DEPS} ) |
906 |
- systemtap? ( dev-util/systemtap ) |
907 |
- xattr? ( sys-apps/attr[static-libs(+)] )" |
908 |
- |
909 |
-# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) |
910 |
-# softmmu targets (qemu-system-*). |
911 |
-SOFTMMU_TOOLS_DEPEND=" |
912 |
- >=x11-libs/pixman-0.28.0[static-libs(+)] |
913 |
- accessibility? ( |
914 |
- app-accessibility/brltty[api] |
915 |
- app-accessibility/brltty[static-libs(+)] |
916 |
- ) |
917 |
- aio? ( dev-libs/libaio[static-libs(+)] ) |
918 |
- alsa? ( >=media-libs/alsa-lib-1.0.13 ) |
919 |
- bluetooth? ( net-wireless/bluez ) |
920 |
- bzip2? ( app-arch/bzip2[static-libs(+)] ) |
921 |
- caps? ( sys-libs/libcap-ng[static-libs(+)] ) |
922 |
- curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) |
923 |
- fdt? ( >=sys-apps/dtc-1.4.2[static-libs(+)] ) |
924 |
- glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) |
925 |
- gnutls? ( |
926 |
- dev-libs/nettle:=[static-libs(+)] |
927 |
- >=net-libs/gnutls-3.0:=[static-libs(+)] |
928 |
- ) |
929 |
- gtk? ( |
930 |
- gtk2? ( |
931 |
- x11-libs/gtk+:2 |
932 |
- vte? ( x11-libs/vte:0 ) |
933 |
- ) |
934 |
- !gtk2? ( |
935 |
- x11-libs/gtk+:3 |
936 |
- vte? ( x11-libs/vte:2.91 ) |
937 |
- ) |
938 |
- ) |
939 |
- infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] ) |
940 |
- iscsi? ( net-libs/libiscsi ) |
941 |
- jpeg? ( virtual/jpeg:0=[static-libs(+)] ) |
942 |
- lzo? ( dev-libs/lzo:2[static-libs(+)] ) |
943 |
- ncurses? ( |
944 |
- sys-libs/ncurses:0=[unicode] |
945 |
- sys-libs/ncurses:0=[static-libs(+)] |
946 |
- ) |
947 |
- nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] ) |
948 |
- numa? ( sys-process/numactl[static-libs(+)] ) |
949 |
- opengl? ( |
950 |
- virtual/opengl |
951 |
- media-libs/libepoxy[static-libs(+)] |
952 |
- media-libs/mesa[static-libs(+)] |
953 |
- media-libs/mesa[egl,gbm] |
954 |
- ) |
955 |
- png? ( media-libs/libpng:0=[static-libs(+)] ) |
956 |
- pulseaudio? ( media-sound/pulseaudio ) |
957 |
- rbd? ( sys-cluster/ceph[static-libs(+)] ) |
958 |
- sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) |
959 |
- sdl? ( |
960 |
- !sdl2? ( |
961 |
- media-libs/libsdl[X] |
962 |
- >=media-libs/libsdl-1.2.11[static-libs(+)] |
963 |
- ) |
964 |
- sdl2? ( |
965 |
- media-libs/libsdl2[X] |
966 |
- media-libs/libsdl2[static-libs(+)] |
967 |
- ) |
968 |
- ) |
969 |
- seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) |
970 |
- smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) |
971 |
- snappy? ( app-arch/snappy:=[static-libs(+)] ) |
972 |
- spice? ( |
973 |
- >=app-emulation/spice-protocol-0.12.3 |
974 |
- >=app-emulation/spice-0.12.0[static-libs(+)] |
975 |
- ) |
976 |
- ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] ) |
977 |
- usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) |
978 |
- usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) |
979 |
- vde? ( net-misc/vde[static-libs(+)] ) |
980 |
- virgl? ( media-libs/virglrenderer[static-libs(+)] ) |
981 |
- virtfs? ( sys-libs/libcap ) |
982 |
- xen? ( app-emulation/xen-tools:= ) |
983 |
- xfs? ( sys-fs/xfsprogs[static-libs(+)] )" |
984 |
- |
985 |
-X86_FIRMWARE_DEPEND=" |
986 |
- pin-upstream-blobs? ( |
987 |
- ~sys-firmware/edk2-ovmf-2017_pre20170505[binary] |
988 |
- ~sys-firmware/ipxe-1.0.0_p20160620 |
989 |
- ~sys-firmware/seabios-1.10.2[binary,seavgabios] |
990 |
- ~sys-firmware/sgabios-0.1_pre8 |
991 |
- ) |
992 |
- !pin-upstream-blobs? ( |
993 |
- sys-firmware/edk2-ovmf |
994 |
- sys-firmware/ipxe |
995 |
- >=sys-firmware/seabios-1.10.2[seavgabios] |
996 |
- sys-firmware/sgabios |
997 |
- )" |
998 |
- |
999 |
-CDEPEND=" |
1000 |
- !static? ( |
1001 |
- ${ALL_DEPEND//\[static-libs(+)]} |
1002 |
- ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} |
1003 |
- ) |
1004 |
- qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) |
1005 |
- qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )" |
1006 |
-DEPEND="${CDEPEND} |
1007 |
- dev-lang/perl |
1008 |
- =dev-lang/python-2* |
1009 |
- sys-apps/texinfo |
1010 |
- virtual/pkgconfig |
1011 |
- kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) |
1012 |
- gtk? ( nls? ( sys-devel/gettext ) ) |
1013 |
- static? ( |
1014 |
- ${ALL_DEPEND} |
1015 |
- ${SOFTMMU_TOOLS_DEPEND} |
1016 |
- ) |
1017 |
- static-user? ( ${ALL_DEPEND} ) |
1018 |
- test? ( |
1019 |
- dev-libs/glib[utils] |
1020 |
- sys-devel/bc |
1021 |
- )" |
1022 |
-RDEPEND="${CDEPEND} |
1023 |
- selinux? ( sec-policy/selinux-qemu )" |
1024 |
- |
1025 |
-PATCHES=( |
1026 |
- "${FILESDIR}"/${PN}-2.5.0-cflags.patch |
1027 |
- "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch |
1028 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8309.patch # bug 616870 |
1029 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8379.patch # bug 616872 |
1030 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8380.patch # bug 616874 |
1031 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8112.patch # bug 616636 |
1032 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-7493.patch # bug 618808 |
1033 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-11434.patch # bug 625614 |
1034 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-11334.patch # bug 621292 |
1035 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9524-1.patch # bug 621292 |
1036 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9524-2.patch |
1037 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9503-1.patch # bug 621184 |
1038 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9503-2.patch |
1039 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-10664.patch # bug 623016 |
1040 |
- "${FILESDIR}"/${PN}-2.9.0-CVE-2017-10806.patch # bug 624088 |
1041 |
-) |
1042 |
- |
1043 |
-STRIP_MASK="/usr/share/qemu/palcode-clipper" |
1044 |
- |
1045 |
-QA_PREBUILT=" |
1046 |
- usr/share/qemu/openbios-ppc |
1047 |
- usr/share/qemu/openbios-sparc64 |
1048 |
- usr/share/qemu/openbios-sparc32 |
1049 |
- usr/share/qemu/palcode-clipper |
1050 |
- usr/share/qemu/s390-ccw.img |
1051 |
- usr/share/qemu/u-boot.e500" |
1052 |
- |
1053 |
-QA_WX_LOAD="usr/bin/qemu-i386 |
1054 |
- usr/bin/qemu-x86_64 |
1055 |
- usr/bin/qemu-alpha |
1056 |
- usr/bin/qemu-arm |
1057 |
- usr/bin/qemu-cris |
1058 |
- usr/bin/qemu-m68k |
1059 |
- usr/bin/qemu-microblaze |
1060 |
- usr/bin/qemu-microblazeel |
1061 |
- usr/bin/qemu-mips |
1062 |
- usr/bin/qemu-mipsel |
1063 |
- usr/bin/qemu-or1k |
1064 |
- usr/bin/qemu-ppc |
1065 |
- usr/bin/qemu-ppc64 |
1066 |
- usr/bin/qemu-ppc64abi32 |
1067 |
- usr/bin/qemu-sh4 |
1068 |
- usr/bin/qemu-sh4eb |
1069 |
- usr/bin/qemu-sparc |
1070 |
- usr/bin/qemu-sparc64 |
1071 |
- usr/bin/qemu-armeb |
1072 |
- usr/bin/qemu-sparc32plus |
1073 |
- usr/bin/qemu-s390x |
1074 |
- usr/bin/qemu-unicore32" |
1075 |
- |
1076 |
-DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the |
1077 |
-kernel module loaded before running kvm. The easiest way to ensure that the |
1078 |
-kernel module is loaded is to load it on boot. |
1079 |
- For AMD CPUs the module is called 'kvm-amd'. |
1080 |
- For Intel CPUs the module is called 'kvm-intel'. |
1081 |
-Please review /etc/conf.d/modules for how to load these. |
1082 |
- |
1083 |
-Make sure your user is in the 'kvm' group. Just run |
1084 |
- $ gpasswd -a <USER> kvm |
1085 |
-then have <USER> re-login. |
1086 |
- |
1087 |
-For brand new installs, the default permissions on /dev/kvm might not let |
1088 |
-you access it. You can tell udev to reset ownership/perms: |
1089 |
- $ udevadm trigger -c add /dev/kvm |
1090 |
- |
1091 |
-If you want to register binfmt handlers for qemu user targets: |
1092 |
-For openrc: |
1093 |
- # rc-update add qemu-binfmt |
1094 |
-For systemd: |
1095 |
- # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" |
1096 |
- |
1097 |
-pkg_pretend() { |
1098 |
- if use kernel_linux && kernel_is lt 2 6 25; then |
1099 |
- eerror "This version of KVM requres a host kernel of 2.6.25 or higher." |
1100 |
- elif use kernel_linux; then |
1101 |
- if ! linux_config_exists; then |
1102 |
- eerror "Unable to check your kernel for KVM support" |
1103 |
- else |
1104 |
- CONFIG_CHECK="~KVM ~TUN ~BRIDGE" |
1105 |
- ERROR_KVM="You must enable KVM in your kernel to continue" |
1106 |
- ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" |
1107 |
- ERROR_KVM_AMD+=" your kernel configuration." |
1108 |
- ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" |
1109 |
- ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." |
1110 |
- ERROR_TUN="You will need the Universal TUN/TAP driver compiled" |
1111 |
- ERROR_TUN+=" into your kernel or loaded as a module to use the" |
1112 |
- ERROR_TUN+=" virtual network device if using -net tap." |
1113 |
- ERROR_BRIDGE="You will also need support for 802.1d" |
1114 |
- ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." |
1115 |
- use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" |
1116 |
- ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" |
1117 |
- ERROR_VHOST_NET+=" support" |
1118 |
- |
1119 |
- if use amd64 || use x86 || use amd64-linux || use x86-linux; then |
1120 |
- CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL" |
1121 |
- fi |
1122 |
- |
1123 |
- use python && CONFIG_CHECK+=" ~DEBUG_FS" |
1124 |
- ERROR_DEBUG_FS="debugFS support required for kvm_stat" |
1125 |
- |
1126 |
- # Now do the actual checks setup above |
1127 |
- check_extra_config |
1128 |
- fi |
1129 |
- fi |
1130 |
- |
1131 |
- if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then |
1132 |
- eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" |
1133 |
- eerror "instances are still pointing to it. Please update your" |
1134 |
- eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" |
1135 |
- eerror "and the right system binary (e.g. qemu-system-x86_64)." |
1136 |
- die "update your virt configs to not use qemu-kvm" |
1137 |
- fi |
1138 |
-} |
1139 |
- |
1140 |
-pkg_setup() { |
1141 |
- enewgroup kvm 78 |
1142 |
-} |
1143 |
- |
1144 |
-# Sanity check to make sure target lists are kept up-to-date. |
1145 |
-check_targets() { |
1146 |
- local var=$1 mak=$2 |
1147 |
- local detected sorted |
1148 |
- |
1149 |
- pushd "${S}"/default-configs >/dev/null || die |
1150 |
- |
1151 |
- # Force C locale until glibc is updated. #564936 |
1152 |
- detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) |
1153 |
- sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) |
1154 |
- if [[ ${sorted} != "${detected}" ]] ; then |
1155 |
- eerror "The ebuild needs to be kept in sync." |
1156 |
- eerror "${var}: ${sorted}" |
1157 |
- eerror "$(printf '%-*s' ${#var} configure): ${detected}" |
1158 |
- die "sync ${var} to the list of targets" |
1159 |
- fi |
1160 |
- |
1161 |
- popd >/dev/null |
1162 |
-} |
1163 |
- |
1164 |
-handle_locales() { |
1165 |
- # Make sure locale list is kept up-to-date. |
1166 |
- local detected sorted |
1167 |
- detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u)) |
1168 |
- sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u)) |
1169 |
- if [[ ${sorted} != "${detected}" ]] ; then |
1170 |
- eerror "The ebuild needs to be kept in sync." |
1171 |
- eerror "PLOCALES: ${sorted}" |
1172 |
- eerror " po/*.po: ${detected}" |
1173 |
- die "sync PLOCALES" |
1174 |
- fi |
1175 |
- |
1176 |
- # Deal with selective install of locales. |
1177 |
- if use nls ; then |
1178 |
- # Delete locales the user does not want. #577814 |
1179 |
- rm_loc() { rm po/$1.po || die; } |
1180 |
- l10n_for_each_disabled_locale_do rm_loc |
1181 |
- else |
1182 |
- # Cheap hack to disable gettext .mo generation. |
1183 |
- rm -f po/*.po |
1184 |
- fi |
1185 |
-} |
1186 |
- |
1187 |
-src_prepare() { |
1188 |
- check_targets IUSE_SOFTMMU_TARGETS softmmu |
1189 |
- check_targets IUSE_USER_TARGETS linux-user |
1190 |
- |
1191 |
- # Alter target makefiles to accept CFLAGS set via flag-o |
1192 |
- sed -i -r \ |
1193 |
- -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ |
1194 |
- Makefile Makefile.target || die |
1195 |
- |
1196 |
- default |
1197 |
- |
1198 |
- # Fix ld and objcopy being called directly |
1199 |
- tc-export AR LD OBJCOPY |
1200 |
- |
1201 |
- # Verbose builds |
1202 |
- MAKEOPTS+=" V=1" |
1203 |
- |
1204 |
- # Run after we've applied all patches. |
1205 |
- handle_locales |
1206 |
- |
1207 |
- #remove bundled copy of libfdt |
1208 |
- rm -r dtc || die |
1209 |
-} |
1210 |
- |
1211 |
-## |
1212 |
-# configures qemu based on the build directory and the build type |
1213 |
-# we are using. |
1214 |
-# |
1215 |
-qemu_src_configure() { |
1216 |
- debug-print-function ${FUNCNAME} "$@" |
1217 |
- |
1218 |
- local buildtype=$1 |
1219 |
- local builddir="${S}/${buildtype}-build" |
1220 |
- |
1221 |
- mkdir "${builddir}" |
1222 |
- |
1223 |
- local conf_opts=( |
1224 |
- --prefix=/usr |
1225 |
- --sysconfdir=/etc |
1226 |
- --libdir=/usr/$(get_libdir) |
1227 |
- --docdir=/usr/share/doc/${PF}/html |
1228 |
- --disable-bsd-user |
1229 |
- --disable-guest-agent |
1230 |
- --disable-strip |
1231 |
- --disable-werror |
1232 |
- # We support gnutls/nettle for crypto operations. It is possible |
1233 |
- # to use gcrypt when gnutls/nettle are disabled (but not when they |
1234 |
- # are enabled), but it's not really worth the hassle. Disable it |
1235 |
- # all the time to avoid automatically detecting it. #568856 |
1236 |
- --disable-gcrypt |
1237 |
- --python="${PYTHON}" |
1238 |
- --cc="$(tc-getCC)" |
1239 |
- --cxx="$(tc-getCXX)" |
1240 |
- --host-cc="$(tc-getBUILD_CC)" |
1241 |
- $(use_enable debug debug-info) |
1242 |
- $(use_enable debug debug-tcg) |
1243 |
- --enable-docs |
1244 |
- $(use_enable tci tcg-interpreter) |
1245 |
- $(use_enable xattr attr) |
1246 |
- ) |
1247 |
- |
1248 |
- # Disable options not used by user targets. This simplifies building |
1249 |
- # static user targets (USE=static-user) considerably. |
1250 |
- conf_notuser() { |
1251 |
- if [[ ${buildtype} == "user" ]] ; then |
1252 |
- echo "--disable-${2:-$1}" |
1253 |
- else |
1254 |
- use_enable "$@" |
1255 |
- fi |
1256 |
- } |
1257 |
- conf_opts+=( |
1258 |
- $(conf_notuser accessibility brlapi) |
1259 |
- $(conf_notuser aio linux-aio) |
1260 |
- $(conf_notuser bzip2) |
1261 |
- $(conf_notuser bluetooth bluez) |
1262 |
- $(conf_notuser caps cap-ng) |
1263 |
- $(conf_notuser curl) |
1264 |
- $(conf_notuser fdt) |
1265 |
- $(conf_notuser glusterfs) |
1266 |
- $(conf_notuser gnutls) |
1267 |
- $(conf_notuser gnutls nettle) |
1268 |
- $(conf_notuser gtk) |
1269 |
- $(conf_notuser infiniband rdma) |
1270 |
- $(conf_notuser iscsi libiscsi) |
1271 |
- $(conf_notuser jpeg vnc-jpeg) |
1272 |
- $(conf_notuser kernel_linux kvm) |
1273 |
- $(conf_notuser lzo) |
1274 |
- $(conf_notuser ncurses curses) |
1275 |
- $(conf_notuser nfs libnfs) |
1276 |
- $(conf_notuser numa) |
1277 |
- $(conf_notuser opengl) |
1278 |
- $(conf_notuser png vnc-png) |
1279 |
- $(conf_notuser rbd) |
1280 |
- $(conf_notuser sasl vnc-sasl) |
1281 |
- $(conf_notuser sdl) |
1282 |
- $(conf_notuser seccomp) |
1283 |
- $(conf_notuser smartcard) |
1284 |
- $(conf_notuser snappy) |
1285 |
- $(conf_notuser spice) |
1286 |
- $(conf_notuser ssh libssh2) |
1287 |
- $(conf_notuser usb libusb) |
1288 |
- $(conf_notuser usbredir usb-redir) |
1289 |
- $(conf_notuser vde) |
1290 |
- $(conf_notuser vhost-net) |
1291 |
- $(conf_notuser virgl virglrenderer) |
1292 |
- $(conf_notuser virtfs) |
1293 |
- $(conf_notuser vnc) |
1294 |
- $(conf_notuser vte) |
1295 |
- $(conf_notuser xen) |
1296 |
- $(conf_notuser xen xen-pci-passthrough) |
1297 |
- $(conf_notuser xfs xfsctl) |
1298 |
- ) |
1299 |
- |
1300 |
- if [[ ! ${buildtype} == "user" ]] ; then |
1301 |
- # audio options |
1302 |
- local audio_opts="oss" |
1303 |
- use alsa && audio_opts="alsa,${audio_opts}" |
1304 |
- use sdl && audio_opts="sdl,${audio_opts}" |
1305 |
- use pulseaudio && audio_opts="pa,${audio_opts}" |
1306 |
- conf_opts+=( |
1307 |
- --audio-drv-list="${audio_opts}" |
1308 |
- ) |
1309 |
- use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) ) |
1310 |
- use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) ) |
1311 |
- fi |
1312 |
- |
1313 |
- case ${buildtype} in |
1314 |
- user) |
1315 |
- conf_opts+=( |
1316 |
- --enable-linux-user |
1317 |
- --disable-system |
1318 |
- --disable-blobs |
1319 |
- --disable-tools |
1320 |
- ) |
1321 |
- local static_flag="static-user" |
1322 |
- ;; |
1323 |
- softmmu) |
1324 |
- conf_opts+=( |
1325 |
- --disable-linux-user |
1326 |
- --enable-system |
1327 |
- --disable-tools |
1328 |
- --with-system-pixman |
1329 |
- ) |
1330 |
- local static_flag="static" |
1331 |
- ;; |
1332 |
- tools) |
1333 |
- conf_opts+=( |
1334 |
- --disable-linux-user |
1335 |
- --disable-system |
1336 |
- --disable-blobs |
1337 |
- --enable-tools |
1338 |
- ) |
1339 |
- local static_flag="static" |
1340 |
- ;; |
1341 |
- esac |
1342 |
- |
1343 |
- local targets="${buildtype}_targets" |
1344 |
- [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) |
1345 |
- |
1346 |
- # Add support for SystemTAP |
1347 |
- use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) |
1348 |
- |
1349 |
- # We always want to attempt to build with PIE support as it results |
1350 |
- # in a more secure binary. But it doesn't work with static or if |
1351 |
- # the current GCC doesn't have PIE support. |
1352 |
- if use ${static_flag}; then |
1353 |
- conf_opts+=( --static --disable-pie ) |
1354 |
- else |
1355 |
- tc-enables-pie && conf_opts+=( --enable-pie ) |
1356 |
- fi |
1357 |
- |
1358 |
- echo "../configure ${conf_opts[*]}" |
1359 |
- cd "${builddir}" |
1360 |
- ../configure "${conf_opts[@]}" || die "configure failed" |
1361 |
- |
1362 |
- # FreeBSD's kernel does not support QEMU assigning/grabbing |
1363 |
- # host USB devices yet |
1364 |
- use kernel_FreeBSD && \ |
1365 |
- sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak |
1366 |
-} |
1367 |
- |
1368 |
-src_configure() { |
1369 |
- local target |
1370 |
- |
1371 |
- python_setup |
1372 |
- |
1373 |
- softmmu_targets= softmmu_bins=() |
1374 |
- user_targets= user_bins=() |
1375 |
- |
1376 |
- for target in ${IUSE_SOFTMMU_TARGETS} ; do |
1377 |
- if use "qemu_softmmu_targets_${target}"; then |
1378 |
- softmmu_targets+=",${target}-softmmu" |
1379 |
- softmmu_bins+=( "qemu-system-${target}" ) |
1380 |
- fi |
1381 |
- done |
1382 |
- |
1383 |
- for target in ${IUSE_USER_TARGETS} ; do |
1384 |
- if use "qemu_user_targets_${target}"; then |
1385 |
- user_targets+=",${target}-linux-user" |
1386 |
- user_bins+=( "qemu-${target}" ) |
1387 |
- fi |
1388 |
- done |
1389 |
- |
1390 |
- softmmu_targets=${softmmu_targets#,} |
1391 |
- user_targets=${user_targets#,} |
1392 |
- |
1393 |
- [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" |
1394 |
- [[ -n ${user_targets} ]] && qemu_src_configure "user" |
1395 |
- qemu_src_configure "tools" |
1396 |
-} |
1397 |
- |
1398 |
-src_compile() { |
1399 |
- if [[ -n ${user_targets} ]]; then |
1400 |
- cd "${S}/user-build" |
1401 |
- default |
1402 |
- fi |
1403 |
- |
1404 |
- if [[ -n ${softmmu_targets} ]]; then |
1405 |
- cd "${S}/softmmu-build" |
1406 |
- default |
1407 |
- fi |
1408 |
- |
1409 |
- cd "${S}/tools-build" |
1410 |
- default |
1411 |
-} |
1412 |
- |
1413 |
-src_test() { |
1414 |
- if [[ -n ${softmmu_targets} ]]; then |
1415 |
- cd "${S}/softmmu-build" |
1416 |
- pax-mark m */qemu-system-* #515550 |
1417 |
- emake -j1 check |
1418 |
- emake -j1 check-report.html |
1419 |
- fi |
1420 |
-} |
1421 |
- |
1422 |
-qemu_python_install() { |
1423 |
- python_domodule "${S}/scripts/qmp/qmp.py" |
1424 |
- |
1425 |
- python_doscript "${S}/scripts/kvm/vmxcap" |
1426 |
- python_doscript "${S}/scripts/qmp/qmp-shell" |
1427 |
- python_doscript "${S}/scripts/qmp/qemu-ga-client" |
1428 |
-} |
1429 |
- |
1430 |
-# Generate binfmt support files. |
1431 |
-# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) |
1432 |
-# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) |
1433 |
-generate_initd() { |
1434 |
- local out="${T}/qemu-binfmt" |
1435 |
- local out_systemd="${T}/qemu.conf" |
1436 |
- local d="${T}/binfmt.d" |
1437 |
- |
1438 |
- einfo "Generating qemu binfmt scripts and configuration files" |
1439 |
- |
1440 |
- # Generate the debian fragments first. |
1441 |
- mkdir -p "${d}" |
1442 |
- "${S}"/scripts/qemu-binfmt-conf.sh \ |
1443 |
- --debian \ |
1444 |
- --exportdir "${d}" \ |
1445 |
- --qemu-path "${EPREFIX}/usr/bin" \ |
1446 |
- || die |
1447 |
- # Then turn the fragments into a shell script we can source. |
1448 |
- sed -E -i \ |
1449 |
- -e 's:^([^ ]+) (.*)$:\1="\2":' \ |
1450 |
- "${d}"/* || die |
1451 |
- |
1452 |
- # Generate the init.d script by assembling the fragments from above. |
1453 |
- local f qcpu package interpreter magic mask |
1454 |
- cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die |
1455 |
- for f in "${d}"/qemu-* ; do |
1456 |
- source "${f}" |
1457 |
- |
1458 |
- # Normalize the cpu logic like we do in the init.d for the native cpu. |
1459 |
- qcpu=${package#qemu-} |
1460 |
- case ${qcpu} in |
1461 |
- arm*) qcpu="arm";; |
1462 |
- mips*) qcpu="mips";; |
1463 |
- ppc*) qcpu="ppc";; |
1464 |
- s390*) qcpu="s390";; |
1465 |
- sh*) qcpu="sh";; |
1466 |
- sparc*) qcpu="sparc";; |
1467 |
- esac |
1468 |
- |
1469 |
- cat <<EOF >>"${out}" |
1470 |
- if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then |
1471 |
- echo ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register |
1472 |
- fi |
1473 |
-EOF |
1474 |
- |
1475 |
- echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" |
1476 |
- |
1477 |
- done |
1478 |
- cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die |
1479 |
-} |
1480 |
- |
1481 |
-src_install() { |
1482 |
- if [[ -n ${user_targets} ]]; then |
1483 |
- cd "${S}/user-build" |
1484 |
- emake DESTDIR="${ED}" install |
1485 |
- |
1486 |
- # Install binfmt handler init script for user targets. |
1487 |
- generate_initd |
1488 |
- doinitd "${T}/qemu-binfmt" |
1489 |
- |
1490 |
- # Install binfmt/qemu.conf. |
1491 |
- insinto "/usr/share/qemu/binfmt.d" |
1492 |
- doins "${T}/qemu.conf" |
1493 |
- fi |
1494 |
- |
1495 |
- if [[ -n ${softmmu_targets} ]]; then |
1496 |
- cd "${S}/softmmu-build" |
1497 |
- emake DESTDIR="${ED}" install |
1498 |
- |
1499 |
- # This might not exist if the test failed. #512010 |
1500 |
- [[ -e check-report.html ]] && dohtml check-report.html |
1501 |
- |
1502 |
- if use kernel_linux; then |
1503 |
- udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules |
1504 |
- fi |
1505 |
- |
1506 |
- if use python; then |
1507 |
- python_foreach_impl qemu_python_install |
1508 |
- fi |
1509 |
- fi |
1510 |
- |
1511 |
- cd "${S}/tools-build" |
1512 |
- emake DESTDIR="${ED}" install |
1513 |
- |
1514 |
- # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 |
1515 |
- pushd "${ED}"/usr/bin >/dev/null |
1516 |
- pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 |
1517 |
- popd >/dev/null |
1518 |
- |
1519 |
- # Install config file example for qemu-bridge-helper |
1520 |
- insinto "/etc/qemu" |
1521 |
- doins "${FILESDIR}/bridge.conf" |
1522 |
- |
1523 |
- cd "${S}" |
1524 |
- dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt |
1525 |
- newdoc pc-bios/README README.pc-bios |
1526 |
- dodoc docs/qmp-*.txt |
1527 |
- |
1528 |
- if [[ -n ${softmmu_targets} ]]; then |
1529 |
- # Remove SeaBIOS since we're using the SeaBIOS packaged one |
1530 |
- rm "${ED}/usr/share/qemu/bios.bin" |
1531 |
- rm "${ED}/usr/share/qemu/bios-256k.bin" |
1532 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
1533 |
- dosym ../seabios/bios.bin /usr/share/qemu/bios.bin |
1534 |
- dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin |
1535 |
- fi |
1536 |
- |
1537 |
- # Remove vgabios since we're using the seavgabios packaged one |
1538 |
- rm "${ED}/usr/share/qemu/vgabios.bin" |
1539 |
- rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" |
1540 |
- rm "${ED}/usr/share/qemu/vgabios-qxl.bin" |
1541 |
- rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" |
1542 |
- rm "${ED}/usr/share/qemu/vgabios-virtio.bin" |
1543 |
- rm "${ED}/usr/share/qemu/vgabios-vmware.bin" |
1544 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
1545 |
- dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin |
1546 |
- dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin |
1547 |
- dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin |
1548 |
- dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin |
1549 |
- dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin |
1550 |
- dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin |
1551 |
- fi |
1552 |
- |
1553 |
- # Remove sgabios since we're using the sgabios packaged one |
1554 |
- rm "${ED}/usr/share/qemu/sgabios.bin" |
1555 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
1556 |
- dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin |
1557 |
- fi |
1558 |
- |
1559 |
- # Remove iPXE since we're using the iPXE packaged one |
1560 |
- rm "${ED}"/usr/share/qemu/pxe-*.rom |
1561 |
- if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
1562 |
- dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom |
1563 |
- dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom |
1564 |
- dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom |
1565 |
- dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom |
1566 |
- dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom |
1567 |
- dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom |
1568 |
- fi |
1569 |
- fi |
1570 |
- |
1571 |
- DISABLE_AUTOFORMATTING=true |
1572 |
- readme.gentoo_create_doc |
1573 |
-} |
1574 |
- |
1575 |
-firmware_abi_change() { |
1576 |
- local pv |
1577 |
- for pv in ${REPLACING_VERSIONS}; do |
1578 |
- if ! version_is_at_least ${FIRMWARE_ABI_VERSION} ${pv}; then |
1579 |
- return 0 |
1580 |
- fi |
1581 |
- done |
1582 |
- return 1 |
1583 |
-} |
1584 |
- |
1585 |
-pkg_postinst() { |
1586 |
- if [[ -n ${softmmu_targets} ]] && use kernel_linux; then |
1587 |
- udev_reload |
1588 |
- fi |
1589 |
- |
1590 |
- fcaps cap_net_admin /usr/libexec/qemu-bridge-helper |
1591 |
- |
1592 |
- DISABLE_AUTOFORMATTING=true |
1593 |
- readme.gentoo_print_elog |
1594 |
- |
1595 |
- if use pin-upstream-blobs && firmware_abi_change; then |
1596 |
- ewarn "This version of qemu pins new versions of firmware blobs:" |
1597 |
- ewarn " $(best_version sys-firmware/edk2-ovmf)" |
1598 |
- ewarn " $(best_version sys-firmware/ipxe)" |
1599 |
- ewarn " $(best_version sys-firmware/seabios)" |
1600 |
- ewarn " $(best_version sys-firmware/sgabios)" |
1601 |
- ewarn "This might break resume of hibernated guests (started with a different" |
1602 |
- ewarn "firmware version) and live migration to/from qemu versions with different" |
1603 |
- ewarn "firmware. Please (cold) restart all running guests. For functional" |
1604 |
- ewarn "guest migration ensure that all" |
1605 |
- ewarn "hosts run at least" |
1606 |
- ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." |
1607 |
- fi |
1608 |
-} |
1609 |
- |
1610 |
-pkg_info() { |
1611 |
- echo "Using:" |
1612 |
- echo " $(best_version app-emulation/spice-protocol)" |
1613 |
- echo " $(best_version sys-firmware/edk2-ovmf)" |
1614 |
- if has_version 'sys-firmware/edk2-ovmf[binary]'; then |
1615 |
- echo " USE=binary" |
1616 |
- else |
1617 |
- echo " USE=''" |
1618 |
- fi |
1619 |
- echo " $(best_version sys-firmware/ipxe)" |
1620 |
- echo " $(best_version sys-firmware/seabios)" |
1621 |
- if has_version 'sys-firmware/seabios[binary]'; then |
1622 |
- echo " USE=binary" |
1623 |
- else |
1624 |
- echo " USE=''" |
1625 |
- fi |
1626 |
- echo " $(best_version sys-firmware/sgabios)" |
1627 |
-} |