linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Generic udev rule for PTP camera
@ 2006-11-16 13:27 Frederic Peters
  2006-11-16 17:57 ` Andrey Borzenkov
  0 siblings, 1 reply; 2+ messages in thread
From: Frederic Peters @ 2006-11-16 13:27 UTC (permalink / raw)
  To: linux-hotplug

Hello,

For a long time, since we totally switched from hotplug to udev, we
have been unable in Debian to provide fallback support for unknown
PTP cameras.

Hotplugging any known camera works perfectly but this require
attentive maintenance of matching USB id and always lags behind
constructors.

PTP camera devices define an interface which I thought could be
matched by the following rule:

SYSFS{bInterfaceClass}="06", SYSFS{bInterfaceSubClass}="01", \
  SYSFS{bInterfaceProtocol}="01", MODE="0660", GROUP="plugdev"

Unfortunately this doesn't work.  Then Marcus Meissner from libgphoto2
suggested to use ENV{INTERFACE}="6/1/1" as matcher but I can't get it
to work and Marco d'Itri (Debian udev maintainer) believe this not to
be the correct solution anyway.

Since Marco doesn't have much time for the moment he suggested I asked
the question here, so here it is: what would be the rule to use to set
mode/group on /dev/bus/usb/... device when detecting this device by
bInterface{Class/SubClass/Protocol} ?

For the record, I copied below the output of udevmonitor --env when
plugging in a camera.


Thanks for your support,

        Frederic


UEVENT[1163683152.644771] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2
SUBSYSTEM=usb
SEQNUM\x1708
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb

UEVENT[1163683152.645218] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/usbdev1.4_ep00
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/usbdev1.4_ep00
SUBSYSTEM=usb_endpoint
SEQNUM\x1709
MAJORD2
MINOR=3

UDEV  [1163683152.645698] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2
SUBSYSTEM=usb
SEQNUM\x1708
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
UDEVD_EVENT=1
DRIVER=usb

UEVENT[1163683152.647503] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0
SUBSYSTEM=usb
SEQNUM\x1710
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/001/004
PRODUCTJ9/30fd/2
TYPE=0/0/0
INTERFACE=6/1/1
MODALIAS=usb:v04A9p30FDd0002dc00dsc00dp00ic06isc01ip01

UEVENT[1163683152.647551] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
SUBSYSTEM=usb_endpoint
SEQNUM\x1711
MAJORD2
MINOR=3

UEVENT[1163683152.647585] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
SUBSYSTEM=usb_endpoint
SEQNUM\x1712
MAJORD2
MINOR=3

UEVENT[1163683152.647618] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
SUBSYSTEM=usb_endpoint
SEQNUM\x1713
MAJORD2
MINOR=3

UEVENT[1163683152.647657] add@/class/usb_device/usbdev1.4
ACTION­d
DEVPATH=/class/usb_device/usbdev1.4
SUBSYSTEM=usb_device
SEQNUM\x1714
PHYSDEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR\x189
MINOR=3

UDEV  [1163683152.664824] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/usbdev1.4_ep00
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/usbdev1.4_ep00
SUBSYSTEM=usb_endpoint
SEQNUM\x1709
MAJORD2
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.4_ep00

UDEV  [1163683152.665734] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0
SUBSYSTEM=usb
SEQNUM\x1710
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/001/004
PRODUCTJ9/30fd/2
TYPE=0/0/0
INTERFACE=6/1/1
MODALIAS=usb:v04A9p30FDd0002dc00dsc00dp00ic06isc01ip01
UDEVD_EVENT=1

UDEV  [1163683152.698823] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
SUBSYSTEM=usb_endpoint
SEQNUM\x1711
MAJORD2
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.4_ep81

UDEV  [1163683152.700491] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
SUBSYSTEM=usb_endpoint
SEQNUM\x1712
MAJORD2
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.4_ep02

UDEV  [1163683152.701862] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
SUBSYSTEM=usb_endpoint
SEQNUM\x1713
MAJORD2
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.4_ep83

UDEV  [1163683152.715971] add@/class/usb_device/usbdev1.4
UDEV_LOG=3
ACTION­d
DEVPATH=/class/usb_device/usbdev1.4
SUBSYSTEM=usb_device
SEQNUM\x1714
PHYSDEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR\x189
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/bus/usb/001/004

UEVENT[1163683157.940219] remove@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
SUBSYSTEM=usb_endpoint
SEQNUM\x1715
MAJORD2
MINOR=3

UEVENT[1163683157.940251] remove@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
SUBSYSTEM=usb_endpoint
SEQNUM\x1716
MAJORD2
MINOR=3

UEVENT[1163683157.940278] remove@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
SUBSYSTEM=usb_endpoint
SEQNUM\x1717
MAJORD2
MINOR=3

UEVENT[1163683157.940285] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
SUBSYSTEM=usb_endpoint
SEQNUM\x1718
MAJORD2
MINOR=3

UEVENT[1163683157.940292] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
SUBSYSTEM=usb_endpoint
SEQNUM\x1719
MAJORD2
MINOR=3

UEVENT[1163683157.940298] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
SUBSYSTEM=usb_endpoint
SEQNUM\x1720
MAJORD2
MINOR=3

UDEV  [1163683157.953460] remove@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
UDEV_LOG=3
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
SUBSYSTEM=usb_endpoint
SEQNUM\x1715
MAJORD2
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.4_ep81

UDEV  [1163683157.954286] remove@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
UDEV_LOG=3
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
SUBSYSTEM=usb_endpoint
SEQNUM\x1716
MAJORD2
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.4_ep02

UDEV  [1163683157.954900] remove@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
UDEV_LOG=3
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
SUBSYSTEM=usb_endpoint
SEQNUM\x1717
MAJORD2
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.4_ep83

UDEV  [1163683157.957305] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep81
SUBSYSTEM=usb_endpoint
SEQNUM\x1718
MAJORD2
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.4_ep81

UDEV  [1163683157.958620] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep02
SUBSYSTEM=usb_endpoint
SEQNUM\x1719
MAJORD2
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.4_ep02

UDEV  [1163683157.959884] add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0/usbdev1.4_ep83
SUBSYSTEM=usb_endpoint
SEQNUM\x1720
MAJORD2
MINOR=3
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.4_ep83


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Generic udev rule for PTP camera
  2006-11-16 13:27 Generic udev rule for PTP camera Frederic Peters
@ 2006-11-16 17:57 ` Andrey Borzenkov
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Borzenkov @ 2006-11-16 17:57 UTC (permalink / raw)
  To: linux-hotplug

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 16 November 2006 16:27, Frederic Peters wrote:
> Hello,
>
> For a long time, since we totally switched from hotplug to udev, we
> have been unable in Debian to provide fallback support for unknown
> PTP cameras.
>
> Hotplugging any known camera works perfectly but this require
> attentive maintenance of matching USB id and always lags behind
> constructors.
>
> PTP camera devices define an interface which I thought could be
> matched by the following rule:
>
> SYSFS{bInterfaceClass}="06", SYSFS{bInterfaceSubClass}="01", \
>   SYSFS{bInterfaceProtocol}="01", MODE="0660", GROUP="plugdev"
>
> Unfortunately this doesn't work. 

I do not have PTP camera to test, but both /dev/bus/usb/... nodes I can create 
here point to sysfs device *above* interface. Which effectively means, that 
when you rule matches, there is no device to create; and when device is 
created your rule does not match (because those attributes do not exist on 
this level)

> Then Marcus Meissner from libgphoto2 
> suggested to use ENV{INTERFACE}="6/1/1" as matcher but I can't get it
> to work and Marco d'Itri (Debian udev maintainer) believe this not to
> be the correct solution anyway.
>

I guess it fails for the same reason.

> Since Marco doesn't have much time for the moment he suggested I asked
> the question here, so here it is: what would be the rule to use to set
> mode/group on /dev/bus/usb/... device when detecting this device by
> bInterface{Class/SubClass/Protocol} ?
>
> For the record, I copied below the output of udevmonitor --env when
> plugging in a camera.
>

[...]
>
> UEVENT[1163683152.647503]
> add@/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0 ACTION­d
> DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0
> SUBSYSTEM=usb
> SEQNUM\x1710
> PHYSDEVBUS=usb
> DEVICE=/proc/bus/usb/001/004
> PRODUCTJ9/30fd/2
> TYPE=0/0/0
> INTERFACE=6/1/1
> MODALIAS=usb:v04A9p30FDd0002dc00dsc00dp00ic06isc01ip01
>

This is your interface

[...]
>
> UEVENT[1163683152.647657] add@/class/usb_device/usbdev1.4
> ACTION­d
> DEVPATH=/class/usb_device/usbdev1.4
> SUBSYSTEM=usb_device
> SEQNUM\x1714
> PHYSDEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-2
> PHYSDEVBUS=usb
> PHYSDEVDRIVER=usb
> MAJOR\x189
> MINOR=3
>

And here is where your /dev/bus/usb/... node is created.


Something like this /could/ work:

SYSFS{bInterfaceClass}="06", SYSFS{bInterfaceSubClass}="01", \
  SYSFS{bInterfaceProtocol}="01", RUN+="sh -c 'echo ${DEVPATH%/*} 
>> /tmp/perms'"

SUBSYSTEM=udb_device, PROGRAM="grep -q $DEVPATH /tmp/perms", GROUP="plugdev" 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFXKZ7R6LMutpd94wRAugNAJ9RQn2eyPEc3YIjQ1xyQ5JYdTW91wCfXxnw
OJ92KHJAs8C7CGjKTy5n9yM=qm4c
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-16 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-16 13:27 Generic udev rule for PTP camera Frederic Peters
2006-11-16 17:57 ` Andrey Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).