udev: String substitutions can be done in ENV, too
[systemd_ALT.git] / rules.d / 70-uaccess.rules.in
blobb82ce04a39d384706a0662b50cc42b77adceb62f
1 #  SPDX-License-Identifier: LGPL-2.1-or-later
3 #  This file is part of systemd.
5 #  systemd is free software; you can redistribute it and/or modify it
6 #  under the terms of the GNU Lesser General Public License as published by
7 #  the Free Software Foundation; either version 2.1 of the License, or
8 #  (at your option) any later version.
10 ACTION=="remove", GOTO="uaccess_end"
11 ENV{MAJOR}=="", GOTO="uaccess_end"
13 # PTP/MTP protocol devices, cameras, portable media players
14 SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG+="uaccess"
16 # Digicams with proprietary protocol
17 ENV{ID_GPHOTO2}=="?*", TAG+="uaccess"
19 # SCSI and USB scanners
20 ENV{libsane_matched}=="yes", TAG+="uaccess"
22 # HPLIP devices (necessary for ink level check and HP tool maintenance)
23 ENV{ID_HPLIP}=="1", TAG+="uaccess"
25 # optical drives
26 SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG+="uaccess"
27 SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", TAG+="uaccess"
29 # Sound devices
30 SUBSYSTEM=="sound", TAG+="uaccess", \
31   OPTIONS+="static_node=snd/timer", OPTIONS+="static_node=snd/seq"
33 # Webcams, frame grabber, TV cards
34 SUBSYSTEM=="video4linux", TAG+="uaccess"
35 SUBSYSTEM=="dvb", TAG+="uaccess"
36 SUBSYSTEM=="media", TAG+="uaccess"
38 # industrial cameras, some webcams, camcorders, set-top boxes, TV sets, audio devices, and more
39 SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_MIDI}=="1", TAG+="uaccess"
40 SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_AUDIO}=="1", TAG+="uaccess"
41 SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_VIDEO}=="1", TAG+="uaccess"
43 # DRI video devices
44 SUBSYSTEM=="drm", KERNEL=="card*", TAG+="uaccess"
45 {% if GROUP_RENDER_UACCESS %}
46 # DRI render nodes
47 SUBSYSTEM=="drm", KERNEL=="renderD*", TAG+="uaccess"
48 {% endif %}
49 {% if DEV_KVM_UACCESS %}
50 # KVM
51 SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="uaccess"
52 {% endif %}
54 # smart-card readers
55 ENV{ID_SMARTCARD_READER}=="?*", TAG+="uaccess"
57 # (USB) authentication devices
58 ENV{ID_SECURITY_TOKEN}=="?*", TAG+="uaccess"
60 # PDA devices
61 ENV{ID_PDA}=="?*", TAG+="uaccess"
63 # Programmable remote control
64 ENV{ID_REMOTE_CONTROL}=="1", TAG+="uaccess"
66 # joysticks
67 SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="uaccess"
69 # color measurement devices
70 ENV{COLOR_MEASUREMENT_DEVICE}=="?*", TAG+="uaccess"
72 # DDC/CI device, usually high-end monitors such as the DreamColor
73 ENV{DDC_DEVICE}=="?*", TAG+="uaccess"
75 # media player raw devices (for user-mode drivers, Android SDK, etc.)
76 SUBSYSTEM=="usb", ENV{ID_MEDIA_PLAYER}=="?*", TAG+="uaccess"
78 # software-defined radio communication devices
79 ENV{ID_SOFTWARE_RADIO}=="?*", TAG+="uaccess"
81 # 3D printers, CNC machines, laser cutters, 3D scanners, etc.
82 ENV{ID_MAKER_TOOL}=="?*", TAG+="uaccess"
84 # Protocol analyzers
85 ENV{ID_SIGNAL_ANALYZER}=="?*", ENV{DEVTYPE}=="usb_device", TAG+="uaccess"
86 ENV{ID_SIGNAL_ANALYZER}=="?*", KERNEL=="ttyACM[0-9]*", TAG+="uaccess"
88 # rfkill / radio killswitches
89 KERNEL=="rfkill", SUBSYSTEM=="misc", TAG+="uaccess"
91 # AV production controllers
92 # Most of these devices use HID for the knobs, faders, buttons, encoders, and jog wheels.
93 SUBSYSTEM=="hidraw", ENV{ID_AV_PRODUCTION_CONTROLLER}=="1", TAG+="uaccess"
95 # Some devices use vendor defined protocols on USB Bulk endpoints for controllers.
96 # Other devices transfer graphics to screens on the device through USB Bulk endpoints.
97 # This also allows accessing HID devices with the libusb backend of hidapi.
98 SUBSYSTEM=="usb", ENV{ID_AV_PRODUCTION_CONTROLLER}=="1", TAG+="uaccess"
100 LABEL="uaccess_end"