blob: a403f7d69fa5c1ffae039b201f49538449477229 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Fast open source processor emulator"
Brad Bishopf3f93bb2019-10-16 14:33:32 -04002DESCRIPTION = "QEMU is a hosted virtual machine monitor: it emulates the \
3machine's processor through dynamic binary translation and provides a set \
4of different hardware and device models for the machine, enabling it to run \
5a variety of guest operating systems"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006HOMEPAGE = "http://qemu.org"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00007LICENSE = "GPL-2.0-only & LGPL-2.1-only"
Brad Bishop19323692019-04-05 15:28:33 -04008
Patrick Williams169d7bc2024-01-05 11:33:25 -06009DEPENDS += "bison-native meson-native ninja-native"
10
Patrick Williams213cb262021-08-07 19:21:33 -050011RDEPENDS:${PN}-ptest = "bash"
Brad Bishop19323692019-04-05 15:28:33 -040012
Brad Bishop15ae2502019-06-18 21:44:24 -040013require qemu-targets.inc
Andrew Geissler5082cc72023-09-11 08:41:39 -040014# 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
Brad Bishop15ae2502019-06-18 21:44:24 -040017
Brad Bishop19323692019-04-05 15:28:33 -040018LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
Brad Bishopc342db32019-05-15 21:57:59 -040019 file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
Brad Bishop19323692019-04-05 15:28:33 -040020
21SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
22 file://powerpc_rom.bin \
Brad Bishop19323692019-04-05 15:28:33 -040023 file://run-ptest \
Andrew Geisslerd5838332022-05-27 11:33:10 -050024 file://0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch \
Andrew Geisslerd5838332022-05-27 11:33:10 -050025 file://0003-apic-fixup-fallthrough-to-PIC.patch \
26 file://0004-configure-Add-pkg-config-handling-for-libgcrypt.patch \
27 file://0005-qemu-Do-not-include-file-if-not-exists.patch \
28 file://0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch \
29 file://0007-qemu-Determinism-fixes.patch \
30 file://0008-tests-meson.build-use-relative-path-to-refer-to-file.patch \
31 file://0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch \
32 file://0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060033 file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \
Andrew Geissler5082cc72023-09-11 08:41:39 -040034 file://fixedmeson.patch \
Patrick Williams169d7bc2024-01-05 11:33:25 -060035 file://no-pip.patch \
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060036 file://fix_segv.patch \
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050037 file://qemu-guest-agent.init \
38 file://qemu-guest-agent.udev \
Andrew Geisslerc9f78652020-09-18 14:11:35 -050039 "
Brad Bishop19323692019-04-05 15:28:33 -040040UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
41
Patrick Williams73bd93f2024-02-20 08:07:48 -060042# SDK_OLDEST_KERNEL is set below 4.17, which is the minimum version required by QEMU >= 8.1
43# This is due to two MMAP flags being used at certain points
44SRC_URI:append:class-nativesdk = " \
45 file://0011-linux-user-workaround-for-missing-MAP_FIXED_NOREPLAC.patch \
46 file://0012-linux-user-workaround-for-missing-MAP_SHARED_VALIDAT.patch \
47 "
Andrew Geissler5082cc72023-09-11 08:41:39 -040048
Patrick Williams73bd93f2024-02-20 08:07:48 -060049# Support building and using native version on pre 4.17 kernels
50SRC_URI:append:class-native = " \
51 file://0011-linux-user-workaround-for-missing-MAP_FIXED_NOREPLAC.patch \
52 file://0012-linux-user-workaround-for-missing-MAP_SHARED_VALIDAT.patch \
53 "
54
55SRC_URI[sha256sum] = "8562751158175f9d187c5f22b57555abe3c870f0325c8ced12c34c6d987729be"
Brad Bishop19323692019-04-05 15:28:33 -040056
Andrew Geissler8f840682023-07-21 09:09:43 -050057CVE_STATUS[CVE-2007-0998] = "not-applicable-config: The VNC server can expose host files uder some circumstances. We don't enable it by default."
William A. Kennington IIIac69b482021-06-02 12:28:27 -070058
William A. Kennington IIIac69b482021-06-02 12:28:27 -070059# https://bugzilla.redhat.com/show_bug.cgi?id=1609015#c11
Andrew Geissler8f840682023-07-21 09:09:43 -050060CVE_STATUS[CVE-2018-18438] = "disputed: The issues identified by this CVE were determined to not constitute a vulnerability."
William A. Kennington IIIac69b482021-06-02 12:28:27 -070061
Andrew Geissler028142b2023-05-05 11:29:21 -050062# As per https://nvd.nist.gov/vuln/detail/CVE-2023-0664
63# https://bugzilla.redhat.com/show_bug.cgi?id=2167423
Andrew Geissler8f840682023-07-21 09:09:43 -050064CVE_STATUS[CVE-2023-0664] = "not-applicable-platform: Issue only applies on Windows"
Andrew Geissler028142b2023-05-05 11:29:21 -050065
Patrick Williamsac13d5f2023-11-24 18:59:46 -060066# As per https://bugzilla.redhat.com/show_bug.cgi?id=2203387
67CVE_STATUS[CVE-2023-2680] = "not-applicable-platform: RHEL specific issue."
68
Patrick Williams73bd93f2024-02-20 08:07:48 -060069CVE_STATUS[CVE-2023-3019] = "cpe-incorrect: Applies only against versions before 8.2.0"
70
71CVE_STATUS[CVE-2023-5088] = "cpe-incorrect: Applies only against version 8.2.0 and earlier"
72
73CVE_STATUS[CVE-2023-6693] = "cpe-incorrect: Applies only against version 8.2.0 and earlier"
74
Patrick Williams213cb262021-08-07 19:21:33 -050075COMPATIBLE_HOST:mipsarchn32 = "null"
76COMPATIBLE_HOST:mipsarchn64 = "null"
Andrew Geissler595f6302022-01-24 19:11:47 +000077COMPATIBLE_HOST:riscv32 = "null"
Brad Bishop19323692019-04-05 15:28:33 -040078
Andrew Geisslerc9f78652020-09-18 14:11:35 -050079# Per https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html
80# upstream states qemu doesn't work without optimization
81DEBUG_BUILD = "0"
82
Patrick Williams213cb262021-08-07 19:21:33 -050083do_install:append() {
Brad Bishop19323692019-04-05 15:28:33 -040084 # Prevent QA warnings about installed ${localstatedir}/run
85 if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
86}
87
Brad Bishop19323692019-04-05 15:28:33 -040088do_install_ptest() {
89 cp -rL ${B}/tests ${D}${PTEST_PATH}
Andrew Geisslerd1e89492021-02-12 15:35:20 -060090 find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcodp]" | xargs -i rm -rf {}
Brad Bishop19323692019-04-05 15:28:33 -040091
Brad Bishop19323692019-04-05 15:28:33 -040092 # Don't check the file genreated by configure
Andrew Geissler635e0e42020-08-21 15:58:33 -050093 sed -i -e "1s,#!/usr/bin/bash,#!${base_bindir}/bash," ${D}${PTEST_PATH}/tests/data/acpi/disassemle-aml.sh
Andrew Geissler90fd73c2021-03-05 15:25:55 -060094
95 # Strip the paths from the QEMU variable, we can use PATH
Andrew Geissler517393d2023-01-13 08:55:19 -060096 makfiles=$(find ${D}${PTEST_PATH} -name "*.mak")
97 sed -i -e "s#^QEMU=.*/qemu-#QEMU=qemu-#g" $makfiles
Andrew Geisslereff27472021-10-29 15:35:00 -050098
Andrew Geissler87f5cff2022-09-30 13:13:31 -050099 # Strip compiler flags as they break reproducibility
100 sed -i -e "s,^CC=.*,CC=gcc," \
101 -e "s,^CCAS=.*,CCAS=gcc," \
Andrew Geissler517393d2023-01-13 08:55:19 -0600102 -e "s,^LD=.*,LD=ld," $makfiles
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500103
104 # Update SRC_PATH variable to the right place on target
Andrew Geissler517393d2023-01-13 08:55:19 -0600105 sed -i -e "s#^SRC_PATH=.*#SRC_PATH=${PTEST_PATH}#g" $makfiles
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500106
Andrew Geissler517393d2023-01-13 08:55:19 -0600107 # https://gitlab.com/qemu-project/qemu/-/issues/1403
108 rm ${D}${PTEST_PATH}/tests/unit/test-io-channel-command
Brad Bishop19323692019-04-05 15:28:33 -0400109}
110
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111# QEMU_TARGETS is overridable variable
Patrick Williams864cc432023-02-09 14:54:44 -0600112QEMU_TARGETS ?= "arm aarch64 i386 loongarch64 mips mipsel mips64 mips64el ppc ppc64 ppc64le riscv32 riscv64 sh4 x86_64"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500113
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500114EXTRA_OECONF = " \
115 --prefix=${prefix} \
116 --bindir=${bindir} \
117 --includedir=${includedir} \
118 --libdir=${libdir} \
119 --mandir=${mandir} \
120 --datadir=${datadir} \
121 --docdir=${docdir}/${BPN} \
122 --sysconfdir=${sysconfdir} \
123 --libexecdir=${libexecdir} \
124 --localstatedir=${localstatedir} \
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600125 --with-suffix=${BPN} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500126 --disable-strip \
127 --disable-werror \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500128 --extra-cflags='${CFLAGS}' \
Andrew Geisslerd25ed322020-06-27 00:28:28 -0500129 --extra-ldflags='${LDFLAGS}' \
Andrew Geissler5082cc72023-09-11 08:41:39 -0400130 --disable-download \
131 --disable-docs \
Patrick Williams73bd93f2024-02-20 08:07:48 -0600132 --host-cc='${BUILD_CC}' \
133 --disable-af-xdp \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800134 ${PACKAGECONFIG_CONFARGS} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500135 "
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600136
Patrick Williamsf52e3dd2024-01-26 13:04:43 -0600137EXTRA_OECONF:append:class-target = " --cross-prefix=${HOST_PREFIX}"
138EXTRA_OECONF:append:class-nativesdk = " --cross-prefix=${HOST_PREFIX}"
139
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800140B = "${WORKDIR}/build"
141
Patrick Williams0ca19cc2021-08-16 14:03:13 -0500142#EXTRA_OECONF:append = " --python=${HOSTTOOLS_DIR}/python3"
Brad Bishop96ff1982019-08-19 13:50:42 -0400143
Patrick Williams213cb262021-08-07 19:21:33 -0500144do_configure:prepend:class-native() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500145 # Append build host pkg-config paths for native target since the host may provide sdl
146 BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
147 if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
148 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500149 fi
150}
151
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500152do_configure() {
Patrick Williamsf52e3dd2024-01-26 13:04:43 -0600153 export PKG_CONFIG=pkg-config
Andrew Geissler78b72792022-06-14 06:47:25 -0500154 ${S}/configure ${EXTRA_OECONF}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500155}
Brad Bishop64c979e2019-11-04 13:55:29 -0500156do_configure[cleandirs] += "${B}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500157
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500158do_install () {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800159 export STRIP=""
160 oe_runmake 'DESTDIR=${D}' install
Andrew Geisslerfc113ea2023-03-31 09:59:46 -0500161
162 # If we built the guest agent, also install startup/udev rules
163 if [ -e "${D}${bindir}/qemu-ga" ]; then
164 install -d ${D}${sysconfdir}/init.d/
165 install -m 0755 ${WORKDIR}/qemu-guest-agent.init ${D}${sysconfdir}/init.d/qemu-guest-agent
166 sed -i 's:@bindir@:${bindir}:' ${D}${sysconfdir}/init.d/qemu-guest-agent
167
168 install -d ${D}${sysconfdir}/udev/rules.d/
169 install -m 0644 ${WORKDIR}/qemu-guest-agent.udev ${D}${sysconfdir}/udev/rules.d/60-qemu-guest-agent.rules
170
171 install -d ${D}${systemd_unitdir}/system/
172 install -m 0644 ${S}/contrib/systemd/qemu-guest-agent.service ${D}${systemd_unitdir}/system
173 sed -i -e 's,-/usr/bin/,-${bindir}/,g' ${D}${systemd_unitdir}/system/qemu-guest-agent.service
174 fi
Andrew Geissler5082cc72023-09-11 08:41:39 -0400175 # ELF binary /usr/share/qemu/s390-netboot.img has relocations in .text
176 rm ${D}${datadir}/qemu/s390-netboot.img -f
177 # ELF binary /usr/share/qemu/s390-ccw.img has relocations in .text [textrel]
178 rm ${D}${datadir}/qemu/s390-ccw.img -f
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500179}
180
181# The following fragment will create a wrapper for qemu-mips user emulation
182# binary in order to work around a segmentation fault issue. Basically, by
183# default, the reserved virtual address space for 32-on-64 bit is set to 4GB.
184# This will trigger a MMU access fault in the virtual CPU. With this change,
185# the qemu-mips works fine.
186# IMPORTANT: This piece needs to be removed once the root cause is fixed!
Patrick Williams213cb262021-08-07 19:21:33 -0500187do_install:append() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500188 if [ -e "${D}/${bindir}/qemu-mips" ]; then
189 create_wrapper ${D}/${bindir}/qemu-mips \
190 QEMU_RESERVED_VA=0x0
191 fi
192}
193# END of qemu-mips workaround
194
Brad Bishop19323692019-04-05 15:28:33 -0400195# Disable kvm/virgl/mesa on targets that do not support it
Andrew Geissler9aee5002022-03-30 16:27:02 +0000196PACKAGECONFIG:remove:darwin = "kvm virglrenderer epoxy gtk+"
Patrick Williamsf52e3dd2024-01-26 13:04:43 -0600197PACKAGECONFIG:remove:mingw32 = "kvm virglrenderer epoxy gtk+ pie"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600198
Brad Bishopc342db32019-05-15 21:57:59 -0400199PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl2"
Andrew Geissler517393d2023-01-13 08:55:19 -0600200PACKAGECONFIG[png] = "--enable-png,--disable-png,libpng"
Andrew Geisslerb7d28612020-07-24 16:15:54 -0500201PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr --enable-cap-ng,--disable-virtfs,libcap-ng attr,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500202PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
Patrick Williamsdb4c27e2022-08-05 08:10:29 -0500203PACKAGECONFIG[uring] = "--enable-linux-io-uring,--disable-linux-io-uring,liburing"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500204PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen-tools,xen-tools-libxenstore xen-tools-libxenctrl xen-tools-libxenguest"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500205PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
206PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
Brad Bishop79641f22019-09-10 07:20:22 -0400207PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,curl,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500208PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500209PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
Brad Bishopc342db32019-05-15 21:57:59 -0400210PACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native"
211PACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500212PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
Brad Bishopc68388fc2019-08-26 01:33:31 -0400213PACKAGECONFIG[ssh] = "--enable-libssh,--disable-libssh,libssh,"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500214PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500215PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500216PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
217PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
Andrew Geissler595f6302022-01-24 19:11:47 +0000218PACKAGECONFIG[alsa] = "--audio-drv-list=default,,alsa-lib"
Andrew Geissler9aee5002022-03-30 16:27:02 +0000219PACKAGECONFIG[epoxy] = "--enable-opengl,--disable-opengl,libepoxy"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500220PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
Andrew Geissler220dafd2023-10-04 10:18:08 -0500221PACKAGECONFIG[dax] = "--enable-libdaxctl,--disable-libdaxctl,ndctl"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500222PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
223PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600224PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500225PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi"
226PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800227PACKAGECONFIG[virglrenderer] = "--enable-virglrenderer,--disable-virglrenderer,virglrenderer"
228# spice will be in meta-networking layer
229PACKAGECONFIG[spice] = "--enable-spice,--disable-spice,spice"
230# usbredir will be in meta-networking layer
Andrew Geissler5082cc72023-09-11 08:41:39 -0400231PACKAGECONFIG[dbus-display] = "--enable-dbus-display,--disable-dbus-display,glib-2.0-native,dbus"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800232PACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir"
Brad Bishopc342db32019-05-15 21:57:59 -0400233PACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy"
Andrew Geisslerd25ed322020-06-27 00:28:28 -0500234PACKAGECONFIG[glusterfs] = "--enable-glusterfs,--disable-glusterfs,glusterfs"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500235PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
Andrew Geissler5082cc72023-09-11 08:41:39 -0400236PACKAGECONFIG[libudev] = "--enable-libudev,--disable-libudev,udev"
Andrew Geisslerd25ed322020-06-27 00:28:28 -0500237PACKAGECONFIG[attr] = "--enable-attr,--disable-attr,attr,"
238PACKAGECONFIG[rbd] = "--enable-rbd,--disable-rbd,ceph,ceph"
239PACKAGECONFIG[vhost] = "--enable-vhost-net,--disable-vhost-net,,"
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500240PACKAGECONFIG[ust] = "--enable-trace-backends=ust,,lttng-ust,"
Andrew Geisslerd25ed322020-06-27 00:28:28 -0500241PACKAGECONFIG[pie] = "--enable-pie,--disable-pie,,"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600242PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
Andrew Geisslereff27472021-10-29 15:35:00 -0500243# libnfs is currently provided by meta-kodi
244PACKAGECONFIG[libnfs] = "--enable-libnfs,--disable-libnfs,libnfs"
245PACKAGECONFIG[pmem] = "--enable-libpmem,--disable-libpmem,pmdk"
Andrew Geissler8f840682023-07-21 09:09:43 -0500246PACKAGECONFIG[pulseaudio] = "--enable-pa,--disable-pa,pulseaudio"
Andrew Geissler595f6302022-01-24 19:11:47 +0000247PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux"
Andrew Geisslerd5838332022-05-27 11:33:10 -0500248PACKAGECONFIG[bpf] = "--enable-bpf,--disable-bpf,libbpf"
Andrew Geissler615f2f12022-07-15 14:00:58 -0500249PACKAGECONFIG[capstone] = "--enable-capstone,--disable-capstone"
250PACKAGECONFIG[rdma] = "--enable-rdma,--disable-rdma"
251PACKAGECONFIG[vde] = "--enable-vde,--disable-vde"
Andrew Geissler5082cc72023-09-11 08:41:39 -0400252PACKAGECONFIG[fuse] = "--enable-fuse --enable-fuse-lseek,--disable-fuse --disable-fuse-lseek,fuse3"
Andrew Geissler517393d2023-01-13 08:55:19 -0600253PACKAGECONFIG[slirp] = "--enable-slirp,--disable-slirp,libslirp"
Andrew Geissler615f2f12022-07-15 14:00:58 -0500254PACKAGECONFIG[brlapi] = "--enable-brlapi,--disable-brlapi"
Patrick Williams2390b1b2022-11-03 13:47:49 -0500255PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack,"
Patrick Williamse760df82023-05-26 11:10:49 -0500256PACKAGECONFIG[debuginfo] = "--enable-libdw,--disable-libdw,elfutils"
Patrick Williams169d7bc2024-01-05 11:33:25 -0600257PACKAGECONFIG[pipewire] = "--enable-pipewire,--disable-pipewire,pipewire"
Patrick Williamsf52e3dd2024-01-26 13:04:43 -0600258PACKAGECONFIG[sndio] = "--enable-sndio,--disable-sndio,sndio"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500259
Andrew Geissler5082cc72023-09-11 08:41:39 -0400260INSANE_SKIP:${PN}-common = "arch"
Brad Bishopc342db32019-05-15 21:57:59 -0400261
Patrick Williams213cb262021-08-07 19:21:33 -0500262FILES:${PN} += "${datadir}/icons"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -0500263
Patrick Williams520786c2023-06-25 16:20:36 -0500264# For user who want to install all arch packages
Andrew Geissler5082cc72023-09-11 08:41:39 -0400265PACKAGES =+ "${PN}-common"
266RDEPENDS:${PN} += "${PN}-common"
Patrick Williams520786c2023-06-25 16:20:36 -0500267
Andrew Geissler5082cc72023-09-11 08:41:39 -0400268ALLOW_EMPTY:${PN} = "1"
269FILES:${PN} = ""
270
271FILES:${PN}-common = "${bindir}/* ${includedir}/* ${libexecdir}/* ${datadir}/* ${localstatedir}"
Patrick Williams520786c2023-06-25 16:20:36 -0500272
Andrew Geissler8f840682023-07-21 09:09:43 -0500273PACKAGES_DYNAMIC += "^${PN}-user-.* ^${PN}-system-.*"
274
Patrick Williams520786c2023-06-25 16:20:36 -0500275PACKAGESPLITFUNCS =+ "split_qemu_packages"
276
277python split_qemu_packages () {
278 archdir = d.expand('${bindir}/')
Andrew Geissler5082cc72023-09-11 08:41:39 -0400279 subpackages = do_split_packages(d, archdir, r'^qemu-system-(.*)$', '${PN}-system-%s', 'QEMU full system emulation binaries(%s)' , prepend=True, extra_depends='${PN}-common')
Patrick Williams520786c2023-06-25 16:20:36 -0500280
Andrew Geissler5082cc72023-09-11 08:41:39 -0400281 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')
282 if subpackages:
283 d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(subpackages))
Patrick Williams520786c2023-06-25 16:20:36 -0500284 mipspackage = d.getVar('PN') + "-user-mips"
Andrew Geissler5082cc72023-09-11 08:41:39 -0400285 if mipspackage in ' '.join(subpackages):
Patrick Williams520786c2023-06-25 16:20:36 -0500286 d.appendVar('RDEPENDS:' + mipspackage, ' ' + d.getVar("MLPREFIX") + 'bash')
287}
288
Andrew Geisslerfc113ea2023-03-31 09:59:46 -0500289# Put the guest agent in a separate package
290PACKAGES =+ "${PN}-guest-agent"
291SUMMARY:${PN}-guest-agent = "QEMU guest agent"
292FILES:${PN}-guest-agent += " \
293 ${bindir}/qemu-ga \
294 ${sysconfdir}/udev/rules.d/60-qemu-guest-agent.rules \
295 ${sysconfdir}/init.d/qemu-guest-agent \
296 ${systemd_unitdir}/system/qemu-guest-agent.service \
297"
298
299INITSCRIPT_PACKAGES = "${PN}-guest-agent"
300INITSCRIPT_NAME:${PN}-guest-agent = "qemu-guest-agent"
301INITSCRIPT_PARAMS:${PN}-guest-agent = "defaults"
302
303SYSTEMD_PACKAGES = "${PN}-guest-agent"
304SYSTEMD_SERVICE:${PN}-guest-agent = "qemu-guest-agent.service"