Tom Berger <[EMAIL PROTECTED]> writes:

> Harald Schreiber wrote:
> > 
> > Tom Berger <[EMAIL PROTECTED]> writes:
> > 
> > > Hi there!
> > >
> > > I just wondered (again):
> > >
> > > If you define aliases in /etc/conf.modules how does the system know which
> > > device they refer to?
> > >
> > > An example:
> > >
> > > If I load
> > >
> > > alias scsi_hostadapter [module-name]
> > >
> > > it works. What if I'd type
> > >
> > > alias my_yummy_scsi_card [module-name]
> > >
> > > ?
> > >
> > > Valid kernel-parameters are described in kernel-parameters.txt, but what
> > > about valid module-aliases?
> > >
> > > Obviously I am missing something. May anyone help me?
> > >
> > [...]
> > 
> > Hi Tom,
> > 
> > in the special case of "alias scsi_hostadapter [module-name]"
> > this entry is only needed by the shell script "/sbin/mkinitrd"
> > line 158-165:
> > 
> > ----------8<--------------------8<----------
> >     if [ -f /etc/conf.modules ]; then
> >         scsimodules=`grep scsi_hostadapter /etc/conf.modules | grep -v '^[      
>]*#' | sort -u | awk '{ print $3 }'`
> >         for n in $scsimodules; do
> >     # for now allow scsi modules to come from anywhere.  There are some
> >     # RAID controllers with drivers in block/
> >             findmodule "" $n
> >         done
> >     fi
> > ----------8<---------------------8<----------
> > 
> > If you change the entry in /etc/conf.modules
> > 
> > alias scsi_hostadapter [module-name]
> > 
> > to
> > 
> > alias my_yummy_scsi_card [module-name]
> > 
> > your initial ramdisk will not contain the module for
> > your SCSI hostadapter and your machine will not boot
> > if you are booting from a SCSI drive and have your
> > SCSI host adapter support not built in the kernel.
> 
> 
> Hi Harald,
> 
> thanks a lot for your explaination but I still don't understand ;-). 
> 
> I see the case with mkinitrd, but what if I don't need any SCSI devices on
> startup and the card driver is built as a module?
> 
> If there is now a request *at runtime* (let's say to a SCSI CD burner)
> modprobe looks into /etc/conf.modules and sees the line
> 
> alias scsi_hostadapter [module-name]
> 
> How does it know that the string 'scsi_hostadapter' refers to a SCSI host
> adapter?
> 
> Or did I got the wrong way round and modprobe doesn't need to look up
> conf.modules since the card has been detected during boot? Does modprobe
> query /proc/scsi first? Does your explaination mean that I don't need this
> entry at all if I don't need SCSI during init?
> 
> Sorry if I seem to look exceptionally dim but I really want to understand
> this correctly.
> 
> I really hope you take the time to enlighten me about it.
> 
> 
[...]

Hi Tom,

to be honest I didn't think of this case in my previous mail
at all and I don't understand it completely too.

Obviously my statement that the entry 
alias scsi_hostadapter [module-name]
is only needed by /sbin/mkinitrd is wrong.

I have looked at the kernel sources and found this in line 
3220-3224 of /usr/src/linux/drivers/scsi/scsi.c
(kernel-2.2.29-27mdk)

#ifdef CONFIG_KMOD
        if (scsi_hosts == NULL)
            request_module("scsi_hostadapter");
#endif

So I think if the kernel detects that it needs
a driver for a SCSI hostadapter and no one is loaded
it requests kmod to load a module "scsi_hostadapter".

Then kmod looks up /etc/conf.modules for a line
alias scsi_hostadapter [module]
and if this line exits kmod loads [module].

If you want to know this precisely you should ask
Bj�rn Ekwall <[EMAIL PROTECTED]> who is the expert
for this.

Regards
Harald

-- 
-------------------------------------------------------------------
 Harald Schreiber,    Nizzaalle 26,    D-52072 Aachen,     Germany
Phone: +49-241-9108015, Email: [EMAIL PROTECTED]
-------------------------------------------------------------------

Reply via email to