site  contact  subhomenews

Adding parameters to module loading

June 17, 2008 — BarryK
It is sometimes required that you have to load a module with explicit commandline parameters. One example that comes to mind are the ALSA modules -- sometimes sound does not work on certain hardware even though the correct kernel module has loaded. So, you do some research on the Internet and find that it has to be loaded with certain parameters.

/etc/MODULESCONFIG is a user-editable file that is managed by the BootManager, the latter being a GUI application. You can either edit MODULESCONFIG directly or use the GUI.
MODULESCONFIG has two variables, SKIPLIST and ADDLIST, that are relevant here.

It is possible to edit /etc/modprobe.conf to tell the 'modprobe' executable to load a module with certain parameters, however the syntactical requirements may be too challenging for many. I aim to provide simple GUI tools for all user requirements, so I have extended the BootManager to cater for this need also.

Well, even editing the /etc/MODULESCONFIG file directly is very easy. Let's say that we want the 'mmc_block.ko' module to be loaded with parameter 'major=179'. Just edit MODULESCONFIG like this:

SKIPLIST=' someothermodule someothermodule mmc_block '
ADDLIST=' someothermodule someothermodule mmc_block:major=179 '


The SKIPLIST will prevent the kernel from automatically loading the module at bootup (without any params) and the ADDLIST (which is read in /etc/rc.d/rc.modules2 at bootup) will load the module with the params. Note the ':' which represents a space, as the ADDLIST uses space characters as module delimiters.

I have added the extra feature of adding module parameters to the BootManager GUI application (/usr/sbin/bootmanager), found in the System menu. So that makes it even easier.

Personal note

Comments

LZMA
Username: Ted Dog
I learned to be nice and keep repeating myself, repeating myself, until I am heard. And dropping hints LZMA to remind LZMA the key thing LZMA I am striving to LZMA get added LZMA to puppy distro. I put it in the header so you can safely skip it. For a quasi-hermit, we sure know a lot about you. Your travels, pets, family hopes and dreams. That's not very hermit-like. Oh I just ordered my own wind generator/solar system, does the mate travel? Oh the multi-posts are a bug on your end. I'm glad others have been repeating their messages.

Re: LZMA
Username: BarryK
"Ted Dog, Make it easy for me, what are the most relevant links? There is a forum thread isn't there, with recent discussion on this? And I think you found a site with a patch for compressing the initrd and/or kernel. How come I never get double-posts? Heh heh, I did add the "quasi" qualifier :happy: Besides, the personal stuff I post to the blog is only the tip of the iceberg.

LZMA
Username: tempestuous
LZMA on forum - http://www.murga-linux.com/puppy/viewtopic.php?t=29343 LZMA kernel patch - http://www.linuxfromscratch.org/patches/downloads/linux/linux-2.6-lzma-1.patch

firmware fix
Username: tempestuous
"Another fix - there is a typographical error in the firmware installation script - /lib/modules/firmware.dep.2.6.25.4 - "rt61pc.ko" should be "rt61pci.ko" This is preventing firmware for the rt61pci module from loading. And what's the situation with D-Bus? The bluetooth utilities require it, and I think XFCE requires it.

Minor Typo
Username: JustGreg
"In your blog post on adding parameters to module loading, there is a minor typo. The file MODULESCONFIG is located in the directory /etc/rc.d/ and not just in /etc/. I need to re-do my post on the 2goPC web camera to use the process that you recommend for adding modules at startup. In trying the new way, I noticed the difference in the location. As playdayz said, be kind to yourself. There is always more stuff to be done then time! Enjoy life, JustGreg Live Well, Laugh Often, Love Much

Re: typos
Username: BarryK
"tempestous, thanks I fixed it. JustGreg, yes, but note that adding module parameters is not supported until 4.1alpha3 is released.


Tags: puppy