Magellan Linux

Contents of /trunk/udev/udev-acl.rules.magellan

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1016 - (show annotations) (download)
Tue Apr 6 23:46:22 2010 UTC (14 years ago) by niro
File size: 3340 byte(s)
-merged with upstream udev-151 rules

1 # /etc/udev/rules/70-acl.rules: device naming rules for udev
2 # $Header: /root/magellan-cvs/src/udev/udev-acl.rules.magellan,v 1.2 2010-04-06 23:46:22 niro Exp $
3 #
4 # There are a number of modifiers that are allowed to be used in some
5 # of the different fields. They provide the following subsitutions:
6 # %n - the "kernel number" of the device.
7 # For example, 'sda3' has a "kernel number" of '3'
8 # %k - the kernel name for the device.
9 # %M - the kernel major number for the device
10 # %m - the kernel minor number for the device
11 # %b - the bus id for the device
12 # %c - the string returned by the PROGRAM. (Note, this doesn't work within
13 # the PROGRAM field for the obvious reason.)
14 # %s{filename} - the content of a sysfs attribute.
15 # %% - the '%' char itself.
16 #
17 # Try not to modify this file, if you wish to change things, create a new rule
18 # file that can be run before this one.
19 #
20
21 ENV{MAJOR}=="", GOTO="acl_end"
22 ENV{ACL_MANAGE}=="0", GOTO="acl_end"
23 ACTION!="add|change", GOTO="acl_apply"
24
25 # PTP/MTP protocol devices, cameras, portable media players
26 SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p"
27 SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", ENV{ACL_MANAGE}="1"
28
29 # digicams with proprietary protocol
30 ENV{ID_GPHOTO2}=="*?", ENV{ACL_MANAGE}="1"
31
32 # SCSI scanners
33 KERNEL=="sg[0-9]*", ATTRS{type}=="6", ENV{ACL_MANAGE}="1"
34 KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", ENV{ACL_MANAGE}="1"
35
36 # USB scanners
37 ENV{libsane_matched}=="yes", ENV{ACL_MANAGE}="1"
38
39 # HPLIP devices (necessary for ink level check and HP tool maintenance)
40 ENV{ID_HPLIP}=="1", ENV{ACL_MANAGE}="1"
41
42 # optical drives
43 SUBSYSTEM=="block", ENV{ID_CDROM}=="1", ENV{ACL_MANAGE}="1"
44
45 # sound devices
46 SUBSYSTEM=="sound", ENV{ACL_MANAGE}="1"
47 # sound jack-sense
48 SUBSYSTEM=="input", SUBSYSTEMS=="sound", ENV{ACL_MANAGE}="1"
49
50 # webcams, frame grabber, TV cards
51 SUBSYSTEM=="video4linux", ENV{ACL_MANAGE}="1"
52 SUBSYSTEM=="dvb", ENV{ACL_MANAGE}="1"
53
54 # IIDC devices: industrial cameras and some webcams
55 SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", ENV{ACL_MANAGE}="1"
56 # AV/C devices: camcorders, set-top boxes, TV sets, audio devices, and more
57 SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", ENV{ACL_MANAGE}="1"
58
59 # old style firewire devices
60 KERNEL=="dv1394-[0-9]*", ENV{ACL_MANAGE}="1"
61 KERNEL=="video1394-[0-9]*", ENV{ACL_MANAGE}="1"
62
63 # fingerprint readers
64 SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", ENV{ACL_MANAGE}="1"
65
66 # GPS devices
67 # Garmin GPSMap 60
68 SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", ENV{ACL_MANAGE}="1"
69
70
71 # DRI video devices
72 SUBSYSTEM=="drm", KERNEL=="card*", ENV{ACL_MANAGE}="1"
73
74 # KVM
75 SUBSYSTEM=="misc", KERNEL=="kvm", ENV{ACL_MANAGE}="1"
76
77 # smart-card readers
78 ENV{ID_SMARTCARD_READER}=="*?", ENV{ACL_MANAGE}="1"
79
80 # joysticks
81 SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", ENV{ACL_MANAGE}="1"
82
83 # smart phones
84 SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", ENV{ACL_MANAGE}="1"
85
86 # color measurement devices
87 ENV{COLOR_MEASUREMENT_DEVICE}=="*?", ENV{ACL_MANAGE}="1"
88
89 # apply ACL for all locally logged in users
90 LABEL="acl_apply", ENV{ACL_MANAGE}=="?*", TEST=="/var/run/ConsoleKit/database", \
91 RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}"
92
93 LABEL="acl_end"