From nobody Mon Apr 29 21:55:25 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VSy7R4Nhkz5Jwgq; Mon, 29 Apr 2024 22:05:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSy7R2yTxz40wg; Mon, 29 Apr 2024 22:05:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wlWUqO2Eg6DSLXIco7/YUxPQR3V/2MoglO7wm3b6gII=; b=G2dEite8hgBSBXVBHLLSIx2cWjVyLreBoSayRnJJHv7fATh+cU5qDVLkdLDk2HLuKlS/sk 3Holr2cKX/5iCR8Aw0P20UdOjHLAxZm4gJ3BgiM2xpu4XKqF2PvH12UVYg6Eq5hICiilgt rrl57i5g1rVU5TLJ0zcg5nrpN+HC4DUB4Ts+Bt8Pt4Wh0djhdQ9Jj7kzd66uxBZ9vQ+b1J CFMf81XRIBkOl7F2VAQja0DcfVvNh+eI+IJApizasC9r6sOpK32+paUvw2Ca0DYTztny6w kczxvaL1D3/JBi+71bLJNTWs0qqwo4M/A1tCfpMn5ohowA8830/Q35brlyfoNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714428323; a=rsa-sha256; cv=none; b=vhz/xvi4WFCv9S2dETUOJ9ZrlX8T1tvbkjh0HLwQ/0yAfaZiRkmZyTs6eGPdjTrdVt0cof 5f9iiAlFl92kLkQNZ8v4Obr6fBTkaC9gx8/E9maTVTfBqWZfCw0iSJWOroEXqiW//wlrDT dlw5lqcSlDPFk1lU3u8MH5Q68SBYtFVS/eUQY5Dn56IzPzkR9ARGOjYDM9gezwttNX/aDl +7h8Mpc3fd5hc6ZzPMl87z1MMrx/O3Kg//G3N3YED04J3GR6aCLZ5xrOyYtUTjp44Gucwl SZQMyN/KDiD/L2Ak9REH6QaX6ExTzY754Q36P0NaHCM/ZtFzOFto/Dmship/bQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wlWUqO2Eg6DSLXIco7/YUxPQR3V/2MoglO7wm3b6gII=; b=ZbVkP0yFeVTgyaeI0ztDp7Rde60eLTA9irr0FcUoNZaGpC5t57ljM+9GQfubRuEiHNYLqq Evae13nhO5R+mhsAbiRUGYY9GA21okgBJH6++dZ/E+Upstou017Nt7XXZ/r98gjCyd9fbd rAFfTT2Ve8NEYJ4wdIY63T/35gPXXLEz1u1fW1tRe4bzj6uiRjU1OMh+eksNpnl77HPIq1 UQecRRGNBFe4STZ9TDAvEIpl7zzbiibQO82PVxJxloBXHugAz7YeqSKpuA81Bc6VHfmNCp s5mMqXp0MhHiPHe1PppGSADmNpu+0ua/EHzVcaWzCel+S6ZJPAUWmZZvEC28Aw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VSxvx5Kgpz1ML9; Mon, 29 Apr 2024 21:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TLtP6b026392; Mon, 29 Apr 2024 21:55:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TLtPRf026389; Mon, 29 Apr 2024 21:55:25 GMT (envelope-from git) Date: Mon, 29 Apr 2024 21:55:25 GMT Message-Id: <202404292155.43TLtPRf026389@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: e70bc73ba8b0 - main - emulators/qemu8: New port List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e70bc73ba8b012034c0820c95b0937f7ec0553dd Auto-Submitted: auto-generated The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/ports/commit/?id=e70bc73ba8b012034c0820c95b0937f7ec0553dd commit e70bc73ba8b012034c0820c95b0937f7ec0553dd Author: Muhammad Moinur Rahman AuthorDate: 2024-04-29 21:38:55 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2024-04-29 21:55:05 +0000 emulators/qemu8: New port This port is a near identical copy of the qemu port created for provisioning the update of the new 9.X.X branch of qemu. --- emulators/Makefile | 1 + emulators/qemu8/Makefile | 190 +++++++++++++++++++++ emulators/qemu8/distinfo | 3 + emulators/qemu8/files/patch-block_export_fuse.c | 69 ++++++++ .../files/patch-bsd-user_host_i386_host-signal.h | 10 ++ emulators/qemu8/files/patch-util_cpuinfo-ppc.c | 34 ++++ emulators/qemu8/files/patch-util_meson.build | 15 ++ emulators/qemu8/files/qemu-ifdown.sample | 2 + emulators/qemu8/files/qemu-ifup.sample | 2 + emulators/qemu8/pkg-descr | 14 ++ emulators/qemu8/pkg-message | 76 +++++++++ emulators/qemu8/pkg-plist | 180 +++++++++++++++++++ 12 files changed, 596 insertions(+) diff --git a/emulators/Makefile b/emulators/Makefile index c93954f5a2e8..240b4d30a637 100644 --- a/emulators/Makefile +++ b/emulators/Makefile @@ -114,6 +114,7 @@ SUBDIR += qemu-user-static SUBDIR += qemu-user-static-devel SUBDIR += qemu7 + SUBDIR += qemu8 SUBDIR += qmc2 SUBDIR += quasi88 SUBDIR += reicast diff --git a/emulators/qemu8/Makefile b/emulators/qemu8/Makefile new file mode 100644 index 000000000000..4787fec7ba91 --- /dev/null +++ b/emulators/qemu8/Makefile @@ -0,0 +1,190 @@ +PORTNAME= qemu +DISTVERSION= 8.2.2 +CATEGORIES= emulators +MASTER_SITES= https://download.qemu.org/ +DIST_SUBDIR= qemu/${PORTVERSION} + +MAINTAINER= bofh@FreeBSD.org +COMMENT= QEMU CPU Emulator ${${FLAVOR}_COMMENT} - 8.X.X +WWW= https://www.qemu.org/ + +LICENSE= GPLv2 + +ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc64 powerpc64le +# We need to check if it build with other ARCHS + +BUILD_DEPENDS= bash:shells/bash +LIB_DEPENDS+= libfdt.so:sysutils/dtc \ + libzstd.so:archivers/zstd \ + libslirp.so:net/libslirp +.if ${FLAVOR:U} != nox11 +LIB_DEPENDS+= libepoxy.so:graphics/libepoxy +.endif + +FLAVORS= default nox11 +FLAVOR?= ${FLAVORS:[1]} +default_PKGNAMESUFFIX= 8 +default_CONFLICTS_INSTALL= qemu-devel qemu-nox11 qemu-tools qemu-utils \ + qemu7* qemu8* +nox11_PKGNAMESUFFIX= 8-nox11 +nox11_CONFLICTS_INSTALL= qemu qemu-devel qemu* qemu7* qemu-guest-agent +nox11_COMMENT= (without X11) + +USES= cpe gmake gnome ninja perl5 pkgconfig python:build shebangfix tar:xz +SHEBANG_FILES= scripts/xml-preprocess.py +USE_GNOME= glib20 +USE_PERL5= build +USES+= iconv:wchar_t +.if ${FLAVOR:U} != nox11 +USE_GNOME+= cairo +.endif + +HAS_CONFIGURE= yes +CONFIGURE_ARGS+= --cc=${CC} \ + --disable-guest-agent \ + --disable-kvm \ + --disable-linux-aio \ + --disable-linux-user \ + --disable-xen \ + --extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\" \ + --extra-ldflags=-L${LOCALBASE}/lib \ + --extra-ldflags=-L/usr/lib \ + --localstatedir=/var \ + --mandir=${PREFIX}/share/man \ + --prefix=${PREFIX} \ + --python=${PYTHON_CMD} +CONFIGURE_ARGS+= --enable-fdt=system \ + --enable-netmap + +CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//} +WITHOUT_CPU_CFLAGS= yes #to avoid problems with register allocation + +PORTDOCS= .buildinfo _static/* about/* dbus-dbusindex.html devel/* docs \ + genindex.html index.html interop/* objects.inv search.html \ + searchindex.js specs/* system/* tools/* user/* + +OPTIONS_DEFINE= CAPSTONE CDROM_DMA CURL DEBUG DOCS GNUTLS GTK3 \ + ISCSI JPEG OPENGL PNG SAMBA SASL STATIC_LINK \ + STRIP USBREDIR VDE X11 X86_TARGETS +OPTIONS_DEFAULT= CDROM_DMA CURL GNUTLS GTK3 JPEG NCURSES_DEFAULT \ + OPENGL PNG SASL VDE X11 +OPTIONS_SINGLE= NCURSES +OPTIONS_SINGLE_NCURSES= NCURSES_BASE NCURSES_DEFAULT NCURSES_PORT +.if ${FLAVOR:U} == nox11 +OPTIONS_EXCLUDE:= GTK3 OPENGL X11 +.endif +OPTIONS_SUB= yes +CAPSTONE_DESC= Disassembly framework support +CDROM_DMA_DESC= IDE CDROM DMA +GNUTLS_DESC= gnutls dependency (vnc encryption) +ISCSI_DESC= libiscsi dependency (iSCSI client for emulated drives) +JPEG_DESC= jpeg dependency (vnc lossy compression) +NCURSES_BASE_DESC= Depend on ncurses in base +NCURSES_DEFAULT_DESC= Depend on ncurses (ports if installed, otherwise base) +NCURSES_PORT_DESC= Depend on devel/ncurses in ports +PNG_DESC= png dependency (vnc compression) +SAMBA_DESC= samba dependency (for -smb) +SASL_DESC= cyrus-sasl dependency (vnc encryption) +STATIC_LINK_DESC= Statically link the executables +USBREDIR_DESC= usb device network redirection (experimental!) +VDE_DESC= vde dependency (for vde networking) +X86_TARGETS_DESC= Build only x86 system targets +CAPSTONE_LIB_DEPENDS= libcapstone.so:devel/capstone +CAPSTONE_CONFIGURE_ON= --enable-capstone \ + --extra-cflags=-I${LOCALBASE}/include/capstone +CAPSTONE_CONFIGURE_OFF= --disable-capstone +CURL_LIB_DEPENDS= libcurl.so:ftp/curl +CURL_CONFIGURE_OFF= --disable-curl +DEBUG_CONFIGURE_ON= --enable-debug +DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx_rtd_theme>0:textproc/py-sphinx_rtd_theme@${PY_FLAVOR} \ + sphinx-build:textproc/py-sphinx@${PY_FLAVOR} +DOCS_CONFIGURE_ENABLE= docs +GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls +GNUTLS_CONFIGURE_OFF= --disable-gnutls +GTK3_LIB_DEPENDS= libxkbcommon.so:x11/libxkbcommon +GTK3_USES= gettext gl +GTK3_USE= GNOME=gdkpixbuf2,gtk30,vte3 \ + XORG=x11,xext +GTK3_CONFIGURE_OFF= --disable-gtk \ + --disable-vte +ISCSI_LIB_DEPENDS= libiscsi.so:net/libiscsi +ISCSI_CONFIGURE_OFF= --disable-libiscsi +JPEG_USES= jpeg +JPEG_CONFIGURE_OFF= --disable-vnc-jpeg +NCURSES_BASE_USES= ncurses:base +NCURSES_DEFAULT_USES= ncurses +NCURSES_PORT_USES= ncurses:port +OPENGL_USES= gl +OPENGL_USE= GL=gbm,gl +OPENGL_CONFIGURE_OFF= --disable-opengl +PNG_LIB_DEPENDS= libpng.so:graphics/png +PNG_CONFIGURE_OFF= --disable-png +SAMBA_USES= samba:run # smbd +SAMBA_CONFIGURE_ON= --smbd=${LOCALBASE}/sbin/smbd +SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 +SASL_CONFIGURE_OFF= --disable-vnc-sasl +STATIC_LINK_PREVENTS= GTK3 X11 +STATIC_LINK_PREVENTS_MSG= X11 ui cannot be built static +STATIC_LINK_CONFIGURE_ON= --static +STRIP_CONFIGURE_OFF= --disable-strip +USBREDIR_BUILD_DEPENDS= usbredir>=0.6:net/usbredir +USBREDIR_RUN_DEPENDS= usbredir>=0.6:net/usbredir +USBREDIR_CONFIGURE_OFF= --disable-usb-redir +VDE_LIB_DEPENDS= libvdeplug.so:net/vde2 +VDE_CONFIGURE_OFF= --disable-vde +X11_USES= sdl +X11_USE= GNOME=gdkpixbuf2 \ + SDL=sdl2 \ + XORG=x11,xext +X11_CONFIGURE_ENABLE= sdl +.if (empty(FLAVOR) || ${FLAVOR:U} == default || ${FLAVOR:U} == nox11) +X86_TARGETS_LIB_DEPENDS_OFF= libdw.so:devel/elfutils +X86_TARGETS_USES_OFF= xorg +X86_TARGETS_USE_OFF= XORG=pixman,x11 +X86_TARGETS_CONFIGURE_ON= --target-list='i386-softmmu i386-bsd-user x86_64-softmmu x86_64-bsd-user' +.endif + +.include + +.if (empty(FLAVOR) || ${FLAVOR:U} == default || ${FLAVOR:U} == nox11) +.if ${ARCH} == "amd64" +MAKE_ARGS+= ARCH=x86_64 +.endif + +.if ${ARCH} == "powerpc" +CFLAGS+= -D_CALL_SYSV +MAKE_ARGS+= ARCH=ppc +USE_GCC= yes +.endif + +.if ${ARCH:Mpowerpc64*} || ${ARCH:Maarch64} +CONFIGURE_ARGS+= --disable-bsd-user +MAKE_ARGS+= ARCH=${ARCH:C/powerpc64.*/ppc64/} +PLIST_SUB+= BSDUSER="@comment " +.else +PLIST_SUB+= BSDUSER="" +.endif + +PLIST_SUB+= LINUXBOOT_DMA="" +.endif + +post-patch-CDROM_DMA-off: + @${REINPLACE_CMD} -e '/USE_DMA_CDROM/d' ${WRKSRC}/include/hw/ide/internal.h + +do-build: + cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${GMAKE} -j${MAKE_JOBS_NUMBER} + +do-install: + cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} DESTDIR=${STAGEDIR} ${GMAKE} install + +.if !target(post-install) +post-install: + ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup.sample ${STAGEDIR}${PREFIX}/etc + ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown.sample ${STAGEDIR}${PREFIX}/etc + @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-* + +post-install-DOCS-on: + @(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR}/) +.endif + +.include diff --git a/emulators/qemu8/distinfo b/emulators/qemu8/distinfo new file mode 100644 index 000000000000..7b44f6a13a47 --- /dev/null +++ b/emulators/qemu8/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1709670183 +SHA256 (qemu/8.2.2/qemu-8.2.2.tar.xz) = 847346c1b82c1a54b2c38f6edbd85549edeb17430b7d4d3da12620e2962bc4f3 +SIZE (qemu/8.2.2/qemu-8.2.2.tar.xz) = 129398020 diff --git a/emulators/qemu8/files/patch-block_export_fuse.c b/emulators/qemu8/files/patch-block_export_fuse.c new file mode 100644 index 000000000000..03b9cc8b5994 --- /dev/null +++ b/emulators/qemu8/files/patch-block_export_fuse.c @@ -0,0 +1,69 @@ +--- block/export/fuse.c.orig 2023-12-19 21:24:34 UTC ++++ block/export/fuse.c +@@ -690,12 +690,6 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t + return; + } + +-#ifdef CONFIG_FALLOCATE_PUNCH_HOLE +- if (mode & FALLOC_FL_KEEP_SIZE) { +- length = MIN(length, blk_len - offset); +- } +-#endif /* CONFIG_FALLOCATE_PUNCH_HOLE */ +- + if (!mode) { + /* We can only fallocate at the EOF with a truncate */ + if (offset < blk_len) { +@@ -715,53 +709,6 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t + ret = fuse_do_truncate(exp, offset + length, true, + PREALLOC_MODE_FALLOC); + } +-#ifdef CONFIG_FALLOCATE_PUNCH_HOLE +- else if (mode & FALLOC_FL_PUNCH_HOLE) { +- if (!(mode & FALLOC_FL_KEEP_SIZE)) { +- fuse_reply_err(req, EINVAL); +- return; +- } +- +- do { +- int size = MIN(length, BDRV_REQUEST_MAX_BYTES); +- +- ret = blk_pwrite_zeroes(exp->common.blk, offset, size, +- BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK); +- if (ret == -ENOTSUP) { +- /* +- * fallocate() specifies to return EOPNOTSUPP for unsupported +- * operations +- */ +- ret = -EOPNOTSUPP; +- } +- +- offset += size; +- length -= size; +- } while (ret == 0 && length > 0); +- } +-#endif /* CONFIG_FALLOCATE_PUNCH_HOLE */ +-#ifdef CONFIG_FALLOCATE_ZERO_RANGE +- else if (mode & FALLOC_FL_ZERO_RANGE) { +- if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + length > blk_len) { +- /* No need for zeroes, we are going to write them ourselves */ +- ret = fuse_do_truncate(exp, offset + length, false, +- PREALLOC_MODE_OFF); +- if (ret < 0) { +- fuse_reply_err(req, -ret); +- return; +- } +- } +- +- do { +- int size = MIN(length, BDRV_REQUEST_MAX_BYTES); +- +- ret = blk_pwrite_zeroes(exp->common.blk, +- offset, size, 0); +- offset += size; +- length -= size; +- } while (ret == 0 && length > 0); +- } +-#endif /* CONFIG_FALLOCATE_ZERO_RANGE */ + else { + ret = -EOPNOTSUPP; + } diff --git a/emulators/qemu8/files/patch-bsd-user_host_i386_host-signal.h b/emulators/qemu8/files/patch-bsd-user_host_i386_host-signal.h new file mode 100644 index 000000000000..07d731fd4f54 --- /dev/null +++ b/emulators/qemu8/files/patch-bsd-user_host_i386_host-signal.h @@ -0,0 +1,10 @@ +--- bsd-user/host/i386/host-signal.h.orig 2022-12-14 16:28:45 UTC ++++ bsd-user/host/i386/host-signal.h +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/emulators/qemu8/files/patch-util_cpuinfo-ppc.c b/emulators/qemu8/files/patch-util_cpuinfo-ppc.c new file mode 100644 index 000000000000..af9999a22108 --- /dev/null +++ b/emulators/qemu8/files/patch-util_cpuinfo-ppc.c @@ -0,0 +1,34 @@ +--- util/cpuinfo-ppc.c.orig 2024-01-29 19:13:22 UTC ++++ util/cpuinfo-ppc.c +@@ -6,13 +6,21 @@ + #include "qemu/osdep.h" + #include "host/cpuinfo.h" + +-#include + #ifdef CONFIG_GETAUXVAL + # include + #else ++# ifdef __linux__ ++# include ++# elif defined(__FreeBSD__) ++# include ++# endif + # include "elf.h" + #endif + ++#ifndef PPC_FEATURE2_ARCH_3_1 ++# define PPC_FEATURE2_ARCH_3_1 0x00040000 ++#endif ++ + unsigned cpuinfo; + + /* Called both as constructor and (possibly) via other constructors. */ +@@ -53,7 +61,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(voi + * always have both anyway, since VSX came with Power7 + * and crypto came with Power8. + */ +- if (hwcap2 & PPC_FEATURE2_VEC_CRYPTO) { ++ if (hwcap2 & PPC_FEATURE2_HAS_VEC_CRYPTO) { + info |= CPUINFO_CRYPTO; + } + } diff --git a/emulators/qemu8/files/patch-util_meson.build b/emulators/qemu8/files/patch-util_meson.build new file mode 100644 index 000000000000..1e42351652d7 --- /dev/null +++ b/emulators/qemu8/files/patch-util_meson.build @@ -0,0 +1,15 @@ +--- util/meson.build.orig 2023-12-19 21:24:35 UTC ++++ util/meson.build +@@ -102,11 +102,7 @@ if have_block + util_ss.add(files('readline.c')) + util_ss.add(files('throttle.c')) + util_ss.add(files('timed-average.c')) +- if config_host_data.get('CONFIG_INOTIFY1') +- util_ss.add(files('filemonitor-inotify.c')) +- else +- util_ss.add(files('filemonitor-stub.c')) +- endif ++ util_ss.add(files('filemonitor-stub.c')) + util_ss.add(when: 'CONFIG_LINUX', if_true: files('vfio-helpers.c')) + endif + diff --git a/emulators/qemu8/files/qemu-ifdown.sample b/emulators/qemu8/files/qemu-ifdown.sample new file mode 100644 index 000000000000..89d9a9bff436 --- /dev/null +++ b/emulators/qemu8/files/qemu-ifdown.sample @@ -0,0 +1,2 @@ +#!/bin/sh +exec true diff --git a/emulators/qemu8/files/qemu-ifup.sample b/emulators/qemu8/files/qemu-ifup.sample new file mode 100644 index 000000000000..89d9a9bff436 --- /dev/null +++ b/emulators/qemu8/files/qemu-ifup.sample @@ -0,0 +1,2 @@ +#!/bin/sh +exec true diff --git a/emulators/qemu8/pkg-descr b/emulators/qemu8/pkg-descr new file mode 100644 index 000000000000..592b7660dd49 --- /dev/null +++ b/emulators/qemu8/pkg-descr @@ -0,0 +1,14 @@ +QEMU is a FAST! processor emulator using dynamic translation to achieve +good emulation speed. +QEMU has two operating modes: + + * Full system emulation. In this mode, QEMU emulates a full system +(for example a PC), including a processor and various peripherials. +It can be used to launch different Operating Systems without rebooting +the PC or to debug system code. + * User mode emulation (Linux host only). In this mode, QEMU can launch +Linux processes compiled for one CPU on another CPU. It can be used to +launch the Wine Windows API emulator or to ease cross-compilation and +cross-debugging. + +As QEMU requires no host kernel patches to run, it is very safe and easy to use. diff --git a/emulators/qemu8/pkg-message b/emulators/qemu8/pkg-message new file mode 100644 index 000000000000..ac6e871ff11c --- /dev/null +++ b/emulators/qemu8/pkg-message @@ -0,0 +1,76 @@ +[ +{ type: install + message: < hosts. The linux 2.6 + kernel uses 1000 by default btw. (changed to 250 later, and recent linux + kernels now no longer have a fixed HZ, aka `tickless kernel'...) + Enabling /dev/rtc doesn't seem to help either (not included since it needs + a patch to emulators/rtc.) + +- The -smb option (smb-export local dir to guest using the default + slirp networking) needs the samba port/package installed + in addition to qemu. (SAMBA knob.) + +- If you want to use usb devices connected to the host in the guest + yot can use usbredir over the network (see below); also unless you are + running qemu as root you then need to fix permissions for /dev/ugen* + device nodes: if you are on 5.x or later (devfs) put a rule in + /etc/devfs.rules, activate it in /etc/rc.conf and run /etc/rc.d/devfs + restart. Example devfs.rules: + + [ugen_ruleset=20] + add path 'ugen*' mode 660 group operator + + corresponding rc.conf line: + + devfs_system_ruleset="ugen_ruleset" + +- Still usb: since the hub is no longer attached to the uchi controller and + the wakeup mechanism, resume interrupt is not implemented yet linux guests + will suspend the bus, i.e. they wont see devices usb_add'ed after its + (linux') uhci module got loaded. Workaround: either add devices before + linux loads the module or rmmod and modprobe it afterwards. [Not sure + if this still applies to the new libusb host code used on recent + 10-current.] + +- If you get repeated `atapi_poll called!' console messages with FreeBSD + guests or other weird cdrom problems then thats probably because the guest + has atapicam loaded, which for reasons still to be determined has problems + with qemu's now by default enabled cdrom dma. You can build the port with + CDROM_DMA disabled to disable it. [Looks like this is fixed in recent + FreeBSD guest versions.] + +- If you build qemu wihout SDL and then get crashes running it try passing it + -nographic. This should probably be default in that case... + +- qemu's network boot roms (-boot n) have a bug when bootfiles sizes are a + multiple of blksize, if this affects you (like with FreeBSD's /boot/pxeboot) + you can do like + + cp /boot/pxeboot pxeboot-qemu && chmod +w pxeboot-qemu && echo >>pxeboot-qemu + + and then use pxeboot-qemu. Actually you need recent btx code + (from after 7.0 was released) because of the real mode boot + problem, so use at least pxeboot from there. And I just did that + for the pxeboot extracted out of + + ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/200805/7.0-STABLE-200805-i386-bootonly.iso + + and placed it here: + + http://people.freebsd.org/~nox/qemu/pxeboot-qemu + +- If you use slirp (usernet, the default) and want to mount nfs into the guest + and you are not running qemu as root, then mountd(8) on the exporting box + needs to be run with -n in order to accept requests from ports >= 1024. + +EOM +} +] diff --git a/emulators/qemu8/pkg-plist b/emulators/qemu8/pkg-plist new file mode 100644 index 000000000000..ecfff8c9de72 --- /dev/null +++ b/emulators/qemu8/pkg-plist @@ -0,0 +1,180 @@ +%%CURL%%bin/elf2dmp +%%BSDUSER%%%%NO_X86_TARGETS%%bin/qemu-arm +bin/qemu-edid +%%BSDUSER%%bin/qemu-i386 +bin/qemu-img +bin/qemu-io +%%GTK3%%bin/qemu-keymap +bin/qemu-nbd +bin/qemu-storage-daemon +%%NO_X86_TARGETS%%bin/qemu-system-aarch64 +%%NO_X86_TARGETS%%bin/qemu-system-alpha +%%NO_X86_TARGETS%%bin/qemu-system-avr +%%NO_X86_TARGETS%%bin/qemu-system-arm +%%NO_X86_TARGETS%%bin/qemu-system-cris +%%NO_X86_TARGETS%%bin/qemu-system-hppa +bin/qemu-system-i386 +%%NO_X86_TARGETS%%bin/qemu-system-loongarch64 +%%NO_X86_TARGETS%%bin/qemu-system-m68k +%%NO_X86_TARGETS%%bin/qemu-system-microblaze +%%NO_X86_TARGETS%%bin/qemu-system-microblazeel +%%NO_X86_TARGETS%%bin/qemu-system-mips +%%NO_X86_TARGETS%%bin/qemu-system-mips64 +%%NO_X86_TARGETS%%bin/qemu-system-mips64el +%%NO_X86_TARGETS%%bin/qemu-system-mipsel +%%NO_X86_TARGETS%%bin/qemu-system-nios2 +%%NO_X86_TARGETS%%bin/qemu-system-or1k +%%NO_X86_TARGETS%%bin/qemu-system-ppc +%%NO_X86_TARGETS%%bin/qemu-system-ppc64 +%%NO_X86_TARGETS%%bin/qemu-system-riscv32 +%%NO_X86_TARGETS%%bin/qemu-system-riscv64 +%%NO_X86_TARGETS%%bin/qemu-system-rx +%%NO_X86_TARGETS%%bin/qemu-system-s390x +%%NO_X86_TARGETS%%bin/qemu-system-sh4 +%%NO_X86_TARGETS%%bin/qemu-system-sh4eb +%%NO_X86_TARGETS%%bin/qemu-system-sparc +%%NO_X86_TARGETS%%bin/qemu-system-sparc64 +%%NO_X86_TARGETS%%bin/qemu-system-tricore +bin/qemu-system-x86_64 +%%NO_X86_TARGETS%%bin/qemu-system-xtensa +%%NO_X86_TARGETS%%bin/qemu-system-xtensaeb +%%BSDUSER%%bin/qemu-x86_64 +include/qemu-plugin.h +%%PORTDOCS%%share/man/man1/qemu.1.gz +%%PORTDOCS%%share/man/man1/qemu-img.1.gz +%%PORTDOCS%%share/man/man7/qemu-block-drivers.7.gz +%%PORTDOCS%%share/man/man7/qemu-cpu-models.7.gz +%%PORTDOCS%%share/man/man8/qemu-nbd.8.gz +%%PORTDOCS%%share/man/man8/qemu-pr-helper.8.gz +%%PORTDOCS%%share/man/man7/qemu-qmp-ref.7.gz +%%PORTDOCS%%share/man/man1/qemu-storage-daemon.1.gz +%%PORTDOCS%%share/man/man7/qemu-storage-daemon-qmp-ref.7.gz +@sample etc/qemu-ifup.sample +@sample etc/qemu-ifdown.sample +%%DATADIR%%/QEMU,tcx.bin +%%DATADIR%%/QEMU,cgthree.bin +%%DATADIR%%/bios-256k.bin +%%DATADIR%%/bios-microvm.bin +%%DATADIR%%/bios.bin +%%DATADIR%%/canyonlands.dtb +%%DATADIR%%/edk2-aarch64-code.fd +%%DATADIR%%/edk2-arm-code.fd +%%DATADIR%%/edk2-arm-vars.fd +%%DATADIR%%/edk2-i386-code.fd +%%DATADIR%%/edk2-i386-secure-code.fd +%%DATADIR%%/edk2-i386-vars.fd +%%DATADIR%%/edk2-licenses.txt +%%DATADIR%%/edk2-x86_64-code.fd +%%DATADIR%%/edk2-x86_64-secure-code.fd +%%DATADIR%%/efi-e1000.rom +%%DATADIR%%/efi-e1000e.rom +%%DATADIR%%/efi-eepro100.rom +%%DATADIR%%/efi-ne2k_pci.rom +%%DATADIR%%/efi-pcnet.rom +%%DATADIR%%/efi-rtl8139.rom +%%DATADIR%%/efi-virtio.rom +%%DATADIR%%/efi-vmxnet3.rom +%%DATADIR%%/firmware/50-edk2-i386-secure.json +%%DATADIR%%/firmware/50-edk2-x86_64-secure.json +%%DATADIR%%/firmware/60-edk2-aarch64.json +%%DATADIR%%/firmware/60-edk2-arm.json +%%DATADIR%%/firmware/60-edk2-i386.json +%%DATADIR%%/firmware/60-edk2-x86_64.json +%%DATADIR%%/hppa-firmware.img +%%DATADIR%%/keymaps/ar +%%DATADIR%%/keymaps/bepo +%%DATADIR%%/keymaps/cz +%%DATADIR%%/keymaps/da +%%DATADIR%%/keymaps/de +%%DATADIR%%/keymaps/de-ch +%%DATADIR%%/keymaps/en-gb +%%DATADIR%%/keymaps/en-us +%%DATADIR%%/keymaps/es +%%DATADIR%%/keymaps/et +%%DATADIR%%/keymaps/fi +%%DATADIR%%/keymaps/fo +%%DATADIR%%/keymaps/fr +%%DATADIR%%/keymaps/fr-be +%%DATADIR%%/keymaps/fr-ca +%%DATADIR%%/keymaps/fr-ch +%%DATADIR%%/keymaps/hr +%%DATADIR%%/keymaps/hu +%%DATADIR%%/keymaps/is +%%DATADIR%%/keymaps/it +%%DATADIR%%/keymaps/ja +%%DATADIR%%/keymaps/lt +%%DATADIR%%/keymaps/lv +%%DATADIR%%/keymaps/mk +%%DATADIR%%/keymaps/nl +%%DATADIR%%/keymaps/no +%%DATADIR%%/keymaps/pl +%%DATADIR%%/keymaps/pt +%%DATADIR%%/keymaps/pt-br +%%DATADIR%%/keymaps/ru +%%DATADIR%%/keymaps/sl +%%DATADIR%%/keymaps/sv +%%DATADIR%%/keymaps/th +%%DATADIR%%/keymaps/tr +%%DATADIR%%/linuxboot.bin +%%LINUXBOOT_DMA%%%%DATADIR%%/linuxboot_dma.bin +%%DATADIR%%/multiboot.bin +%%DATADIR%%/multiboot_dma.bin +%%DATADIR%%/npcm7xx_bootrom.bin +%%DATADIR%%/openbios-ppc +%%DATADIR%%/openbios-sparc32 +%%DATADIR%%/openbios-sparc64 +%%DATADIR%%/opensbi-riscv32-generic-fw_dynamic.bin +%%DATADIR%%/opensbi-riscv64-generic-fw_dynamic.bin +%%DATADIR%%/palcode-clipper +%%DATADIR%%/petalogix-ml605.dtb +%%DATADIR%%/pxe-e1000.rom +%%DATADIR%%/pxe-eepro100.rom +%%DATADIR%%/pxe-ne2k_pci.rom +%%DATADIR%%/pxe-rtl8139.rom +%%DATADIR%%/pxe-pcnet.rom +%%DATADIR%%/pxe-virtio.rom +%%DATADIR%%/qboot.rom +%%DATADIR%%/qemu-nsis.bmp +%%DATADIR%%/qemu_vga.ndrv +%%DATADIR%%/s390-ccw.img +%%DATADIR%%/s390-netboot.img +%%DATADIR%%/slof.bin +%%DATADIR%%/u-boot-sam460-20100605.bin +%%DATADIR%%/vgabios.bin +%%DATADIR%%/vgabios-ati.bin +%%DATADIR%%/vgabios-cirrus.bin +%%DATADIR%%/vgabios-qxl.bin +%%DATADIR%%/vgabios-stdvga.bin +%%DATADIR%%/vgabios-virtio.bin +%%DATADIR%%/vgabios-vmware.bin +%%DATADIR%%/skiboot.lid +%%DATADIR%%/trace-events-all +%%DATADIR%%/petalogix-s3adsp1800.dtb +%%DATADIR%%/bamboo.dtb +%%DATADIR%%/kvmvapic.bin +%%DATADIR%%/u-boot.e500 +%%DATADIR%%/pvh.bin +%%DATADIR%%/vgabios-bochs-display.bin +%%DATADIR%%/vgabios-ramfb.bin +%%DATADIR%%/vof-nvram.bin +%%DATADIR%%/vof.bin +share/icons/hicolor/128x128/apps/qemu.png +share/icons/hicolor/16x16/apps/qemu.png +share/icons/hicolor/24x24/apps/qemu.png +share/icons/hicolor/256x256/apps/qemu.png +share/icons/hicolor/32x32/apps/qemu.bmp +share/icons/hicolor/32x32/apps/qemu.png +share/icons/hicolor/48x48/apps/qemu.png +share/icons/hicolor/512x512/apps/qemu.png +share/icons/hicolor/64x64/apps/qemu.png +share/icons/hicolor/scalable/apps/qemu.svg +share/applications/qemu.desktop +%%GTK3%%share/locale/bg/LC_MESSAGES/qemu.mo +%%GTK3%%share/locale/de_DE/LC_MESSAGES/qemu.mo +%%GTK3%%share/locale/fr_FR/LC_MESSAGES/qemu.mo +%%GTK3%%share/locale/hu/LC_MESSAGES/qemu.mo +%%GTK3%%share/locale/it/LC_MESSAGES/qemu.mo +%%GTK3%%share/locale/sv/LC_MESSAGES/qemu.mo +%%GTK3%%share/locale/tr/LC_MESSAGES/qemu.mo +%%GTK3%%share/locale/uk/LC_MESSAGES/qemu.mo +%%GTK3%%share/locale/zh_CN/LC_MESSAGES/qemu.mo