tags 609300 +patch
thanks

On Fri, Jul 15, 2011 at 06:30:41PM +0100, Ben Hutchings wrote:
>...
> This is wrong on so many levels.
> 1. There is no way to declare relations to 'all kernel packages'.

Why not?

How could a package declare "I need at least kernel 2.6.39"?
(I know that self-compiled kernels are a different story, but for
 kernel packages that should be possible.)

>...
> 3. You know how people complain about udev and kernel upgrade ordering
>    dependencies?  You're proposing to do the same thing.

udev is a special case, since it is very essential and udev and kernel 
upgrade ordering was a tricky problem.

input-utils is a peripheral package without much hassle.

> I suspect that the correct way to deal with this may be to build
> input-utils from the linux-2.6 source package and add some sort of
> wrapper in linux-base to select the right version (like we do for
> perf).
> 
> Or, you change the program to check which protocol version to use at
> run-time.

After looking a bit into it, and especially at commit ab4e0192
(Input: define separate EVIOCGKEYCODE_V2/EVIOCSKEYCODE_V2) in
the kernel, the correct fix for input-utils is a different and
quite simple one:

The input kernel<->userspace API might be enhanced with additional 
functionality in the future, but it will never change in a way that 
breaks the ABI.

Therefore the old functionality input-utils is using will always
be available, and the bug was that EVIOCGVERSION shouldn't be used
to check with equality for EV_VERSION (version >= 0x010001 might
be a valid check for software using EVIOCGKEYCODE_V2).

A patch for input-utils to remove the wrong version check is below.

After that, a Breaks in all kernel images on the unfixed input-utils 
would be required.

> Ben.

cu
Adrian


<--  snip  -->


--- input.c.old 2011-07-18 14:12:14.000000000 +0300
+++ input.c     2011-07-18 14:12:32.000000000 +0300
@@ -83,7 +83,7 @@
 int device_open(int nr, int verbose)
 {
        char filename[32];
-       int fd, version;
+       int fd;
 
        snprintf(filename,sizeof(filename),
                 "/dev/input/event%d",nr);
@@ -96,17 +96,6 @@
        if (verbose)
                printf("%s\n",filename);
 
-       if (-1 == ioctl(fd,EVIOCGVERSION,&version)) {
-               perror("ioctl EVIOCGVERSION");
-               close(fd);
-               return -1;
-       }
-       if (EV_VERSION != version) {
-               fprintf(stderr, "protocol version mismatch (expected %d, got 
%d)\n",
-                       EV_VERSION, version);
-               close(fd);
-               return -1;
-       }
        return fd;
 }
 




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to