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

[RFC] Proposed transition plan for adb -> linux keycodes



Since there appears to be no objections to moving away from the
deprecated adb keycodes over to linux keycodes I have been thinking
about a way to make the transition as painless as possible.  

Problems:

1) the kernel needs to be reconfigured with CONFIG_MAC_ADBKEYCODES=n
this will require that a new i386 keymap be installed or the console
will be unusable.

2) console-data needs to start setting up i386 maps instead of Mac
maps.  on upgrade it needs to change over to an i386 map, coinciding
with kernel replacement. 

Proposal:

* Woody ships with a 2.2.19 (or 2.2.20) kernel with
  CONFIG_MAC_ADBKEYCODES=n 

* console-data is changed to install a i386 map by default on new
  woody install.

* console-data when upgraded from previous versions will check the
  status of the dev/mac_hid/keyboard_sends_linux_keycodes sysctl:
	- If it exists and is set to 1, do nothing, the admin has already
	  taken care of the transition.
	- If it exists and is set to 0 we have a standard potato install
	  put up a message informing the user of the situation and
          what to do about it [1].
	- If the sysctl does not exist at all we have either a custom,
	  misconfigured kernel, or a very old potato kernel.  Explain
	  this situation and what to do about it [2].

[1] Your system is using obsolete Macintosh keycodes and keymap.  In
order to properly transition to the standard Linux keycodes you must
upgrade your kernel to a version which has the configuration option
`CONFIG_MAC_ADBKEYCODES' set to NO *AND* you *MUST* reselect an i386
keymap.  You may select the keymap now, but you must upgrade your
kernel before you reboot again or the console will become unusable.
Options:
1) Reconfigure keymap now
2) Reconfigure keymap later

Option 1 will select and install a i386 keymap and run sysctl -w
dev/mac_hid/keyboard_sends_linux_keycodes=1 which will keep the
console usable until the next reboot, at which point the user must
have replaced the kernel with a properly configured version.  

One other possibility is have Option 1 also create a new temporary
initscript with the following and link it to 06 in runlevel S:

/etc/init.d/keycode-fix.sh
#!/bin/sh

if [ "$(/sbin/sysctl -n dev/mac_hid/keyboard_sends_linux_keycodes)" = 0 ] ; then
    echo -n "WARNING: Fixing kernel keycodes...
    /sbin/sysctl -w dev/mac_hid/keyboard_sends_linux_keycodes=1 >/dev/null 
    echo "done."
elif [ "$(/sbin/sysctl -n dev/mac_hid/keyboard_sends_linux_keycodes)" = 1 ] ; then
    rm -f /etc/rcS.d/S06keycode-fix.sh 2> /dev/null
    rm -f /etc/init.d/keycode-fix.sh 2> /dev/null
fi

this script would fix the sysctl until the user fixed the kernel at
which point it would delete itself as its no longer needed.  i
personally find this rather hideous but it would save the user some
hassle if they forget to fix the kernel after fixing the keymap...  of
course this would not work in the next scenario.

[2] Your system is using the deprecated Macintosh keycodes and your
kernel does not support the new input later or standard Linux
keycodes.  You should upgrade your kernel before attempting to
reconfigure the keymap.  

This all does nothing about X11, I presume the XFree packages should
do something of their own to note the change. 

Bugs will have to be filed against:

* relevant XFree package to use i386 keymaps instead of Macintosh during configuration.
* console-data (see above)
* kernel-image-pmac turn off CONFIG_MAC_ADBKEYCODES

This is all still a bit rough, I am looking for comments and
suggestions on how to proceed.  I want this transition to occur for
woody so it needs to start ASAP.  

-- 
Ethan Benson
http://www.alaska.net/~erbenson/

Attachment: pgpih4O17x7KJ.pgp
Description: PGP signature


Reply to: