View previous topic :: View next topic |
Author |
Message |
nagoola n00b
Joined: 29 Dec 2003 Posts: 47 Location: Germany
|
Posted: Tue Nov 14, 2006 8:04 am Post subject: how to tell udev/hotplug to load a certain module? |
|
|
Hi,
I want to load some modules when I insert a device. I am having the problem that I have to compile ntfs and vfat support into the kernel (which I don't like) just because the moduel does not get loaded - neither when I insert the device nor when I try to mount it. How could I solve this problem?
Thanks, nagoola _________________ Took me a while to be okay with compiling everything on a desktop system - but it was worth it
---
PIIIm-1GHz ' 1024MB RAM ' Trident Chipset / GPU ' 20 GB HDD ' Laptop |
|
Back to top |
|
|
lonrot_m Apprentice
Joined: 18 Jun 2005 Posts: 274 Location: Mexico
|
Posted: Tue Nov 14, 2006 5:38 pm Post subject: |
|
|
i dont really know how to autoload a module when a device is detected, but why don't you compile the ntfs and vfat as modules and then add them as modules at the beginning, just adding the name of the modules in modules.autoload.d file _________________ The only fool bigger than the person who knows it all is the person who argues with him. |
|
Back to top |
|
|
Leikor Tux's lil' helper
Joined: 04 Sep 2003 Posts: 123
|
Posted: Tue Nov 14, 2006 6:10 pm Post subject: |
|
|
It looks like you can use the RUN option in the udev rules to do this. Add something like this at the end of the udev rule for your device. Code: | RUN+="absolute path to script" |
Or if there is only one module you have to load, you can just use "/sbin/modprobe module" instead of a script.
Leikor |
|
Back to top |
|
|
nagoola n00b
Joined: 29 Dec 2003 Posts: 47 Location: Germany
|
Posted: Tue Nov 14, 2006 8:29 pm Post subject: |
|
|
Loading them as modules at the beginning would mean I still have them loaded all the time - I don't know why but for some reason I don't like that.
The udev script thing seems to be a great idea. I am gonna try that and I am sure I can do the exact same thing for unloading it again - which would be what I wanted!!!
Thanks!!! _________________ Took me a while to be okay with compiling everything on a desktop system - but it was worth it
---
PIIIm-1GHz ' 1024MB RAM ' Trident Chipset / GPU ' 20 GB HDD ' Laptop |
|
Back to top |
|
|
Leikor Tux's lil' helper
Joined: 04 Sep 2003 Posts: 123
|
Posted: Tue Nov 14, 2006 8:45 pm Post subject: |
|
|
Here's where I found the information, it'll probably be a very useful site for you
It looks like there is an ACTION environmental variable you can use to detect if the device is plugged in, or unplugged.
Also, when you get it, go ahead and port it, I think I (and others) will be glad to have it.
Leikor |
|
Back to top |
|
|
|