We may use insmod in init.rc. But, doesn't this force the modules to be loaded into kernel at boot time? Is there any way by which a module is allowed to be loaded "only" when the corresponding devices is (hot) plugged in? (Or, init.rc may really provide a way for this, but I'm not clear about that... Please advise. :'( )
Below is a description according to my understanding for the hotplug-module-loading problem. In a Linux box, the kernel will inform the user space helper, e.g. udev, hotplug, or modprobe, to load the modules directly or indirectly. However, in Android, which user space program will be in charge of loading the module on device insertion? I've just taken a quick look at the init sources. I see that ueventd will be passed the device-add events. However, this program seems to be only used to create the device nodes only... Any further comments or answers are greatly appreciated. William Liang 2011/7/28 Arindam Roy <[email protected]> > Isn't init.rc and init.omapxxx.rc used to register an event, from where in > you can load the module. > And in the application code you can fire that event. > Also, it can be written in such a way, that by default on boot, the module > will get automatically loaded. > -AR > > On Wed, Jul 27, 2011 at 6:03 PM, William W.-Y. Liang < > [email protected]> wrote: > >> Chris, >> >> I think Dani is asking how the module can be loaded dynamically when a >> peripheral device has been plugged in during the run time. (Assume the .ko >> files have been put in the image file.) >> >> To Dani, that is about the hotplug mechanism in the kernel, including >> platform driver, sysfs issues, etc. I believe these have been done in your >> drivers. The rest of the problem is how the modules can be loaded in >> automatically at run time, right? >> >> In current Linux, it basically relies on udev, with the help from sysfs, >> such as uevent. I see the similar features in the source of init for >> Android. However, I still haven't located which file is used to specify the >> config like the way used by udev. (Kinda busy these days. :( ) >> >> Wish the above info could help solve the question, if anyone can provide >> the answer right away. >> >> - William Liang >> >> 2011 7 28 02:02 於 "Chris Stratton" <[email protected]> 寫道: >> >> On Monday, July 25, 2011 3:46:59 AM UTC-4, David_lavi wrote: >> > >> > I have tried , to edit the file but... >> >> >> Have you >> >> 1) verified that you can manually insmod the module successfully from the >> command line? >> >> 2) verified that your changes to the configuration files and copying of >> the module are actually present on the file system after reboot (many >> systems uncompress their root filesystem from an image; changes have to be >> made to the image, not the running filesystem, if they are going to survive >> reboot) >> >> >> -- >> >> unsubscribe: [email protected] >> website: http://groups.google.com/group/and... >> >> -- >> unsubscribe: [email protected] >> website: http://groups.google.com/group/android-kernel >> > > -- > unsubscribe: [email protected] > website: http://groups.google.com/group/android-kernel -- unsubscribe: [email protected] website: http://groups.google.com/group/android-kernel
