Ported from OpenSUSE: Provide an udev rule that not only sets the group of /dev/kvm but also triggers automatic loading of the kernel modules during boot. Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> --- Makefile | 1 + scripts/65-kvm.rules | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) create mode 100644 scripts/65-kvm.rules 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'" -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html