diff mbox

[03/12] Add udev rule

Message ID 20091019105924.3988.4209.stgit@mchn012c.ww002.siemens.net (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Oct. 19, 2009, 10:59 a.m. UTC
None
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 8314833..8614449 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,7 @@  install:
 		if [ -f "$$i" ]; then mv "$$i" "$$i.orig"; fi; \
 	done
 	/sbin/depmod -a $(DEPMOD_VERSION) -b $(DESTDIR)
+	install -m 644 -D scripts/65-kvm.rules $(DESTDIR)/etc/udev/rules.d/65-kvm.rules
 
 tmpspec = .tmp.kvm-kmod.spec
 
diff --git a/scripts/65-kvm.rules b/scripts/65-kvm.rules
new file mode 100644
index 0000000..857b08c
--- /dev/null
+++ b/scripts/65-kvm.rules
@@ -0,0 +1,2 @@ 
+KERNEL=="kvm", MODE="0660", GROUP="kvm"
+ACTION=="add|change", SUBSYSTEM=="dmi", KERNEL=="id", RUN+="/bin/sh -c 'grep -q vmx /proc/cpuinfo && /sbin/modprobe kvm-intel; grep -q svm /proc/cpuinfo && /sbin/modprobe kvm-amd'"