[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Linux has a special userspace /dev
device manager called udev that
deals with, amongst other things, plug-and-play USB devices. It is
recommended to specify so-called udev rules to define access permissions
for these devices instead. These rules typically reside in a file with the
name nn-
descriptive-name.rules
in the directory
/etc/udev/rules.d
. Here, nn is a two-digit number that
determines the lexical order in which the udev rule files are processed.
Rules processed later can overwrite earlier rules, but it not recommended
to put user-generated rules higher than 60, as some of the actions they
require are processed by higher-level system rules.
Here a typical udev rule for allowing an ordinary user access to the plugged-in AVRISP mkII programmer (product ID 0x2104) by Atmel (vendor ID 0x0eb):
|
This furnishes the corresponding device node with 0660
access permissions: this means r/w for the user root
and any user
belonging to the group of the device, which the device driver might assign
to a different group than the default root
. The key of the rule is
the attached TAG
named uaccess
, which has the effect that
the login daemon applies a dynamic user access control list to the device
node making the device usable for the currently logged-in user. When used
in anger, udev rules must appear on one line; above example was broken
into two lines so it fits into the example box.
AVRDUDE’s developer option -c
programmer/u
will show
above suggested udev rule for the named programmer. Wildcards are allowed:
|
Again, each rule must be written as one line: breaking up rules
into two lines was only done to fit AVRDUDE’s output to the boxed display.
USB devices in HID mode require a second rule dealing with the
hidraw
subsystem as seen above.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Stefan Rueger on August 24, 2024 using texi2html 1.82.