aboutsummaryrefslogtreecommitdiff
path: root/emulators/qemu-sbruno
diff options
context:
space:
mode:
authorJuergen Lock <nox@FreeBSD.org>2014-12-30 23:50:20 +0000
committerJuergen Lock <nox@FreeBSD.org>2014-12-30 23:50:20 +0000
commit1a89f2e00bc658677e9f386a0a1538e990497e61 (patch)
treed61813df0ec21cd3ed89cb764bb49d6bf6dfab5f /emulators/qemu-sbruno
parent4c1bb8329eb2f8b42c7932505d7910cc3185709c (diff)
downloadports-1a89f2e00bc658677e9f386a0a1538e990497e61.tar.gz
ports-1a89f2e00bc658677e9f386a0a1538e990497e61.zip
Notes
Diffstat (limited to 'emulators/qemu-sbruno')
-rw-r--r--emulators/qemu-sbruno/Makefile296
-rw-r--r--emulators/qemu-sbruno/distinfo4
-rw-r--r--emulators/qemu-sbruno/files/cdrom-dma-patch10
-rw-r--r--emulators/qemu-sbruno/files/patch-Makefile25
-rw-r--r--emulators/qemu-sbruno/files/patch-include-qemu-aes.h18
-rw-r--r--emulators/qemu-sbruno/files/patch-qemu-doc.texi11
-rw-r--r--emulators/qemu-sbruno/files/patch-qemu-include-net-net.h12
-rw-r--r--emulators/qemu-sbruno/files/qemu-ifdown.sample2
-rw-r--r--emulators/qemu-sbruno/files/qemu-ifup.sample2
-rw-r--r--emulators/qemu-sbruno/pkg-descr20
-rw-r--r--emulators/qemu-sbruno/pkg-message182
-rw-r--r--emulators/qemu-sbruno/pkg-plist135
12 files changed, 717 insertions, 0 deletions
diff --git a/emulators/qemu-sbruno/Makefile b/emulators/qemu-sbruno/Makefile
new file mode 100644
index 000000000000..c06238973e56
--- /dev/null
+++ b/emulators/qemu-sbruno/Makefile
@@ -0,0 +1,296 @@
+# Created by: Juergen Lock <nox@jelal.kn-bremen.de>
+# $FreeBSD$
+
+PORTNAME= qemu
+PORTVERSION= 2.2.50.g20141230
+CATEGORIES= emulators
+MASTER_SITES= GH GHC \
+ LOCAL/nox \
+ LOCAL/nox:dtc \
+ http://people.freebsd.org/~nox/tmp/distfiles/ \
+ http://people.freebsd.org/~nox/tmp/distfiles/:dtc
+PKGNAMESUFFIX?= -sbruno
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
+ dtc-v1.4.0${EXTRACT_SUFX}:dtc
+DIST_SUBDIR= qemu/${PORTVERSION}
+
+MAINTAINER= nox@FreeBSD.org
+COMMENT?= QEMU CPU Emulator - github bsd-user branch
+
+USE_GITHUB= yes
+GH_ACCOUNT= seanbruno
+GH_PROJECT= ${PORTNAME}-bsd-user
+GH_COMMIT= 11db3cc
+GH_TAGNAME= 11db3cc
+HAS_CONFIGURE= yes
+USES= gmake pkgconfig bison perl5 python:2,build
+USE_PERL5= build
+USE_XORG= pixman
+USE_GNOME+= glib20
+PATCH_STRIP= -p1
+MAKE_ENV+= BSD_MAKE="${MAKE}"
+ONLY_FOR_ARCHS= amd64 i386 powerpc powerpc64 # XXX someone wants to debug sparc64 hosts?
+
+OPTIONS_DEFINE= SAMBA X11 GTK2 OPENGL GNUTLS SASL JPEG PNG CURL \
+ CDROM_DMA PCAP USBREDIR X86_TARGETS BSD_USER \
+ STATIC_LINK DOCS
+SAMBA_DESC= samba dependency (for -smb)
+GNUTLS_DESC= gnutls dependency (vnc encryption)
+SASL_DESC= cyrus-sasl dependency (vnc encryption)
+JPEG_DESC= jpeg dependency (vnc lossy compression)
+PNG_DESC= png dependency (vnc compression)
+CDROM_DMA_DESC= IDE CDROM DMA
+PCAP_DESC= pcap dependency (networking with bpf)
+USBREDIR_DESC= usb device network redirection (experimental!)
+X86_TARGETS_DESC= Don't build non-x86 system targets
+BSD_USER_DESC= Also build bsd-user targets (for testing)
+STATIC_LINK_DESC= Statically link the executables
+OPTIONS_DEFAULT=X11 GTK2 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA CURL PCAP
+
+.if !defined(QEMU_USER_STATIC)
+CONFLICTS_INSTALL= qemu-[0-9]* qemu-devel-*
+.endif
+
+.include <bsd.port.options.mk>
+
+CONFIGURE_ARGS+= --localstatedir=/var
+CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib
+CONFIGURE_ARGS+= --disable-smartcard-nss --disable-libssh2
+PORTDOCS= docs qemu-doc.html qemu-tech.html qmp-commands.txt
+
+.if defined(QEMU_USER_STATIC)
+.if ${ARCH} != "amd64"
+CONFIGURE_ARGS+= --target-list=i386-bsd-user,sparc-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,ppc-bsd-user
+.else
+CONFIGURE_ARGS+= --target-list=i386-bsd-user,x86_64-bsd-user,sparc-bsd-user,sparc64-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,mips64-bsd-user,mips64el-bsd-user,ppc-bsd-user,ppc64-bsd-user
+.endif
+.else
+.if ${PORT_OPTIONS:MX86_TARGETS}
+.if ${PORT_OPTIONS:MBSD_USER}
+.if ${ARCH} != "amd64"
+CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu,i386-bsd-user,sparc-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,ppc-bsd-user
+.else
+CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu,i386-bsd-user,x86_64-bsd-user,sparc-bsd-user,sparc64-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,mips64-bsd-user,mips64el-bsd-user,ppc-bsd-user,ppc64-bsd-user
+.endif
+.else
+CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu
+.endif
+.else
+.if empty(PORT_OPTIONS:MBSD_USER)
+CONFIGURE_ARGS+= --disable-bsd-user
+.else
+.if ${ARCH} != "amd64"
+CONFIGURE_ARGS+= --target-list=i386-softmmu,x86_64-softmmu,aarch64-softmmu,alpha-softmmu,arm-softmmu,cris-softmmu,lm32-softmmu,m68k-softmmu,microblaze-softmmu,microblazeel-softmmu,mips-softmmu,mipsel-softmmu,mips64-softmmu,mips64el-softmmu,or32-softmmu,ppc-softmmu,ppcemb-softmmu,ppc64-softmmu,sh4-softmmu,sh4eb-softmmu,sparc-softmmu,sparc64-softmmu,s390x-softmmu,xtensa-softmmu,xtensaeb-softmmu,unicore32-softmmu,moxie-softmmu,i386-bsd-user,sparc-bsd-user,arm-bsd-user,mips-bsd-user,mipsel-bsd-user,ppc-bsd-user
+.endif
+.endif
+.endif
+.endif
+
+.if empty(PORT_OPTIONS:MBSD_USER)
+PLIST_SUB+= BSD_USER="@comment "
+.else
+PLIST_SUB+= BSD_USER=""
+.if ${ARCH} == "sparc64"
+IGNORE= bsd-user targets not tested on sparc64
+.endif
+.endif
+.if empty(PORT_OPTIONS:MBSD_USER) || ${ARCH} != "amd64"
+PLIST_SUB+= BSD_USER64="@comment "
+.else
+PLIST_SUB+= BSD_USER64=""
+.endif
+
+.if ${PORT_OPTIONS:MX86_TARGETS}
+PLIST_SUB+= NONX86="@comment "
+.else
+PLIST_SUB+= NONX86=""
+.endif
+
+.if defined(QEMU_USER_STATIC)
+PLIST_SUB+= SOFTMMU="@comment "
+PLIST_SUB+= STATIC="-static"
+.else
+PLIST_SUB+= SOFTMMU=""
+PLIST_SUB+= STATIC=""
+.endif
+
+#.if ${PORT_OPTIONS:MGNS3}
+#EXTRA_PATCHES+= ${FILESDIR}/hw_e1000_c.patch
+#.endif
+
+WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation
+CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//}
+CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC} --enable-docs \
+ --disable-linux-user --disable-linux-aio \
+ --disable-kvm --disable-xen \
+ --smbd=${LOCALBASE}/sbin/smbd \
+ --enable-debug \
+ --enable-debug-info \
+ --extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"${PREFIX}\\\"
+
+.if empty(PORT_OPTIONS:MX11)
+CONFIGURE_ARGS+= --disable-sdl
+.else
+CONFIGURE_ARGS+= --enable-sdl
+USE_SDL= sdl
+.endif
+
+.if empty(PORT_OPTIONS:MGTK2)
+CONFIGURE_ARGS+= --disable-gtk --disable-vte
+PLIST_SUB+= GTK2="@comment "
+.else
+USE_GNOME+= gtk20 vte
+USES+= gettext
+PLIST_SUB+= GTK2=""
+.endif
+
+.if empty(PORT_OPTIONS:MGNUTLS)
+CONFIGURE_ARGS+= --disable-vnc-tls
+.else
+LIB_DEPENDS+= libgnutls.so:${PORTSDIR}/security/gnutls
+.endif
+
+.if empty(PORT_OPTIONS:MSASL)
+CONFIGURE_ARGS+= --disable-vnc-sasl
+.else
+LIB_DEPENDS+= libsasl2.so:${PORTSDIR}/security/cyrus-sasl2
+.endif
+
+.if empty(PORT_OPTIONS:MJPEG)
+CONFIGURE_ARGS+= --disable-vnc-jpeg
+.else
+LIB_DEPENDS+= libjpeg.so:${PORTSDIR}/graphics/jpeg
+.endif
+
+.if empty(PORT_OPTIONS:MPNG)
+CONFIGURE_ARGS+= --disable-vnc-png
+.else
+LIB_DEPENDS+= libpng.so:${PORTSDIR}/graphics/png
+.endif
+
+.if empty(PORT_OPTIONS:MCURL)
+CONFIGURE_ARGS+= --disable-curl
+.else
+LIB_DEPENDS+= libcurl.so:${PORTSDIR}/ftp/curl
+.endif
+
+.if empty(PORT_OPTIONS:MOPENGL)
+CONFIGURE_ARGS+= --disable-glx
+.else
+USE_GL= yes
+.endif
+
+.if empty(PORT_OPTIONS:MUSBREDIR)
+CONFIGURE_ARGS+= --disable-usb-redir
+.else
+BUILD_DEPENDS+= usbredir>=0.6:${PORTSDIR}/net/usbredir
+RUN_DEPENDS+= usbredir>=0.6:${PORTSDIR}/net/usbredir
+.endif
+
+.if ${PORT_OPTIONS:MPCAP}
+CONFIGURE_ARGS+= --enable-pcap
+.else
+CONFIGURE_ARGS+= --disable-pcap
+.endif
+
+.if ${PORT_OPTIONS:MSTATIC_LINK}
+.if ${PORT_OPTIONS:MGTK2} || ${PORT_OPTIONS:MX11}
+IGNORE= X11 ui cannot be built static
+.endif
+CONFIGURE_ARGS+= --static
+.endif
+
+.if ${PORT_OPTIONS:MSAMBA}
+RUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba36
+.endif
+
+.if ${PORT_OPTIONS:MDOCS}
+BUILD_DEPENDS+= texi2html:${PORTSDIR}/textproc/texi2html
+USES+= makeinfo
+.else
+MAKE_ARGS+= NOPORTDOCS=1
+.endif
+
+.if !defined(STRIP) || ${STRIP} == ""
+CONFIGURE_ARGS+=--disable-strip
+.endif
+
+.if ${ARCH} == "amd64"
+MAKE_ARGS+= ARCH=x86_64
+.endif
+
+.if ${ARCH} == "powerpc"
+MAKE_ARGS+= ARCH=ppc
+.endif
+
+.if ${ARCH} == "powerpc64"
+MAKE_ARGS+= ARCH=ppc64
+.endif
+
+.if ${ARCH} == "sparc64"
+CONFIGURE_ARGS+= --sparc_cpu=v9
+.endif
+
+.if ${OSVERSION} < 900033
+BUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
+CONFIGURE_ENV+= LD=${LOCALBASE}/bin/ld
+CONFIGURE_ENV+= COMPILER_PATH=${LOCALBASE}/bin
+MAKE_ENV+= COMPILER_PATH=${LOCALBASE}/bin
+.endif
+
+CONFIGURE_ARGS+= --python=${PYTHON_CMD}
+
+# -lprocstat actually only _needs_ -lelf after r249666 or r250870 (MFC)
+# but it shouldn't matter much
+post-patch:
+ @${MV} ${WRKDIR}/dtc ${WRKSRC}
+.if ${OSVERSION} < 900000
+ @${REINPLACE_CMD} -e '/LIBS/s|-lprocstat||' ${WRKSRC}/configure
+.else
+ @${REINPLACE_CMD} -e '/LIBS/s|-lprocstat|-lprocstat -lelf|' \
+ ${WRKSRC}/configure
+.endif
+ @${REINPLACE_CMD} -e '/libs_qga=/s|glib_libs|glib_libs -lintl|' ${WRKSRC}/configure
+#.if ${PORT_OPTIONS:MPCAP}
+# @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/pcap-patch
+#.endif
+.if empty(PORT_OPTIONS:MCDROM_DMA)
+ @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/cdrom-dma-patch
+.endif
+ @${REINPLACE_CMD} -E \
+ -e "/^by Tibor .TS. S/s|Sch.*z.$$|Schuetz.|" \
+ ${WRKSRC}/qemu-doc.texi
+ @${REINPLACE_CMD} -E \
+ -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing|" \
+ -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \
+ ${WRKSRC}/Makefile.target
+ @${REINPLACE_CMD} -E \
+ -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing -I.|" \
+ -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \
+ ${WRKSRC}/Makefile
+ @${REINPLACE_CMD} -E \
+ -e "1s|^(#! )/usr/bin/perl|\1${PERL}|" \
+ ${WRKSRC}/scripts/texi2pod.pl
+
+.if ${OSVERSION} >= 800091
+# XXX need to disable usb host code on head while it's not ported to the
+# new usb stack yet
+post-configure:
+ @${REINPLACE_CMD} -E \
+ -e "s|^(HOST_USB=)bsd|\1stub|" \
+ ${WRKSRC}/config-host.mak
+.endif
+
+.if !target(post-install)
+post-install:
+.if ${PORT_OPTIONS:MDOCS}
+ @(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR}/)
+.endif
+ ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup.sample ${STAGEDIR}${PREFIX}/etc
+ ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown.sample ${STAGEDIR}${PREFIX}/etc
+ @(cd ${STAGEDIR}${PREFIX}/etc/qemu && \
+ ${MV} -i target-x86_64.conf target-x86_64.conf.sample)
+ @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-*
+.endif
+
+.include <bsd.port.mk>
diff --git a/emulators/qemu-sbruno/distinfo b/emulators/qemu-sbruno/distinfo
new file mode 100644
index 000000000000..152620658e93
--- /dev/null
+++ b/emulators/qemu-sbruno/distinfo
@@ -0,0 +1,4 @@
+SHA256 (qemu/2.2.50.g20141230/qemu-2.2.50.g20141230.tar.gz) = 17d9b7850032a2537f883b827b9e8a5c6e0208f8141b741624624d79ae9c0377
+SIZE (qemu/2.2.50.g20141230/qemu-2.2.50.g20141230.tar.gz) = 10698531
+SHA256 (qemu/2.2.50.g20141230/dtc-v1.4.0.tar.gz) = 39d0713efd82a27adc065ecb9ef36401c53d5ee87ae1764e2bb243fcd97488e3
+SIZE (qemu/2.2.50.g20141230/dtc-v1.4.0.tar.gz) = 131893
diff --git a/emulators/qemu-sbruno/files/cdrom-dma-patch b/emulators/qemu-sbruno/files/cdrom-dma-patch
new file mode 100644
index 000000000000..4eea657e3bae
--- /dev/null
+++ b/emulators/qemu-sbruno/files/cdrom-dma-patch
@@ -0,0 +1,10 @@
+Index: hw/ide/internal.h
+@@ -27,7 +27,7 @@
+ //#define DEBUG_IDE
+ //#define DEBUG_IDE_ATAPI
+ //#define DEBUG_AIO
+-#define USE_DMA_CDROM
++// #define USE_DMA_CDROM
+
+ /* Bits of HD_STATUS */
+ #define ERR_STAT 0x01
diff --git a/emulators/qemu-sbruno/files/patch-Makefile b/emulators/qemu-sbruno/files/patch-Makefile
new file mode 100644
index 000000000000..ec67d45dc178
--- /dev/null
+++ b/emulators/qemu-sbruno/files/patch-Makefile
@@ -0,0 +1,25 @@
+--- Makefile.orig 2013-11-27 23:15:55.000000000 +0100
++++ Makefile 2014-01-19 15:35:48.000000000 +0100
+@@ -72,7 +72,11 @@
+ HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
+
+ ifdef BUILD_DOCS
++ifdef NOPORTDOCS
++DOCS=qemu.1 qemu-img.1 qemu-nbd.8
++else
+ DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt
++endif
+ ifdef CONFIG_VIRTFS
+ DOCS+=fsdev/virtfs-proxy-helper.1
+ endif
+@@ -311,8 +315,10 @@
+
+ install-doc: $(DOCS)
+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
++ifndef NOPORTDOCS
+ $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
+ $(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
++endif
+ ifdef CONFIG_POSIX
+ $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
+ $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
diff --git a/emulators/qemu-sbruno/files/patch-include-qemu-aes.h b/emulators/qemu-sbruno/files/patch-include-qemu-aes.h
new file mode 100644
index 000000000000..7c9b8d1d52d9
--- /dev/null
+++ b/emulators/qemu-sbruno/files/patch-include-qemu-aes.h
@@ -0,0 +1,18 @@
+--- a/include/qemu/aes.h
++++ b/include/qemu/aes.h
+@@ -10,6 +10,15 @@ struct aes_key_st {
+ };
+ typedef struct aes_key_st AES_KEY;
+
++/* FreeBSD has it's own AES_set_decrypt_key in -lcrypto, avoid conflicts */
++#ifdef __FreeBSD__
++#define AES_set_encrypt_key QEMU_AES_set_encrypt_key
++#define AES_set_decrypt_key QEMU_AES_set_decrypt_key
++#define AES_encrypt QEMU_AES_encrypt
++#define AES_decrypt QEMU_AES_decrypt
++#define AES_cbc_encrypt QEMU_AES_cbc_encrypt
++#endif
++
+ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+ int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
diff --git a/emulators/qemu-sbruno/files/patch-qemu-doc.texi b/emulators/qemu-sbruno/files/patch-qemu-doc.texi
new file mode 100644
index 000000000000..1a7d9ef2ca51
--- /dev/null
+++ b/emulators/qemu-sbruno/files/patch-qemu-doc.texi
@@ -0,0 +1,11 @@
+Index: qemu/qemu-doc.texi
+@@ -985,7 +985,8 @@
+
+ @c man begin SEEALSO
+ The HTML documentation of QEMU for more precise information and Linux
+-user mode emulator invocation.
++user mode emulator invocation, as well as the FreeBSD host notes in
++@file{pkg-message} in the relevant qemu port directory.
+ @c man end
+
+ @c man begin AUTHOR
diff --git a/emulators/qemu-sbruno/files/patch-qemu-include-net-net.h b/emulators/qemu-sbruno/files/patch-qemu-include-net-net.h
new file mode 100644
index 000000000000..401f91246ee1
--- /dev/null
+++ b/emulators/qemu-sbruno/files/patch-qemu-include-net-net.h
@@ -0,0 +1,12 @@
+Index: qemu/include/net/net.h
+@@ -174,8 +174,8 @@ void net_host_device_remove(Monitor *mon
+ int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data);
+ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
+
+-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
+-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
++#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup"
++#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown"
+ #define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper"
+ #define DEFAULT_BRIDGE_INTERFACE "br0"
+
diff --git a/emulators/qemu-sbruno/files/qemu-ifdown.sample b/emulators/qemu-sbruno/files/qemu-ifdown.sample
new file mode 100644
index 000000000000..89d9a9bff436
--- /dev/null
+++ b/emulators/qemu-sbruno/files/qemu-ifdown.sample
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec true
diff --git a/emulators/qemu-sbruno/files/qemu-ifup.sample b/emulators/qemu-sbruno/files/qemu-ifup.sample
new file mode 100644
index 000000000000..89d9a9bff436
--- /dev/null
+++ b/emulators/qemu-sbruno/files/qemu-ifup.sample
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec true
diff --git a/emulators/qemu-sbruno/pkg-descr b/emulators/qemu-sbruno/pkg-descr
new file mode 100644
index 000000000000..ff08c4afa0dc
--- /dev/null
+++ b/emulators/qemu-sbruno/pkg-descr
@@ -0,0 +1,20 @@
+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. 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.
+
+http://wiki.qemu.org/Main_Page
+
+This is building sbruno's bsd-user github branch:
+
+WWW: https://github.com/seanbruno/qemu-bsd-user/commits/bsd-user
diff --git a/emulators/qemu-sbruno/pkg-message b/emulators/qemu-sbruno/pkg-message
new file mode 100644
index 000000000000..9292512f5cfe
--- /dev/null
+++ b/emulators/qemu-sbruno/pkg-message
@@ -0,0 +1,182 @@
+FreeBSD host notes
+==================
+
+- Needs to set net.link.tap.user_open sysctl in order to use /dev/tap*
+ networking as non-root. Don't forget to adjust device node permissions in
+ /etc/devfs.rules.
+
+- slirp (usermode networking) is fixed now in cvs, on FreeSBIE 1.0 guests you
+ still have to manually do: echo nameserver 10.0.2.3 >/etc/resolv.conf but
+ i've been told that that's normal. (fixed on FreeSBIE 1.1.) And you have
+ to wait a bit for dhclient to do its thing; traffic to address 10.0.2.2 is
+ routed to 127.1 on the host.
+
+- Expect timer problems when guest kernel HZ is > hosts, for example time
+ sleep 1 takes 49 seconds and booting sleeps for minutes at the acd0 probe
+ with a FreeSBIE 1.0 guest, thats because its kernel is built with HZ=5000,
+ and FreeBSD's default is 100... (no longer a problem with FreeSBIE 1.1.)
+ 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.)
+
+- Update: the above problem has gotten worse with FreeBSD guests
+ somewhere before 8.0, mainly since the kernel now usually wants
+ double or even quadruple number of timer irqs compared to HZ if
+ it detects an apic (and at least early versions of FreeBSD 8 had
+ a bug that essentially halved qemu's clock rate too); the only
+ reason you usually don't see symptoms of this with FreeBSD 8
+ guests is they automatically reduce their HZ to 100 when running
+ in a VM while the default for the host kernel is still HZ=1000.
+ Workaround: you can disable the apic clock in the guest by setting
+
+ hint.apic.0.clock="0"
+
+ in loader.conf(5) (or manually at the loader prompt), if that
+ doesn't work the only things you can do is either reduce the
+ guest's HZ to, say, 100 by setting e.g.
+
+ kern.hz="100"
+
+ from the loader as above (which usually is a good idea in a VM
+ anyway and FreeBSD 8 now does by itself as mentioned), or otherwise
+ increase the host's HZ to 2000 or even 4000 from the loader in
+ the same way.
+
+- The -smb option (smb-export local dir to guest using the default
+ slirp networking) needs the net/samba36 port/package installed
+ in addition to qemu. (SAMBA knob.)
+
+- If you want to use usb devices connected to the host in the guest
+ yot need either recent 10-current (not tested yet much) or you 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"
+
+- If you want to test the new (in 0.15.0) usb network redirection (USBREDIR
+ option) see this thread by Hans de Goede <hdegoede <at> redhat.com>:
+
+ http://thread.gmane.org/gmane.comp.emulators.qemu/110176/focus=110183
+
+ Quote:
+
+ Example usage:
+
+ 1) Start usbredirserver for a usb device:
+ sudo usbredirserver 045e:0772
+ 2) Start qemu with usb2 support + a chardev talking to usbredirserver +
+ a usb-redir device using this chardev:
+ qemu -usb \
+ -readconfig docs/ich9-ehci-uhci.cfg \
+ -chardev socket,id=usbredirchardev,host=localhost,port=4000 \
+ -device usb-redir,chardev=usbredirchardev,id=usbredirdev ...
+
+ [you would replace docs/ich9-ehci-uhci.cfg with e.g.
+ /usr/local/share/doc/qemu/docs/ich9-ehci-uhci.cfg, but turns out
+ ehci was broken for me here with FreeBSD guests and the previous
+ qemu version at least, I got:
+
+ FETCHENTRY: entry at 22C5484 is of type 2 which is not supported yet
+processing error - resetting ehci HC
+ Assertion failed: (0), function ehci_advance_state, file /data/ports/emulators/qemu-devel/work/qemu-0.15.0/hw/usb-ehci.c, line 2045.
+
+ The new qemu version works better tho.]
+
+- 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.
+
+- (not FreeBSD-specific:) There have been reports of qcow2 corruption with (at
+ least) win2k guests on recent kvm (which uses similar qcow2 code than qemu
+ now, see this thread:
+
+ http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg00713.html -
+
+ the consensus on that thread seems to be that qcow(2) code has always been
+ experimental and you should use raw images if you want reliability; raw is
+ also usually faster.) You should be able to migrate existing images to raw
+ using qemu-img(1)'s convert function; raw doesn't support advanced features
+ like snapshots tho. [a few important qcow2 bugfixed have been committed in
+ the meantime so this _might_ be less of an issue now; and meanwhile there
+ also is the new qed format - I don't know how stable that one is.]
+
+- (also not FreeBSD-specific:) It is recommended to pass raw images using the
+ new -drive syntax, specifying format=raw explicitly in order to avoid
+ malicious guests being able to exploit the format autodetection thats
+ otherwise getting used. (Not that you should run malicious guests anyway,
+ but this eleminates at least a known attack vector.)
+
+- qemu now has improved physical cdrom support, but still there is at
+ least one known problem: you need to have the guest eject the disc if you
+ want to change it/take it out, or otherwise the guest may continue using
+ state (like size) of the old disc. (You can also do like `change ide1-cd0
+ /dev/acd0' in the monitor after taking out the disc if a guest cannot eject
+ it itself.)
+
+- The default configuration location (qemu-ifup script etc.) has been changed
+ from /etc to PREFIX/etc (usually /usr/local/etc). Move your files
+ accordingly.
+
+- The pcap code (-net nic... -net pcap,ifname=...) should work properly now,
+ with only one exception: Advanced features like TSO used on the host
+ interface can cause oversize packets which now do get truncated to avoid
+ confusing/panicing guests but of course still will cause retransmissions.
+ So if you see slow throughput and `pcap_send: packet size > ..., truncating'
+ messages on qemu's tty try disabling TSO etc on the host interface at least
+ while using pcap.
+
+- kqemu is no longer supported in qemu upstream after the 0.11 branch
+ was created, which means also not in this version. (Linux has moved
+ on to kvm now for qemu(-like) virtualization needs, so if you want qemu
+ to go faster and don't want to switch to virtualbox or stick to the older
+ emulators/qemu port which is at 0.11.1 atm and as such still supports
+ kqemu you should help getting the FreeBSD kvm port updated and
+ completed:
+
+ http://wiki.freebsd.org/FabioChecconi/PortingLinuxKVMToFreeBSD
+
+ )
diff --git a/emulators/qemu-sbruno/pkg-plist b/emulators/qemu-sbruno/pkg-plist
new file mode 100644
index 000000000000..9f251700074c
--- /dev/null
+++ b/emulators/qemu-sbruno/pkg-plist
@@ -0,0 +1,135 @@
+%%SOFTMMU%%bin/qemu-ga
+%%SOFTMMU%%bin/qemu-img
+%%SOFTMMU%%bin/qemu-io
+%%SOFTMMU%%bin/qemu-nbd
+%%NONX86%%bin/qemu-system-aarch64
+%%NONX86%%bin/qemu-system-alpha
+%%NONX86%%bin/qemu-system-arm
+%%NONX86%%bin/qemu-system-cris
+%%SOFTMMU%%bin/qemu-system-i386
+%%NONX86%%bin/qemu-system-lm32
+%%NONX86%%bin/qemu-system-m68k
+%%NONX86%%bin/qemu-system-microblaze
+%%NONX86%%bin/qemu-system-microblazeel
+%%NONX86%%bin/qemu-system-mips
+%%NONX86%%bin/qemu-system-mips64
+%%NONX86%%bin/qemu-system-mips64el
+%%NONX86%%bin/qemu-system-mipsel
+%%NONX86%%bin/qemu-system-moxie
+%%NONX86%%bin/qemu-system-or32
+%%NONX86%%bin/qemu-system-ppc
+%%NONX86%%bin/qemu-system-ppc64
+%%NONX86%%bin/qemu-system-ppcemb
+%%NONX86%%bin/qemu-system-s390x
+%%NONX86%%bin/qemu-system-sh4
+%%NONX86%%bin/qemu-system-sh4eb
+%%NONX86%%bin/qemu-system-sparc
+%%NONX86%%bin/qemu-system-sparc64
+%%NONX86%%bin/qemu-system-tricore
+%%NONX86%%bin/qemu-system-unicore32
+%%BSD_USER%%bin/qemu-arm%%STATIC%%
+%%BSD_USER%%bin/qemu-i386%%STATIC%%
+%%BSD_USER%%bin/qemu-mips%%STATIC%%
+%%BSD_USER64%%bin/qemu-mips64%%STATIC%%
+%%BSD_USER64%%bin/qemu-mips64el%%STATIC%%
+%%BSD_USER%%bin/qemu-mipsel%%STATIC%%
+%%BSD_USER%%bin/qemu-ppc%%STATIC%%
+%%BSD_USER64%%bin/qemu-ppc64%%STATIC%%
+%%BSD_USER%%bin/qemu-sparc%%STATIC%%
+%%BSD_USER64%%bin/qemu-sparc64%%STATIC%%
+%%BSD_USER64%%bin/qemu-x86_64%%STATIC%%
+%%SOFTMMU%%bin/qemu-system-x86_64
+%%NONX86%%bin/qemu-system-xtensa
+%%NONX86%%bin/qemu-system-xtensaeb
+%%SOFTMMU%%man/man1/qemu.1.gz
+%%SOFTMMU%%man/man1/qemu-img.1.gz
+%%SOFTMMU%%man/man8/qemu-nbd.8.gz
+%%SOFTMMU%%@sample etc/qemu-ifup.sample
+%%SOFTMMU%%@sample etc/qemu-ifdown.sample
+%%SOFTMMU%%@sample etc/qemu/target-x86_64.conf.sample
+%%SOFTMMU%%%%DATADIR%%/QEMU,tcx.bin
+%%SOFTMMU%%%%DATADIR%%/QEMU,cgthree.bin
+%%SOFTMMU%%%%DATADIR%%/acpi-dsdt.aml
+%%SOFTMMU%%%%DATADIR%%/q35-acpi-dsdt.aml
+%%SOFTMMU%%%%DATADIR%%/bios-256k.bin
+%%SOFTMMU%%%%DATADIR%%/bios.bin
+%%SOFTMMU%%%%DATADIR%%/efi-e1000.rom
+%%SOFTMMU%%%%DATADIR%%/efi-eepro100.rom
+%%SOFTMMU%%%%DATADIR%%/efi-ne2k_pci.rom
+%%SOFTMMU%%%%DATADIR%%/efi-pcnet.rom
+%%SOFTMMU%%%%DATADIR%%/efi-rtl8139.rom
+%%SOFTMMU%%%%DATADIR%%/efi-virtio.rom
+%%SOFTMMU%%%%DATADIR%%/s390-ccw.img
+%%SOFTMMU%%%%DATADIR%%/u-boot.e500
+%%SOFTMMU%%%%DATADIR%%/vgabios.bin
+%%SOFTMMU%%%%DATADIR%%/vgabios-cirrus.bin
+%%SOFTMMU%%%%DATADIR%%/vgabios-qxl.bin
+%%SOFTMMU%%%%DATADIR%%/vgabios-stdvga.bin
+%%SOFTMMU%%%%DATADIR%%/vgabios-vmware.bin
+%%SOFTMMU%%%%DATADIR%%/palcode-clipper
+%%SOFTMMU%%%%DATADIR%%/ppc_rom.bin
+%%SOFTMMU%%%%DATADIR%%/openbios-ppc
+%%SOFTMMU%%%%DATADIR%%/openbios-sparc32
+%%SOFTMMU%%%%DATADIR%%/openbios-sparc64
+%%SOFTMMU%%%%DATADIR%%/pxe-e1000.rom
+%%SOFTMMU%%%%DATADIR%%/pxe-eepro100.rom
+%%SOFTMMU%%%%DATADIR%%/pxe-ne2k_pci.rom
+%%SOFTMMU%%%%DATADIR%%/pxe-rtl8139.rom
+%%SOFTMMU%%%%DATADIR%%/pxe-pcnet.rom
+%%SOFTMMU%%%%DATADIR%%/pxe-virtio.rom
+%%SOFTMMU%%%%DATADIR%%/petalogix-ml605.dtb
+%%SOFTMMU%%%%DATADIR%%/spapr-rtas.bin
+%%SOFTMMU%%%%DATADIR%%/slof.bin
+%%SOFTMMU%%%%DATADIR%%/s390-zipl.rom
+%%SOFTMMU%%%%DATADIR%%/linuxboot.bin
+%%SOFTMMU%%%%DATADIR%%/multiboot.bin
+%%SOFTMMU%%%%DATADIR%%/sgabios.bin
+%%SOFTMMU%%%%DATADIR%%/petalogix-s3adsp1800.dtb
+%%SOFTMMU%%%%DATADIR%%/bamboo.dtb
+%%SOFTMMU%%%%DATADIR%%/kvmvapic.bin
+%%SOFTMMU%%%%DATADIR%%/qemu-icon.bmp
+%%SOFTMMU%%%%DATADIR%%/qemu_logo_no_text.svg
+%%SOFTMMU%%%%DATADIR%%/trace-events
+%%SOFTMMU%%%%DATADIR%%/keymaps/ar
+%%SOFTMMU%%%%DATADIR%%/keymaps/bepo
+%%SOFTMMU%%%%DATADIR%%/keymaps/common
+%%SOFTMMU%%%%DATADIR%%/keymaps/cz
+%%SOFTMMU%%%%DATADIR%%/keymaps/da
+%%SOFTMMU%%%%DATADIR%%/keymaps/de
+%%SOFTMMU%%%%DATADIR%%/keymaps/de-ch
+%%SOFTMMU%%%%DATADIR%%/keymaps/en-gb
+%%SOFTMMU%%%%DATADIR%%/keymaps/en-us
+%%SOFTMMU%%%%DATADIR%%/keymaps/es
+%%SOFTMMU%%%%DATADIR%%/keymaps/et
+%%SOFTMMU%%%%DATADIR%%/keymaps/fi
+%%SOFTMMU%%%%DATADIR%%/keymaps/fo
+%%SOFTMMU%%%%DATADIR%%/keymaps/fr
+%%SOFTMMU%%%%DATADIR%%/keymaps/fr-be
+%%SOFTMMU%%%%DATADIR%%/keymaps/fr-ca
+%%SOFTMMU%%%%DATADIR%%/keymaps/fr-ch
+%%SOFTMMU%%%%DATADIR%%/keymaps/hr
+%%SOFTMMU%%%%DATADIR%%/keymaps/hu
+%%SOFTMMU%%%%DATADIR%%/keymaps/is
+%%SOFTMMU%%%%DATADIR%%/keymaps/it
+%%SOFTMMU%%%%DATADIR%%/keymaps/ja
+%%SOFTMMU%%%%DATADIR%%/keymaps/lt
+%%SOFTMMU%%%%DATADIR%%/keymaps/lv
+%%SOFTMMU%%%%DATADIR%%/keymaps/mk
+%%SOFTMMU%%%%DATADIR%%/keymaps/modifiers
+%%SOFTMMU%%%%DATADIR%%/keymaps/nl
+%%SOFTMMU%%%%DATADIR%%/keymaps/nl-be
+%%SOFTMMU%%%%DATADIR%%/keymaps/no
+%%SOFTMMU%%%%DATADIR%%/keymaps/pl
+%%SOFTMMU%%%%DATADIR%%/keymaps/pt
+%%SOFTMMU%%%%DATADIR%%/keymaps/pt-br
+%%SOFTMMU%%%%DATADIR%%/keymaps/ru
+%%SOFTMMU%%%%DATADIR%%/keymaps/sl
+%%SOFTMMU%%%%DATADIR%%/keymaps/sv
+%%SOFTMMU%%%%DATADIR%%/keymaps/th
+%%SOFTMMU%%%%DATADIR%%/keymaps/tr
+%%GTK2%%share/locale/de_DE/LC_MESSAGES/qemu.mo
+%%GTK2%%share/locale/fr_FR/LC_MESSAGES/qemu.mo
+%%GTK2%%share/locale/it/LC_MESSAGES/qemu.mo
+%%GTK2%%share/locale/hu/LC_MESSAGES/qemu.mo
+%%GTK2%%share/locale/tr/LC_MESSAGES/qemu.mo
+%%GTK2%%share/locale/zh_CN/LC_MESSAGES/qemu.mo