https://wiki.archlinux.org/api.php?action=feedcontributions&user=DajJense&feedformat=atomArchWiki - User contributions [en]2024-03-19T09:23:51ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=IBM_ThinkPad_T41&diff=65247IBM ThinkPad T412009-03-18T15:32:23Z<p>DajJense: </p>
<hr />
<div>[[Category:Laptops (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
== Introduction ==<br />
This article covers the installation and configuration of Arch Linux on an IBM/Lenovo T41 laptop. These laptops were very popular with corporate customers, and are now available reconditioned fairly cheaply. Typical spec is a 1.6GHz Pentium M, 512MB RAM, 32MB ATI Radeon graphics adapter and a 40GB hard drive. It is possible to get most if not all of the hardware to work in Arch, though the hard drive protection sensor requires a patched kernel.<br />
<br />
== Preparation and Installation ==<br />
This laptop has a hidden protected area (HPA) at the end of the hard drive, which can be used to restore the default OS (usually Windows XP Pro) to the factory state. If you do not want to use this feature, or have the recovery disks, you can reclaim about 3GB by disabling the "IBM Predesktop Area" in the BIOS.<br />
<br />
If you have the recovery disks or an intact HPA, they are the best way to install Windows (if you want to dual boot). Do this first, as the recovery disks will overwrite your MBR, and possibly other things too. Then you can shrink down the partition it creates, and install Arch.<br />
<br />
Note you can [http://thinkwiki.org/wiki/Ordering_Recovery_CDs#Creating_Recovery_CDs_from_the_preinstalled_O.2FS Create Recovery CDs from the preinstalled OS] if you need to, or if you're still under warranty, IBM may send some out to you.<br />
<br />
You can then install Arch as normal: [[Official_Arch_Linux_Install_Guide | Official Install Guide]].<br />
<br />
== ACPI ==<br />
The TP41 has excelent ACPI support. For the steps below, you will need acpid, which is available through pacman.<br />
<br />
=== Hibernation and Sleep ===<br />
The easiest way is to use [[pm-utils]], which supports suspend to RAM (sleep), suspend to file and suspend to swap (hibernate).<br />
<br />
=== CPU Frequency Scaling ===<br />
This Laptop has a Pentium M Banias chip, which supports [[speedstep]]<br />
<br />
You need the cpufrequtils package, and either cpufreqd or cpudyn. The correct module for the Banias is acpi_cpufreq.<br />
<br />
=== ACPI Events ===<br />
Out of the box, Fn+F4, Fn+F12 and the power button generate ACPI events. The thinkpad_acpi module can generate more events, see "FnFx and Special Buttons" below.<br />
<br />
=== Special Modules ===<br />
The thinkpad_acpi module (which may or may not be loaded by udev) provides support for all hotkeys (see below) and a number of other features. It has a procfs interface at ''/proc/acpi/ibm/'' which can be used to read out a number of thermal sensors, fan speed etc. and control volume, brightness, LEDs, beep codes and much more. Control of fan speed is possible if the driver is loaded with the experimental option, but if you use this keep an eye on the thermal sensors.<br />
<br />
The tp_smapi module is available in the AUR. On this model of thinkpad it only provides extra battery information; Battery discharge control is not supported. Note that this module conflicts with the hdaps module in the kernel mainline, they cannot both be loaded at the same time.<br />
<br />
== APM ==<br />
As an alternative to acpi, you can use apm. By default Arch Linux uses the much more modern acpi, so you have to boot your kernel with apm. The only reason to use apm is that with apm the ThinkPad keys work out of the box. apm is missing some features of acpi. To do so, append apm=on acpi=off to the kernel line in /boot/grub/menu.lst.<br />
title kernel26-ARCH<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 resume=/dev/sda2 ro vga=792 '''apm=on acpi=off'''<br />
initrd /kernel26.img<br />
<br />
=== Hibernation ===<br />
With apm enabled, all hotkeys work out of the box, but to use suspend to disk (Fn+F12), you have to prepare a "save2dsk.bin" file on a fat16 partition using the program [[http://samba.org/junkcode/#tphdisk | tphdisk]]. The Size of this file should be ramsize+videoramsize+few mb more. eg:<br />
tphdisk 565 > save2dsk.bin<br />
Do a cold reboot, so the bios can see the new file.<br />
<br />
=== Speedstep === <br />
As per ACPI<br />
<br />
== Fn+FX Function Keys and Special Buttons==<br />
=== Volume, Brightness, Thinklight & Lid ===<br />
The volume buttons, Fn+Home, Fn+End, Fn+PgUp and lid buttons are wired directly to the relevant piece of hardware, so do not need any configuration. With an appropriate mask (see below) they will still produce an acpi event, which can be used to display onscreen messages using xosd or libnotify.<br />
<br />
=== Back and Forward ===<br />
The two buttons next to the arrow keys generate normal keystrokes (233 and 234) when pressed, and can used in xbindkeys or xmodmap, or as shortcut keys. They can be used to change workspace in Metacity for example. If you want Windows-like back and forward in your browser, there are some instructions for most browsers on the [http://www.thinkwiki.org/wiki/How_to_get_special_keys_to_work#Example_Applications Thinkwiki].<br />
<br />
=== Other Keys and Buttons ===<br />
If you are using APM most Fn+Fx keys just work. <br />
<br />
If you are using ACPI without the thinkpad_acpi module, many work out of the box. If you want more/better/configurable keys, read on.<br />
<br />
By default most of the keys and buttons produce an acpi event. You can test which using:<br />
$ acpi_listen<br />
<br />
Exactly which keys produce an event depends on the mask set in ''/proc/acpi/ibm/hotkey''. You can read the mask using cat, and change it with something like:<br />
# echo enable,0x00ffffff > /proc/acpi/ibm/hotkey<br />
The hex value is a mask, which controls which keys are handled by the laptop firmware and which ones are handled by acpid. Exactly which bit effects which key/button is unknown, but 0x00000000 sends all events to the firmware, and 0x00ffffff send all events to acpid. The default is0 x008c7fff, which creates acpi events for most buttons, but not those listed above which are connected directly to the hardware. If you want to set the mask at every boot, just add the above command to ''/etc/rc.local''.<br />
If unsure, just leave it alone.<br />
<br />
You must then set up acpid to handle the acpi events. In Arch this is done through ''/etc/acpi/handler.sh'', which is a bash script, and uses case structures to decide what action to take for each event. With a mask of 0x00ffffff the following script handles most of the Fn+Fx keys according to the blue icons on them.<br />
<br />
'''FIXME: If you know how to toggle the external display on this laptop (Fn+F7), please update the script'''<br />
<pre><br />
#!/bin/sh<br />
<br />
# Acpi script that takes an entry for all actions. For an IBM <br />
# Thinkpad t41, assumes hotkey mask 0x00ffffff. Uses netcfg package.<br />
# by Jack Barraclough<br />
<br />
set $*<br />
<br />
case "$1" in<br />
ibm/hotkey)<br />
case "$4" in<br />
'00001003') # Fn + F3 switch off backlight<br />
xset -display :0 dpms force off<br />
;;<br />
'00001004') # Fn + F4 suspend<br />
/usr/sbin/pm-suspend<br />
;;<br />
'00001005') #Fn + F5 toggles network<br />
if [ -f /var/run/daemons/net-profiles ]<br />
then<br />
/etc/rc.d/net-profiles stop<br />
else<br />
/etc/rc.d/net-profiles start<br />
fi<br />
;;<br />
'0000100c') # Fn + F12 hibernates<br />
/usr/sbin/pm-hibernate<br />
;;<br />
*)<br />
logger "ACPI action undefined: $*"<br />
;;<br />
#<br />
# Add your own events here.<br />
#<br />
esac<br />
;;<br />
*)<br />
logger "ACPI action undefined: $*"<br />
esac<br />
</pre><br />
This may seem like a lot of work just to get the hotkeys working, but it is also very powerful and extensible. You can easily add more actions, and every Fn+Fx combo generates an event. To control [[mpd]] with Fn+{F9-F11} for example:<br />
<pre><br />
'00001009') # Tell MPD to skip back Fn+F9<br />
mpc prev<br />
;;<br />
'0000100a') # Tell MPD to play/pause Fn+F10<br />
mpc toggle<br />
;;<br />
'0000100b') # Tell MPD to skip forward Fn+F11<br />
mpc next<br />
;;<br />
</pre><br />
One word of warning: the script runs as root, so be careful. If you want to start firefox using the Access IBM button for example, use su or sudo to start it as your normal user, not root.<br />
<br />
A complete list of buttons/keys and the events they produce is available on the [http://www.thinkwiki.org/wiki/How_to_get_special_keys_to_work#Triggering_key_events Thinkwiki].<br />
<br />
=== tpb ===<br />
There is another method of getting these keys to work, using the nvram kernel module and a piece of software called tpb. This is quite complicated, and does not work as well. It is not recommended as thinkpad_acpi supports all the buttons on this laptop. For the curious, there is some information on the [Thinkpad OSD] page.<br />
<br />
== UltraPad and TrackPoint==<br />
Both the pad and TrackPoint are supported by the standard mouse driver, and by the [[synaptics]] package, which provides more functionality, such as scrolling using the edges of the pad.<br />
The below code will give you windows like functionality. It'll let you scroll with the middle mouse button, and also use it as a third mouse button for pasting and such.<br />
There are more details on how to configure more options on<br />
[http://thinkwiki.org/wiki/How_to_configure_the_TrackPoint Thinkwiki]<br />
<code><br />
Section "InputDevice"<br />
Identifier "Configured Mouse"<br />
Driver "mouse"<br />
Option "CorePointer"<br />
Option "Device" "/dev/input/mice"<br />
Option "Protocol" "ExplorerPS/2"<br />
Option "Emulate3Buttons" "on"<br />
Option "Emulate3TimeOut" "50"<br />
Option "EmulateWheel" "on"<br />
Option "EmulateWheelTimeOut" "200"<br />
Option "EmulateWheelButton" "2"<br />
Option "YAxisMapping" "4 5"<br />
Option "XAxisMapping" "6 7"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
</code><br />
<br />
== Networking ==<br />
=== Wired ===<br />
Wired ethernet should be working out of the box, with the e1000 module. To get gigabit speeds you may need to add this module to the MODULES array in ''/etc/rc.conf'' if it is not autodetected.<br />
<br />
=== Wireless ===<br />
The T41 comes with three diffrent wireless cards:<br />
* IBM 11a/b/g Wireless LAN Mini PCI Adapter (which uses an Atheros chipset)<br />
* Cisco Aironet Wireless 802.11b<br />
* Intel PRO/Wireless LAN 2100 3B Mini PCI Adapter<br />
You can check which you have with:<br />
lspci | grep Ethernet<br />
All of which should work under linux, and more details can be found on the [[Wireless Setup]] page.<br />
<br />
====Atheros Cards ====<br />
These cards are supported by the [[Wireless_Setup#madwifi | Madwifi]] driver. There is also the experimental ath5k driver, which will eventually replace the Madwifi project, and Ndiswrapper which has been reported to work better in some circumstances, but is considerably harder to set up.<br />
<br />
==== Cisco Cards ====<br />
'''FIXME: If you have a cisco card in your T41, please update this section'''<br />
These should be supported by the open source airo module, or the closed source mpi350 module from cisco.<br />
<br />
==== Intel Cards ====<br />
<br />
First install the wireless_tools package if you haven't selected it during the installation. It contains the ipw2100 dirver:<br />
pacman -S wireless_tools<br />
<br />
<br />
All you need to do now is install the firmware:<br />
pacman -S ipw2100-fw<br />
<br />
Your wireless device should now show up if you do:<br />
iwconfig<br />
<br />
For network management the combination of netcfg and archassistant works well.<br />
<br />
<br />
== Display ==<br />
The laptop has a ATI Radeon 7500 or 9000 graphics adapter, supported by the [[ATI#Open-Source ATI Drivers | open source ATI driver]]. Note that as of fglrx 8.28.8 these chipsets are not supported, so stick with the open source drivers.<br />
Most of the options on the radeon man page and on the ATI driver page can be used with this chip, but there are reports of crashes or blank screens when FastAGPWrites is enabled. On option of interest not on the ATI page is DynamicClocks, which can be used to reduce power consumption.<br />
<br />
==Hard drive Active Protection ==<br />
The T41 has a built in accelerometer, which can be used to detect when the laptop is dropped, and park the hard drive heads. Making this work in Linux requires three things:<br />
#'''The hdaps kernel module.''' Available in the stock kernel or in an improved form through tp_smapi. This makes the accelerometer readings available at ''/sys/devices/platform/hdaps/''. With the joydev kernel module, this can work as a joystick (good for neverball). There are also a few anti-theft scripts which use this interface.<br />
#'''The hdaps daemon.''' This reads the accelerometer values, and decides when to park the heads, it's in the AUR.<br />
#'''A patched kernel.''' In order to park the heads, the hdaps_protect patch kernel is needed. You will need to build your own kernel, or use a thinkpad-specific kernel from the AUR.<br />
<br />
== Links ==<br />
* [http://thinkwiki.org/ ThinkWiki (an invaluable resource) ]<br />
* [http://thinkwiki.org/wiki/Category:T41 ThinkWiki Page on the T41 ]<br />
* [ftp://ftp.software.ibm.com/pc/pccbbs/mobiles_pdf/13n6243.pdf Thinkpad T41 Hardware Maintenance Manual]</div>DajJense