Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Get Hal to use udev symlink
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
graffitici
Tux's lil' helper
Tux's lil' helper


Joined: 04 Feb 2004
Posts: 136
Location: Istanbul-Turkey

PostPosted: Mon Jun 25, 2007 7:15 pm    Post subject: Get Hal to use udev symlink Reply with quote

Hi,

I just finished writing a few udev rules in order to use my cell-phone with my laptop. They seem to work perfectly fine by themselves, and I can see the symlinks that are generated. Now, I would also like to configure ivman to mount these drives when they are detected, and open up rox to browse them. However hal doesn't seem to recognize the names that I have created.

The udev rules that I wrote are
Quote:
# phone related stuff
SUBSYSTEMS=="usb", ATTRS{interface}=="Sony Ericsson Memory Stick", NAME="%k", SYMLINK="ericsson/phone"
SUBSYSTEMS=="usb", ATTRS{interface}=="memory2", NAME="%k", SYMLINK="ericsson/mmcard"


I figured the best way to mount these would be to look at block.device, hoping that it would be "/dev/ericsson/phone" and "/dev/ericsson/mmcard". However the output of hal-device shows that those properties are still seen as /dev/sdb1 and /dev/sdc1. Is there a chance to get the udev version to be assigned to block.device? Should I just reverse the NAME and SYMLINK fields above, without breaking anything?

Thanks for your help,
Berk
Back to top
View user's profile Send private message
dritan
Apprentice
Apprentice


Joined: 01 Feb 2006
Posts: 210
Location: New York

PostPosted: Mon Jun 25, 2007 8:05 pm    Post subject: Reply with quote

you can check here for how to name the devices, don't use symlink, use permantent naming insteat (i think its in the howto). and you don't have to use hal or ivman if you just want to launch rox, you can just add
Code:
RUN+==/path/to/rox
in your rule and it will run automatically. I am still new to udev (trying to figure out my external HD as well) so I can't guarantee anything, you also better hear from someone else.
_________________
Regards,
Dritan

Please try to help answer the unanswered
Back to top
View user's profile Send private message
graffitici
Tux's lil' helper
Tux's lil' helper


Joined: 04 Feb 2004
Posts: 136
Location: Istanbul-Turkey

PostPosted: Mon Jun 25, 2007 9:31 pm    Post subject: Reply with quote

As far as I remember, the ideal way of using custom UDEV rules is to include the usual kernel node as NAME="%k", and add the custom device as a SYMLINK. The sample rules in the document you mentioned seemed to approve that

Quote:
BUS=="usb", KERNEL=="sd*", SYSFS{product}=="USB 2.0 Storage Device", NAME="%k", SYMLINK+="usbhd%n"


As for the RUN argument, I don't think that would work in my case, since I want to run rox as a user, and not root. If I were to do that, I would also need to worry about giving root the required permissions for using the regular user's display (through xauth). Since ivman is run as a user, I think that is the most elegant solution. If only I could figure out how to do it... :)

Thanks for the reply,
bB
Back to top
View user's profile Send private message
quatsch
Tux's lil' helper
Tux's lil' helper


Joined: 24 Apr 2005
Posts: 104
Location: New York, NY

PostPosted: Tue Jun 26, 2007 4:59 pm    Post subject: Reply with quote

I use custom devicenames for some of my removable devices. Never had problems (I would be more cautious with devices that must be present for the system to work but removable devices aren't one of those). You could use SYMLINK+="%k" just in case some program expects to find it under the 'standard' name though usually you can tell a program where to find a particular device.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum