Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 295179

Summary: app-emulation/virtualbox-modules-3.0.12: udev rules cleanup
Product: Gentoo Linux Reporter: Matthias Schwarzott <zzam>
Component: New packagesAssignee: Patrick Lauer <patrick>
Status: RESOLVED FIXED    
Severity: normal CC: polynomial-c, swapon
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: virtualbox-modules-3.0.8.ebuild patch
virtualbox-modules-3.0.10.ebuild patch
virtualbox-modules-3.0.12.ebuild patch
virtualbox-modules-3.0.12.ebuild patch

Description Matthias Schwarzott gentoo-dev 2009-11-30 12:59:56 UTC
udev rules of app-emulation/virtualbox-modules-3.0.12 could be simplified or even deleted completely:
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="", MODE=""
SUBSYSTEM=="usb_device", GROUP="", MODE=""
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="", MODE=""

1. NAME="vboxdrv" does not add anything as udev assigns it automatically.
2. Empty GROUP and MODE should be removed. What are they for? If you want to keep user root, group as root and mode 0660 then strip them off.
So the second and third rule gets completely useless and can be deleted and your rules file simplifies to nothing.
Comment 1 Alessio Cassibba (X-Drum) 2009-11-30 23:22:20 UTC
i just rewrote the udev rules pushed by the app-emulation/virtualbox-modules
ebuilds, using your (and upstream) guidelines.

In attachment all the needed patches for the existing (in tree) ebuilds.
Comment 2 Alessio Cassibba (X-Drum) 2009-11-30 23:22:48 UTC
Created attachment 211634 [details, diff]
virtualbox-modules-3.0.8.ebuild patch
Comment 3 Alessio Cassibba (X-Drum) 2009-11-30 23:23:05 UTC
Created attachment 211636 [details, diff]
virtualbox-modules-3.0.10.ebuild patch
Comment 4 Alessio Cassibba (X-Drum) 2009-11-30 23:23:20 UTC
Created attachment 211638 [details, diff]
virtualbox-modules-3.0.12.ebuild patch
Comment 5 Matthias Schwarzott gentoo-dev 2009-12-01 07:04:24 UTC
Your new rules are:
1. KERNEL=="vboxdrv", OWNER="root", GROUP="root", MODE="0660"
2. SUBSYSTEM=="usb_device", GROUP="vboxusers", MODE="0644"
3. SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="vboxusers", MODE="0644"

Please don't commit this. Rule number 1 does just re-apply defaults - can be dropped.
Rules 2 and 3 unconditionally chown all libusb devices to group vboxusers. For what devices this is needed?
If it is really needed in some case, please add it commented out.
Comment 6 Alessio Cassibba (X-Drum) 2009-12-01 14:24:36 UTC
Hi,

(In reply to comment #5)
[..]
> Please don't commit this. Rule number 1 does just re-apply defaults - can be
> dropped.
Ok, i will drop it

> Rules 2 and 3 unconditionally chown all libusb devices to group vboxusers. 
> For what devices this is needed?
> If it is really needed in some case, please add it commented out.
Well as said before, upstream adopt and suggests this rules (2 and 3) in order
to have a fully working usb device emulation (available on PUEL edition).
I will comment both rules and add a note on pkg_postinst.

BTW thanks for the hint.
Comment 7 Alessio Cassibba (X-Drum) 2009-12-01 15:15:26 UTC
Created attachment 211699 [details, diff]
virtualbox-modules-3.0.12.ebuild patch

updated patch for the (in tree) virtualbox-modules ebuild,
virtualbox-modules-3.1.0 ebuild updated on jokey's overlay.
Comment 8 Matthias Schwarzott gentoo-dev 2009-12-01 19:11:22 UTC
(In reply to comment #6)
> Well as said before, upstream adopt and suggests this rules (2 and 3) in order
> to have a fully working usb device emulation (available on PUEL edition).
> I will comment both rules and add a note on pkg_postinst.
> 
> BTW thanks for the hint.
> 
Only problem with your approach now is: Until now /etc/udev/rules.d is in CONFIG_PROTECT_MASK, so portage will overwrite changes.
This should be changed, as udev itself installs its rules to /lib/udev/rules.d and other apps, that provide not to be edited rules should also do.
Comment 9 Alessio Cassibba (X-Drum) 2009-12-01 22:36:24 UTC
(In reply to comment #8)
> Only problem with your approach now is: Until now /etc/udev/rules.d is in
> CONFIG_PROTECT_MASK, so portage will overwrite changes.
> This should be changed, as udev itself installs its rules to /lib/udev/rules.d
> and other apps, that provide not to be edited rules should also do.
> 

Ok the problem it's clear, how do you suggest to act in this case?
Comment 10 Matthias Schwarzott gentoo-dev 2009-12-05 16:38:11 UTC
udev-149 ebuild does no longer has /etc/udev/rules.d in CONFIG_PROTECT_MASK.
Comment 11 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2010-05-19 16:54:47 UTC
Can this be closed as fixed?
Comment 12 Matthias Schwarzott gentoo-dev 2010-05-20 19:23:29 UTC
Mark fixed, as requested :)