LinuxQuestions.org
Review your favorite Linux distribution.
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 09-19-2003, 11:20 PM   #1
raylpc
Member
 
Registered: Jun 2003
Location: Canada
Distribution: Red Hat 9
Posts: 94

Rep: Reputation: 15
How do I specify the loading order of the modules in RH9?


I have a hot-swap DVD/CDRW drive for my HP xt6050 laptop. I have spent quite some time on the internet to figure out how to make the drive real "hot-swap". And I found something on the Gentoo forum.

I need to load the modules in the following order:

scsi_mod 83876 2 [sr_mod ide-scsi]
ide-scsi 8752 0
cdrom 29504 0 (autoclean) [ide-cd sr_mod]
sr_mod 14392 0 (autoclean) (unused)
ide-cd 30036 0 (autoclean)

In gentoo, there's a file modules.autoload where I can specify the loading order. But in RH9, how do I do that?

Or is there any other way to make my hot-swap drive "hot-swap"? It's very annoying to have to reboot whenever I need to use the drive. (I usually don't have drive plugged in to make my laptop more portable. And after the suspend to ram, I lost the drive too)

Thanks
 
Old 09-19-2003, 11:54 PM   #2
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I think the file you're after is /etc/modules.conf (or /etc/conf.modules). Read the man page for it to learn how to use it; basically, it allows you to specify in detail which modules are loaded before which other modules.
 
Old 09-20-2003, 12:18 AM   #3
raylpc
Member
 
Registered: Jun 2003
Location: Canada
Distribution: Red Hat 9
Posts: 94

Original Poster
Rep: Reputation: 15
Thanks wapcaplet, I read the manual, and found 2 methods:

1. Use
Code:
add above module module-list
OR
Code:
add below module module-list
Entry for these two:
[add] above module module_list
This directive makes it possible for one module to "pull in"
another set of modules on top of itself in a module stack, as
seen in the output of the lsmod(8) command. The above directive
is useful for those circumstances when the dependencies are more
complex than what can be described in the modules.dep dependency
file. This is an optimized case of the post-install and pre-
remove directives. Note that failure of installing the module
will not influence the exit status of modprobe. The optional
add prefix adds the new list to the previous list instead of
replacing it.

[add] below module module_list
This directive makes it possible for one module to "push"
another set of modules below itself in a module stack, as seen
in the output of the lsmod(8) command. The below directive is
useful for those circumstances when the dependencies are more
complex than what can be described in the modules.dep dependency
file. This is an optimized case of the pre-install and post-
remove directives. Note that failure of installing the module
will not influence the exit status of modprobe. The optional
add prefix adds the new list to the previous list instead of
replacing it.

Will they specify the order?

2. Use
Code:
alias some_module off
OR
Code:
alias some_module null
, then in rc.local modprobe in the order I want.

Are these two the methods you intent to show me? Coz my /etc/modules.conf only has some lines about the sound card and netword card, and nothing else. So I think there is a place where you specify what modules to load and their order.

Thanks

Last edited by raylpc; 09-20-2003 at 12:20 AM.
 
Old 09-20-2003, 07:07 AM   #4
coolamit78
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31
Hi...

I can suggest u the way in which i have loaded modules to my startup.

1. As written by you, arrange the modules to be loaded in the required sequence and create a file .......lets suppose u name it

'start_hotswap.sh'

2. Save this shell script in the directory

/usr/local/bin

3. Now open the rc.local file, go to the end and add the following line:

/usr/local/bin/start_hotswap.sh

4. Save the file and exit.

Now next time when u reboot, this script will be loaded automatically at the time of startup.

note - This may not be the most efficient way of getting files loaded at startup, but since i find this way easier and that does not need me to edit the /etc/modules.conf file, so i chose this way.

thanks
 
Old 09-20-2003, 01:18 PM   #5
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Actually what I had in mind was the pre-install, post-install and similar commands. Ex:

pre-install ide-scsi insmod scsi_mod

will load scsi_mod before loading ide-scsi. Though, in my experience, modprobe usually takes care of that stuff for you. Now that I look at your list of modules, it looks more like a simple dependency issue. Since ide-scsi depends on scsi_mod, scsi_mod must be loaded first. Apparently ide-cd depends on all of the previous ones.

What happens if you simply type "modprobe ide-cd"? If it doesn't work, try this (as root):

cd /lib/modules/`uname -r`
depmod -ae

Then try modprobe again. It ought to work; if not, maybe the pre-install commands and such will help you out. Good luck!
 
Old 09-20-2003, 07:25 PM   #6
raylpc
Member
 
Registered: Jun 2003
Location: Canada
Distribution: Red Hat 9
Posts: 94

Original Poster
Rep: Reputation: 15
Thanks, wapcaplet and coolamit78.

I finally figured out the problem. It is not the order that matters. It is the stupid "updating /etc/fstab" thing. If I boot my laptop without the cdrom drive, it will delete my cdrom mount entry in /etc/fstab and won't load scisi emulation, thus I have no devices in /dev to mount even though I plug in the drive later.

Now I just make the /etc/fstab not writable. Is there another way telling the system not to update /etc/fstab every time I boot?

Thanks for all your help.


Last edited by raylpc; 09-20-2003 at 07:26 PM.
 
  


Reply

Tags
loading, modules


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
modules: change load order? (agpgart & radeon) mehlkelm Debian 2 09-21-2004 03:52 PM
Loading modules error after loading compiled kernel td0l2 Linux - Newbie 12 07-28-2004 11:10 AM
Change order of lp and imm modules? cfw Linux - General 0 02-23-2004 05:33 PM
Loading sound modules in order ia64processor Red Hat 3 01-22-2004 08:21 AM
Module loading order johntmills Linux - Software 2 09-24-2002 08:18 AM


All times are GMT -5. The time now is 04:48 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration