Comment 41 for bug 1057024

Revision history for this message
Steve Langasek (vorlon) wrote :

The change that's been uploaded to precise for this is:

diff -u qemu-kvm-1.0+noroms/debian/qemu-kvm.postinst qemu-kvm-1.0+noroms/debian/qemu-kvm.postinst
--- qemu-kvm-1.0+noroms/debian/qemu-kvm.postinst
+++ qemu-kvm-1.0+noroms/debian/qemu-kvm.postinst
@@ -16,2 +16,15 @@
-exit 0
+# if we just installed the package, udev rules aren't picked up yet,
+# so udev created the device (/dev/kvm) with default permissions.
+# Fix it here, but only if the perms are like default.
+# (See #607391)
+
+if [ -c /dev/kvm -a ! -L /dev/kvm ] && [ .$(stat -c %u%g /dev/kvm) = .00 ]
+then
+ chgrp kvm /dev/kvm
+ chmod 0660 /dev/kvm
+ if type setfacl > /dev/null 2>&1; then
+ setfacl -m g::rw /dev/kvm
+ fi
+fi

+exit 0

Please don't do this by hand. The correct way to do this in a maintainer script should be by calling:

    udevadm trigger --subsystem-match=misc --action=change

See xserver-xorg-input-vmmouse, udisks2 for examples of this.

Rejecting this SRU for now. If there's some reason 'udevadm trigger' can't be used here, we can un-reject the previous upload; otherwise, please reupload using udevadm.