Whenever the Kernel detects a change in the device tree (i. e. when a device is added or removed etc.), a
uevent is raised. This uevent is then probed against the udev rules whose defined actions are triggered when the uevent matches the rule criteria.
When Linux is booted, udev takes an inventory of the hardware and loads the appropriate modules (drivers).
Rule files
Udev rules are formulated in rule files.
Every non-empty, uncommented line in a rule file has at least one key-value pair.
There are two types of keys:
All match keys must match against their values in order for the rule to be applied, i. e. for the assignment keys get their values assigned.
Locations for rule files include:
The files in these directories must have a .rules
extension in order to be processed.