Is there a standard way to list the parameter values of a loaded Linux module? I'm essentially probing for another answer to this Linux kernel module parameters question, because the module I'm interested in doesn't have a /sys/modules/<module_name>/parameters interface.
| |||
|
feedback
|
|
You could use the "modinfo(8)" command to get available load time parameters for a module. For instance:
As for getting the parameters of loaded modules, try combining the modinfo command with a simple "lsmod | awk '{ print $1 }'" | |||||
feedback
|
|
You can do it by using this simple one way command, which uses the /proc/modules and /sys virtual filesystems:
You will obtain an output like this:
Hope this helps. | |||
|
feedback
|
|
Working off of katriel's work, you can get a (admittedly ugly) one-liner by combining the two of them in a bash loop:
| |||||||
feedback
|
|
Would come out ugly as a comment, but I did this check on my system..
To check if modules without parameters in /sys show up as having parameters in modinfo but I couldnt find any. I am no expert, but the difference here is that modinfo reads the module file itself for the parameters by looking in the .modinfo elf headers, whereas sys is reading these from its runtime variant. It may be possible to have parameters you can modify at runtime which dont appear as a modinfo parameter value, but since the module format should be pretty fixed I dont imagine its possible for you to pass a option parameter to a module when loading without there being a .modinfo structure for it linked in. I am curious, does your module suggest there are parameters passable with modinfo when you check it that way but there are none in /sys for it? Certainly on my system I was unable to find any examples of this using the command provided above. | |||
|
feedback
|