From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Borzenkov Date: Thu, 16 Nov 2006 17:57:14 +0000 Subject: Re: Generic udev rule for PTP camera Message-Id: <200611162057.15841.arvidjaar@mail.ru> List-Id: References: <20061116132734.GA13117@entrouvert.com> In-Reply-To: <20061116132734.GA13117@entrouvert.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org -----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}=3D"06", SYSFS{bInterfaceSubClass}=3D"01", \ > SYSFS{bInterfaceProtocol}=3D"01", MODE=3D"0660", GROUP=3D"plugdev" > > Unfortunately this doesn't work.=20 I do not have PTP camera to test, but both /dev/bus/usb/... nodes I can cre= ate=20 here point to sysfs device *above* interface. Which effectively means, that= =20 when you rule matches, there is no device to create; and when device is=20 created your rule does not match (because those attributes do not exist on = this level) > Then Marcus Meissner from libgphoto2=20 > suggested to use ENV{INTERFACE}=3D"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=ADd > DEVPATH=3D/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:1.0 > SUBSYSTEM=3Dusb > SEQNUM=1710 > PHYSDEVBUS=3Dusb > DEVICE=3D/proc/bus/usb/001/004 > PRODUCTJ9/30fd/2 > TYPE=3D0/0/0 > INTERFACE=3D6/1/1 > MODALIAS=3Dusb:v04A9p30FDd0002dc00dsc00dp00ic06isc01ip01 > This is your interface [...] > > UEVENT[1163683152.647657] add@/class/usb_device/usbdev1.4 > ACTION=ADd > DEVPATH=3D/class/usb_device/usbdev1.4 > SUBSYSTEM=3Dusb_device > SEQNUM=1714 > PHYSDEVPATH=3D/devices/pci0000:00/0000:00:1d.7/usb1/1-2 > PHYSDEVBUS=3Dusb > PHYSDEVDRIVER=3Dusb > MAJOR=189 > MINOR=3D3 > And here is where your /dev/bus/usb/... node is created. Something like this /could/ work: SYSFS{bInterfaceClass}=3D"06", SYSFS{bInterfaceSubClass}=3D"01", \ SYSFS{bInterfaceProtocol}=3D"01", RUN+=3D"sh -c 'echo ${DEVPATH%/*}=20 >> /tmp/perms'" SUBSYSTEM=3Dudb_device, PROGRAM=3D"grep -q $DEVPATH /tmp/perms", GROUP=3D"p= lugdev"=20 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFXKZ7R6LMutpd94wRAugNAJ9RQn2eyPEc3YIjQ1xyQ5JYdTW91wCfXxnw OJ92KHJAs8C7CGjKTy5n9yM=3Dqm4c -----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=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ 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