Your message dated Thu, 16 Jul 2009 11:35:30 +0800
with message-id <[email protected]>
and subject line devfs is obsolete
has caused the Debian Bug report #269121,
regarding mdetect: mdetect doesn't recognize /dev/input/mice
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
269121: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=269121
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: mdetect
Version: 0.5.2
Severity: normal

/dev/psaux has moved to /dev/input/mice in 2.6 kernels. If a kernel is
compiled without the compatibility option to enable /dev/psaux then
mdetect won't recognize a common PS/2 mouse.

The following patch fixes that. It prefers /dev/input/mice over
/dev/psaux. It might need to be refined further to handle usb mice on
/dev/input/mouse1 and above (I noticed the special case to ensure
/dev/input/mouse0 is last on the list).

diff -ru mdetect-0.5.2/mdetect.c mdetect-0.5.2-patched/mdetect.c
--- mdetect-0.5.2/mdetect.c     2002-02-28 02:45:17.000000000 +0100
+++ mdetect-0.5.2-patched/mdetect.c     2004-08-30 23:53:27.000000000 +0200
@@ -234,7 +234,9 @@
                }
        } else {
                /* nasty, nasty special case logic for XFree86 */
-               if ((strcmp(dev->name, "/dev/psaux") == 0) || 
(strcmp(dev->name, "/dev/misc/psaux") == 0)) {
+               if ((strcmp(dev->name, "/dev/input/mice") == 0) ||
+                   (strcmp(dev->name, "/dev/psaux") == 0) ||
+                   (strcmp(dev->name, "/dev/misc/psaux") == 0)) {
                        if (strcasecmp(driver->xfree86_protocol_name, 
"IntelliMouse") == 0) {
                                driver->xfree86_protocol_name = "ImPS/2";
                        }
@@ -396,12 +398,42 @@
        DIR             *dir;
        struct dirent   *de;
 
+       /* /dev/psaux has moved to /dev/input/mice in 2.6, but there's
+        * a compat option to let both work. To be on the safe side,
+        * we don't probe /dev/psaux if /dev/input/mice has responded,
+        * so that there aren't duplicate entries for the same
+        * device. */
+       int             found_dev_input_mice = 0;
+
        /* look for a USB mouse first */
        if ((tmp = open_device("input/mouse0")) != 0) {
                tmp->next = dev;
                dev = tmp;
        }
 
+       /* search /dev/input for something works */
+       /* XXX is this *really* a good idea? */
+       if (!(dir = opendir("/dev/input"))) {
+               perror("/dev/input");
+               return NULL;
+       }
+
+       while ((de = readdir(dir)) != 0) {
+               if (strcmp(de->d_name,"mouse0") != 0) {
+                       char name[100];
+                       strcpy(name, "input/");
+                       strncat(name, de->d_name, 90);
+                       if ((tmp = open_device(name)) != 0) {
+                               tmp->next = dev;
+                               dev = tmp;
+                               if (!strcmp(name, "input/mice")) {
+                                       found_dev_input_mice = 1;
+                               }
+                       }
+               }
+       }
+       closedir(dir);
+
        /* search /dev for something works */
        /* XXX is this *really* a good idea? */
        if (!(dir = opendir("/dev"))) {
@@ -410,9 +442,12 @@
        }
 
        while ((de = readdir(dir)) != 0) {
-               if ((tmp = open_device(de->d_name)) != 0) {
-                       tmp->next = dev;
-                       dev = tmp;
+               if (!found_dev_input_mice ||
+                   strcmp(de->d_name, "psaux") != 0) {
+                       if ((tmp = open_device(de->d_name)) != 0) {
+                               tmp->next = dev;
+                               dev = tmp;
+                       }
                }
        }
        closedir(dir);
diff -ru mdetect-0.5.2/mice.c mdetect-0.5.2-patched/mice.c
--- mdetect-0.5.2/mice.c        2001-02-16 16:49:56.000000000 +0100
+++ mdetect-0.5.2-patched/mice.c        2004-08-30 23:06:11.000000000 +0200
@@ -667,6 +667,8 @@
 {
        if (!strcmp(name, "serial"))
                return &mouse_serial;
+       if (!strcmp(name, "input/mice"))
+               return &mouse_psaux;
        if (!strcmp(name, "psaux"))
                return &mouse_psaux;
        if (!strcmp(name, "usb") || !strcmp(name, "hidbp-mse-0"))

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.8
Locale: LANG=C, LC_CTYPE=sv_SE

Versions of packages mdetect depends on:
ii  libc6                       2.3.2.ds1-16 GNU C Library: Shared libraries an

-- no debconf information


--- End Message ---
--- Begin Message ---
Since devfs has been obsolete, I close these related bugs.

-- 
 LIU Qi

 [email protected]
 [email protected]

 PGP Key fingerprint:
  A8C0 860C D8A9 D6FC 551F
  6E2C A4AB 763B 00EC 886F


--- End Message ---

Reply via email to