blob: 0fdbcf3d5a02f3951cfcc3afbd95eb695dd9ef5b [file] [log] [blame] [edit]
# Copyright 2021 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# For an ipp-over-usb device, set the group permissions so that it can
# be accessed by libusb without having to run as. Then start the ipp-usb
# bridge.
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
ACTION=="add", \
ENV{ID_USB_INTERFACES}=="*:070104:*", OWNER="root", GROUP="ippusb", \
MODE="0660", RUN+="/usr/libexec/ippusb/bridge_start", TAG+="ippusb"
# For other events, ensure the permissions don't get reset to usb or usbprinter
# by earlier rules. The RUN key is left off so we don't start additional
# copies of ippusb_bridge.
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
ACTION!="remove", \
ENV{ID_USB_INTERFACES}=="*:070104:*", OWNER="root", GROUP="ippusb", \
MODE="0660"
# ippusb_bridge will shut itself down when the USB device is removed, but we
# also want to tell upstart to stop tracking the job. Otherwise it will try to
# respawn ippusb_bridge several times before giving up.
SUBSYSTEM=="usb", TAG=="ippusb", ACTION=="remove", \
RUN+="/usr/libexec/ippusb/bridge_stop"