Config-option for PS/2 mouse detection at boot time [patch]

Sven Koch (haegar@comunit.net)
Mon, 7 Dec 1998 23:52:44 +0100 (CET)


hi...

I maintain about 200 machines spread throughout germany, and need one
software-setup for all. As they only use ps2- or ms-mice, I used to check
for "I can load module psaux, so there is a ps2-mouse, otherwise use
ms-type on ttyS0", but with the new scheme I found no other way but
patching the kernel.

With the new psaux-driver merged into the kernel, I'm no longer able to
check if there is a ps2-mouse connected to the machine, as the
psaux-driver is loaded (and initalized) every time when I compile it in.

With the following little patch (really easy, as all the code was still
there), you get a new config option to reenable the old behavior of
supporting the ps2-mouse only if it was found at boot time. This way I can
check /proc/misc for "psaux", and if it's there, the mouse was found.

Please correct me if this patch is bad and there is a better way to really
detect the presence of a ps2-mouse from userland.

c'ya
sven

--- linux/drivers/char/Config.in.save Fri Nov 20 04:43:26 1998
+++ linux/drivers/char/Config.in Fri Nov 20 04:45:06 1998
@@ -57,6 +57,9 @@
tristate 'Logitech busmouse support' CONFIG_BUSMOUSE
tristate 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE
bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE
+ if [ "$CONFIG_PSMOUSE" = "y" ] ; then
+ bool 'Only enable PS/2 mouse if found at boot time' CONFIG_PSMOUSE_BOOT
+ fi
tristate 'C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE
tristate 'PC110 digitizer pad support' CONFIG_PC110_PAD
fi
--- linux/drivers/char/pc_keyb.c.save Fri Nov 20 04:43:43 1998
+++ linux/drivers/char/pc_keyb.c Fri Nov 20 04:45:47 1998
@@ -904,7 +904,7 @@

static int __init psaux_init(void)
{
-#if 0
+#if CONFIG_PSMOUSE_BOOT
/*
* Don't bother with the BIOS flag: even if we don't have
* a mouse connected at bootup we may still want to connect

---

The Internet treats censorship as a routing problem, and routes around it. (John Gilmore on http://www.cygnus.com/~gnu/)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/