| www.volker-lanz.de | |||||||
|
Software Development blog.volker-lanz.de KDE Partition Manager BoxMonster QSynergy The Black Art of Optimising Thirdparty or roll your own? Linux Thinkpad function keys on SUSE Linux 9.2 SUSE Linux 9.2 on an IBM Thinkpad T41p Mac The Mac Mini Toys SUSE Linux 10 and an Apple iPod The Nokia 9500 Communicator Interactive Fiction Inf2ATR Infocom's Deadline ported to Inform Intruder NPC Engine for Inform Meta About |
Getting the IBM Thinkpad's function keys to work on SUSE Linux 9.2If you have read my essay on running SUSE Linux 9.2 on an IBM Thinkpad T41p, you know that the Thinkpad's special function keys (like Fn+F3 for "backlight off" or Fn+F12 for "suspend to disk") don't work by default after installing SUSE Linux 9.2.They can be made to work, however, this requires quite some effort. Let me describe the process here for you. Building your own kernelSUSE 9.2 is becoming a dated distribution as of now (SUSE 9.3 is about to be released, but is rumoured to be less than spectacular) and quite a few Kernel updates have been released since it saw the light of day. Thus, the first thing we need to do is update the ageing 2.6.8 kernel to 2.6.11. Please note that you might probably get away with running the SUSE Linux kernel 2.6.8, but I have not tried this: Running a newer kernel than 2.6.8 had become a necessity for me before, because 2.6.9 and 2.6.10 both have important fixes in the USB department I needed to get my USB stick (an LG X-Tick) to work. To enable all of the Thinkpad's function keys, we need to use the ibm_acpi kernel module, and a quite recent version of this comes with 2.6.11. If you do not want to update your kernel, it might suffice to get the ibm_acpi sources and build the module only. This, however, is not covered here.How to build your own kernel is described in various documents found on the web, so I won't cover the process in greater detail here. There are a few SUSE-Linux-specific things to note, however:
Setting up the ibm_acpi kernel moduleWith the new kernel up and running, it's time to get the ibm_acpi kernel module to work. First of all, we need to make sure it is loaded when the Thinkpad boots up, so we add the following lines to/etc/init.d/boot.local:
modprobe ibm_acpi experimental=1The first line inserts the module and turns on its experimental features (don't worry, we won't do anything potentially harmful). The second line enables the hotkeys and the third line tells the module to pass all hotkey events to acpid.
SUSE Linux 9.2 uses acpid only to pass on the ACPI events to powersaved, so there's no use in configuring acpid to do anything with the special IBM hotkey events we now get. However, you should see these events in acpid's logfile, /var/log/acpid.
Configuring powersavedWe are now going to deal with all hotkey events ourselves, so first we need to make surepowersaved does ignore the events we want to process and passes them on to a script of our own.
Make sure you have these lines in /etc/sysconfig/powersave/events:
POWERSAVE_EVENT_BUTTON_POWER="ignore"These settings make sure powersaved doesn't process the events generated when the "sleep button" (powersaved thinks this is Fn+F3) is pressed or when the power button is pressed.
To make powersaved pass on the hotkey events to us, we need to add another line to /etc/sysconfig/powersave/events:
POWERSAVE_EVENT_OTHER="acpi_hotkeys_IBM_t41p"This line has the effect of powersaved calling the script /usr/lib/powersave/scripts/acpi_hotkeys_IBM_t41p
each time an event is to be processed that it doesn't itself know how
to deal with. Of course, this script does not yet exist. We will have
to provide it ourselves.
The hotkey scriptFor the impatient: Get the script, put it in/usr/lib/powersave/scripts/, and you're done. Make sure you have the radeontoolbinary installed in /usr/local/sbin, or Fn+F3 will not work.
The script's inner workings are pretty straightforward: Depending on what arguments it is called with by powersaved, it triggers certain actions: For Fn+F4, for example, it calls powersave -u
to put the machine to suspend to ram. It also makes the sleep-LED blink
before doing so, to indicate that the Thinkpad did indeed receive the
hotkey event.
The script processes Fn+F3, Fn+F4, Fn+F5, Fn+F7 and Fn+F12. Unfortunately, Fn+F7 doesn't really work. This is apparently caused by the X.org-radeon-driver. The script also handles the lid close event, because for some reason I did not quite understand powersaved stopped processing this event for me after setting up the script. I find this surprising because I still have
POWERSAVE_EVENT_BUTTON_LID_CLOSED="suspend_to_ram"in /etc/sysconfig/powersave/events. Anyway, adding the LID_CLOSE event to the script works without a problem.
Fn+F5 turns off bluetooth and shuts down ath0. Pressing it again turns on bluetooth and gets ath0 up again. If you never ever need bluetooth, you might want to comment out the lines echo enable > /proc/acpi/ibm/bluetoothfrom the script, because having bluetooth running all the time consumes power that is of course wasted if you don't use bluetooth at all. If you have radeontool installed, but the binary is not located in /usr/local/sbin, you will need to adjust the RADEONTOOL variable at the top of the script to point to where you have it on your Thinkpad.
SummaryGetting the IBM Thinkpad's function keys to work under SUSE Linux 9.2 requires a little tweaking and fiddling, but is not an unsurmountable task. The hardest part, for me at least, was to find out how to pass on unprocessed events frompowersaved to a user-supplied
bash script. The Thinkpad now properly goes to sleep (suspend-to-ram)
when Fn+F3 is pressed and hibernates (suspend-to-disk) with Fn+F12.
Also, Fn+F5 toggles WLAN and Bluetooth on and off.
Not all function keys are being processed by powersaved
and the bash script, however. The brightness keys, the zoom function
(on space bar), the ThinkLight key and the Access IBM key are still
being dealt with by tbp.
|
||||||
|
|