aboutsummaryrefslogtreecommitdiff
path: root/emulators/kqemu-kmod-devel
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2006-12-15 08:38:11 +0000
committerMartin Wilke <miwi@FreeBSD.org>2006-12-15 08:38:11 +0000
commitd7aa9009e069d74f3493c676e3d2fc82438bee6d (patch)
tree775558df95567cee34a5b32cf062149eede5936d /emulators/kqemu-kmod-devel
parent4b805aff1834c451b52cd021e8328cc3c56eab4c (diff)
downloadports-d7aa9009e069d74f3493c676e3d2fc82438bee6d.tar.gz
ports-d7aa9009e069d74f3493c676e3d2fc82438bee6d.zip
Notes
Diffstat (limited to 'emulators/kqemu-kmod-devel')
-rw-r--r--emulators/kqemu-kmod-devel/Makefile4
-rw-r--r--emulators/kqemu-kmod-devel/files/kqemu.in49
-rw-r--r--emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c11
3 files changed, 63 insertions, 1 deletions
diff --git a/emulators/kqemu-kmod-devel/Makefile b/emulators/kqemu-kmod-devel/Makefile
index 70b7bccfed25..8bfcf08aea1d 100644
--- a/emulators/kqemu-kmod-devel/Makefile
+++ b/emulators/kqemu-kmod-devel/Makefile
@@ -7,7 +7,7 @@
PORTNAME= kqemu
PORTVERSION= 1.3.0.p9
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= emulators
MASTER_SITES= http://qemu.org/
PKGNAMESUFFIX= -kmod
@@ -20,6 +20,8 @@ COMMENT= Kernel Acceralator for QEMU CPU Emulator (development version)
ONLY_FOR_ARCHS= i386 amd64
NO_PACKAGE= Depends on kernel, and module not redistributable
+USE_RC_SUBR= kqemu
+
.include <bsd.port.pre.mk>
PLIST_FILES= "include/kqemu/kqemu.h"
diff --git a/emulators/kqemu-kmod-devel/files/kqemu.in b/emulators/kqemu-kmod-devel/files/kqemu.in
new file mode 100644
index 000000000000..c8ececdd2226
--- /dev/null
+++ b/emulators/kqemu-kmod-devel/files/kqemu.in
@@ -0,0 +1,49 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# PROVIDE: kqemu
+# KEYWORD: nojail
+#
+# Add the following line to /etc/rc.conf[.local] to enable kqemu
+#
+# kqemu_enable="YES"
+#
+
+. /etc/rc.subr
+
+name="kqemu"
+load_rc_config $name
+rcvar=`set_rcvar`
+start_cmd=kqemu_start
+stop_cmd=kqemu_stop
+
+kqemu_start()
+{
+ # load aio if needed
+ if ! kldstat -qm aio; then
+ if kldload aio; then
+ info 'aio module loaded.'
+ else
+ warn 'aio module failed to load.'
+ return 1
+ fi
+ fi
+ if ! kldstat -qm kqemu; then
+ if kldload kqemu; then
+ echo 'kqemu module loaded.'
+ else
+ warn 'kqemu module failed to load.'
+ return 1
+ fi
+ fi
+ return 0
+}
+
+kqemu_stop()
+{
+ if kldstat -qm kqemu && kldunload kqemu; then
+ echo 'kqemu module unloaded.'
+ fi
+}
+
+run_rc_command "$1"
diff --git a/emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c b/emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c
index 7e2844d8107f..e1f131452ad2 100644
--- a/emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c
+++ b/emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c
@@ -7,3 +7,14 @@ Index: kqemu-freebsd.c
static struct kqemu_global_state *kqemu_gs = NULL;
#if __FreeBSD_version < 500000
+@@ -321,6 +321,9 @@
+ #if __FreeBSD_version >= 500000
+ dev->si_drv1 = NULL;
+ TAILQ_REMOVE(&kqemuhead, ks, kqemu_ent);
++#if __FreeBSD_version >= 700024
++ dev_relthread(dev);
++#endif
+ destroy_dev(dev);
+ #endif
+ free(ks, M_KQEMU);
+