LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   load a module before usbhid load's (https://www.linuxquestions.org/questions/linux-hardware-18/load-a-module-before-usbhid-loads-588812/)

adamruss 10-02-2007 03:33 AM

load a module before usbhid load's
 
well... i think the topic say's it :)

if i want to load a module before usbhid load's up where do i write it? (/etc/modules didnt works...)

blackhole54 10-03-2007 05:48 AM

If you're running a sufficiently new version of Linux, I believe /etc/modprobe.conf will do what you want. Use the install primitive to give a command line type argument for what you want. In your case, probably modprobe the prerequisite module followed by modprobing usbhid. When you modprobe usbhid you probably want to use the --ignore-install switch so you don't get into an infinite loop. I've even seen a sleep command put between the two modprobes. Separate the commands with semicolons like you would do in bash.

I am no expert on this (which is why I didn't put something specific between code tags), but I think this is the general direction you want to go.

adamruss 10-03-2007 06:34 AM

but usbhid is allready getting loaded somewhere... (?) and it's not in /etc/modules

i'm running debian so there's no /etc/modprobe.conf - only /etc/modules and /etc/modprobe.d (dir)

blackhole54 10-03-2007 09:47 AM

A thousand pardons! I was not at a Linux machine when I typed that. On Ubuntu (which is based on Debian) there is indeed not a /etc/modprobe.conf. (Although perhaps one could be created and it would work???) But the files in /etc/modprobe.d are treated as if they were part of modprobe.conf.

As an example, when I needed to alter the behavior when the em28xx module was loaded, following directions I found on the Internet, I created the file /etc/modprobe/dvbstick:

Code:

$ cat /etc/modprobe.d/dvbstick
install em28xx /sbin/modprobe --ignore-install em28xx; /bin/sleep 2; /sbin/modprobe em2880-dvb

Now this installs an additional module after the specified module rather than before, as you want, but the basic method is the same.

In your case, I don't know what is loading usbhid, but as I understand it, if whatever it is is using modprobe to do so, the behavior can be altered with a file in /etc/modeprobe.d.


All times are GMT -5. The time now is 04:17 PM.