LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 09-30-2012, 06:21 AM   #1
polch
LQ Newbie
 
Registered: Sep 2010
Posts: 22

Rep: Reputation: 0
modprobe -l option not available


Hi.

The "-l" option of modprobe isn't available anymore ? Is there any replacement ?

Regards.

Paul.
 
Old 09-30-2012, 06:45 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,064

Rep: Reputation: Disabled
That's right. In the manual page of the version shipped in Slackware 13.37 we were warned:
Quote:
This option is provided for backwards compatibility and may go away in future
You could do something like this instead:
Code:
find /lib/modules/<kernel version>/ -type f -name "*ko"
EDIT You can replace <kernel version> with $(uname -r) or `uname -r` if you want to list the modules associated with the running kernel.

Last edited by Didier Spaier; 10-01-2012 at 12:47 AM. Reason: EDIT added
 
Old 09-30-2012, 09:00 AM   #3
Eternal_Newbie
Member
 
Registered: Jun 2005
Location: The Pudding Isles
Distribution: Slackware
Posts: 573

Rep: Reputation: 59
EDIT: Ignore this, it's wrong! (thanks Didier, for spotting the glaring error)

You could always use lsmod, that would be slightly more elegant than Didier's solution.

Last edited by Eternal_Newbie; 10-01-2012 at 04:20 AM. Reason: WRONG!
 
Old 09-30-2012, 10:21 AM   #4
GNU/Linux
Member
 
Registered: Sep 2012
Distribution: Slackware-14
Posts: 120

Rep: Reputation: Disabled
I've been using rc.firewall (from Projectfiles.com). So with Slackware 14 it spits out that error and I've decided to use 'lsmod' instead of lsmod -l in the line:
Code:
if (( `modprobe -l | grep -c "$MODULE"` )); then
I hope that's fine, but I do think that there are some other changes that came in with new kernel. So should I abandon the script and look somewhere else, since there might be other changes in iptables that are not available in the latest stable.

Anybody else still using the firewall from projectfiles?
 
Old 09-30-2012, 01:10 PM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,064

Rep: Reputation: Disabled
Quote:
Originally Posted by Eternal_Newbie View Post
You could always use lsmod, that would be slightly more elegant than Didier's solution.
"lsmod" only list loaded modules. Instead, "modprobe -l" (did) list all modules, be they loaded or not and the solution I proposed do the same. So they are not equivalent.

Last edited by Didier Spaier; 10-01-2012 at 12:48 AM. Reason: "Instead," added
 
Old 10-01-2012, 01:45 AM   #6
polch
LQ Newbie
 
Registered: Sep 2010
Posts: 22

Original Poster
Rep: Reputation: 0
Thank you.

I didn't notice the warning in the manual of the 13.37.

Thank for the tip.
 
Old 10-01-2012, 03:27 AM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,064

Rep: Reputation: Disabled
Quote:
Originally Posted by GNU/Linux View Post
I've been using rc.firewall (from Projectfiles.com). So with Slackware 14 it spits out that error and I've decided to use 'lsmod' instead of lsmod -l in the line:
Code:
if (( `modprobe -l | grep -c "$MODULE"` )); then
I hope that's fine
No, that's not fine.

I suppose you are thinking about making the replacement in this code snippet (from line #1189):
Code:
  for MODULE in $REQUIRED_MODULES; do
    if (( `modprobe -l | grep -c "$MODULE"` )); then
      modprobe $MODULE > /dev/null 2>&1
    fi
  done
So replacing "modprobe -l" with "lsmod" would have the effect of only loading modules that are already loaded, which was certainly not intended by the author. Furthermore as the script date back 2006 the list of modules in $REQUIRED_MODULES should most probably be updated.

I would suggest you try the Easy Firewall Generator for IPTables from Alien Bob instead.

Last edited by Didier Spaier; 10-01-2012 at 03:29 AM.
 
Old 10-01-2012, 04:17 AM   #8
Eternal_Newbie
Member
 
Registered: Jun 2005
Location: The Pudding Isles
Distribution: Slackware
Posts: 573

Rep: Reputation: 59
Quote:
Originally Posted by Didier Spaier View Post
"lsmod" only list loaded modules. Instead, "modprobe -l" (did) list all modules, be they loaded or not and the solution I proposed do the same. So they are not equivalent.
Thanks for catching my mistake. I wonder why they got rid of modprobe -l when there is obviously a need for it?
 
Old 10-01-2012, 04:37 AM   #9
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,064

Rep: Reputation: Disabled
Quote:
Originally Posted by Eternal_Newbie View Post
I wonder why they got rid of modprobe -l when there is obviously a need for it?
Because it's easy enough to replace with a "find" command, as shown above. In previous "man modprobe" it was suggested to use "find" and "basename" instead. Let's do that (I suppose you want to list only the modules' names, without their paths):
Code:
for i in $(find /lib/modules/$(uname -r)/ -type f -name "*ko"); do basename $i; done
Proposing a simpler solution is left as an exercise .

EDIT Nostalgia? Add following line to your ~/.bashrc

Code:
alias ls-l='for i in $(find /lib/modules/$(uname -r)/ -type f -name "*ko"); do basename $i; done'
Then fire up a terminal and type:
Code:
ls-l

Last edited by Didier Spaier; 10-01-2012 at 05:08 AM. Reason: EDIT added
 
Old 10-01-2012, 05:16 AM   #10
FeyFre
Member
 
Registered: Jun 2010
Location: Ukraine, Vinnitsa
Distribution: Slackware
Posts: 351

Rep: Reputation: 30
Quote:
Because it's easy enough to replace with a "find" command, as shown above. In previous "man modprobe" it was suggested to use "find" and "basename" instead. Let's do that:
So instead of simple spawning "modporbe -l" from my C code I forced to spawn shell(which can be absent)? I don't think I shall like it.
 
Old 10-01-2012, 05:21 AM   #11
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,064

Rep: Reputation: Disabled
Quote:
Originally Posted by FeyFre View Post
So instead of simple spawning "modporbe -l" from my C code I forced to spawn shell(which can be absent)? I don't think I shall like it.
I assume that you will easily replace the shell command by a subroutine written in C.
 
  


Reply



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
Error message: modprobe: modprobe: can't locate module nls_iso8859-1 berty800 Linux - Hardware 1 06-06-2008 09:07 AM
Modprobe option issue nuubuntu Linux - Hardware 4 01-09-2007 02:53 PM
l option with modprobe? muddywaters Linux - General 2 09-06-2005 04:44 PM
modprobe: modprobe: Couldn't locate module nvnet.o/nvaudio.o xiojqwnko Linux - Newbie 2 12-08-2003 05:41 PM
modprobe: modprobe can't locate module ppp0 in redhat 7.1 while shutting down. cyberdude3k Linux - Networking 1 09-08-2003 12:01 PM

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

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