Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Anyone know a way to tell what options a kernel module was loaded with? Something like /proc/cmdline but for loadable modules? I've googled and poked around /sys and /proc without luck...
Your suggestions are good for seeing the name/version of the running kernel, and the kernel boot options for each kernel that grub knows about (just as you said).
I was hoping to find a way to determine what options/parameters had been fed into a loadable kernel module at the time it was loaded. These options are set in files in /etc/modprobe.d/
I've poked around a bit more and I think the answer is that there isn't a way to tell what parameters were set when the module got loaded. Each module can display a subset of its parameters in /sys. For example, loading the module snd_usb_audio creates the directory:
/sys/module/snd_usb_audio/parameters
In /etc/modprobe.d/options I have the line:
options snd_usb_audio async_unlink=0
and after loading that module I get:
% cat /sys/module/snd_usb_audio/parameters/async_unlink
N
But AFAIK it's up to each module to decide which of its parameters to export to /sys. And the values in /sys reflect the current state, not the state requested when the module was loaded.
Frank,
If you told us what your exact problem is, rather than just the steps you have taken to try to resolve it, we might be able to see the bigger picture and be better informed to help you.
Sorry if I was so mysterious :-) Bigger picture is I am loading thinkpad_acpi on a 600X running kubuntu gutsy. Wanted to see if I could control the fan, so put this in /etc/modules.d/options:
options thinkpad_acpi fan_control=1
When I loaded the thinkpad_acpi module I could see /proc/acpi/ibm/fan but trying
echo 'level 1' > /proc/acpi/ibm/fan
gave a "write error: invalid argument"
Before concluding that the 600x doesn't support fan control through thinkpad_acpi, I thought I'd make sure that the fan_control=1 option was in fact being set when the module was loaded. I couldn't tell for sure from the system log, so wondered if there was some other way to tell. Since then I've tried setting the thinkpad_acpi options debug=0xffff or debug=0x0000 in /etc/modules.d/options and can see the difference between these two in the number of things being logged during module load. So I have to conclude that the fan_control=1 option is being picked up but simply does not work on the 600x.
Bottom line is that I had no reason to suspect that /etc/modprobe.d options weren't being set, but grew curious if there was any way to tell. And short answer AFAICT is that in the general case there is no way to tell.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.