linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Williams <steve@icarus.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Hotplug and USB device removal
Date: Sat, 19 May 2001 04:54:56 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-99024815809140@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-99023795831169@msgid-missing>

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

  parent reply	other threads:[~2001-05-19  4:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-19  2:05 Hotplug and USB device removal Stephen Williams
2001-05-19  3:13 ` Brad Hards
2001-05-19  4:54 ` Stephen Williams [this message]
2001-05-19 10:17 ` Brad Hards
2001-05-19 10:31 ` Brad Hards
2001-05-19 14:09 ` Stephen Williams
2001-05-19 14:13 ` Stephen Williams
2001-05-19 15:57 ` David Brownell
2001-05-19 20:45 ` Greg KH
2001-05-19 21:33 ` Stephen Williams

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=marc-linux-hotplug-99024815809140@msgid-missing \
    --to=steve@icarus.com \
    --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 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).