The console rule consists of three keys: one match key (KERNEL) and two assign
keys (MODE, OPTIONS). The KERNEL match rule searches the device list for any items
of the type console. Only exact matches are valid and trigger this rule to be executed.
The MODE key assigns special permissions to the device node, in this case, read and
write permissions to the owner of this device only. The OPTIONS key makes this rule
the last rule to be applied to any device of this type. Any later rule matching this partic-
ular device type does not have any effect.
The serial devices rule is not available in 50-udev-default.rules any-
more, but it is still worth considering. It consists of two match keys (KERNEL and
ATTRS) and one assign key (SYMLINK). The KERNEL key searches for all devices of
the ttyUSB type. Using the * wild card, this key matches several of these devices.
The second match key, ATTRS, checks whether the product attribute le in sysfs
for any ttyUSB device contains a certain string. The assign key (SYMLINK) triggers
the addition of a symbolic link to this device under /dev/pilot. The operator used
in this key (+=) tells udev to additionally perform this action, even if previous or later
rules add other symbolic links. As this rule contains two match keys, it is only applied
if both conditions are met.
The printer rule deals with USB printers and contains two match keys which must
both apply to get the entire rule applied (SUBSYSTEM and KERNEL). Three assign
keys deal with the naming for this device type (NAME), the creation of symbolic device
links (SYMLINK) and the group membership for this device type (GROUP). Using the
* wild card in the KERNEL key makes it match several lp printer devices. Substitutions
are used in both, the NAME and the SYMLINK keys to extend these strings by the internal
device name. For example, the symlink to the rst lp USB printer would read /dev/
usblp0.
The kernel firmware loader rule makes udev load additional rmware by
an external helper script during runtime. The SUBSYSTEM match key searches for the
firmware subsystem. The ACTION key checks whether any device belonging to the
firmware subsystem has been added. The RUN+= key triggers the execution of the
firmware.sh script to locate the rmware that is to be loaded.
Some general characteristics are common to all rules:
• Each rule consists of one or more key value pairs separated by a comma.
212 Reference