Jag TROR att /etc/udev/rules.d körs före /lib/udev/rules.d, det är i alla fall mest logiskt. Och sen körs de i nummer ordning där.
Om du tittar på reglerna i /lib/udev/rules.d så har nästan alla av dem nån slags "if XXXXX hoppa över resten av filen", så de reglerna gör bara saker om ingen tidigare regel har lyckats identifiera devicen.
Det finns en README-fil under /usr/Share/doc/udev där det hänvisas till http://www.kernel.org/pub/linux/utils/k ... plug/udev/ fast den sidan verkar vara redirectad...
Det finns också en README.Debian där som säger:
I den finns också en referens till http://www.reactivated.net/writing_udev_rules.html som verkar innehålla bra info om att skriva regler.The /etc/udev/rules.d/ directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The files are read and processed in alphabetical order, and the directives
of matching rules are applied in order.
If a file with the same name is present in more than one of the
/run/udev/rules.d/, /etc/udev/rules.d/ and /lib/udev/rules.d/ directories
then the latter(s) file will be ignored.
Since the order may be important, files have a specific name which
must be considered when adding custom rules. So far have been defined:
- 60: path_id and the other *_id programs are run. persistent links
are set.
- 70: network interfaces are renamed and generated rules for persistent
links are processed.
- 75: the rules generators are run if needed.
- 80: drivers are loaded.
- 91: the default permissions and owners are set.
- 95: $REMOVE_CMD is run, and then processing of tty devices
is stopped with last_rule.
The persistent-*.rules files are generated by the *-generator.rules files
using the /lib/udev/write_*_rules scripts when new devices are detected.
They set stable names for network interfaces and optical devices aliases.
Som ett av de första korta exempel på den sidan hittar man t.ex.
Nu kanske det inte är KERNEL som är bäst att matcha på här utan vendor/device ID, men det är alltså enkelt att sätta ett "eget" namn på devicen så den slipper autodetekteringen.KERNEL=="hdb", NAME="my_spare_disk"
The above rule says: match a device which was named by the kernel as hdb, and instead of calling it hdb, name the device node as my_spare_disk. The device node appears at /dev/my_spare_disk.