Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 888 - (show annotations) (download)
Tue Oct 13 15:10:19 2009 UTC (14 years, 6 months ago) by niro
File size: 2578 byte(s)
-added missing 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.1 2009-10-13 15:10:19 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 ACTION!="add|change", GOTO="acl_apply"
23
24 # PTP/MTP protocol devices, cameras, portable media players
25 SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p"
26 SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", ENV{ACL_MANAGE}="1"
27
28 # digicams with proprietary protocol
29 ENV{ID_GPHOTO2}=="*?", ENV{ACL_MANAGE}="1"
30
31 # SCSI scanners
32 KERNEL=="sg[0-9]*", ATTRS{type}=="6", ENV{ACL_MANAGE}="1"
33 KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", ENV{ACL_MANAGE}="1"
34
35 # USB scanners
36 ENV{libsane_matched}=="yes", ENV{ACL_MANAGE}="1"
37
38 # HPLIP devices (necessary for ink level check and HP tool maintenance)
39 ENV{ID_HPLIP}=="1", ENV{ACL_MANAGE}="1"
40
41 # optical drives
42 SUBSYSTEM=="block", ENV{ID_CDROM}=="1", ENV{ACL_MANAGE}="1"
43
44 # sound devices
45 SUBSYSTEM=="sound", ENV{ACL_MANAGE}="1"
46 # sound jack-sense
47 SUBSYSTEM=="input", SUBSYSTEMS=="sound", ENV{ACL_MANAGE}="1"
48
49 # webcams, frame grabber, TV cards
50 SUBSYSTEM=="video4linux", ENV{ACL_MANAGE}="1"
51 SUBSYSTEM=="dvb", ENV{ACL_MANAGE}="1"
52
53 # fingerprint readers
54 SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", ENV{ACL_MANAGE}="1"
55
56 # DRI video devices
57 SUBSYSTEM=="drm", KERNEL=="card*", ENV{ACL_MANAGE}="1"
58
59 # KVM
60 SUBSYSTEM=="misc", KERNEL=="kvm", ENV{ACL_MANAGE}="1"
61
62 # smart-card readers
63 ENV{ID_SMARTCARD_READER}=="*?", ENV{ACL_MANAGE}="1"
64
65 # joysticks
66 SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ACL_MANAGE}="1"
67
68 # apply ACL for all locally logged in users
69 LABEL="acl_apply", ENV{ACL_MANAGE}=="?*", TEST=="/var/run/ConsoleKit/database", \
70 RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}"
71
72 LABEL="acl_end"