Difference between revisions of "IBM ThinkPad X41"

From ArchWiki
Jump to: navigation, search
(Other information: update package name.)
(Added the "Getting display keys to work" section)
(23 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
[[Category:IBM]]
 
[[Category:IBM]]
Installing Arch Linux isn't exactly trivial if you happen to be a lucky owner of an ThinkPad X41 laptop. As a rather new machine with a Serial-ATA (SATA) harddrive, no internal CD or DVD drive, and a slightly unusual networking chipset, you'll have to have some patience and time in order to get it “Arched”.
+
[[de:IBM X41t]]
 +
The X41 and X41t (tablet) are both SATA-based machines that
 +
include a SATA-PATA bridge allowing the use of PATA HDDs, see external links for
 +
modifications to use SATA HDDs and SSDs. The laptops utilise a Pentium M
 +
processor (either 1.5GHz or 1.6GHz), the [[Linux-ck]] packages contain optimised
 +
packages for this architecture.
  
With this guide, we hope to make it easier for you to run your new favorite Linux distribution on your laptop. Please help us improve and keep it updated.
+
This article contains some useful tweaks to make the most of your machine, the
 +
tweaks are mainly powersaving biased. With vanilla Arch, around 3 hours battery
 +
life was achieved, following powersaving tweaks a bit over than 5 hours
 +
was achieved, this was performed with screen brightness at the second highest
 +
value.
 +
==Installation==
 +
Grab the .iso file from [https://www.archlinux.org/download/ the download page], write this to a memory stick {{bc |<nowiki> sudo dd if=archlinux-201x.xx.xx-dual.iso of=/dev/sdX bs=4M</nowiki>}}Restart the computer and boot into it like any other Arch installation.
  
'''Update:''' As of June 17th, 2008 remastering the installation CD is no longer needed. The same IBM Thinkpad X41 boots and installs without a hitch with the official, standard ISO discs.
+
==Useful packages==
 +
Some useful packages for your IBM/Lenovo ThinkPad X41:  
 +
===System Packages===
 +
* {{Pkg|acpi}} - provides /proc/acpi, interesting things like lid state, temperatures, volume, brightness etc.
 +
* {{Pkg|xf86-input-wacom}} - Driver supporting Wacom tablet screen.
 +
* {{Pkg|xf86-video-intel}} - Xorg driver for the Intel 915GM graphics chip.
 +
* {{Pkg|tp_smapi}} - Adds support for SMAPI functions (battery discharge control, battery information, hdaps acceloremeter support).
 +
* {{Pkg|thinkfinger}} - Driver for fingerprint reader.
  
==The problem==
+
The IBM X41 comes with a ipw2915 wireless Centrino (A, B and G) or ipw2200
So what's the big deal here? You've installed a bunch of different distributions already, and never had any problems. So why should an Arch Linux install be any different? Well, for some reason the Arch Linux bootable ISO image doesn't contain the drivers necessary to boot from an USB-connected CDROM.
+
wireless Centrino (B and G) module, the {{Pkg|ipw2200}} module provides support
 +
for these two devices. {{Pkg|netctl}} has been tested and works flawlessly with
 +
the ipw2915.
  
Since the X-series laptops from IBM/Lenovo doesn't have any internal optical drives, you won't be able to access the stuff on the CD after a boot.
+
===Applications===
Part of this “stuff” is the tg3 kernel module, used by your primary NIC which is of   Broadcom make. Hence, you can only boot from the CD, but not load modules, keymaps or get your network connection up and running.
+
* {{Pkg|powertop}} - Measure power usage.
 +
* {{Pkg|cellwriter}} - (X41t) on-screen tablet keyboard.
 +
{{Note|Thinkfan seems to fail due to thinkpad_acpi not having a fan_control function}}
 +
* {{AUR|thinkfan}} - Control the utilisation of the fan.
 +
* {{Pkg|gpm}} - Linux console mouse server.
  
http://xarragon.terminal.se/stuff/0002/elcheapo_cd.jpg
+
==General Tweaks==
 +
===Scrolling with trackpoint===
 +
The following file can be added for trackpoint scrolling support in X.
 +
{{hc|/etc/X11/xorg.conf.d/10-trackpoint.conf|
 +
<nowiki>
 +
Section "InputClass"
 +
        Identifier      "Trackpoint Wheel Emulation"
 +
        MatchProduct    "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device"
 +
        MatchDevicePath "/dev/input/event*"
 +
        Option          "EmulateWheel"          "true"
 +
        Option          "EmulateWheelButton"    "2"
 +
        Option          "Emulate3Buttons"      "false"
 +
        Option          "XAxisMapping"          "6 7"
 +
        Option          "YAxisMapping"          "4 5"
 +
EndSection</nowiki>}}
 +
Taken from [[Xorg#Example: Wheel emulation (for a Trackpoint)]]
 +
==Powersaving tweaks==
 +
Initially without any powersaving tweaks, the X41 uses quite a lot of power
 +
(this can be monitored using {{Pkg|powertop}}, it also provides suggestions for
 +
reducing power consumption). Here are some modifications that I found
 +
considerable improved the battery life of the X41t.  
  
==The solution==
+
===laptop-mode (kernel)===
Luckily, we are seemingly not alone with this problem, since there is an excellent [https://wiki.archlinux.org/index.php/Remastering_the_Install_ISO guide on remastering the install ISO] for Arch Linux. This is exactly what we'll try to do. We will build a custom kernel witch includes support for the X41's hardware, and replace or add it to the ISO. You'll need a working Unix system in order to build the kernel and remaster the ISO.
+
Laptop mode is included in the kernel, it buffers disk activities to reduce
 +
utilisation of your HDD therefore saving a considerable amount of power. The
 +
effect with SSDs is less pronounced, but still saves some power.
 +
{{bc|<nowiki>echo "vm.laptop_mode=5" | sudo tee /etc/sysctl.d/laptop_mode.conf</nowiki>}}
  
As described in the aforementioned guide, you'll need an up-to-date Arch Linux install ISO to base your work on. I simply downloaded “arch-0.7.2-base.iso” from https://www.archlinux.org/download.
+
===SATA-ALPM (pm-utils)===
 +
ALPM - Aggressive Link Power Management allows the SATA host bus adapter to
 +
enter a low power state when inactive therefore reducing power consumption.
 +
{{bc|<nowiki>echo "SATA_ALPM_ENABLE=true" | sudo tee /etc/pm/config.d/sata_alpm
 +
sudo chmod +x /etc/pm/config.d/sata_alpm</nowiki>}}
  
Next we'll need a kernel. I simply downloaded the latest stable release from http://www.kernel.org, which was 2.6.17.6 at the time of this writing.
+
===Powersaving on PCI devices===
 +
Powersaving isn't automatically enabled on devices as sometimes it causes
 +
issues, this can save about 2W.
 +
{{hc|/etc/udev/rules.d/pci_powersaving.rules|<nowiki>
 +
ACTION=="add", SUBSYSTEM=="pci", ATTR{power/control}="auto"</nowiki>}}
  
Configuring the kernel comes next. I chose to compile all the drivers required by the X41 straight into the kernel, so I wouldn't need to mess with any modules at all. That's how I did it in my old Slackware days, you see. ;-)
+
===i915 RC6 powersaving===
 +
See [[Intel_Graphics#Module-based_Powersaving_Options]].
  
Here is a [http://xarragon.terminal.se/stuff/0002/config kernel configuration file] describing the kernel I built. You should be able to use it with newer kernels by dropping the file into the unpacked kernel source tree and issuing the `make oldconfig' command. Rename it from 'config' to '.config'.
+
===Disable NMI watchdog===
 +
The NMI watchdog is a debugging feature of the linux kernel that is enabled by
 +
default. It is useless for normal operation and significantly increases the
 +
number of CPU wakeups/second.  
 +
{{bc|<nowiki>echo "kernel.nmi_watchdog=0" | sudo tee /etc/sysctl.d/nmi_watchdog.conf
 +
</nowiki>}}
  
Here is a short summary of some of the options (to the best of my knowledge).
+
===PHC===
 +
PHC - Processor Hardware Control. {{AUR|intel-phc}} supports the Mobile Centrino
 +
line of processors and hence the X41, this program allows you to undervolt your
 +
CPU. Undervolting reduces the voltage(V) the processor runs at, because P=IV this will reduce your power consumption, this has no effect on performance, any excess voltage will be dissipated as heat, your laptop will run cooler and the fan will activate less frequently.
 +
{{bc|
 +
$ yaourt -S phc-intel
 +
$ phc-intel setup # To install drivers
 +
$ yaourt -S linux-phc-optimize
 +
$ sudo linux-phc-optimize # Repeat this each time the laptop crashes until you've got a full set of parameters, this is 9 times
 +
}}
  
 +
Once you have established stable VIDs, adding them to system startup can be
 +
accomplished modifying the phc-intel configuration file. If it doesn't exist,
 +
create it
 +
{{hc|/etc/phc-intel.conf|
 +
<nowiki> VIDS="17 15 13 11 9 7 5 4 4" </nowiki> }}
  
*BLK_DEV_SD - SCSI disk support, needed for harddrive access.
+
You can check that this is enabled on your next reboot by {{ic|sudo phc-intel
*BLK_DEV_SR - SCSI cdrom support, needed for USB CDROM access.
+
status}}
*SCSI_SATA - Generic SATA support.
+
*SCSI_ATA_PIIX - Chipset support for Intel ICH5/6 SATA chipset.
+
*BLK_DEV_RAM - Ramdisk support, needed during startup.
+
*BLK_DEV_INITRD - Initrd support, needed for boot process.
+
*TIGON3 - The wired gigabit ethernet card driver, tg3 for the Broadcom chipset.
+
*MPENTIUMM - Select Pentium M processor type.
+
  
 +
==Tablet support==
 +
The X41t utilises a Wacom digitiser for input, {{ic|pacman -S xf86-input-wacom}}
 +
provides support for it. Once installed the driver should be activated following
 +
the next reboot.
 +
===Getting display keys to work===
 +
If the display keys (Rotate, Escape, Enter, Prev, Next,...) on your X41 tablet aren't working, add {{ic|1=atkbd.softraw=0}} as a [[kernel parameter]] in your boot loader configuration. Once they're producing [[Extra Keyboard Keys|scancodes]], you can [[map scancodes to keycodes#Using setkeycodes|map them to keycodes]].
  
When happy with your configuration, build your kernel.
+
= External links =
Set the root device for the kernel using the rdev command:
+
  
 
+
* This report has been listed in the [http://tuxmobil.org/ibm.html Linux Laptop and Notebook Installation Survey: IBM].  
rdev <kernel-directory>/arch/i386/boot/bzImage /dev/ram0
+
* [http://www.placaware.com/?page_id=120 SATA support modification]
 
+
* [http://www.thinkwiki.org/wiki/Category:X41 ThinkWiki X41 page]
 
+
* [http://linuxfocus.org/~guido/gentoo-tpt43p/cooling/ T43p Cooling - applicable to X41t], I've added ~1mm thick copper sheet to both the CPU and northbridge heatsinks with no ill effects.
Follow the [https://wiki.archlinux.org/index.php/Remastering_the_Install_ISO instructions for remastering the install ISO]. Basically, you only need to copy the ISO contents to another directory, replace the 'isolinux/vmlinuz' kernel image with your own, and then make a new iso file from the modified directory tree. Burn the resulting ISO image to a CD.
+
 
+
Now you are ready to begin the installation! Hooray!
+
 
+
 
+
==Performing the installation==
+
So you've got your very own, customized Arch Linux bootable CD, and now you want to get it installed. Well, be warned. Since we kind of hacked that CD together, we'll need some magic fingers to get it to install properly.
+
 
+
First off, plug in your USB-based CD-drive into your laptop and put the CD in. Power up the laptop, and make sure you have your BIOS set to attempt to boot from the CD-drive. You'll be greeted with the standard Arch Linux boot prompt if you succeed.
+
 
+
Just press enter and your homemade kernel will begin booting shortly. If you get an error message about '/dev/ram0' not existing, you probably forgot to compile initrd support into your kernel (the ramdisc will hence not be created). If so, rebuild with support enabled and make a new CD (bummer, eh?).
+
 
+
After the boot messages have washed by, you will be left in the initial environment, from where you can load modules, change keymaps etc.
+
Since I have a Swedish keyboard layout, I first wanted to change that.
+
You will need to load the keyboard mapping files from the CD.
+
 
+
Examining the 'dmesg' output, you'll probably notice that no USB CD-drive is mentioned. You can either unplug the CD-drive and plug it back in, at which time it will be identified and assigned to '/dev/scd0', or simply “know” that the CD is actually already identified and assigned to '/dev/sr0'. Either way, you'll load the CD data by issuing the 'loaddisk <device>' command, where '<device>' is either '/dev/scd0' or '/dev/sr0', depending on your preference.
+
 
+
Then type 'km' and choose keyboard mapping in the list. Us swedes use 'i386/qwerty/sv-latin1.map.gz', choose whatever is appropriate for you.
+
 
+
Now you are ready to launch the Arch Linux setup program, located in the 'arch' directory. Type '/arch/setup' at the prompt.
+
 
+
From here on, the installation is pretty much smooth sailing. Just follow the on-screen instructions, and you should be home free.
+
 
+
http://xarragon.terminal.se/stuff/0002/login_ready.jpg
+
 
+
Myself I chose not to install a kernel at this point (since I wasn't sure it wouldn't install the shoddy, home-made one used for booting the system), and instead booted up the system from the CD-drive once again, but using the freshly installed root filesystem on the harddrive. Then I used pacman to install a kernel directly from the Arch Linux repositories.
+
 
+
If you want to do the same, just reboot with the CD-drive plugged in, and when the boot prompt shows up, issue 'arch root=/dev/sda2 noinitrd ro' (if you root Linux partition happens to be '/dev/sda2', as in my case).
+
 
+
Login as root, make sure your network interface is running properly (I use DHCP), and then issue the following pacman commands:
+
 
+
 
+
pacman –sync –refresh
+
pacman -S linux
+
 
+
 
+
Then add your new kernel to '/boot/grub/menu.lst', or to whatever file your bootloader uses.
+
 
+
==Other information==
+
Some interesting packages for your IBM/Lenovo ThinkPad X41:
+
*acpi
+
*acpid
+
*laptop-mode-tools
+
*xf86-video-intel
+
*thinkpad
+
*tpb
+
*tbctl
+
 
+
The IBM X41 comes with ipw2915 wireless Centrino (A, B and G) module. You use the ipw2200 modules (installable via pacman, several versions available depending on your kernel version). There seems to be some problem with the drivers for both wireless and cabled ethernet, since I've experienced weird behavior from those devices a number of times, both under Debian, Ubuntu and now also Arch Linux. The devices just doesn't respond to certain commands, or simply doesn't work. For example, the wireless device can sometimes not switch mode via  the iwconfig command, "operation not supported". A reboot usually fixes these issues. They can be related to having performed a sleep earlier.
+
 
+
= External Links =
+
 
+
* This report has been listed in the [http://tuxmobil.org/ibm.html Linux Laptop and Notebook Installation Survey: IBM].
+

Revision as of 12:30, 27 December 2013

The X41 and X41t (tablet) are both SATA-based machines that include a SATA-PATA bridge allowing the use of PATA HDDs, see external links for modifications to use SATA HDDs and SSDs. The laptops utilise a Pentium M processor (either 1.5GHz or 1.6GHz), the Linux-ck packages contain optimised packages for this architecture.

This article contains some useful tweaks to make the most of your machine, the tweaks are mainly powersaving biased. With vanilla Arch, around 3 hours battery life was achieved, following powersaving tweaks a bit over than 5 hours was achieved, this was performed with screen brightness at the second highest value.

Installation

Grab the .iso file from the download page, write this to a memory stick
 sudo dd if=archlinux-201x.xx.xx-dual.iso of=/dev/sdX bs=4M
Restart the computer and boot into it like any other Arch installation.

Useful packages

Some useful packages for your IBM/Lenovo ThinkPad X41:

System Packages

  • acpi - provides /proc/acpi, interesting things like lid state, temperatures, volume, brightness etc.
  • xf86-input-wacom - Driver supporting Wacom tablet screen.
  • xf86-video-intel - Xorg driver for the Intel 915GM graphics chip.
  • tp_smapi - Adds support for SMAPI functions (battery discharge control, battery information, hdaps acceloremeter support).
  • thinkfinger - Driver for fingerprint reader.

The IBM X41 comes with a ipw2915 wireless Centrino (A, B and G) or ipw2200 wireless Centrino (B and G) module, the ipw2200 module provides support for these two devices. netctl has been tested and works flawlessly with the ipw2915.

Applications

Note: Thinkfan seems to fail due to thinkpad_acpi not having a fan_control function
  • thinkfanAUR - Control the utilisation of the fan.
  • gpm - Linux console mouse server.

General Tweaks

Scrolling with trackpoint

The following file can be added for trackpoint scrolling support in X.

/etc/X11/xorg.conf.d/10-trackpoint.conf

Section "InputClass"
        Identifier      "Trackpoint Wheel Emulation"
        MatchProduct    "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device"
        MatchDevicePath "/dev/input/event*"
        Option          "EmulateWheel"          "true"
        Option          "EmulateWheelButton"    "2"
        Option          "Emulate3Buttons"       "false"
        Option          "XAxisMapping"          "6 7"
        Option          "YAxisMapping"          "4 5"
EndSection

Taken from Xorg#Example: Wheel emulation (for a Trackpoint)

Powersaving tweaks

Initially without any powersaving tweaks, the X41 uses quite a lot of power (this can be monitored using powertop, it also provides suggestions for reducing power consumption). Here are some modifications that I found considerable improved the battery life of the X41t.

laptop-mode (kernel)

Laptop mode is included in the kernel, it buffers disk activities to reduce utilisation of your HDD therefore saving a considerable amount of power. The effect with SSDs is less pronounced, but still saves some power.

echo "vm.laptop_mode=5" | sudo tee /etc/sysctl.d/laptop_mode.conf

SATA-ALPM (pm-utils)

ALPM - Aggressive Link Power Management allows the SATA host bus adapter to enter a low power state when inactive therefore reducing power consumption.

echo "SATA_ALPM_ENABLE=true" | sudo tee /etc/pm/config.d/sata_alpm
sudo chmod +x /etc/pm/config.d/sata_alpm

Powersaving on PCI devices

Powersaving isn't automatically enabled on devices as sometimes it causes issues, this can save about 2W.

/etc/udev/rules.d/pci_powersaving.rules
ACTION=="add", SUBSYSTEM=="pci", ATTR{power/control}="auto"

i915 RC6 powersaving

See Intel_Graphics#Module-based_Powersaving_Options.

Disable NMI watchdog

The NMI watchdog is a debugging feature of the linux kernel that is enabled by default. It is useless for normal operation and significantly increases the number of CPU wakeups/second.

echo "kernel.nmi_watchdog=0" | sudo tee /etc/sysctl.d/nmi_watchdog.conf

PHC

PHC - Processor Hardware Control. intel-phcAUR supports the Mobile Centrino line of processors and hence the X41, this program allows you to undervolt your CPU. Undervolting reduces the voltage(V) the processor runs at, because P=IV this will reduce your power consumption, this has no effect on performance, any excess voltage will be dissipated as heat, your laptop will run cooler and the fan will activate less frequently.

$ yaourt -S phc-intel
$ phc-intel setup # To install drivers
$ yaourt -S linux-phc-optimize
$ sudo linux-phc-optimize # Repeat this each time the laptop crashes until you've got a full set of parameters, this is 9 times

Once you have established stable VIDs, adding them to system startup can be accomplished modifying the phc-intel configuration file. If it doesn't exist, create it

/etc/phc-intel.conf
 VIDS="17 15 13 11 9 7 5 4 4"  

You can check that this is enabled on your next reboot by sudo phc-intel status

Tablet support

The X41t utilises a Wacom digitiser for input, pacman -S xf86-input-wacom provides support for it. Once installed the driver should be activated following the next reboot.

Getting display keys to work

If the display keys (Rotate, Escape, Enter, Prev, Next,...) on your X41 tablet aren't working, add atkbd.softraw=0 as a kernel parameter in your boot loader configuration. Once they're producing scancodes, you can map them to keycodes.

External links