2

I am trying to change the permission on my printer device in OpenWRT (Barrier Breaker 14.07) when the device is mounted. I am having trouble getting the path of the mounted device on the invocation of the hotplug script. This version of openWRT uses procd to monitor hotplugged devices.

I set up a debugging hotplug script in /etc/hotplug.d/usb

logger "hotplug usb: action='$ACTION' product='$PRODUCT' type='$TYPE' interface='$INTERFACE' devicename='$DEVICENAME' devname='$DEVNAME' devpath='$DEVPATH'"

The output of which appears below:

Sat Nov 28 17:42:15 2015 kern.info kernel: [64593.800000] usb 1-1: new full-speed USB device number 10 using ehci-platform
Sat Nov 28 17:42:15 2015 user.notice root: hotplug usb: action='add' product='4b8/84d/100' type='0/0/0' interface='' devicename='1-1' devname='bus/usb/001/010' devpath='/devices/platform/ehci-platform.0/usb1/1-1'
Sat Nov 28 17:42:15 2015 user.notice root: hotplug usb: action='add' product='4b8/84d/100' type='0/0/0' interface='255/255/255' devicename='1-1:1.0' devname='' devpath='/devices/platform/ehci-platform.0/usb1/1-1/1-1:1.0'
Sat Nov 28 17:42:15 2015 user.notice root: hotplug usb: action='add' product='4b8/84d/100' type='0/0/0' interface='7/1/2' devicename='1-1:1.1' devname='' devpath='/devices/platform/ehci-platform.0/usb1/1-1/1-1:1.1'

I am looking for the interface = 7/x/x to tell that the device is a printer, but 'DEVNAME' is set to blank on this invocation. DEVNAME was set on a previous call, but I can't seem to be able to find how to correlate this. Is there an easy way to get the device on the interface call? (Maybe using the device path somehow?)

My eventual goal is to chown lp $DEVNAME, so that CUPS can write to my printer without elevating all the permissions for plugged in devices, and to be able to install this action independently of the rest of the system though opkg.

chicks
  • 3,793
  • 10
  • 27
  • 36
Edward
  • 171
  • 6

0 Answers0