LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   contents of /etc/modules (https://www.linuxquestions.org/questions/linux-kernel-70/contents-of-etc-modules-869064/)

SaintDanBert 03-16-2011 08:23 PM

contents of /etc/modules
 
Where do I find documentation on /etc/modules?

Specifically, I found a post that said to add "option" as a line
in this file. I cannot find any details about a module called "option" and my efforts to web search swim in an ocean of search results using the word "option".

The command modprobe --list tells me which modules are available (already built) for my current kernel. How do I discover what any given something.ko file does? The command modinfo whatever gives a geek dump, but is hardly descriptive or informative outside of kernel developer land.

Please help,
~~~ 0;-Dan

Aquarius_Girl 03-17-2011 12:42 AM

Did you try Googling the following keywords?
Quote:

man /etc/modules.conf

And with 600+ posts you still don't know that /etc/modules has nothing to do with the desktops?

SaintDanBert 03-17-2011 10:33 AM

Quote:

Originally Posted by Anisha Kaul (Post 4293417)
Did you try Googling the following keywords?

I'm trying to learn the features and functions and details about the module called "option". I have no idea about the thousands of ways that the keyword "option" appears in various web postings other than the first several screens of Google(tm) (I view 30 results per screen) had nothing meaningful.

Quote:

Originally Posted by Anisha Kaul (Post 4293417)
And with 600+ posts you still don't know that /etc/modules has nothing to do with the desktops?

Exactly which LQ forum do you recommend for a question about kernel modules? I chose a forum where I expected (guessed) I might be most likely to get some useful answers.

Thanks for your time,
~~~ 0;-Dan

PTrenholme 03-17-2011 11:51 AM

The is, of course, no module called "option." I suspect that you have misunderstood what you read, which you have reported as "add "option" as a line in this file." The post should, most likely, have said something like "Add the option in the /etc/modules.d/<module>.conf file," where "<module>" is the name of the kernel module for which you were to set the option.

The "geek-speak" you see when you do a modinfo <module> is, among other things, a list of the options you can set and the type of argument that each option accepts.

See man modprobe.conf for details of how the options are specified. Here is the section for that file about setting options:
Code:

options modulename option...
              This command allows you to add options to the module modulename (which might be an alias) every time
              it is inserted into the kernel: whether directly (using modprobe modulename or  because  the  module
              being inserted depends on this module.

              All  options  are  added together: they can come from an option for the module itself, for an alias,
              and on the command line.


Aquarius_Girl 03-17-2011 10:09 PM

Quote:

Originally Posted by SaintDanBert (Post 4293221)
Specifically, I found a post that said to add "option" as a line in this file.

Can you show us that post? It might help others to correct your misunderstanding.

Quote:

Originally Posted by SaintDanBert (Post 4293972)
Exactly which LQ forum do you recommend for a question about kernel modules? I chose a forum where I expected (guessed) I might be most likely to get some useful answers.

http://www.linuxquestions.org/questi...nux-kernel-70/

and also for future use find time to scroll down this page and check out all the available options: http://www.linuxquestions.org/questions/

jschiwal 03-18-2011 08:35 AM

Moved: This thread is more suitable in Linux Kernel and has been moved accordingly to help your thread/question get the exposure it deserves.

jschiwal 03-18-2011 08:41 AM

Take a look at the "modinfo" program. It lists what options a particular module supports.
Code:

/sbin/modinfo acpi_cpufreq
filename:      /lib/modules/2.6.37.1-1.2-desktop/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko
alias:          acpi
license:        GPL
description:    ACPI Processor P-States Driver
author:        Paul Diefenbaugh, Dominik Brodowski
srcversion:    513F747D3E9E884F1A0364A
depends:        processor,mperf
vermagic:      2.6.37.1-1.2-desktop SMP preempt mod_unload modversions
parm:          acpi_pstate_strict:value 0 or non-zero. non-zero -> strict ACPI checks are performed during frequency changes. (uint)

The options are the parameters listed.
Code:

Module parameters can be specified in /etc/modprobe.conf.local, e.g. as:
 options <module name> <module options>

Also read the kernel-parameters.txt file in the kernel source Documentation directory. You may need to install a kernel-docs package for it.
Or you can google for it, but it may be for a different kernel version.

SaintDanBert 03-19-2011 02:48 PM

Quote:

Originally Posted by PTrenholme (Post 4294086)
The is, of course, no module called "option." I suspect that you have misunderstood what you read, which you have reported as "add "option" as a line in this file."
...

I disagree and submit this:
Code:

modprobe --list | grep -5 option
kernel/drivers/usb/serial/mos7840.ko
kernel/drivers/usb/serial/moto_modem.ko
kernel/drivers/usb/serial/navman.ko
kernel/drivers/usb/serial/omninet.ko
kernel/drivers/usb/serial/opticon.ko
kernel/drivers/usb/serial/option.ko
kernel/drivers/usb/serial/oti6858.ko
kernel/drivers/usb/serial/pl2303.ko
kernel/drivers/usb/serial/qcserial.ko
kernel/drivers/usb/serial/safe_serial.ko
kernel/drivers/usb/serial/siemens_mpi.ko

There is a module called "option".

Now what,
~~~ 0;-/ Dan

SaintDanBert 03-19-2011 02:52 PM

Quote:

Originally Posted by jschiwal (Post 4294978)
Take a look at the "modinfo" program. It lists what options a particular module supports.
...

Thanks. Here is what I see:
Code:

prompt$  modinfo  option

filename:      /lib/modules/2.6.32-30-generic-pae/kernel/drivers/usb/serial/option.ko
license:        GPL
version:        v0.7.2
description:    USB Driver for GSM modems
author:        Matthias Urlichs <smurf@smurf.noris.de>
srcversion:    A11C240D4064C7CF71C68C6
alias:          usb:v211Fp6801d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0B3CpC000d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0681p004Ad*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0681p004Cd*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0681p0040d*dc*dsc*dp*ic*isc*ip*
...
alias:          usb:v0AF0p6300d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0AF0p6200d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0AF0p6100d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0AF0p6000d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0AF0p5000d*dc*dsc*dp*ic*isc*ip*
depends:        usbserial
vermagic:      2.6.32-30-generic-pae SMP mod_unload modversions 586TSC
parm:          debug:Debug messages (bool)


PTrenholme 03-20-2011 01:24 PM

O.K., I stand corrected. :redface:

So, according to the modinfo you posted, that's a USB Driver for GSM modems, so, if you have a GSM modem plugged into one of your USB ports, you want the "option" module loaded. (I still think that's a weird module name. :) )

Try the command su -c 'modprobe option' and tell us if that works. (Note that the driver is specific for the Ubuntu 2.6.32-30-generic-pae kernel. The uname -r command should tell you if that's the kernel you have.) If the modprobe command works, "option.ko" kernel module should be automatically loaded whenever you boot.

Oh, also from the modinfo output you posted, it look like the option driver has only option you can set: "debug," to print debugging messages.

<edit>
P.S. - This is not a response to the question you asked: "Where do I find documentation on /etc/modules?"
If you had asked "How do I install the option module in the kernel?" or, at least, given us the URL of the post to which you referred when you started this thread, or even told us that you were trying to get a USB modem working, our responses would, I think, have much more closely related to what you needed to know.

Note that Ubuntu does not use the (depreciated) /etc/modules.conf file for listing modules to be installed in the kernel.
</edit>

SaintDanBert 03-21-2011 09:24 AM

Quote:

Originally Posted by Anisha Kaul (Post 4294559)
Can you show us that post? It might help others to correct your misunderstanding.

See this page:
http://ubuntuforums.org/showthread.php?t=1581804

~~~ 0;-Dan

PS/ Thanks to moderators for moving the thread.

SaintDanBert 03-21-2011 09:53 AM

Quote:

Originally Posted by PTrenholme (Post 4297220)
O.K., I stand corrected. :redface:

So, according to the modinfo you posted, that's a USB Driver for GSM modems, so, if you have a GSM modem plugged into one of your USB ports, you want the "option" module loaded. (I still think that's a weird module name. :) )

Try the command su -c 'modprobe option' and tell us if that works. (Note that the driver is specific for the Ubuntu 2.6.32-30-generic-pae kernel. The uname -r command should tell you if that's the kernel you have.) If the modprobe command works, "option.ko" kernel module should be automatically loaded whenever you boot.

I used sudo modprobe option and got a simple prompt after the password dialog.
I then tried this:
Code:

prompt$ sudo modprobe -l | grep option

kernel/drivers/usb/serial/option.ko

prompt$

This looks like the module did, in fact, load up.
Quote:

Originally Posted by PTrenholme (Post 4297220)
Oh, also from the modinfo output you posted, it look like the option driver has only option you can set: "debug," to print debugging messages.

<edit>
P.S. - This is not a response to the question you asked: "Where do I find documentation on /etc/modules?" If you had asked "How do I install the option module in the kernel?" or, at least, given us the URL of the post to which you referred when you started this thread, or even told us that you were trying to get a USB modem working, our responses would, I think, have much more closely related to what you needed to know.

Note that Ubuntu does not use the (depreciated) /etc/modules.conf file for listing modules to be installed in the kernel.
</edit>

I'm trying to follow details posted on the http://ubuntuforums.org/showthread.php?t=1581804 so I'm baffled that the details were not valid for *buntu... Then again, I shouldn't THAT be surprised at this sort of confusion.
{soapbox}
I appreciate the attempt to segregate those system start-up and configuration details that happen all the time (usually in /usr/lib somewhere) from per-system local "requests" to alter this standard behavior (typically /etc/somewhere). However, all of this is changing so much and so fast, and sadly is often different from distro to distro that much confusion and parochialism are often an unintended result.
{/soapbox}

~~~ 0;-Dan

PTrenholme 03-21-2011 12:18 PM

A few of comments:
  1. The modprobe -l command simply list the module files present in the /lib/modules/`uname -r`/kernel/drivers directory. It's almost equivalent to find /lib/modules/`uname -r`/kernel/drivers/ -name *.ko. The point is, all it's telling you is that the driver exists in you drivers directories, not that it's loaded.
  2. To see if a driver is loaded, when the modprobe command returns without an error, run a dmesg | tail to see if the kernel said anything when the driver was installed.
  3. The command grep Live /proc/modules | cut -f1 -d' ' | sort will list, in alphabetical order, all the modules loaded in your system that are running.
The reason old posts may refer to depreciated methods is often because a distribution has moved to a more recent kernel release, and the newer kernel urges its users to "modernize" their methodology, or because the Linux developers have arrived, somehow, at a consensus. In the case of Ubuntu, since it is based in the Debian distribution, it often changes its methods when the Debian distribution changes.

The depreciation of the /etc/modules.conf file is part of a general Linux community consensus that each application or program should have its own configuration file or directory, and separable parts of that configuration should be in different files. This separates the configuration task into independent "objects" that can be changed (or not changed) independently of other parts of the configuration task. For example, instead of a single /etc/modules.conf file for all the modules being loaded (which need configuration settings), a /etc/modules.d directory is used which contains files for each module needing some special handling. (By default, Ubuntu populates that directory with kernel modules that have been "blacklisted," which a modules that you should not use. (Usually because they will cause your system fo crash.))


All times are GMT -5. The time now is 05:44 AM.