[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#239035: mac/ADB keymaps inappropriate for powerpc



Hi Colin,

Thanks for your report.

Looking at your patch, you removed mac_kbd.c from powerpc.
I'd prefer to do the following: check in mac-kbd.c:

     fd = open("/proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes", O_RDONLY);

        if ((fd < 0) || (read(fd,&c, 1) != 1)) {
                di_info ("Failed to open /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes;
Assuming not adb");
                k->present = FALSE;
                return keyboards;
        }
        close(fd);
        if (c != '0') {
                di_info ("Sending linux keycodes ; not using ADB keymaps\n");

                k->present = FALSE;
                return keyboards;
        }
                                                                           
                                           


This allows kbd-chooser to be used on a running system 
as well as in d-i. Can you please verify this would work
as planned on powerpc?

On review, it was a mistake to couple "architecture"
(AT / USB / etc.) to keymap choice in d-i. All the 
keymaps in console-keymaps-usb are for the mac keyboards;
"PC" USB keyboards use AT keymaps; etc.
However fixing that  now in sarge would be too much breakage, so I am including
 your patch; and doing the following:

- Read the USB vendor code from /proc/bus/usb/devices ; 
if the keyboard vendor != Apple, don't use the "USB" (Mac USB)
keymaps. 
- If in kbd-chooser.c we find no keyboards, and we're not using a serial console,
use AT keymaps.


Any comments ? Do you know of a way to detect ADB keyboards
on 2.4 / 2.6 kernels?


- Alastair



Reply to: