ports/opt (3.0): [notify] qemu/qemu-all: add udev rules for /dev/kvm
commit 42d84073ff688b87649265063ff7a949ab36e669 Author: Thomas Penteker <tek@serverop.de> Date: Fri Jun 20 22:29:13 2014 +0200 [notify] qemu/qemu-all: add udev rules for /dev/kvm This change requires you to run the bundled pre-install script, that will a new group 'kvm' with proper permissions for the /dev/kvm device, to allow unprivileged users (members of the kvm group) to run kvm-accelerated qemu instances. Please note that this change prevents non-root and non-kvm members from using /dev/kvm acceleration. diff --git a/qemu-all/.footprint b/qemu-all/.footprint index 5b94c02..68a3c7e 100644 --- a/qemu-all/.footprint +++ b/qemu-all/.footprint @@ -1,6 +1,9 @@ drwxr-xr-x root/root etc/ drwxr-xr-x root/root etc/qemu/ -rw-r--r-- root/root etc/qemu/target-x86_64.conf (EMPTY) +drwxr-xr-x root/root etc/udev/ +drwxr-xr-x root/root etc/udev/rules.d/ +-rw-r--r-- root/root etc/udev/rules.d/60-kvm.rules drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ -rwxr-xr-x root/root usr/bin/qemu-aarch64 diff --git a/qemu-all/Pkgfile b/qemu-all/Pkgfile index 1897e89..078d5e9 100644 --- a/qemu-all/Pkgfile +++ b/qemu-all/Pkgfile @@ -3,7 +3,7 @@ # Maintainer: Thomas Penteker, tek at serverop dot de # Packager: Lucas Hazel, lucas at die dot net dot au # Depends on: libsdl -# Nice to have: libseccomp libiscsi +# Nice to have: libseccomp libiscsi libusb usbredir name=qemu-all version=2.0.0 @@ -38,5 +38,9 @@ build() { install -D -m 644 qemu-img.1 $PKG/usr/man/man1/qemu-img.1 install -D -m 644 qemu-nbd.8 $PKG/usr/man/man8/qemu-nbd.8 + install -d $PKG/etc/udev/rules.d/ + echo 'KERNEL=="kvm", NAME="kvm", OWNER="root", GROUP="kvm", MODE="0660"' > \ + $PKG/etc/udev/rules.d/60-kvm.rules + rm -rf $PKG/usr/share/locale } diff --git a/qemu-all/pre-install b/qemu-all/pre-install new file mode 100755 index 0000000..ece20be --- /dev/null +++ b/qemu-all/pre-install @@ -0,0 +1,2 @@ +#!/bin/sh +getent group kvm || /usr/sbin/groupadd kvm diff --git a/qemu/.footprint b/qemu/.footprint index a7a28c8..df159d6 100644 --- a/qemu/.footprint +++ b/qemu/.footprint @@ -1,6 +1,9 @@ drwxr-xr-x root/root etc/ drwxr-xr-x root/root etc/qemu/ -rw-r--r-- root/root etc/qemu/target-x86_64.conf (EMPTY) +drwxr-xr-x root/root etc/udev/ +drwxr-xr-x root/root etc/udev/rules.d/ +-rw-r--r-- root/root etc/udev/rules.d/60-kvm.rules drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ -rwxr-xr-x root/root usr/bin/qemu-ga diff --git a/qemu/Pkgfile b/qemu/Pkgfile index 894c57b..9a80c3c 100644 --- a/qemu/Pkgfile +++ b/qemu/Pkgfile @@ -39,5 +39,9 @@ build() { install -D -m 644 qemu-img.1 $PKG/usr/man/man1/qemu-img.1 install -D -m 644 qemu-nbd.8 $PKG/usr/man/man8/qemu-nbd.8 + install -d $PKG/etc/udev/rules.d/ + echo 'KERNEL=="kvm", NAME="kvm", OWNER="root", GROUP="kvm", MODE="0660"' > \ + $PKG/etc/udev/rules.d/60-kvm.rules + rm -rf $PKG/usr/share/locale } diff --git a/qemu/pre-install b/qemu/pre-install new file mode 100755 index 0000000..ece20be --- /dev/null +++ b/qemu/pre-install @@ -0,0 +1,2 @@ +#!/bin/sh +getent group kvm || /usr/sbin/groupadd kvm
participants (1)
-
crux@crux.nu