LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-10-2005, 09:08 AM   #1
linetnew
Member
 
Registered: Apr 2005
Location: India
Posts: 32

Rep: Reputation: 15
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
 
Old 05-10-2005, 09:20 AM   #2
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
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
 
Old 05-10-2005, 11:56 AM   #3
linetnew
Member
 
Registered: Apr 2005
Location: India
Posts: 32

Original Poster
Rep: Reputation: 15
But module is in my home directory /home/rahul/testmodule.o
How to use modprobe then ?
 
Old 05-10-2005, 12:45 PM   #4
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to build NVIDIA kernel module / determin kernel version Night Ink Fedora 2 05-31-2004 05:54 PM
Can't load module :error kernel version mismatch garv Linux - Software 1 04-05-2004 01:47 PM
Xfree prob radeon.o kernel module version is 1.1.1 but version 1.5.0 or newer needed. jimdaworm Slackware 0 10-01-2003 07:27 PM
Sample Driver Module incompatibility with Kernel version (or gcc version) jvs Linux - General 1 06-07-2002 02:40 AM
Module won't load due to Kernel version mismatch salukibob Programming 0 03-31-2001 02:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration