Package: console-tools
Version: 1:0.2.3dbs-56
Followup-For: Bug #312844

I'm having exactly the same problem while attempting to build a kernel
for the psion 5mx (http://linux-7110.sourceforge.net/)

This contains a number of special keycodes for controlling things like
backlight, contrast, power off etc.
The codes are thing like:
altgr   keycode  61 = 0xf03                             # Backlight

loadkeys --mktable keymap_psion_us.map >keymap_psion_us.c

For console-tools_0.2.3-23.3 this build the map file correctly.
For console-tools_0.2.3dbs-56 this replaces all the 0xff0? values with
0xf020

-       0xf200, 0xf117, 0xf114, 0xf200, 0xf118, 0xff03, 0xf10d, 0xfc00,
+       0xf200, 0xf117, 0xf114, 0xf200, 0xf118, 0xf020, 0xf10d, 0xfc00,

And console-tools_0.2.3dbs-60 has the same problem except that it
additionally requires you to run this as root otherwise you get:
$ ./console-tools_0.2.3dbs-60/bin/loadkeys --mktable keymap_psion_us.map
Couldnt get a file descriptor referring to the console
KDGKBMODE: Bad file descriptor
loadkeys: error reading keyboard mode
$

The following patch to the function add_number fixes this issue (but may
cause other problems)

--- ksyms.c.orig        2006-04-01 09:32:27.000000000 +0100
+++ ksyms.c     2006-04-01 10:02:15.000000000 +0100
@@ -1826,7 +1826,7 @@
        }
        if (kbd_mode != K_UNICODE && KTYP(code) < syms_size)
                return code;
-       return ksymtocode(codetoksym(code));
+       return code;
 }

 int

The cause here is that the 0xf03 in the map file is being converted into
a symbol and then back into the code. And it therefore rejected if there
is no mapping for this character.

I also don't understand why there are all the:
        ioctl(fd, KDGKBMODE, &kbd_mode);

when we are running with --mktable. AFAICT we shouldn't even be touching
the console (nor require running as root).

I think this is probably the underlying cause although I'm not
completely clear how this should be fixed. I think that if we are
running with --mktable we should not be looking at the console at all
but maybe need to consider whether -u was on the commandline?

(When I'm building the psion-5mx kernel I'm doing a cross compile. So
not only is loadkeys looking at the console on the wrong machine, it's
the wrong architecture and hardware as well)

Tim.


-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.27-3-686
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages console-tools depends on:
ii  console-common             0.7.49        Basic infrastructure for text cons
ii  debconf                    1.4.30.13     Debian configuration management sy
ii  libc6                      2.3.2.ds1-22  GNU C Library: Shared libraries an
ii  libconsole                 1:0.2.3dbs-56 Shared libraries for Linux console
ii  sysvinit                   2.86.ds1-1    System-V like init

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to