Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Searching for udev/eudev rule writing a modern how-to.
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
TheLexx
Tux's lil' helper
Tux's lil' helper


Joined: 04 Dec 2005
Posts: 84
Location: Austin Tx

PostPosted: Thu Jun 20, 2013 7:45 pm    Post subject: Searching for udev/eudev rule writing a modern how-to. Reply with quote

I'm looking for a how-to guide for writing my own udev/eudev rules. The newest version of a guide I could find was at http://www.reactivated.net/writing_udev_rules.html, which was last revised in 2008. There have been many changes to the system since then, such as the upgrade from udevinfo to udevadm and the move from /sys/block/ to /sys/class/block/. Back when the udev system was first released, I wrote a few rules that worked with with an old system. Now I have seam to have forgotten the basic of rule writing and many of the tools have changed.

Here is a list of questions I am having difficulty with.

1. How can the auto rule making system be controlled so that it does not messing up the hand written rules?

2. While there can be many SYMLINKs for a device there can only be one NAME for a device. If multiple rules match a device which one gets to chose the NAME?

3. Can the resultant "device name" or "link name" be based on a string supplies by the udeve/eudev system?

example DEVPATH=/devices/pci0000:00/0000:00:11.1/ide0/0.0 -> ...c0d0
DEVPATH=/devices/pci0000:00/0000:00:11.1/ide0/0.1 -> ...c0d1
DEVPATH=/devices/pci0000:00/0000:00:11.1/ide1/1.1 -> ...c1d1

4. Is there a way to have one rule preempt another. Example: If a device that uses usb_storage.ko is recognized as a special device like a camera or an *pod(ipod). I want to assign it a link camera or xpod. If the device is not recognized, I want to link it to thumb0, thumb1, etc. in the order detected without an sort of persistent naming. If the device is determined to be a camera or xpod I do not want to even create a link to thumb(x).

Does anyone know if such a guide exists?
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1507
Location: Switzerland (Romandie)

PostPosted: Thu Jul 04, 2013 12:42 pm    Post subject: Reply with quote

1) It depend of what you mean by messing up.

2) The first rule with a NAME that match fix it. According to 'man udev', "All rules files are collectively sorted and processed in lexical order, ...".

3) In the NAME or SYMLINK key, you can put whatever name you want to use, if it is your question.

4) I think yes, but have no idea how.
_________________
[[[ To any NSA and FBI agents reading that text: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
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