LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-19-2007, 04:37 AM   #1
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Rep: Reputation: 32
Location for Custom udev Rules


I am using the lastest udev package as in 'Current' and I want to create one or two rules for my own devices, for example my digital camera.

My question is: what is the preferred name for the rule file that I should create for my rules to put in the /etc/udev/rules.d directory?.

Many thanks,

Bill.
 
Old 11-19-2007, 04:52 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,367

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
I would suggest /etc/udev/rules.d/90-local.rules.
You create this for yourself, and it will survive any upgrades to udev rules that you make in the future.
 
Old 11-19-2007, 05:16 AM   #3
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Original Poster
Rep: Reputation: 32
Many thanks.

Someone suggested /etc/udev/rules.d/10-local.rules as an alternative.

Is there any advantage of an 'early' or 'late' rule for something like a USB digatal camera storage device?.

Thanks,

Bill.
 
Old 11-19-2007, 05:33 AM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,367

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
I do not know. I am only passing on what rworkman and PiterPunk suggested in a thread I participated in recently.
 
Old 11-19-2007, 07:35 AM   #5
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
Later would probably be better than sooner in this case. Sooner would run the risk of tangling with an update actually setting a rule for your device that doesn't match what you've been using and possibly breaking something.

...when dealing with overlapping rules in general, you want them to be defined in order of broadest scope to narrowest scope (everywhere/everything, ix86 or ppc machines, stuff that's here, this particular machine).

Last edited by evilDagmar; 11-19-2007 at 08:54 AM.
 
Old 11-19-2007, 08:05 AM   #6
swampdog2002
Member
 
Registered: Jul 2005
Distribution: Slackware 12.2, 13.0, openSUSE 11.2
Posts: 400

Rep: Reputation: 33
I have created a file to create symbolic links for my modem and dvd drives as /etc/udev/rules.d/10-udev.rules and seems to work fine for my purposes. I imagine that is would all depend on the types of rules that you are trying to create, or if they would conflict with and default udev rules.
 
Old 11-19-2007, 12:27 PM   #7
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Original Poster
Rep: Reputation: 32
Many thanks.

It works with either /etc/udev/rules.d/10-local.rules or /etc/udev/rules.d/90-local.rules.


Perhaps one of the above is preferable, but I don't know enough about udev to decide myself.


Bill.
 
Old 11-19-2007, 12:42 PM   #8
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
In the first versions of udev, it read the list of rules and applied the first one that matched. This is a similar behaviour to iptables rules and other situations. In these first versions, the best strategy to create, for example, a symbolic link to a device was to find out the rule matching the device, copying it adding the symbolic links, and finally putting the rule in a file which was read before the rest of files.

However, udev later changed for practical reasons to a model in which every matching rule is applied in order, and some attributes admit the += operator to add more content. Some others only admit the = operator, and some of them may be assigned a fixed value that can't be modified later, with the := operator (see man udev). With this new model the order doesn't matter as much as before, and it can be right or wrong to put your rule before or after the system rules, depending on what you want to do. In general, I'd say it's safer to put your rules after the system rules, and add symbolic links with the += operator.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
udev rules Slackware 11 swampdog2002 Slackware 9 11-17-2006 07:06 PM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 03:43 AM
UDEV Rules Location Toods Slackware 1 04-28-2006 02:23 AM
need help fixing my udev rules or ivman rules hedpe Linux - Hardware 2 03-18-2006 10:07 AM
Networking rules (udev) cassi0peias Linux - Networking 1 10-18-2005 10:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration