From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Williams Date: Sat, 19 May 2001 04:54:56 +0000 Subject: Re: Hotplug and USB device removal Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Stephen Williams wrote: > Also, as you guessed, I have a program that loads the ez-usb device > from user mode. bhards@bigpond.net.au said: > Ideally, the loader would be generalized to handle a range of > different formats (automatically, if possible). Well, My loader supports intel hex files that sdcc generates, and it also sets the permisions and creates a soft link if so requested. I've abstracted the loader a bit more so that it is easier to add support for other formats, i.e. S-Records and Adam's hacked format. With this program, my hotplug script looks like this: !/bin/sh # This script is the part of the server that goes into the hotplug # directory. It takes the parameters of the policy agent and makes # calls to the gflashd server. case "$PRODUCT" in 547/2235/*) exec /usr/sbin/gflashd -I /usr/share/gflash/aa55.ihx ;; 12c5/*/*) exec /usr/sbin/gflashd -m 0666 -L/var/run/gflash.lnk ;; esac (This handles the renumeration by detecting the Cypress chip. I haven't programmed the eeprom on this device yet.) My application, then, can just look for the /var/run/gflash.lnk symbolic link to show up, and that is the device appearing and ready. The problem here is that the link persists even when the device is disconnected. The usb.agent script does not pass on remove events to interested scripts. -- Steve Williams "The woods are lovely, dark and deep. steve@icarus.com But I have promises to keep, steve@picturel.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep." _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel