From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Tue, 23 Aug 2005 19:25:26 +0000 Subject: Re: Run hotplug scripts after device node is created? Message-Id: <20050823192526.GA30736@vrfy.org> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Tue, Aug 23, 2005 at 08:25:05PM +0200, Stefan Schweizer wrote: > On 8/22/05, Kay Sievers wrote: > > > currently the script is scanning all devices for a supported one .. is > > > there some variable in a hotplug script to read out the device node? > >=20 > > Sure. DEVNAME. >=20 > thank you .. but I do not seem to be able to access DEVNAME :( >=20 > Any better idea than again guessing and sleeping? >=20 > relevant part of udev.conf: >=20 > SUBSYSTEM=3D"usb", ACTION=3D"add", ENV{PRODUCT}=3D"3f0/0517*", > RUN+=3D"/etc/hotplug/hplj-udev" > SUBSYSTEM=3D"usb", ACTION=3D"add", ENV{PRODUCT}=3D"3f0/1317*", > RUN+=3D"/etc/hotplug/hplj-udev" > SUBSYSTEM=3D"usb", ACTION=3D"add", ENV{PRODUCT}=3D"3f0/2B17*", > RUN+=3D"/etc/hotplug/hplj-udev" > SUBSYSTEM=3D"usb", KERNEL=3D"lp*", ACTION=3D"add", NAME=3D"usb/%k", > SYMLINK+=3D"usb%k", GROUP=3D"lp" > #BUS=3D"usb", KERNEL=3D"lp[0-9]*", NAME=3D"usb/%k", GROUP=3D"lp" >=20 > env of the script: > SUBSYSTEM=3Dusb > DEVPATH=3D/devices/pci0000:00/0000:00:0f.5/usb2/2-2/2-2.1/2-2.1:1.0 > PATH=3D/sbin:/bin:/usr/sbin:/usr/bin > ACTION=ADd > MODALIAS=3Dusb:v03F0p1317d0120dc00dsc00dp00ic07isc01ip02 > PWD=3D/ > UDEVD_EVENT=3D1 > SHLVL=3D1 > HOME=3D/ > DEVICE=3D/proc/bus/usb/002/017 > INTERFACE=3D7/1/2 > PRODUCT?0/1317/120 > TYPE=3D0/0/0 > PHYSDEVBUS=3Dusb > SEQNUM=863 > _=3D/bin/env You are catching the event for the "raw" usb device here. I don't know what device you need to upload the firmware too, but "raw" usb devices don't have a device node in the current kernel only an interface in /proc. You may need to catch the event for the printer interface, not sure. Run "udevmonitor" while connecting the printer, it will show you all events. And "udevmonitor --env" will print the whole environment, where you can possibly see the DEVNAME. Good luck, Kay ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ 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