Re: [modules] modprobe 1.3.69k broken with options keyword

Bjorn Ekwall (bj0rn@blox.se)
Sat, 25 May 1996 19:42:00 +0200 (MET DST)


Graham Mitchell wrote:
>
> On 22 May 96 at 8:08, Bjorn Ekwall wrote:
>
> > Darren J Moffat wrote:
> > > I've just upgraded from modules 1.3.57 to 1.3.69k and modprobe appears to
> > > be broken wrt the options keyword in /etc/modules.conf
> > >
> > > I have the following line to load the sbpcd module:
> > > options sbpcd sbpcd=0x630,LaserMate
> > >
>
> >
> > No problem seen here... "modprobe -v" shows the expected line.
> > Also, modprobe doesn't actually _do_ anything with these options,
> > except saving them and then adding them to the insmod command line.
> >
> > Please try to recompile and reinstall (I'm using gcc-2.7.2 b.t.w.).
>
> Hmmm. I had that weird value being passed in too, but I recompiled
> 1.3.69k and with an options line of
>
> options block-major-25 sbpcd=0x230,SoundBlaster

Hi guys!

First of all, since I don't use the sbpcd module, I just looked at
modprobe and its handling of the option lines in /etc/conf.modules.
I didn't see anything wrong with it, but you still seem to have problems...

So, I looked into the module source instead, and found that sbpcd[] is
an array of integers, not an array of structs {int, char *}. This lead
me to take a look in <linux/sbpcd.h> instead, and this is what I found:

/*
* Attention! This file contains user-serviceable parts!
* I recommend to make use of it...
* If you feel helpless, look into linux/Documentation/cdrom/sbpcd
* (good idea anyway, at least before mailing me).
*
* The definitions for the first controller can get overridden by
* the kernel command line ("lilo boot option").
* Examples:
* sbpcd=0x300,LaserMate
* or
* sbpcd=0x230,SoundBlaster
* or
* sbpcd=0x338,SoundScape
* or
* sbpcd=0x2C0,Teac16bit
*
* If sbpcd gets used as a module, you can load it with
* insmod sbpcd.o sbpcd=0x300,0
* or
* insmod sbpcd.o sbpcd=0x230,1
* or
* insmod sbpcd.o sbpcd=0x338,2
* or
* insmod sbpcd.o sbpcd=0x2C0,3
* respective to override the configured address and type.
*/

So, the option line in /etc/conf.modules should look like this instead:

options sbpcd sbpcd=0x230,0

or whatever your configuration dictates. I.e., the LaserMate string
is intended for configuration via lilo. When initializing via insmod
you should use an integer instead.
I know this might be a bit irritating, but some adventurous soul might
like to do a small hack to sbpcd.c so that it would check for string
contents instead, even when loading as a module...

Cheers,

Bjorn