If you have ever modified udev rules, maybe you wondered, what are those numbers in the beginning of a rule name:
60-iwlwifi-led.rules
99-iwlwifi-led.rules
All rules files are collectively sorted and processed in lexical order.
lexical order in simple human language means that the rules are loaded according to the file names of the rules. This in turn usually means that larger number in the beginning of the filename gives it higher priority.
You have to keep in mind that lexical order is not the same as so called natural order (http://sourcefrog.net/projects/natsort/). So in, e.g. Konqueror with Natural sorting of items (Settings - Configure Konqueror - File Management - General), the files will appear this way:
But they will be really loaded in this way:
So better check the order from the console (the lower, the higher priority):
However, there is easier way to make sure, that you rule will not be overwritten: use := operator. So even if your rule name starts with 00-, the rule statement will not be overwritten.
Had I known it before modifying udev rules, I would save a couple of hours. Hope you will do.
Have fun!
References
udev rules doesn't work with small number
http://superuser.com/questions/38028...h-small-number
How to write udev rules
http://hackaday.com/2009/09/18/how-to-write-udev-rules/
Chapter 12. Dynamic Kernel Device Management with udev
https://activedoc.opensuse.org/de/node/1481
udev - dynamic device management
http://manpages.ubuntu.com/manpages/...n7/udev.7.html
60-iwlwifi-led.rules
99-iwlwifi-led.rules
All rules files are collectively sorted and processed in lexical order.
lexical order in simple human language means that the rules are loaded according to the file names of the rules. This in turn usually means that larger number in the beginning of the filename gives it higher priority.
You have to keep in mind that lexical order is not the same as so called natural order (http://sourcefrog.net/projects/natsort/). So in, e.g. Konqueror with Natural sorting of items (Settings - Configure Konqueror - File Management - General), the files will appear this way:
Code:
99-iwlwifi-led.rules
999-my_own.rules
Code:
999-my_own.rules
99-iwlwifi-led.rules
Code:
ls -l /etc/udev/rules.d/
However, there is easier way to make sure, that you rule will not be overwritten: use := operator. So even if your rule name starts with 00-, the rule statement will not be overwritten.
Code:
# Prevent an assignment being overridden by default rules - use the := operator
SUBSYSTEM=="usb", ATTR{idVendor}=="1234", ATTR{idProduct}=="1234", MODE:="0666"
Have fun!
References
udev rules doesn't work with small number
http://superuser.com/questions/38028...h-small-number
How to write udev rules
http://hackaday.com/2009/09/18/how-to-write-udev-rules/
Chapter 12. Dynamic Kernel Device Management with udev
https://activedoc.opensuse.org/de/node/1481
udev - dynamic device management
http://manpages.ubuntu.com/manpages/...n7/udev.7.html