1
0
forked from ports/opt

[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.
This commit is contained in:
Thomas Penteker 2014-06-20 22:29:13 +02:00
parent 4721d86d27
commit 42d84073ff
6 changed files with 19 additions and 1 deletions

View File

@ -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

View File

@ -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
}

2
qemu-all/pre-install Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
getent group kvm || /usr/sbin/groupadd kvm

View File

@ -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

View File

@ -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
}

2
qemu/pre-install Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
getent group kvm || /usr/sbin/groupadd kvm