The way I handle this in the floppy driver is to have a string
variable to which you can assign the LILO configuration string when
using modules. The ability to set string variables is available since
modules-1.3.57.
Thus, you can insert the module using the following command line:
insmod floppy.o floppy=0,4,cmos
where floppy=0,4,cmos is also a valid boot option.
The routine to parse this is rather simple:
char *floppy=NULL;
static void parse_floppy_cfg_string(char *cfg)
{
char *ptr;
int ints[11];
while(*cfg) {
for(ptr = cfg;*cfg && *cfg != ' ' && *cfg != '\t'; cfg++);
if(*cfg) {
*cfg = '\0';
cfg++;
}
if(*ptr)
floppy_setup(get_options(ptr,ints),ints);
}
}
and is called with:
if(floppy)
parse_floppy_cfg_string(floppy);
(Sorry if this code snippet gets garbled on its way through vger. If
that happens, you may look it up in floppy.c)
Unfortunately, this breaks with more recent module utilities, which
got a little bit too smart :-( Indeed, modules-1.3.69k for instance
interprets a comma separated list as an array :-( . In order to avoid
this interpretation, you have to quote the string:
insmod floppy.o 'floppy="0,4,cmos"'
We could extend the module utilities to understand the following:
insmod floppy.o -string floppy=0,4,cmos
Or even better:
insmod floppy.o 0,4,cmos
which would place 0,4,cmos into an static variable called argv in the
module. We could make this a char **, in order to allow for more than
one argument.
Alain
-----------------------------------------------------------------------.
Email: Alain.Knaff@inrialpes.fr Alain Lucien Knaff .
Tel.(work): (33) 76 61 52 68 .
Tel.(home): (33) 76 85 23 05 Appartement 310b .
(répondeur) =====O=====/ 11,rue Général Mangin.
Fax : (33) 76 61 52 52 =====O=====/ 38100 Grenoble France.