Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to tell udev/hotplug to load a certain module?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
nagoola
n00b
n00b


Joined: 29 Dec 2003
Posts: 47
Location: Germany

PostPosted: Tue Nov 14, 2006 8:04 am    Post subject: how to tell udev/hotplug to load a certain module? Reply with quote

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
View user's profile Send private message
lonrot_m
Apprentice
Apprentice


Joined: 18 Jun 2005
Posts: 274
Location: Mexico

PostPosted: Tue Nov 14, 2006 5:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
Leikor
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 123

PostPosted: Tue Nov 14, 2006 6:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
nagoola
n00b
n00b


Joined: 29 Dec 2003
Posts: 47
Location: Germany

PostPosted: Tue Nov 14, 2006 8:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Leikor
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 123

PostPosted: Tue Nov 14, 2006 8:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum