aboutsummaryrefslogtreecommitdiff
path: root/emulators/kqemu-kmod/files
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/files
parent4b805aff1834c451b52cd021e8328cc3c56eab4c (diff)
downloadports-d7aa9009e069d74f3493c676e3d2fc82438bee6d.tar.gz
ports-d7aa9009e069d74f3493c676e3d2fc82438bee6d.zip
Notes
Diffstat (limited to 'emulators/kqemu-kmod/files')
-rw-r--r--emulators/kqemu-kmod/files/kqemu.in49
-rw-r--r--emulators/kqemu-kmod/files/patch-kqemu-freebsd.c11
2 files changed, 60 insertions, 0 deletions
diff --git a/emulators/kqemu-kmod/files/kqemu.in b/emulators/kqemu-kmod/files/kqemu.in
new file mode 100644
index 000000000000..c8ececdd2226
--- /dev/null
+++ b/emulators/kqemu-kmod/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/files/patch-kqemu-freebsd.c b/emulators/kqemu-kmod/files/patch-kqemu-freebsd.c
index 7e2844d8107f..e1f131452ad2 100644
--- a/emulators/kqemu-kmod/files/patch-kqemu-freebsd.c
+++ b/emulators/kqemu-kmod/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);
+