How to hot unplug?
When a USB device is detached, I want to do something to clear up, like unmount the directory for USB Mass Storage devices. Is there any function in hotplug supporting that?
cheers,
Ming
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Stuff, things, and much much more.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 3 lines · ming deng
When a USB device is detached, I want to do something to clear up, like unmount the directory for USB Mass Storage devices. Is there any function in hotplug supporting that?
You get a notification that the device was removed, but so far nothing uses it. Feel free to develop appropriate patches. In the case of unmounting, I'd look at the issues for mounting devices first. (My expectation is that the 2.5 driverfs and disk model unification work will make that workable.)
One thing that folk have wanted to do is unload drivers that are no longer needed. Although there's a lot of email on linux-kernel about module unload races, the real reason that's not done is that the kernel doesn't track which drivers are needed: only which are in curreng use. Having userspace guess such stuff is error prone at best.
- Dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Stuff, things, and much much more.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 7 lines · David Brownell
Quoted 3 lines · ming deng
When a USB device is detached, I want to do something to clear up, like unmount the directory for USB Mass Storage devices. Is there any function in hotplug supporting that?
Quoted 7 lines
You get a notification that the device was removed, but so far nothing uses it. Feel free to develop appropriate patches. In the case of unmounting, I'd look at the issues for mounting devices first. (My expectation is that the 2.5 driverfs and disk model unification work will make that workable.)
thanks. And I found out $REMOVER works. But can someone tell me the rationale behind using $REMOVER instead of using "remove"?
cheers,
Ming
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Stuff, things, and much much more.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 2 lines · [email protected] said:
thanks. And I found out $REMOVER works. But can someone tell me the rationale behind using $REMOVER instead of using "remove"?
The REMOVER variable is set to be a command to execute when the device is removed. The shell script equivalent of a function pointer:-)
This is very much faster then all the lookups and matching that is done on device add, and is easily tailored to the specific device, as the device add script can set whatever REMOVER is appropriate. It is also compatible with the default behavior of ignoring remove.
Signature · 19 lines
Steve Williams "The woods are lovely, dark and deep. steve at icarus.com But I have promises to keep, steve at picturel.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep." [email protected] [email protected] ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Stuff, things, and much much more. http://thinkgeek.com/sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel