What happened to Modprobe?

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
viking777

What happened to Modprobe?

Post by viking777 »

I have a command listed in my cheatsheet (in two places so it must be true :lol: ) that tells me the way to list available (as opposed to loaded) kernel modules is to use modprobe -l. When I run that now I get told it is an invalid option, and the 'l' switch is not listed in the man page. So what happened? What is the alternative?

The same info is still out there on the net so I am not imagining it and I have used the command before and it definitely worked then, very useful it was too.

http://www.thegeekstuff.com/2010/11/mod ... -examples/
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: What happened to Modprobe?

Post by xenopeek »

Correct, and the manpage says the following so it seems that moment has arrived:
-l --list List all modules matching the given wildcard (or "*" if no
wildcard is given). This option is provided for backwards
compatibility and may go away in future: see find(1) and
basename(1) for a more flexible alternative.
lsmod will show the list of currently loaded modules, modinfo will provide information about individual modules, but I don't know which command will show you all modules. Well, except for that modules are stored in .ko files in your kernel tree in /lib/modules.

So you can do the following which will list all modules:

Code: Select all

find /lib/modules/$(uname -r) -name \*.ko
Not sure how useful that is though... Thousands of modules here...
Image
viking777

Re: What happened to Modprobe?

Post by viking777 »

Thanks xenopeek, I didn't notice that part you highlighted.

I think that is a real shame, modpbobe -l is a useful command when attached to grep, the main thing I used it for was to see if it was worth modprobing a module or not (not much point if you don't have that module to load is there). I guess I will have to use that find command instead now but it is nowhere near as succinct.

Actually it doesn't even work (using Manjaro right now so that could be it)

Code: Select all

[manjaro@manjaro ~]$ find /lib/modules/$(uname -r) -name \efivars.ko
[manjaro@manjaro ~]$ 
So the module doesn't exist right.

Code: Select all

sudo modprobe efivars

Code: Select all

lsmod | grep efivars
efivars                17941  1 
I want modprobe -l back!!
proxima_centauri

Re: What happened to Modprobe?

Post by proxima_centauri »

Modules end with .ko.gz in Arch Linux so I'm assuming it will be the same for Manjaro

Code: Select all

 find /lib/modules/`uname -r` -name \*.ko.gz | less
viking777

Re: What happened to Modprobe?

Post by viking777 »

proxima_centauri wrote:Modules end with .ko.gz in Arch Linux so I'm assuming it will be the same for Manjaro

Code: Select all

 find /lib/modules/`uname -r` -name \*.ko.gz | less
Thanks prox, that does it, but it still doesnt' quench my rage :lol:

Firstly it means I now have two long commands where one short one used to do, and secondly the command you gave me is a bash command and I use fish, so now I have to work out a translation!

Like I said I want "modprobe -l" back - it just works - any distro, any shell! (Or it used to :( )
Locked

Return to “Scripts & Bash”