gpm & USB Mouse - Modules not loading when gpm program kicks in

Dagmar d'Surreal dagmar at speakeasy.net
Sat Nov 30 13:05:49 PST 2002


On Sat, 2002-11-30 at 08:11, Frank Hammond wrote:

> The problem I seem to be having is gpm program doesn't seem to trigger the
> devfs program to automatically load the appropriate mouse drivers. (I have a
> Microsoft USB Optical Wheel Mouse and in my /etc/sysconfig/mouse file have
> the gpm MDEVICE setting to /dev/input/mice and the gpm PROTOCOL is set to
> "imps2"). The error I get is a "Device /dev/input/mice not found". (which
> makes sense as devfs hasn't created it).
> 
> If I have modprobe usb-uhci, input, hid and mousedev statements somewhere in
> my rc startup scripts, the mouse driver loads and gpm works perfectly,
> however the way my newbie Linux mind expected devfs, kmod and modules to
> work is that since gpm would want the mouse device, then kmod and devfs
> would get a call for it and load the appropriate driver modules by
> themselves?
> 
> Where is the problem? Is the gpm not fully kmod / devfs "compliant"?

No, but there appears to be a nasty little race condition involved.  The
USB bus takes too long to get things initialized and never seems to get
done in time for gpm to start (or something of that nature, it's been
awhile since I've watched it very carefully).  Your problem is one that
devfs probably isn't making any worse, since the same obnoxious issue
happens on systems with static /dev directories.  Going by "least number
of lines is best" for additions to /etc/modules.conf, this is about the
best I've been able to do to get around this problem:

alias char-major-13     mousedev
alias usb              usb-ohci
alias usbdevfs         usbcore
post-install mousedev  /sbin/mount /proc/bus/usb
pre-install mousedev   /sbin/modprobe usb-ohci && /sbin/modprobe usbcore
&& /sbin/modprobe hid

Note that the pre-install line wraps!  What all that amounts to is that
the pre-install directive effectively forces kmod to wait until the USB
bus is fully initialized by virtue of the hid module will "stick" until
usbcore and the *hci driver have initialized, at which point you have
enough modules loaded for the mouse device to appear under
/proc/bus/usb.  You will still need to keep your regular usbdevfs line
in /etc/fstab so that the post-install line can function properly.

The aliasing of char-major-13 is probably redundant, I just put it in
there to remind myself why I had that complex section (compared to the
rest of my modules.conf) in there so I wouldn't "accidentally" remove it
at some point in the future.

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message



More information about the blfs-support mailing list