PDA

View Full Version : [kubuntu] 9.04 - udev rules



anewguy
April 26th, 2009, 03:50 AM
I switched from Ubuntu to Kubuntu when I installed 9.04. I had special rules in the udev rules.d folder in a file called 41-cvs-permissions.rules as follows:

SUBSYSTEM=="usb", ENV{devtype}=="usb_device", SYSFS{idVendor}=="0dca", SYSFS{idProduct}=="0027", MODE:="0666"
SUBSYSTEM=="usb", ENV{devtype}=="usb_device", SYSFS{idVendor}=="167b", SYSFS{idProduct}=="0101", MODE:="0666"

So, I created the same file in 9.04, but it doesn't seem to be doing anything. Looking in rules.d, at least for kubuntu and 9.04, there are a bunch of files missing (amongst the 40-basic-permissions.rules), so I can't find how it assigns permissions to usb devices. Seeing no files under 70, I renamed my file to 7-persistent-cvs.rules, but still no difference.

Does anyone know what changed, and where the default permissions are being assigned to USB devices as they used to be in 40-basic-permissions.rules?

Without this, I cannot do low-level device interface claims via libusb unless I am root.

Dave :)

Ruhani04
April 26th, 2009, 06:20 AM
Jaunty has the permission rules under
lib\udev\rules.d.
You might want to check out the following thread:
http://ubuntuforums.org/showthread.php?t=1081973&highlight=permission+rules+jaunty

It worked for me and I got my scanner working with xsane.

\\:D/

anewguy
April 26th, 2009, 08:13 AM
Thank you SO much!! I had just gotten used to the change from before and the syntax change in the statements as well, and then they went and moved them again! Too bad the readme in /etc/udev/rules.d doesn't mention that the rules have moved.

I just made the changes and will be testing shortly.

Thanks again!

Dave :)

anewguy
April 26th, 2009, 08:36 AM
Grrrrrrr -- then they go and put the defaults in 50- instead of in 40- like it used to be. I think they may have changed the syntax as well, as the same rules, put at the end as 96-cvs-permissions.rules still don't seem to do anything.

Dave :)

Ruhani04
April 26th, 2009, 07:43 PM
Yes, everything has changed. I just changed the following line:
# libusb device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0666"

and that took care of my problem.

I hope you find your solution.

anewguy
April 27th, 2009, 12:38 AM
Tried what you just suggested, thinking hey if applies to all usb it should work. Guess what - now it doesn't even see the device! I wish to heck that when they make updates to syntax and change where everything is they would at least broadcast that. Trying to find all of that by reading online is darn near impossible!

Thanks again!
Dave :)

Ruhani04
April 27th, 2009, 02:12 AM
Sorry that I couldn't be of more help.
The way I found out about the new rules and file locations was on bug reports. Those do contain a lot of "insider" info.
Changing "0664" to "0666" shouldn't interfere with usb device detection. It just regulates access permissions so far as I understand.
Hopefully somebody more experienced can guide you.
=;

anewguy
April 27th, 2009, 05:25 AM
Yeah, it's still acting like it did before when they changed these things (I think it was 7.10) - I don't see the device unless I am root. Obviously your syntax should have made it available to the world, so I'm just hoping some guru out there comes up with something. Considering the number of people with scanners and cameras that always detected, you'd think this type of thing would get more attention and more word of mouth. Oh well.

Hey, thanks for your input!! It's been greatly appreciated!!

Dave :)

anewguy
April 27th, 2009, 07:11 AM
I'm going to say this thread is closed for now. I really need my "special" USB devices, and since udev rules have all changed, and apparently the syntax as well, I re-installed regular Ubuntu 8.10. Maybe as time goes by someone will figure out they hosed some of us with this update, just as they did before when they changed udev rules. Until that time, when "special" USB devices aren't just automatically owned by root, and the udev stuff settles down instead of constantly changing, I'm sticking with where I am. I loved kubuntu 9.04, but what seems as an obscure problem to some (heck, some don't even think it IS a problem), I have to stay with something that works.

Thanks for your help!!

Dave :)

anewguy
May 10th, 2009, 12:47 AM
I finally found a solution for this problem: the syntax for the udev rules appears to have changed. Where I had to use SYSFS previously, I now had to go back to what worked a few releases ago: ATTRS. So, I modified that statements somewhat so I could actually see the devices get mounted, and this is the result that works:

SUBSYSTEMS=="usb" ATTRS{manufacturer}=="SMaL" attrs{product}=="Digital Camera" MODE:="0666" SYMLINK+="cvs_still_camera"

SUBSYSTEMS=="usb" ATTRS{manufacturer}=="Pure Digital Inc." attrs{product}=="Saturn" MODE:="0666" SYMLINK+="cvs_camcorder"

I could have used ATTRS{idVendor} and ATTRS(idProduct}, but decided to specify the actual names instead of the 4 character id's as I thought it would be easier to remember in the future.

In addition, the SYMLINK+= creates the name in text as a device in /dev so I can see that (a) the statements really worked (b) the device is mounted.

I know similar types of things had to be done in the past for some scanner and some other cameras. If you are having trouble since going to 9.04, try to remember if you had a special rules file before - if so, you need to recreate it with the new syntax, then call it something like 10-local-permissions.rules, and finally place it (as root) in /lib/udev/rules.d.

Dave :)

unutbu
May 10th, 2009, 01:00 AM
anewguy, thank you for posting your solution. I'm sure many will find the information useful.

This is a command that I have found useful under pre-Jaunty releases for finding appropriate udev attributes for devices:


for dev in $(ls /sys/bus/usb/devices); do udevinfo -ap /sys/bus/usb/devices/$dev; done > udevinfo.txt


I'm wondering, does it still work under Jaunty? Would it have helped you find out that
SYSFS{idVendor}=="0dca" does not work, but ATTRS{...} does?

masonmouse
May 11th, 2009, 06:10 AM
Except the udevinfo command seems to have been replaced with udevadm. Googling for proper syntax to explore the sys tree turned up this command:


udevadm info -a -p `udevadm info -q path -n /dev/sda`

Where "sda" is replaced by your actual device of course. Now if I could just get it working with the serial number since I have two USB sticks of the exact same make that I want it to perform different functions on...