On Tue, 18 Nov 2003 15:18:28 +0300
"Andrey Borzenkov"  <[EMAIL PROTECTED]> wrote:
 
> > - the issues with detecting the wheel of ps/2 mice
> 
> wrt to kernel it is irrelevant. we speak about detecting correct
> driver (module) for mouse. To this extent we have (on 2.6)
> 
> "psmouse" - for any sort of PS/2 (type is autodetected by driver)
> "amimouse" - not relevant for x86
> "inport" - busmouse (Microsoft) whatever it is :)
> "lgibm" - Logitech bus mouse
> "logips2pp" - Logitech PS/2++ - no idea what it is
> "maplemouse" - irrelevant
> "pc110pad" - IBM touchpad (one of)
> "rpcmouse" - irrelevant
> "sermouse" - requires user-level helper :(
> "synaptics" - for synaptics
> 
> what I meant is that harddrake could - automatically or manually -
> store mouse driver somewhere, probably in /etc/default/mouse,
> for later use by mkinitrd or some otehr script, e.g. gpm

Why would we need mouse drivers in initrd ?
They're not needed to boot rootfs.
I think mouse modules can be loaded in early initscripts.
Keyboard drivers can be loaded in initscripts too, but before fs check
(I guess it's the first time they are needed).

As you said, we can store a list of needed modules in a config file,
WDYT of /etc/sysconfig/mouse ?

Here's roughly how I would do it, in a initscript loaded early:

***

if /etc/sysconfig/mouse doesn't exist:
   MODULES = all available modules
else
   MODULES = `cat /etc/sysconfig/mouse`

LOADED = ''

for m in MODULES:
   try to load module m
   if it succeeds, add m to LOADED list

if /etc/sysconfig/mouse exists and no module was loaded:
   retry from beginning with all available modules
   # if it fails again:
   #    what to do here ?

write LOADED to /etc/sysconfig/mouse

***

With this approach, it will try to load only needed modules (the one
that were successfully loaded at last boot), and if it fails, it tries
to load every available modules (should not happen very often, only at
first boot or when mouse is replaced).

Shall I start to write this initscript or is it bad ? / does it need
tweaking ?

-- 
Olivier Blin

Reply via email to