From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?q?Ajay?= Date: Sat, 10 Aug 2002 04:58:19 +0000 Subject: Re: Hotplugging USB Compact flash reader 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 I figured out enough of usb.agent to be able to trace it to a point where I found that the handbook and the userbook do not have a match for the VID-PID for the reader that I'm using (it's an SCM ORCA cf-ms-sm-sd reader). However I found that it loads (binds?) the correct drivers. So in the "add" event I simply added "mount /dev/sda /mnt/cf" and in the "remove" event I unmounted it. All this is in usb.agent. In Gnome this works fine - an icon comes to the desktop without me having to do anything else. In KDE, there is no icon, but the device is mounted. My question is: 1. Is it correct to modify usb.agent itself? Should I rather include the VID-PID and other details in the handbook/userbook? 2. What is the "match-flag"?? AFAI can see it seems to be a "mask flag" - something to be 'anded' with something else. What is the principle behind it? 3. This is premature, but could someone give me a hint as to which desktop agent I should be talking to? Thanks and regards, Ajay. --- David Brownell wrote: > Ajay wrote: > > HI, > > I am a first timer in this groups. > > I am trying to develop something that can > recognize > > when a USB Flash card reader is plugged in, when a > > media is plugged into the reader, and when either > of > > them are removed. Something like plug and play - > just > > plug in and an icon appears on the desktop which > takes > > you to the diectory. I guess hotplugging should > have > > the answer. > > You're asking about a missing piece, or maybe a > couple. > > - "disk level" hotplug events, reporting new storage > so that it can be mounted. in 2.5 it seems like > at least the "scsi hotplug" may really happen, > which > should solve your USB cardreader issue. > > - hotplug events talking to X11 desktops > > UNIX desktops traditionally "knew" that only a few > devices > might ever get new media, and polled things like > diskette > and cdrom devices from some desktop monitoring > program. > (Maybe not the same one polling for filesystem > changes.) > > Of Linux today, such devices can connect > dynamically, so > any "poll only these devices" architecture just > loses. > > One of the KDE or GNOME object model hooks ought to > do > nicely to let some hotplug agent talk to some > service > running inside the desktop, reusing infrastructure > that'd > otherwise need to be reinvented for a "raw X11" > solution. > > > > I read as much as I could but I can't figure out > where > > /sbin/hotplug and usb.agent fit in. How do I trap > the > > hotplug notification? Do I have to "register"? How > do > > I do that? > > Considering that you'd need to design some of the > hotplug > events needed to address this problem, you'll need > to > understand enough to create those answers yourself > ... or > wait for someone else to address them! :) > > The core observation will be that the hotplug agent > for > some TBD "storage hotplug event" would need to > invoke some > program that's permitted to talk to the relevant > desktop > service, which would pop up your desktop icon. > > - Dave > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > 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 =="The worst thing one can do is not to try, to be aware of what one wants and not give in to it, to spend years in silent hurt wondering if something could have materialized -- and never knowing." - David Viscott __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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