From: Andrey Borzenkov <arvidjaar@mail.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: Generic udev rule for PTP camera
Date: Thu, 16 Nov 2006 17:57:14 +0000 [thread overview]
Message-ID: <200611162057.15841.arvidjaar@mail.ru> (raw)
In-Reply-To: <20061116132734.GA13117@entrouvert.com>
-----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 ACTIONd
> 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
> ACTIONd
> 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
prev parent reply other threads:[~2006-11-16 17:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-16 13:27 Generic udev rule for PTP camera Frederic Peters
2006-11-16 17:57 ` Andrey Borzenkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200611162057.15841.arvidjaar@mail.ru \
--to=arvidjaar@mail.ru \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.