Skip to content

Commit

Permalink
Use the video group rather than making devices world-writeable
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanor committed Nov 20, 2016
1 parent 2a9bf59 commit 08b0944
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions udev/98-hdmi2usb-atlys.rules
Expand Up @@ -28,7 +28,7 @@ SUBSYSTEM=="video4linux", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="60b7", \
# Exar "USB UART" on the Atlys
# FIXME: Add an ATTRS{idProduct} here
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e2", \
MODE:="0666"
MODE:="0660", GROUP:="video"
SUBSYSTEM=="tty", ATTRS{idVendor}=="04e2", \
MODE:="0666", \
MODE:="0660", GROUP:="video", \
ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_CANDIDATE}:="0"
2 changes: 1 addition & 1 deletion udev/98-hdmi2usb-opsis.rules
Expand Up @@ -23,6 +23,6 @@ SUBSYSTEM=="video4linux", ATTRS{idVendor}=="2a19", ATTRS{idProduct}=="5442", \

# TOFE LowSpeedIO board
SUBSYSTEM=="usb", ATTRS{idVendor}=="2a19", ATTRS{idProduct}=="5445", \
MODE:="0666"
MODE:="0660", GROUP:="video"
SUBSYSTEM=="tty", ATTRS{idVendor}=="2a19", ATTRS{idProduct}=="5445", \
ENV{ID_HDMI2USB}:="1", ENV{ID_HDMI2USB_BOARD}:="opsis", ENV{ID_HDMI2USB_TTY}:="-aux"
15 changes: 9 additions & 6 deletions udev/99-hdmi2usb-permissions.rules
Expand Up @@ -2,25 +2,28 @@

# USB device for using fxload
SUBSYSTEM=="usb", DRIVER=="usb", ENV{ID_HDMI2USB}=="1", \
MODE:="0666"
MODE:="0660", GROUP:="video"

# Serial control console
SUBSYSTEM=="tty", ENV{ID_HDMI2USB}=="1", \
MODE:="0666"
MODE:="0660", GROUP:="video"

# Video capture device
SUBSYSTEM=="video4linux", ENV{ID_HDMI2USB}=="1", \
MODE:="0666"
MODE:="0660", GROUP:="video"

# Allow the user to unbind the kernel drivers attached to the device
SUBSYSTEM=="usb", DRIVER=="usb", ENV{ID_HDMI2USB}=="1", \
TEST=="$sys$env{DEVPATH}/driver/unbind" \
RUN+="/bin/chmod 0666 $sys$env{DEVPATH}/driver/unbind"
RUN+="/bin/chmod 0660 $sys$env{DEVPATH}/driver/unbind" \
RUN+="/bin/chgrp video $sys$env{DEVPATH}/driver/unbind"

SUBSYSTEM=="tty", ENV{ID_HDMI2USB}=="1", \
TEST=="$sys$env{DEVPATH}/../../driver/unbind" \
RUN+="/bin/chmod 0666 $sys$env{DEVPATH}/../../driver/unbind"
RUN+="/bin/chmod 0660 $sys$env{DEVPATH}/../../driver/unbind" \
RUN+="/bin/chgrp video $sys$env{DEVPATH}/../../driver/unbind"

SUBSYSTEM=="video4linux", ENV{ID_HDMI2USB}=="1", \
TEST=="$sys$env{DEVPATH}/../../driver/unbind" \
RUN+="/bin/chmod 0666 $sys$env{DEVPATH}/../../driver/unbind"
RUN+="/bin/chmod 0660 $sys$env{DEVPATH}/../../driver/unbind" \
RUN+="/bin/chgrp video $sys$env{DEVPATH}/../../driver/unbind"
2 changes: 1 addition & 1 deletion udev/99-hdmi2usbaux-cypress.rules
@@ -1,2 +1,2 @@
# Grant permissions to unconfigured cypress chips.
SUBSYSTEM=="usb", ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="8613", MODE:="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="8613", MODE:="0660", GROUP:="video"
4 changes: 2 additions & 2 deletions udev/99-hdmi2usbaux-ixo-usb-jtag.rules
@@ -1,3 +1,3 @@
# Grant permissions to ixo-usb-jtag devices.
SUBSYSTEM=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="06ad", MODE:="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="06ad", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}:="1", ENV{ID_MM_CANDIDATE}:="0"
SUBSYSTEM=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="06ad", MODE:="0660", GROUP:="video"
SUBSYSTEM=="tty", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="06ad", MODE:="0660", GROUP:="video", ENV{ID_MM_DEVICE_IGNORE}:="1", ENV{ID_MM_CANDIDATE}:="0"

0 comments on commit 08b0944

Please sign in to comment.