summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu.inc')
-rw-r--r--meta/recipes-devtools/qemu/qemu.inc214
1 files changed, 148 insertions, 66 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index a6dc941624..7893df0df2 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -4,12 +4,16 @@ machine's processor through dynamic binary translation and provides a set \
4of different hardware and device models for the machine, enabling it to run \ 4of different hardware and device models for the machine, enabling it to run \
5a variety of guest operating systems" 5a variety of guest operating systems"
6HOMEPAGE = "http://qemu.org" 6HOMEPAGE = "http://qemu.org"
7LICENSE = "GPLv2 & LGPLv2.1" 7LICENSE = "GPL-2.0-only & LGPL-2.1-only"
8 8
9RDEPENDS_${PN}-ptest = "bash" 9DEPENDS += "bison-native meson-native ninja-native"
10
11RDEPENDS:${PN}-ptest = "bash"
10 12
11require qemu-targets.inc 13require qemu-targets.inc
12inherit pkgconfig ptest 14# https://gitlab.com/qemu-project/qemu/-/commit/81e2b198a8cb4ee5fdf108bd438f44b193ee3a36 means
15# we need a full python3-native setup
16inherit pkgconfig ptest update-rc.d systemd python3native
13 17
14LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ 18LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
15 file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f" 19 file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
@@ -17,35 +21,47 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
17SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ 21SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
18 file://powerpc_rom.bin \ 22 file://powerpc_rom.bin \
19 file://run-ptest \ 23 file://run-ptest \
20 file://0001-qemu-Add-missing-wacom-HID-descriptor.patch \ 24 file://fix-strerrorname_np.patch \
21 file://0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch \ 25 file://0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch \
22 file://0004-qemu-disable-Valgrind.patch \ 26 file://0002-apic-fixup-fallthrough-to-PIC.patch \
23 file://0006-chardev-connect-socket-to-a-spawned-command.patch \ 27 file://0004-qemu-Do-not-include-file-if-not-exists.patch \
24 file://0007-apic-fixup-fallthrough-to-PIC.patch \ 28 file://0005-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch \
25 file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \ 29 file://0006-qemu-Determinism-fixes.patch \
26 file://0001-Add-enable-disable-udev.patch \ 30 file://0007-tests-meson.build-use-relative-path-to-refer-to-file.patch \
27 file://0001-qemu-Do-not-include-file-if-not-exists.patch \ 31 file://0008-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch \
28 file://mingwfix.patch \ 32 file://0010-configure-lookup-meson-exutable-from-PATH.patch \
29 file://mmap.patch \ 33 file://0011-qemu-Ensure-pip-and-the-python-venv-aren-t-used-for-.patch \
30 file://mmap2.patch \ 34 file://qemu-guest-agent.init \
31 file://determinism.patch \ 35 file://qemu-guest-agent.udev \
32 file://0001-tests-meson.build-use-relative-path-to-refer-to-file.patch \
33 " 36 "
37# file index at download.qemu.org isn't reliable: https://gitlab.com/qemu-project/qemu-web/-/issues/9
38UPSTREAM_CHECK_URI = "https://www.qemu.org"
34UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" 39UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
35 40
36SRC_URI[sha256sum] = "cb18d889b628fbe637672b0326789d9b0e3b8027e0445b936537c78549df17bc" 41SRC_URI[sha256sum] = "ef786f2398cb5184600f69aef4d5d691efd44576a3cff4126d38d4c6fec87759"
42
43CVE_STATUS[CVE-2007-0998] = "not-applicable-config: The VNC server can expose host files uder some circumstances. We don't enable it by default."
44
45# https://bugzilla.redhat.com/show_bug.cgi?id=1609015#c11
46CVE_STATUS[CVE-2018-18438] = "disputed: The issues identified by this CVE were determined to not constitute a vulnerability."
37 47
38SRC_URI_append_class-target = " file://cross.patch" 48# As per https://bugzilla.redhat.com/show_bug.cgi?id=2203387
39SRC_URI_append_class-nativesdk = " file://cross.patch" 49CVE_STATUS[CVE-2023-2680] = "not-applicable-platform: RHEL specific issue."
40 50
41COMPATIBLE_HOST_mipsarchn32 = "null" 51# NVD DB has this CVE as version-less (with "-")
42COMPATIBLE_HOST_mipsarchn64 = "null" 52CVE_STATUS[CVE-2024-6505] = "fixed-version: this CVE is fixed since 9.1.0"
53
54CVE_STATUS[CVE-2023-1386] = "disputed: not an issue as per https://bugzilla.redhat.com/show_bug.cgi?id=2223985"
55
56COMPATIBLE_HOST:mipsarchn32 = "null"
57COMPATIBLE_HOST:mipsarchn64 = "null"
58COMPATIBLE_HOST:riscv32 = "null"
43 59
44# Per https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html 60# Per https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html
45# upstream states qemu doesn't work without optimization 61# upstream states qemu doesn't work without optimization
46DEBUG_BUILD = "0" 62DEBUG_BUILD = "0"
47 63
48do_install_append() { 64do_install:append() {
49 # Prevent QA warnings about installed ${localstatedir}/run 65 # Prevent QA warnings about installed ${localstatedir}/run
50 if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi 66 if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
51} 67}
@@ -55,16 +71,26 @@ do_install_ptest() {
55 find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcodp]" | xargs -i rm -rf {} 71 find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcodp]" | xargs -i rm -rf {}
56 72
57 # Don't check the file genreated by configure 73 # Don't check the file genreated by configure
58 sed -i -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \
59 ${D}/${PTEST_PATH}/tests/qemu-iotests/common.env
60 sed -i -e "1s,#!/usr/bin/bash,#!${base_bindir}/bash," ${D}${PTEST_PATH}/tests/data/acpi/disassemle-aml.sh 74 sed -i -e "1s,#!/usr/bin/bash,#!${base_bindir}/bash," ${D}${PTEST_PATH}/tests/data/acpi/disassemle-aml.sh
61 75
62 # Strip the paths from the QEMU variable, we can use PATH 76 # Strip the paths from the QEMU variable, we can use PATH
63 sed -i -e "s#^QEMU=.*/qemu-#QEMU=qemu-#g" ${D}${PTEST_PATH}/tests/tcg/*.mak 77 makfiles=$(find ${D}${PTEST_PATH} -name "*.mak")
78 sed -i -e "s#^QEMU=.*/qemu-#QEMU=qemu-#g" $makfiles
79
80 # Strip compiler flags as they break reproducibility
81 sed -i -e "s,^CC=.*,CC=gcc," \
82 -e "s,^CCAS=.*,CCAS=gcc," \
83 -e "s,^LD=.*,LD=ld," $makfiles
84
85 # Update SRC_PATH variable to the right place on target
86 sed -i -e "s#^SRC_PATH=.*#SRC_PATH=${PTEST_PATH}#g" $makfiles
87
88 # https://gitlab.com/qemu-project/qemu/-/issues/1403
89 rm ${D}${PTEST_PATH}/tests/unit/test-io-channel-command
64} 90}
65 91
66# QEMU_TARGETS is overridable variable 92# QEMU_TARGETS is overridable variable
67QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc ppc64 ppc64le riscv32 riscv64 sh4 x86_64" 93QEMU_TARGETS ?= "arm aarch64 i386 loongarch64 mips mipsel mips64 mips64el ppc ppc64 ppc64le riscv32 riscv64 sh4 x86_64"
68 94
69EXTRA_OECONF = " \ 95EXTRA_OECONF = " \
70 --prefix=${prefix} \ 96 --prefix=${prefix} \
@@ -82,19 +108,21 @@ EXTRA_OECONF = " \
82 --disable-werror \ 108 --disable-werror \
83 --extra-cflags='${CFLAGS}' \ 109 --extra-cflags='${CFLAGS}' \
84 --extra-ldflags='${LDFLAGS}' \ 110 --extra-ldflags='${LDFLAGS}' \
85 --with-git=/bin/false \ 111 --disable-download \
86 --disable-git-update \ 112 --disable-docs \
87 --meson=meson \ 113 --host-cc='${BUILD_CC}' \
114 --disable-af-xdp \
88 ${PACKAGECONFIG_CONFARGS} \ 115 ${PACKAGECONFIG_CONFARGS} \
89 " 116 "
90 117
91export LIBTOOL="${HOST_SYS}-libtool" 118EXTRA_OECONF:append:class-target = " --cross-prefix=${HOST_PREFIX}"
119EXTRA_OECONF:append:class-nativesdk = " --cross-prefix=${HOST_PREFIX}"
92 120
93B = "${WORKDIR}/build" 121B = "${WORKDIR}/build"
94 122
95#EXTRA_OECONF_append = " --python=${HOSTTOOLS_DIR}/python3" 123#EXTRA_OECONF:append = " --python=${HOSTTOOLS_DIR}/python3"
96 124
97do_configure_prepend_class-native() { 125do_configure:prepend:class-native() {
98 # Append build host pkg-config paths for native target since the host may provide sdl 126 # Append build host pkg-config paths for native target since the host may provide sdl
99 BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "") 127 BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
100 if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then 128 if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
@@ -103,6 +131,7 @@ do_configure_prepend_class-native() {
103} 131}
104 132
105do_configure() { 133do_configure() {
134 export PKG_CONFIG=pkg-config
106 ${S}/configure ${EXTRA_OECONF} 135 ${S}/configure ${EXTRA_OECONF}
107} 136}
108do_configure[cleandirs] += "${B}" 137do_configure[cleandirs] += "${B}"
@@ -110,48 +139,45 @@ do_configure[cleandirs] += "${B}"
110do_install () { 139do_install () {
111 export STRIP="" 140 export STRIP=""
112 oe_runmake 'DESTDIR=${D}' install 141 oe_runmake 'DESTDIR=${D}' install
113}
114 142
115# The following fragment will create a wrapper for qemu-mips user emulation 143 # If we built the guest agent, also install startup/udev rules
116# binary in order to work around a segmentation fault issue. Basically, by 144 if [ -e "${D}${bindir}/qemu-ga" ]; then
117# default, the reserved virtual address space for 32-on-64 bit is set to 4GB. 145 install -d ${D}${sysconfdir}/init.d/
118# This will trigger a MMU access fault in the virtual CPU. With this change, 146 install -m 0755 ${UNPACKDIR}/qemu-guest-agent.init ${D}${sysconfdir}/init.d/qemu-guest-agent
119# the qemu-mips works fine. 147 sed -i 's:@bindir@:${bindir}:' ${D}${sysconfdir}/init.d/qemu-guest-agent
120# IMPORTANT: This piece needs to be removed once the root cause is fixed!
121do_install_append() {
122 if [ -e "${D}/${bindir}/qemu-mips" ]; then
123 create_wrapper ${D}/${bindir}/qemu-mips \
124 QEMU_RESERVED_VA=0x0
125 fi
126}
127# END of qemu-mips workaround
128 148
129make_qemu_wrapper() { 149 install -d ${D}${sysconfdir}/udev/rules.d/
130 gdk_pixbuf_module_file=`pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0` 150 install -m 0644 ${UNPACKDIR}/qemu-guest-agent.udev ${D}${sysconfdir}/udev/rules.d/60-qemu-guest-agent.rules
131 151
132 for tool in `ls ${D}${bindir}/qemu-system-*`; do 152 install -d ${D}${systemd_unitdir}/system/
133 create_wrapper $tool \ 153 install -m 0644 ${S}/contrib/systemd/qemu-guest-agent.service ${D}${systemd_unitdir}/system
134 GDK_PIXBUF_MODULE_FILE=$gdk_pixbuf_module_file \ 154 sed -i -e 's,-/usr/bin/,-${bindir}/,g' ${D}${systemd_unitdir}/system/qemu-guest-agent.service
135 FONTCONFIG_PATH=/etc/fonts \ 155 fi
136 GTK_THEME=Adwaita 156 # ELF binary /usr/share/qemu/s390-netboot.img has relocations in .text
137 done 157 rm ${D}${datadir}/qemu/s390-netboot.img -f
158 # ELF binary /usr/share/qemu/s390-ccw.img has relocations in .text [textrel]
159 rm ${D}${datadir}/qemu/s390-ccw.img -f
160 # We don't support PARISC and these cause strip and SDK relocation errors
161 rm ${D}${datadir}/qemu/hppa* -f
138} 162}
139 163
140# Disable kvm/virgl/mesa on targets that do not support it 164# Disable kvm/virgl/mesa on targets that do not support it
141PACKAGECONFIG_remove_darwin = "kvm virglrenderer glx gtk+" 165PACKAGECONFIG:remove:darwin = "kvm virglrenderer epoxy gtk+"
142PACKAGECONFIG_remove_mingw32 = "kvm virglrenderer glx gtk+" 166PACKAGECONFIG:remove:mingw32 = "kvm virglrenderer epoxy gtk+ pie"
143 167
144PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl2" 168PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,virtual/libsdl2"
169PACKAGECONFIG[sdl-image] = "--enable-sdl-image,--disable-sdl-image,libsdl2-image"
170PACKAGECONFIG[png] = "--enable-png,--disable-png,libpng"
145PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr --enable-cap-ng,--disable-virtfs,libcap-ng attr," 171PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr --enable-cap-ng,--disable-virtfs,libcap-ng attr,"
146PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio," 172PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
147PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs," 173PACKAGECONFIG[uring] = "--enable-linux-io-uring,--disable-linux-io-uring,liburing"
148PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen-tools,xen-tools-libxenstore xen-tools-libxenctrl xen-tools-libxenguest" 174PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen-tools,xen-tools-libxenstore xen-tools-libxenctrl xen-tools-libxenguest"
149PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl," 175PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
150PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg," 176PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
151PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng,"
152PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,curl," 177PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,curl,"
153PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss," 178PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss,"
154PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses," 179PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
180PACKAGECONFIG[pixman] = "--enable-pixman,--disable-pixman,pixman"
155PACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native" 181PACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native"
156PACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native" 182PACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native"
157PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng," 183PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
@@ -160,9 +186,10 @@ PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
160PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle" 186PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
161PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1" 187PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
162PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc" 188PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
163PACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib" 189PACKAGECONFIG[alsa] = "--audio-drv-list=default,,alsa-lib"
164PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,virtual/libgl" 190PACKAGECONFIG[epoxy] = "--enable-opengl,--disable-opengl,libepoxy"
165PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo" 191PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
192PACKAGECONFIG[dax] = "--enable-libdaxctl,--disable-libdaxctl,ndctl"
166PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl" 193PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
167PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls" 194PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
168PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2" 195PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
@@ -172,19 +199,74 @@ PACKAGECONFIG[virglrenderer] = "--enable-virglrenderer,--disable-virglrenderer,v
172# spice will be in meta-networking layer 199# spice will be in meta-networking layer
173PACKAGECONFIG[spice] = "--enable-spice,--disable-spice,spice" 200PACKAGECONFIG[spice] = "--enable-spice,--disable-spice,spice"
174# usbredir will be in meta-networking layer 201# usbredir will be in meta-networking layer
202PACKAGECONFIG[dbus-display] = "--enable-dbus-display,--disable-dbus-display,glib-2.0-native,dbus"
175PACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir" 203PACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir"
176PACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy" 204PACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy"
177PACKAGECONFIG[glusterfs] = "--enable-glusterfs,--disable-glusterfs,glusterfs" 205PACKAGECONFIG[glusterfs] = "--enable-glusterfs,--disable-glusterfs,glusterfs"
178PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon" 206PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
179PACKAGECONFIG[libudev] = "--enable-libudev,--disable-libudev,eudev" 207PACKAGECONFIG[libudev] = "--enable-libudev,--disable-libudev,udev"
180PACKAGECONFIG[libxml2] = "--enable-libxml2,--disable-libxml2,libxml2"
181PACKAGECONFIG[attr] = "--enable-attr,--disable-attr,attr," 208PACKAGECONFIG[attr] = "--enable-attr,--disable-attr,attr,"
182PACKAGECONFIG[rbd] = "--enable-rbd,--disable-rbd,ceph,ceph" 209PACKAGECONFIG[rbd] = "--enable-rbd,--disable-rbd,ceph,ceph"
183PACKAGECONFIG[vhost] = "--enable-vhost-net,--disable-vhost-net,," 210PACKAGECONFIG[vhost] = "--enable-vhost-net,--disable-vhost-net,,"
184PACKAGECONFIG[ust] = "--enable-trace-backend=ust,--enable-trace-backend=nop,lttng-ust," 211PACKAGECONFIG[ust] = "--enable-trace-backends=ust,,lttng-ust,"
185PACKAGECONFIG[pie] = "--enable-pie,--disable-pie,," 212PACKAGECONFIG[pie] = "--enable-pie,--disable-pie,,"
186PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp" 213PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
214# libnfs is currently provided by meta-kodi
215PACKAGECONFIG[libnfs] = "--enable-libnfs,--disable-libnfs,libnfs"
216PACKAGECONFIG[pmem] = "--enable-libpmem,--disable-libpmem,pmdk"
217PACKAGECONFIG[pulseaudio] = "--enable-pa,--disable-pa,pulseaudio"
218PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux"
219PACKAGECONFIG[bpf] = "--enable-bpf,--disable-bpf,libbpf"
220PACKAGECONFIG[capstone] = "--enable-capstone,--disable-capstone"
221PACKAGECONFIG[rdma] = "--enable-rdma,--disable-rdma"
222PACKAGECONFIG[vde] = "--enable-vde,--disable-vde"
223PACKAGECONFIG[fuse] = "--enable-fuse --enable-fuse-lseek,--disable-fuse --disable-fuse-lseek,fuse3"
224PACKAGECONFIG[slirp] = "--enable-slirp,--disable-slirp,libslirp"
225PACKAGECONFIG[brlapi] = "--enable-brlapi,--disable-brlapi"
226PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack,"
227PACKAGECONFIG[debuginfo] = "--enable-libdw,--disable-libdw,elfutils"
228PACKAGECONFIG[pipewire] = "--enable-pipewire,--disable-pipewire,pipewire"
229PACKAGECONFIG[sndio] = "--enable-sndio,--disable-sndio,sndio"
230
231INSANE_SKIP:${PN}-common = "arch"
232
233FILES:${PN} += "${datadir}/icons"
234
235# For user who want to install all arch packages
236PACKAGES =+ "${PN}-common"
237RDEPENDS:${PN} += "${PN}-common"
238
239ALLOW_EMPTY:${PN} = "1"
240FILES:${PN} = ""
241
242FILES:${PN}-common = "${bindir}/* ${includedir}/* ${libexecdir}/* ${datadir}/* ${localstatedir}"
243
244PACKAGES_DYNAMIC += "^${PN}-user-.* ^${PN}-system-.*"
245
246PACKAGESPLITFUNCS =+ "split_qemu_packages"
247
248python split_qemu_packages () {
249 archdir = d.expand('${bindir}/')
250 subpackages = do_split_packages(d, archdir, r'^qemu-system-(.*)$', '${PN}-system-%s', 'QEMU full system emulation binaries(%s)' , prepend=True, extra_depends='${PN}-common')
251
252 subpackages += do_split_packages(d, archdir, r'^qemu-((?!system|edid|ga|img|io|nbd|pr-helper|storage-daemon).*)$', '${PN}-user-%s', 'QEMU full user emulation binaries(%s)' , prepend=True, extra_depends='${PN}-common')
253 if subpackages:
254 d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(subpackages))
255}
256
257# Put the guest agent in a separate package
258PACKAGES =+ "${PN}-guest-agent"
259SUMMARY:${PN}-guest-agent = "QEMU guest agent"
260FILES:${PN}-guest-agent += " \
261 ${bindir}/qemu-ga \
262 ${sysconfdir}/udev/rules.d/60-qemu-guest-agent.rules \
263 ${sysconfdir}/init.d/qemu-guest-agent \
264 ${systemd_unitdir}/system/qemu-guest-agent.service \
265"
187 266
188INSANE_SKIP_${PN} = "arch" 267INITSCRIPT_PACKAGES = "${PN}-guest-agent"
268INITSCRIPT_NAME:${PN}-guest-agent = "qemu-guest-agent"
269INITSCRIPT_PARAMS:${PN}-guest-agent = "defaults"
189 270
190FILES_${PN} += "${datadir}/icons" 271SYSTEMD_PACKAGES = "${PN}-guest-agent"
272SYSTEMD_SERVICE:${PN}-guest-agent = "qemu-guest-agent.service"