 |
Linux Format forums Help, discussion, magazine feedback and more
|
| View previous topic :: View next topic |
| Author |
Message |
John Lumby
Joined: Wed May 12, 2010 3:10 am Posts: 22 Location: Toronto
|
Posted: Sat Apr 16, 2011 1:45 am Post subject: how to find parameters that a kernel module takes |
|
|
Suppose you have some vague idea that some kernel module may take some parameter telling it what to do, but can't find out what the parameter is. Many device drivers have such parms. Or suppose you are plain curious. Then you can run this nifty scriptlet to list the parms and their documentation strings :
Suppose the module name is abcxyz
kmod="abcxyz";find /lib/modules/`uname -r`/kernel -name ${kmod}.ko -exec strings -a '{}' \; | fgrep -e parm=
Three caveats:
1) the module must exist under the /lib/modules dir - i.e. it must not be built-in to the kernel image
2) you have to spell the name exactly - hyphen and underscore are not interchangeable, as the scriptlet is looking for a matching file. But you can run it again with the alternative, or you can make the find command cleverer for a specific name, e.g. to look for whichever of parport_pc or parport-pc
find /lib/modules/`uname -r`/kernel -name parport'[-_]'pc.ko -exec strings -a '{}' \; | fgrep -e parm=
parm=init_mode:Initialise mode for VIA VT8231 port (spp, ps2, epp, ecp or ecpepp)
parm=dma:DMA channel
parm=irq:IRQ line
parm=io_hi:Base I/O address (ECR)
parm=io:Base I/O address (SPP regs)
3) some modules parms may be hidden if the kernel was configured to omit the relevant feature, as they will be compiled out. _________________ John Lumby |
|
| Back to top |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 7993 Location: Warrington, UK
|
Posted: Sun Apr 17, 2011 5:30 pm Post subject: |
|
|
You can also get a list of parameters with
_________________ Unix is user-friendly. It's just very selective about who it's friends are. |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|