LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-01-2011, 12:47 PM   #1
skelter42
LQ Newbie
 
Registered: Jan 2008
Posts: 20

Rep: Reputation: 5
Conceptual Question About Modules


Backstory: I was working on getting my Broadcom4322 wireless adapter working on my slackware 13.1 install. During this (successful) process, a portion is to have the driver module load at startup.

The commands to do so were:
depmod -a
rmmod wl
modprobe wl

And then to put modprobe wl into rc.local.

OK, so I read the man pages on each of the commands. I get that depmod -a creates a list of module dependencies. But apparently rmmod removes the module from the kernel, then modprobe adds it back?

Can someone point me to a resource that explains the process to me? Or explain what is happening in simpler terms?

I understand that putting modprobe wl into rc.local causes the driver to be loaded at startup. I just don't get the what the other steps are doing.

Thanks,
 
Old 07-02-2011, 06:31 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello skelter42,

as far as I understand the commands they mean the following
Code:
depmod -a
configure the dependencies for all modules.
Code:
rmmod wl
unload the module wl
Code:
modprobe wl
load the module wl again but this time with the dependencies.

So I think this three commands only have to be executed together if you have loaded a module at first without the dependencies. So I would guess that (once depmod has been executed) you only need the line
Code:
modprobe wl
in your rc.local.

Markus
 
Old 07-02-2011, 06:39 AM   #3
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
Quote:
I get that depmod -a creates a list of module dependencies. But apparently rmmod removes the module from the kernel, then modprobe adds it back?
Yes, that's exactly right. But you need to understand the difference between the module file on disk, and the copy of the module that's loaded into memory as part of the currently running kernel. The kernel will not update its copy of the module just because you have changed (or added) the file on disk.

Also, the kernel uses a list of module interdependencies and symbols. This list needs to be rebuilt every time a module is added or changed. The command that does this is "depmod -a".

Having done that, you would remove the old version of the module (if any) from the running kernel with "rmmod", and then load the new version of the module with 'modprobe'. (modprobe doesn't do anything if there is already a loaded module, so you need both rmmod and modprobe.) Obviously a reboot would cause the new module to be loaded at startup, but rmmod and modprobe save you the trouble of rebooting.
 
1 members found this post helpful.
Old 07-03-2011, 04:19 AM   #4
skelter42
LQ Newbie
 
Registered: Jan 2008
Posts: 20

Original Poster
Rep: Reputation: 5
The fact that the module needs to be removed and re-added after the dependencies are built is exactly what I had not taken into consideration. That makes it perfectly clear, thank you. (If I had thought of it in terms of changing httpd.conf and restarting apache, I wouldn't have asked the question.)

Thanks for your responses!
 
Old 07-25-2011, 07:36 AM   #5
skelter42
LQ Newbie
 
Registered: Jan 2008
Posts: 20

Original Poster
Rep: Reputation: 5
Fruits of your labor: http://webgnuru.com/linux/slackware_bcm43xx.php. The information you provided went a long ways towards helping me write the article. Thank you!
 
  


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
Conceptual question: why wait until chapter 8 to compile a new kernel? Lufbery Linux From Scratch 3 06-09-2010 05:04 PM
Java: A Conceptual Question timmit Programming 7 10-03-2007 09:12 PM
Ldap neophite with basic conceptual question(s)??? BobMCT Linux - Server 0 11-16-2006 07:43 AM
"Conceptual" question about the start-up frankie_DJ Slackware 16 09-22-2006 05:50 AM
conceptual server design question Bostonian Programming 3 12-27-2004 02:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:34 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