Bug#239035: kbd-chooser: mac/ADB keymaps inappropriate for powerpc
Package: kbd-chooser
Version: 0.45
Severity: normal
I noticed that the reason kbd-chooser was failing on a PowerBook G4 was
that the default keyboard was mac but console-keymaps-mac wasn't in the
initrd, so I built a netboot image with that udeb added to see what
would happen. The result was a thoroughly unusable keymap, because the
keymaps in console-keymaps-mac are all based on ADB keycodes: see
http://www.debian.org/ports/powerpc/keycodes for why these are
inappropriate on powerpc. All our powerpc kernels are built with
CONFIG_MAC_ADBKEYCODES=n.
Figuring out what to do about this is the interesting bit. For the time
being, I'd suggest simply disabling mac keyboard support for powerpc.
The #if !defined(__powerpc__) hack in usb-kbd.c means that they end up
being treated as USB keyboards even though they're not, but this is OK
since the only effect is the keyboard map. It would be neater to have
some way to return a different keymap name from mac_kbd_get, though.
I've tested this on newworld powerpc and it's fine, and I'm pretty sure
it will at least not make other powerpc subarchitectures any worse; but
I'm posting this rather than committing it because perhaps there's some
more general solution, and I'm not sure about the state of ADB on m68k.
Index: Makefile
===================================================================
RCS file: /cvsroot/d-i/debian-installer/tools/kbd-chooser/Makefile,v
retrieving revision 1.25
diff -p -u -r1.25 Makefile
--- Makefile 13 Mar 2004 11:03:11 -0000 1.25
+++ Makefile 20 Mar 2004 11:36:10 -0000
@@ -45,8 +45,8 @@ CFLAGS += -DSPARC_KBD -DUSB_KBD
KEYBOARDS := sparc usb
endif
ifeq ($(ARCH),powerpc)
-CFLAGS += -DUSB_KBD -DAT_KBD -DAMIGA_KBD -DMAC_KBD
-KEYBOARDS := at usb amiga mac
+CFLAGS += -DUSB_KBD -DAT_KBD -DAMIGA_KBD
+KEYBOARDS := at usb amiga
endif
ifeq ($(ARCH),arm)
CFLAGS += -DAT_KBD -DUSB_KBD
Index: usb-kbd.c
===================================================================
RCS file: /cvsroot/d-i/debian-installer/tools/kbd-chooser/usb-kbd.c,v
retrieving revision 1.17
diff -p -u -r1.17 usb-kbd.c
--- usb-kbd.c 13 Mar 2004 10:58:16 -0000 1.17
+++ usb-kbd.c 20 Mar 2004 11:36:11 -0000
@@ -38,8 +38,9 @@ kbd_t *usb_kbd_get (kbd_t *keyboards, co
#if !defined(__powerpc__)
/* The following code tries to autodetect USB keyboards.
- * its currently implicated in debian bug #234513,
- * and excluded for beta3.
+ * While PowerMac systems are often ADB, we don't want to use ADB
+ * keycodes (http://www.debian.org/ports/powerpc/keycodes), so
+ * pretend they're USB.
*/
/* In 2.4, if "Device=usbkbd" is present in /proc/bus/usb/devices
--
Colin Watson [cjwatson@flatline.org.uk]
Reply to: