qemu: update to 9.1.0, split system emulators etc into subpackages

disable user emulators, as those should be provided by qemu-user

add official upstream patch for mmap issue
This commit is contained in:
classabbyamp 2024-08-12 19:08:53 -04:00 committed by classabbyamp
parent 7436ad4c32
commit 7c2c822fe8
38 changed files with 215 additions and 67 deletions

1
srcpkgs/qemu-common Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-doc Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-firmware Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-img Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-aarch64 Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-alpha Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-amd64 Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-arm Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-avr Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-cris Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-hppa Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-i386 Symbolic link
View File

@ -0,0 +1 @@
qemu

View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-m68k Symbolic link
View File

@ -0,0 +1 @@
qemu

View File

@ -0,0 +1 @@
qemu

View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-mips Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-mips64 Symbolic link
View File

@ -0,0 +1 @@
qemu

View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-mipsel Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-or1k Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-ppc Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-ppc64 Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-riscv32 Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-riscv64 Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-rx Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-s390x Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-sh4 Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-sh4eb Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-sparc Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-sparc64 Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-tricore Symbolic link
View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-system-xtensa Symbolic link
View File

@ -0,0 +1 @@
qemu

View File

@ -0,0 +1 @@
qemu

1
srcpkgs/qemu-tools Symbolic link
View File

@ -0,0 +1 @@
qemu

View File

@ -1,8 +0,0 @@
To enable KVM your user must be added to the 'kvm' group:
$ usermod -aG kvm <username>
Don't forget to load the appropiate KVM module for your CPU (x86 only):
$ modprobe kvm-amd # for AMD CPUs
$ modprobe kvm-intel # for Intel CPUs

View File

@ -1,33 +0,0 @@
source: https://gitlab.com/qemu-project/qemu/-/issues/2353
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index be3b9a6..dad29ef 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -559,7 +559,7 @@ static abi_long mmap_h_eq_g(abi_ulong start, abi_ulong len,
int host_prot, int flags, int page_flags,
int fd, off_t offset)
{
- void *p, *want_p = g2h_untagged(start);
+ void *p, *want_p = start ? g2h_untagged(start) : 0;
abi_ulong last;
p = mmap(want_p, len, host_prot, flags, fd, offset);
@@ -609,7 +609,7 @@ static abi_long mmap_h_lt_g(abi_ulong start, abi_ulong len, int host_prot,
int mmap_flags, int page_flags, int fd,
off_t offset, int host_page_size)
{
- void *p, *want_p = g2h_untagged(start);
+ void *p, *want_p = start ? g2h_untagged(start) : 0;
off_t fileend_adj = 0;
int flags = mmap_flags;
abi_ulong last, pass_last;
@@ -739,7 +739,7 @@ static abi_long mmap_h_gt_g(abi_ulong start, abi_ulong len,
int flags, int page_flags, int fd,
off_t offset, int host_page_size)
{
- void *p, *want_p = g2h_untagged(start);
+ void *p, *want_p = start ? g2h_untagged(start) : 0;
off_t host_offset = offset & -host_page_size;
abi_ulong last, real_start, real_last;
bool misaligned_offset = false;

View File

@ -1,38 +1,32 @@
# Template file for 'qemu'
# This package should be updated together with qemu-user-static
# This package should be updated together with qemu-user
pkgname=qemu
version=9.0.2
version=9.1.0
revision=1
build_style=configure
configure_args="--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/libexec --localstatedir=/var
--disable-glusterfs --disable-xen --enable-docs --enable-kvm --enable-libusb --enable-pie
--enable-snappy --enable-tpm --enable-usb-redir --enable-vhost-net --enable-virtfs --enable-png
--audio-drv-list=alsa$(vopt_if sdl2 ,sdl)$(vopt_if jack ,jack)$(vopt_if pulseaudio ,pa)
$(vopt_enable opengl) $(vopt_enable pulseaudio pa) $(vopt_enable sdl2 sdl) $(vopt_enable smartcard)
$(vopt_enable spice) $(vopt_enable virgl virglrenderer) $(vopt_if gtk3 '--enable-gtk')"
hostmakedepends="flex glib-devel gettext pkg-config perl python3 python3-Sphinx python3-sphinx_rtd_theme ninja"
build_style=meta
configure_args="--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/libexec
--localstatedir=/var --enable-pie --disable-user
-Dglusterfs=disabled -Dxen=disabled -Ddocs=enabled -Dlibusb=enabled -Dsnappy=enabled
-Dtpm=enabled -Dusb_redir=enabled -Dvhost_net=enabled -Dvirtfs=enabled -Dpng=enabled
-Daudio_drv_list=alsa,sdl,jack,pa -Dopengl=enabled -Dpa=enabled -Dsdl=enabled
-Dsmartcard=enabled -Dspice=enabled -Dvirglrenderer=enabled -Dgtk=enabled"
hostmakedepends="meson flex glib-devel gettext pkg-config perl python3-sphinx_rtd_theme"
makedepends="capstone-devel dtc-devel libpng-devel libjpeg-turbo-devel pixman-devel
snappy-devel libuuid-devel libX11-devel alsa-lib-devel libaio-devel gnutls-devel
libsasl-devel ncurses-devel libseccomp-devel nss-devel
libcurl-devel xfsprogs-devel libcap-ng-devel vde2-devel usbredir-devel
libbluetooth-devel libssh2-devel libusb-devel libnfs-devel libslirp-devel
libxkbcommon-devel libzstd-devel $(vopt_if sdl2 'SDL2-devel SDL2_image-devel')
$(vopt_if gtk3 'gtk+3-devel vte3-devel')
$(vopt_if spice 'spice-devel pcsclite-devel') $(vopt_if virgl virglrenderer-devel)
$(vopt_if opengl 'libepoxy-devel libdrm-devel MesaLib-devel')
$(vopt_if iscsi 'libiscsi-devel')
$(vopt_if smartcard libcacard-devel) $(vopt_if numa 'libnuma-devel')
$(vopt_if jack 'jack-devel') $(vopt_if pulseaudio 'pulseaudio-devel')"
short_desc="Open Source Processor Emulator"
libxkbcommon-devel libzstd-devel SDL2-devel SDL2_image-devel gtk+3-devel
vte3-devel spice-devel pcsclite-devel virglrenderer-devel libepoxy-devel
libdrm-devel MesaLib-devel libiscsi-devel libcacard-devel libnuma-devel
jack-devel pulseaudio-devel"
short_desc="Open source processor emulator"
maintainer="classabbyamp <void@placeviolette.net>"
license="GPL-2.0-only, LGPL-2.1-only"
homepage="https://www.qemu.org"
distfiles="https://wiki.qemu.org/download/qemu-${version}.tar.bz2"
checksum=6fef38a497ff65f8d45c611b12ed5f5bb3e19ea6d76bfaea6857bf6fd76701e6
checksum=a61859004b531189f28245edaf4ce7fd96402594a33c67f27bf0383fb6e83cb3
ignore_elf_dirs="/usr/share/qemu"
nostrip_files="hppa-firmware.img hppa-firmware64.img openbios-ppc
openbios-sparc32 openbios-sparc64 palcode-clipper s390-ccw.img
s390-netboot.img u-boot.e500"
build_options="gtk3 iscsi jack numa opengl pulseaudio sdl2 smartcard spice virgl"
build_options_default="gtk3 iscsi jack numa opengl pulseaudio sdl2 smartcard spice virgl"
@ -43,23 +37,183 @@ desc_option_smartcard="Enable smartcard support"
desc_option_numa="Enable support for host NUMA"
desc_option_iscsi="Enable support for iSCSI"
subpackages="qemu-ga qemu-img qemu-tools qemu-firmware qemu-doc"
depends="qemu-img>=${version}_${revision} qemu-tools>=${version}_${revision}
qemu-firmware>=${version}_${revision} qemu-doc>=${version}_${revision}
qemu-user>=${version}"
if [ "$CROSS_BUILD" ]; then
configure_args+=" --cross-prefix=${XBPS_CROSS_TRIPLET}-"
fi
post_install() {
vdoc "${FILESDIR}/README.voidlinux"
_archs=(
aarch64
alpha
arm
avr
cris
hppa
i386
loongarch64
m68k
microblaze
microblazeel
mips
mips64
mips64el
mipsel
or1k
ppc
ppc64
riscv32
riscv64
rx
s390x
sh4
sh4eb
sparc
sparc64
tricore
x86_64
xtensa
xtensaeb
)
for _arch in "${_archs[@]}"; do
# bug in xbps: it hates package names ending in _N
_pkgname="qemu-system-${_arch//x86_64/amd64}"
subpackages+=" ${_pkgname}"
depends+=" ${_pkgname}>=${version}_${revision}"
case "$_arch" in
aarch64)
_depends="qemu-firmware>=${version}_${revision}"
;;
alpha)
_extras="palcode-clipper"
;;
arm)
_depends="qemu-firmware>=${version}_${revision}"
_extras="npcm7xx_bootrom.bin"
;;
hppa)
_extras="hppa-firmware.img hppa-firmware64.img"
;;
i386)
_depends="qemu-firmware>=${version}_${revision}"
;;
ppc)
_extras="openbios-ppc u-boot.e500 u-boot-sam460-20100605.bin"
;;
riscv32)
_extras="opensbi-riscv32-generic-fw_dynamic.bin"
;;
riscv64)
_extras="opensbi-riscv64-generic-fw_dynamic.bin"
;;
s390x)
_extras="s390-ccw.img s390-netboot.img"
;;
sparc)
_extras="openbios-sparc32"
;;
sparc64)
_extras="openbios-sparc64"
;;
x86_64)
_depends="qemu-firmware>=${version}_${revision}"
;;
esac
eval "${_pkgname}_package() {
_sys_tmpl '$_arch' '$_depends' '$_extras'
}"
unset _depends _extras
done
subpackages+=" qemu-common"
. /void-packages/common/build-style/configure.sh
_sys_tmpl() {
_arch="$1"
_depends="$2"
_extras="$3"
depends="qemu-common>=${version}_${revision} ${_depends}"
short_desc+=" - ${_arch} system emulator"
nostrip_files="${_extras}"
ignore_elf_dirs="/usr/share/qemu"
pkg_install() {
vmove "usr/bin/qemu-system-$_arch"
for f in $_extras; do
vmove "usr/share/qemu/$f"
done
}
}
post_install() {
# qemu-bridge-helper must be setuid for non privileged users.
chmod u+s ${DESTDIR}/usr/libexec/qemu-bridge-helper
vsv qemu-ga
}
qemu-common_package() {
short_desc+=" - common files"
pkg_install() {
vmove usr/share
vmove usr/include
vmove usr/libexec
}
}
qemu-ga_package() {
short_desc="QEMU Guest Agent"
short_desc+=" - guest agent"
pkg_install() {
vmove usr/bin/qemu-ga
vmove etc/sv/qemu-ga
vmove usr/share/man/man7/qemu-ga-ref.7
vmove usr/share/man/man8/qemu-ga.8
}
}
qemu-img_package() {
short_desc+=" - tools for manipulating disk images"
pkg_install() {
for bin in qemu-{img,io,nbd,storage-daemon}; do
vmove "usr/bin/$bin"
done
vmove usr/share/man/man1/qemu-img.1
vmove usr/share/man/man1/qemu-storage-daemon.1
vmove usr/share/man/man7/qemu-storage-daemon-qmp-ref.7
vmove usr/share/man/man8/qemu-nbd.8
}
}
qemu-tools_package() {
short_desc+=" - support tools"
pkg_install() {
for bin in qemu-{edid,keymap,pr-helper} elf2dmp; do
vmove "usr/bin/$bin"
done
if [ -z "$CROSS_BUILD" ]; then
vmove "usr/bin/qemu-vmsr-helper"
fi
vmove usr/share/man/man8/qemu-pr-helper.8
}
}
qemu-firmware_package() {
short_desc+=" - EDK2 firmware files"
pkg_install() {
vmove usr/share/qemu/firmware
vmove "usr/share/qemu/edk2-*"
}
}
qemu-doc_package() {
short_desc+=" - documentation"
pkg_install() {
vmove usr/share/doc
}
}