Click to See Complete Forum and Search --> : Easy module question


Clutch
02-25-2002, 03:21 PM
I've been looking around for an answere for this, but for some reason I haven't been able to find one. I have a mandrake 8.1 machine and their are a few modules I need to load everytime I boot in order to get my gamepad to work (joydev and a few others). Anyway, I wanted to know how I can get these modules to get loaded automatically so I don't have to run modprobe on all of them everytime I boot up. Thanks

urinal cake
02-25-2002, 03:54 PM
Wow, I think I know this one.

/etc/modules.conf

OR

/etc/conf.modules

Also because I don't know what the hell I'm talking about, read the modules HOWTO. linuxdoc.org has been down, but google will find it for you somewhere else. Also there's a thing on LKM's somewhere out there that is good. www.google.com/linux (http://www.google.com/linux) should find them both.

Clutch
02-25-2002, 05:53 PM
I just don't understand how these conf files work. I need to get three modules loaded, joydev, emu10k1-gp, and analog. I try to write an alias for each one of these but it doesn't work. Do I need to be more specific within the modules.conf file? I am very simply replacing the word "modprobe" with alias and writing them each into the modules.conf file.

Strogian
02-25-2002, 07:12 PM
Alright, joystick/USB drivers can be problematic with automatic module loading. Is it possible for you to just modprobe one of those modules, and have it load all three? (due to dependencies?) I don't think you can. If I am correct, I'd forget about the whole autoloading thing. I worked for weeks and weeks (or perhaps months and months :)) trying to get that stuff to work for me, and I couldn't get a clean solution. The best thing to do is to just have them always load at boot-up.

About aliases in modules.conf, http://www.linuxdoc.org/HOWTO/mini/Kerneld/configuration.html may be of assistance. Essentially, what you're doing is telling kmod (or kerneld, if you're using that as your autoloader instead) that when it gets a generic request such as "char-major-13" (i.e. a char device with major device number 13 is being accessed, but a required module is not loaded) into something it understands, such as "joydev". So if you wanted to load joydev anytime a char-major-13 device was accesed, you would put this in modules.conf:
alias char-major-13 joydev

Clutch
02-25-2002, 07:34 PM
Ok, I can understand the
"alias char-major-13 joydev"
part, that make sense. But I do have to load all three modules, and I believe in order to find that device it already must have my emu10k1-gp module (because that is what it is hooked up to) loaded and maybe the analog module as well. How can I write an alias that tells the kernel to load emu10k1-gp first, so I can then load joydev?

PimpHolic
02-25-2002, 08:23 PM
possibly insmod?
try man insmod in a terminal

Clutch
02-25-2002, 08:36 PM
The modules are installed, just not loaded at boot. My modules.conf looks like this:

pre-install pcmcia_core CARDMGR_OPTS=-f /etc/rc.d/init.d/pcmcia start
alias usb-interface usb-uhci
alias sound-slot-0 emu10k1
alias eth0 natsemi
alias char-major-195 NVdriver
alias char-major-13 joydev *
above joydev emu10k1-gp analog *

the stars are what I have inserted, when I run lsmod after booting, none of the 3 joystick related drivers have been loaded.

mdwatts
02-26-2002, 06:21 AM
Add those modules to either /etc/modules/default or /etc/rc.d/rc.modules.

Strogian
02-26-2002, 07:41 AM
Yeah, an ABOVE statement may work, but I could never find a foolproof solution using it. Does your autoclean work on those modules, Clutch?

TheCatMan
02-26-2002, 09:39 AM
I had the same problem with loading SCSI modules at start-up under Drake 8.0.

I added insmod foo.mod
insmod bar.mod
insmod alltherest.mod to the beginning of /etc/rc.local.

I also added some pre-install and alias lines to /etc/modules.conf, but if you already have no problem starting those modules manually you might not need to.

Clutch
02-26-2002, 03:45 PM
Thanks a lot everyone, using /etc/modules to list the modules I wanted and /etc/rc.d/rc.modules to load them at boot has got it working now. Thanks!