LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to load kernel module based on kernel version? (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-load-kernel-module-based-on-kernel-version-321949/)

linetnew 05-10-2005 09:08 AM

how to load kernel module based on kernel version?
 
Hello,
I want to execute my kernel module at start of red hat linux. But i that depends
on which compiled kernel version i am booting. I have compiled kernel 2.6.10 with its name "2.6.10-NEW". So whenever i boot kernel 2.6.10-New it must load kernel module that i have testmodule.o
How to do that in linux shell script and how to execute it at start of linux RH9?

regards,
rahul

slackie1000 05-10-2005 09:20 AM

hi there,

you just implement an "if" with the command "uname" and everything is fine...
something like that..
Code:

#!/bin/sh
kernel=`uname -r`
if [ "$kernel" -eq "XXX" ]; then
 modprobe $whatyouwant
fi

put that in your init scripts - sorry, i have no idea where they are in redhat - and it works..

regards
slackie1000

linetnew 05-10-2005 11:56 AM

But module is in my home directory /home/rahul/testmodule.o
How to use modprobe then ?

slackie1000 05-10-2005 12:45 PM

hi there,

afaik if you are not root, no chance... security reasons...
if you are root, why you don't copy it to the correct directory?
from your home without being root, sorry.. no idea..

regards

slackie1000


All times are GMT -5. The time now is 08:12 AM.