View previous topic :: View next topic |
Author |
Message |
fsavigny n00b
Joined: 08 Sep 2012 Posts: 24
|
Posted: Sun Dec 09, 2012 9:28 am Post subject: udev: Why has OPTIONS="last_rule" been removed? |
|
|
Dear forum,
I am trying to write udev rules for my various external USB flash (pen) drives and hard disks. While I have now grasped how I always assign the same device node (or symlink) to any specific device, I have not yet figured out how to write "default" rules, in the following sense:
1st rule: if the device is my one and only USB Toshiba xxx hard drive with serial number 24F66G242, always create the symlink /dev/sd_my_toshiba%n
2nd rule: if it is any other USB block device, always create the symlink /dev/sd_anyother%n
I want the 2nd rule to be applied when the first rule does not apply, i.e. make it the default rule. But what happens is that the Toshiba will get assigned /dev/sd_my_toshiba%n AND /dev/sd_anyother%n, because obviously, it is also "any" USB block device (there seems no way of expressing "any other").
I have just found out that in the past, I could simply have added OPTIONS="last_rule" to the first rule, and then the second rule would not have been examined if the first rule matched. The whole WWW sphere seems to be happily using this option, even on recent pages. However, in the udev manpage on my system, "last_rule" does not figure, and the ChangeLog tells me that it has been removed as early as when the version changed from v146 to v147 (or something like that). I'm currently on v171-r9.
Is there any way to get "last_rule" back? Or is there any other way to achieve what I want?
Thanks so much in advance,
Florian |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Sun Dec 09, 2012 10:14 am Post subject: |
|
|
Can use GOTO. Some examples:
Code: | grep GOTO /lib/udev/rules.d/* |
|
|
Back to top |
|
|
fsavigny n00b
Joined: 08 Sep 2012 Posts: 24
|
Posted: Tue Dec 11, 2012 5:56 pm Post subject: |
|
|
Thank you so much!
I realize that OPTIONS="last_rule" can be emulated with GOTO="end", provided there is a LABEL="end" in the end.
It's strange they don't mention this in the manpage, since so much advice on the web mentions OPTIONS="last_rule".
Again, thanks a much! You solved a very annoying problem for me.
Florian |
|
Back to top |
|
|
|
|
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
|
|