blob: ceaa1b5f7a0627a10b751f54363b7c29683ab0b3 [file] [log] [blame]
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# 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"
# 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", ENV{DEVTYPE}=="usb_device", \
ACTION=="remove", ENV{ID_USB_INTERFACES}=="*:070104:*", \
RUN+="/usr/libexec/ippusb/bridge_stop"