LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-27-2003, 05:09 PM   #1
purpleburple
Member
 
Registered: Jun 2002
Location: USA
Distribution: Slackware8.1
Posts: 332

Rep: Reputation: 30
Question about new kernel and modules ....


Hello. I just successfully compiled my new 2.4.20 kernel and have it up and running along with X. When I do a 'lsmod' as 'su' I see a few modules loaded. Question is > the modules are not uncommented in my rc.modules file in rc.d. If I have 2 kernels are the modules loading from the same rc.modules file ( auto-loaded) or is there another file that is loading the modules for my new kernel. Before with my old (2.4.18) kernel I could uncomment a line 'modprobe something' and it would load automatically at boot. Do I use this same rc.modules file for auto loading modules with my new kernel?


thanks
 
Old 03-27-2003, 05:40 PM   #2
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
usually the modules in your new kernel have the same name and do the same job, so loading the same way should be perfectly ok
 
Old 03-27-2003, 05:54 PM   #3
purpleburple
Member
 
Registered: Jun 2002
Location: USA
Distribution: Slackware8.1
Posts: 332

Original Poster
Rep: Reputation: 30
thanks
But I also heard that if your using to seperate kernels and want a file
that loads different modules for each different kernel there is a way to do it. Any help appreciated

thanks
 
Old 03-27-2003, 06:23 PM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
I don't know how often you'd be switching back and forth with these kernels, but you could probably symlink to the desired rc.modules or something.

For example:
You have 3 kernel you want to boot, and want different modules with each kernel. So copy the rc.modules script in the same directory to 3 different names:
cp rc.modules rc.modules.2.4.20
cp rc.modules rc.modules.2.4.19
cp rc.modules. rc.modules.2.4.18

Then edit each to your liking. Remove rc.modules and then symlink to the kernel you will be booting next:
ln -sf rc.modules.2.4.20 rc.modules

There's probably a nicer way to do that using some scripting, but that's probably how I'd do it in such a situation.

You could also look into using modules.conf if that's your forte

Cool
 
Old 03-27-2003, 06:44 PM   #5
purpleburple
Member
 
Registered: Jun 2002
Location: USA
Distribution: Slackware8.1
Posts: 332

Original Poster
Rep: Reputation: 30
thanks
 
Old 03-27-2003, 06:52 PM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
You're Welcome

Cool
 
Old 03-28-2003, 12:23 AM   #7
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0, RHEL5,6), CentOS, SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64, MacOS, Raspian
Posts: 1,141

Rep: Reputation: 66
Quote:
Originally posted by MasterC
... you could probably symlink to the desired rc.modules or something.
You could also use a single rc file and determine which set of modprobe command to run using ``uname -r'' and a case/esac structure that either contained each set modprobe commands or sourced the appropriate file containing the commands.
 
Old 03-28-2003, 12:38 AM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Yeah! But how? That actually seems more appealing, and less of a hassle than my suggestion

Cool
 
Old 03-28-2003, 01:00 AM   #9
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0, RHEL5,6), CentOS, SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64, MacOS, Raspian
Posts: 1,141

Rep: Reputation: 66
Quote:
Originally posted by MasterC
Yeah! But how?
How about a snippet of shell script like:
Code:
KERNEL=`uname -r`
case ${KERNEL} in
'2.4.18')
     modprobe this
     modprobe that
     modprobe theother
     ;;
'2.4.19')
   ...
     ;;
'2.4.20')
    ...
    ;;
*)
    echo "What the...!"
esac
or, using the filename conventions you suggested, it could be as simple as
Code:
KERNEL=`uname -r`
MODFILE=rc.modules.${KERNEL}
if [ -e ${MODFILE} ]
then
     . ${MODFILE}
else
     echo "No rc.modules file for kernel ${KERNEL}!"
fi
Not sure which of these would be simpler to maintain. Personal preference I guess.

Later,
Rick
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New kernel and modules question Tsarok Slackware 8 07-12-2005 01:43 PM
Kernel Modules Question Valhalla Linux - Software 2 01-28-2005 03:40 PM
newbie's question on how to install kernel modules Rammand Linux - Software 1 06-06-2004 10:06 AM
Kernel Modules and modules.conf init Linux - General 0 02-20-2004 07:51 PM
new kernel (2.4.22 up from 2.4.20-6) - missing modules - use old modules? Simon Bridge Linux - Software 1 02-04-2004 06:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration