Difference between revisions of "Lenovo ThinkPad X200"

From ArchWiki
Jump to: navigation, search
(Configuration)
(Configuration)
(18 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
{{Article summary start}}
 
{{Article summary start}}
 
{{Article summary text|This article covers the Arch Linux support for the Lenovo ThinkPad X200 laptop.}}
 
{{Article summary text|This article covers the Arch Linux support for the Lenovo ThinkPad X200 laptop.}}
{{Article summary heading|Related articles}}
 
{{Article summary wiki|Lenovo ThinkPad X200 Tablet}}
 
{{Article summary wiki|Lenovo ThinkPad X200S}}
 
 
{{Article summary end}}
 
{{Article summary end}}
  
Line 16: Line 13:
  
 
Now you can choose whatever network configuration programs you want to use. If you do not already know which network manager you want to use, we highly recommend [[netcfg]].
 
Now you can choose whatever network configuration programs you want to use. If you do not already know which network manager you want to use, we highly recommend [[netcfg]].
 +
 +
If you experience connectivity problems such as a slow connection or aborts, especially when connected to an (Enterprise) WPA2 network, then try to load the iwlwifi module with the options {{ic|11n_disable=1}}, {{ic|11n_disable=2}}, {{ic|swcrypto=1}}, {{ic|bt_coex_active=0}}. There is no clear recommendation which of these options to be used as for some users {{ic|11n_disable=1}} already solves the problem sufficiently, for others {{ic|bt_coex_active=0}}. Thus, play around with each of them. Example:
 +
 +
modprobe iwlwifi 11n_disable=2
 +
 +
If some of them work out for you, then make the options permanent by creating the file {{ic|/etc/modprobe.d/wireless.conf}} and adding the following:
 +
 +
options iwlwifi 11n_disable=2
 +
# Disable blinking LED wireless light
 +
options iwlwifi led_mode=1
  
 
===Graphics===
 
===Graphics===
Line 28: Line 35:
  
 
See [[Alsa]] for more information.
 
See [[Alsa]] for more information.
 +
 +
===Fingerprint Reader===
 +
Some versions of the X200 are equipped with an Authentec 2810 fingerprint reader. The fingerprint reader functions with pam and fprint with minimal configuration of pam.
 +
 +
# sudo pacman -S pam fprint
 +
 +
See [[Fprint]] for more information.
  
 
==Configuration==
 
==Configuration==
 +
{{note|Useful configuration settings and examples for an X200 are maintained in [https://github.com/orschiro/Linux this] github repo.}}
 +
 
===Disable bluetooth at boot===
 
===Disable bluetooth at boot===
 
In order to disable bluetooth at boot you just need to add the following line to a newly created /etc/tmpfiles.d/disable-bluetooth.conf file. Please note, that there is no longer support for a /etc/rc.local file.
 
In order to disable bluetooth at boot you just need to add the following line to a newly created /etc/tmpfiles.d/disable-bluetooth.conf file. Please note, that there is no longer support for a /etc/rc.local file.
  
  w /proc/acpi/ibm/bluetooth ---- disable
+
  w /proc/acpi/ibm/bluetooth - - - - disable
 +
 
 +
===Enable tap to select===
 +
You can enable the double click through tapping on your track point. Create a {{ic|/etc/tmpfiles.d/enable-tap-to-select.conf}} with the following content:
 +
 
 +
w /sys/devices/platform/i8042/serio1/press_to_select - - - - 1
  
 
===Hard Disk Shock Protection===
 
===Hard Disk Shock Protection===
 
The ThinkPad X200 comes with an integrated 2-axis accelerometer providing the possibility of parking the hard drive's disk heads preventing from data loss due to heavy shocks.
 
The ThinkPad X200 comes with an integrated 2-axis accelerometer providing the possibility of parking the hard drive's disk heads preventing from data loss due to heavy shocks.
  
First you'll have to install [https://aur.archlinux.org/packages.php?ID=3985 tp_smapi] and [https://aur.archlinux.org/packages.php?ID=5401 hdapsd] from [[AUR]]. Then you have to load the hdaps module provided by tp_smapi with the option invert=7 passed. This will correct the orientation of the accelerometer's axises.
+
First you'll have to install [https://aur.archlinux.org/packages.php?ID=3985 tp_smapi] and [https://aur.archlinux.org/packages.php?ID=5401 hdapsd] from [[AUR]]. Then you have to load the hdaps module provided by tp_smapi with the option invert=5 passed. This will correct the orientation of the accelerometer's axises. If you are using systemd, create a file {{ic|/etc/modules-load.d/tp_smapi.conf}} with the following line:
  
Since linux provides a default hdaps module which we do not want to use, we have to specify the full path. This cannot be done in /etc/rc.conf, but instead you'll have to load the module manually from /etc/rc.local.
+
# Load tp_smapi at boot
 +
options tp_smapi invert=7
  
To enable shock protection you have to start the hdapsd daemon. Since /etc/rc.local is executed after /etc/rc.conf, hdapsd has to be started from the /etc/rc.local as well.
+
Then you need to start the hdapsd daemon:
  
  $ cat /etc/rc.local
+
  # systemctl enable hdapsd
  [...]
+
  # systemctl start hdapsd
insmod /lib/modules/2.6.32-ARCH/extra/hdaps.ko invert=7
+
 
/etc/rc.d/hdapsd start
+
Now check your log files with {{ic|journalctl}} if you see any parking/unparking entries which indicate that hdapsd is successfully configured.
  
 
For full information see: [[HDAPS]]
 
For full information see: [[HDAPS]]
 +
 +
{{Note|If you experience parking / un-parking events when not moving your hard disk, then you might use the wrong invert value. Install and run [[AUR|hdaps-gl]] and check whether it shows your machine in the correct orientation when turning the machine. If not, you need to change the invert value. Alternatively to reloading the module you can also directly write a value between 0 and 7 to {{ic|/sys/devices/platform/hdaps/invert}}.}}
 +
 +
===Mute button===
 +
If the mute button on your keyboard is not working, then be sure to add acpi_osi="Linux" to your boot parameter in /etc/default/grub.
 +
 +
GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=Linux"
 +
 +
===Screen rotation===
 +
The screen rotation hardware button does not work by default. First you have to assign this button to a free keycode. Then you can assign the script for screen rotation to that button.
 +
# File: /etc/systemd/system/setkeycodes.service
 +
 +
[Unit]
 +
Description=Assign screen rotation hardware button to a free keycode on boot
 +
 +
[Service]
 +
Type=oneshot
 +
ExecStart=/usr/bin/setkeycodes 6c 131
 +
 +
[Install]
 +
WantedBy=multi-user.target
 +
 +
# File: /usr/local/bin/screen_rotation.sh
 +
 +
#!/bin/sh
 +
 +
# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation.
 +
 +
rotation="$(xrandr -q --verbose | grep 'connected' | egrep -o  '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')"
 +
 +
# Using current screen orientation proceed to rotate screen and input tools.
 +
 +
case "$rotation" in
 +
    normal)
 +
    # rotate to the left
 +
    xrandr -o left
 +
    xsetwacom set "Serial Wacom Tablet WACf004 stylus" rotate ccw
 +
    xsetwacom set "Serial Wacom Tablet WACf004 eraser" rotate ccw
 +
    ;;
 +
    left)
 +
    # rotate to normal
 +
    xrandr -o normal
 +
    xsetwacom set "Serial Wacom Tablet WACf004 stylus" rotate none
 +
    xsetwacom set "Serial Wacom Tablet WACf004 eraser" rotate none
 +
    ;;
 +
 +
The assignment of the keycode to the script depends on your desktop environment. For Gnome the assignment can be easily done in the Keyboard preferences of custom shortcuts.
  
 
===Power consumption and fan control===
 
===Power consumption and fan control===
 
You might notice a beeping whilst your system is running. This is due to missing fan control. Install the [https://aur.archlinux.org/packages/tlp/ tlp] package from AUR to enable extensive fan and power consumption control.
 
You might notice a beeping whilst your system is running. This is due to missing fan control. Install the [https://aur.archlinux.org/packages/tlp/ tlp] package from AUR to enable extensive fan and power consumption control.
 +
 +
You can further disable the nmi-watchdog by creating the file {{ic|/etc/tmpfiles.d/disable-nmi-watchdog.conf}} with the following line:
 +
 +
w /proc/sys/kernel/nmi_watchdog - - - - 0
 +
 +
This will disable the watchdog at startup.
 +
 +
Additionally you might want to define different brightness level and automatically dim your screen when you are running on battery. A DE and WM independent solution is the usage of pm-utils. Detailed instructions can be found [https://wiki.archlinux.org/index.php/Pm-utils#Change_brightness_depending_on_AC_state here]. They are tested to work with a X200T.
  
 
===Suspend to RAM===
 
===Suspend to RAM===
Line 64: Line 141:
  
 
'''Note:''' Very seldom after resuming the backlight won't come back on. The following page on ThinkWiki might provide information on how to solve this issue: [http://www.thinkwiki.org/wiki/Problem_with_display_remaining_black_after_resume Problem with display remaining black after resume].
 
'''Note:''' Very seldom after resuming the backlight won't come back on. The following page on ThinkWiki might provide information on how to solve this issue: [http://www.thinkwiki.org/wiki/Problem_with_display_remaining_black_after_resume Problem with display remaining black after resume].
 +
 +
==Unsupported==
 +
<s>Unlike those on older models, the fingerprint reader on the X200 ("Authentec 2810") is unsupported on linux as there are no working drivers either in the kernel or outside[http://www.thinkwiki.org/wiki/Integrated_Fingerprint_Reader#Software_support].</s>
 +
 +
==Troubleshooting==
 +
===System feels unresponsive===
 +
If your system feels unresponsive and lagging, you can try creating a file called {{ic|/etc/modprobe.d/drm_kms.conf}}:
 +
 +
options drm_kms_helper poll=N
 +
 +
===PM device: Resume from hibernation error: Failed to restore -19===
 +
 +
This is likely to be related to the tpm_tis and tpm modules not being properly unloaded before hibernation. These modules are required by the device listed in the error as 00:0a:
 +
 +
# dmesg | grep 00:0a
 +
[    0.377877] pnp 00:0a: Plug and Play ACPI device, IDs PNP0c31 (active)
 +
[  10.746742] tpm_tis 00:0a: 1.2 TPM (device-id 0x1020, rev-id 6)
 +
[  10.746751] tpm_tis 00:0a: Intel iTPM workaround enabled
 +
[  10.866734] tpm_tis 00:0a: TPM is disabled/deactivated (0x6)
 +
 +
To unload the module create the following executable file called {{ic|/usr/lib/systemd/system-sleep/tpm.sh}}, assuming the use of the systemd hibernation procedure:
 +
 +
#!/bin/sh
 +
case $1/$2 in
 +
  pre/*)
 +
    echo "Going to $2..."
 +
    modprobe -r tpm
 +
    modprobe -r tpm_tis
 +
    ;;
 +
  post/*)
 +
    echo "Waking up from $2..."
 +
    modprobe tpm
 +
    modprobe tpm_tis
 +
    ;;
 +
esac
  
 
==See also==
 
==See also==
 
* Thinkwiki: [http://www.thinkwiki.org/wiki/Category:X200 X200 Overview]
 
* Thinkwiki: [http://www.thinkwiki.org/wiki/Category:X200 X200 Overview]
 
* ThinkWiki: [http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption How to reduce power consumption]
 
* ThinkWiki: [http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption How to reduce power consumption]

Revision as of 06:32, 26 June 2013

Template:Article summary start Template:Article summary text Template:Article summary end

The Lenovo ThinkPad X200 is a wonderful high-quality laptop featuring a 12.1" widescreen WXGA monitor, an Intel Core 2 Duo processor (2.26 - 2.66GHz), an Intel Graphics Media Accelerator 4500MHD and up to 4GB of RAM whilst still maintaining impressive battery life.

While Arch Linux is running flawlessly on this laptop there are a few things you have to configure manually. This article will aid you in configuring your system and will provide additionally hints to make your ThinkPad X200 experience even better.

Setup

Wireless

The ThinkPad X200 has a Intel PRO/Wireless 5100 AGN wireless adapter included. In order to make it work you have to install the iwlwifi-5000-ucode package when you install from a 2010.05 snapshot in order to get the firmware, by now the package is included in the linux-firmware package.

Now you can choose whatever network configuration programs you want to use. If you do not already know which network manager you want to use, we highly recommend netcfg.

If you experience connectivity problems such as a slow connection or aborts, especially when connected to an (Enterprise) WPA2 network, then try to load the iwlwifi module with the options 11n_disable=1, 11n_disable=2, swcrypto=1, bt_coex_active=0. There is no clear recommendation which of these options to be used as for some users 11n_disable=1 already solves the problem sufficiently, for others bt_coex_active=0. Thus, play around with each of them. Example:

modprobe iwlwifi 11n_disable=2

If some of them work out for you, then make the options permanent by creating the file /etc/modprobe.d/wireless.conf and adding the following:

options iwlwifi 11n_disable=2
# Disable blinking LED wireless light 
options iwlwifi led_mode=1

Graphics

The graphics card is supported by the xf86-video-intel driver package from the extra repository. The Xorg server makes use of this automatically. There's no need for a Xorg configuration file.

# pacman -S xf86-video-intel

Audio

Audio is supported out of the box after installing the necessary alsa packages from the core repository.

# sudo pacman -S alsa-lib

See Alsa for more information.

Fingerprint Reader

Some versions of the X200 are equipped with an Authentec 2810 fingerprint reader. The fingerprint reader functions with pam and fprint with minimal configuration of pam.

# sudo pacman -S pam fprint

See Fprint for more information.

Configuration

Note: Useful configuration settings and examples for an X200 are maintained in this github repo.

Disable bluetooth at boot

In order to disable bluetooth at boot you just need to add the following line to a newly created /etc/tmpfiles.d/disable-bluetooth.conf file. Please note, that there is no longer support for a /etc/rc.local file.

w /proc/acpi/ibm/bluetooth - - - - disable

Enable tap to select

You can enable the double click through tapping on your track point. Create a /etc/tmpfiles.d/enable-tap-to-select.conf with the following content:

w /sys/devices/platform/i8042/serio1/press_to_select - - - - 1

Hard Disk Shock Protection

The ThinkPad X200 comes with an integrated 2-axis accelerometer providing the possibility of parking the hard drive's disk heads preventing from data loss due to heavy shocks.

First you'll have to install tp_smapi and hdapsd from AUR. Then you have to load the hdaps module provided by tp_smapi with the option invert=5 passed. This will correct the orientation of the accelerometer's axises. If you are using systemd, create a file /etc/modules-load.d/tp_smapi.conf with the following line:

# Load tp_smapi at boot
options tp_smapi invert=7

Then you need to start the hdapsd daemon:

# systemctl enable hdapsd
# systemctl start hdapsd

Now check your log files with journalctl if you see any parking/unparking entries which indicate that hdapsd is successfully configured.

For full information see: HDAPS

Note: If you experience parking / un-parking events when not moving your hard disk, then you might use the wrong invert value. Install and run hdaps-gl and check whether it shows your machine in the correct orientation when turning the machine. If not, you need to change the invert value. Alternatively to reloading the module you can also directly write a value between 0 and 7 to /sys/devices/platform/hdaps/invert.

Mute button

If the mute button on your keyboard is not working, then be sure to add acpi_osi="Linux" to your boot parameter in /etc/default/grub.

GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=Linux"

Screen rotation

The screen rotation hardware button does not work by default. First you have to assign this button to a free keycode. Then you can assign the script for screen rotation to that button.

# File: /etc/systemd/system/setkeycodes.service 

[Unit]
Description=Assign screen rotation hardware button to a free keycode on boot

[Service]
Type=oneshot
ExecStart=/usr/bin/setkeycodes 6c 131

[Install]
WantedBy=multi-user.target
# File: /usr/local/bin/screen_rotation.sh

#!/bin/sh

# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation.

rotation="$(xrandr -q --verbose | grep 'connected' | egrep -o  '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')"

# Using current screen orientation proceed to rotate screen and input tools.

case "$rotation" in
    normal)
    # rotate to the left
    xrandr -o left
    xsetwacom set "Serial Wacom Tablet WACf004 stylus" rotate ccw
    xsetwacom set "Serial Wacom Tablet WACf004 eraser" rotate ccw
    ;;
    left)
    # rotate to normal
    xrandr -o normal
    xsetwacom set "Serial Wacom Tablet WACf004 stylus" rotate none
    xsetwacom set "Serial Wacom Tablet WACf004 eraser" rotate none
    ;;

The assignment of the keycode to the script depends on your desktop environment. For Gnome the assignment can be easily done in the Keyboard preferences of custom shortcuts.

Power consumption and fan control

You might notice a beeping whilst your system is running. This is due to missing fan control. Install the tlp package from AUR to enable extensive fan and power consumption control.

You can further disable the nmi-watchdog by creating the file /etc/tmpfiles.d/disable-nmi-watchdog.conf with the following line:

w /proc/sys/kernel/nmi_watchdog - - - - 0

This will disable the watchdog at startup.

Additionally you might want to define different brightness level and automatically dim your screen when you are running on battery. A DE and WM independent solution is the usage of pm-utils. Detailed instructions can be found here. They are tested to work with a X200T.

Suspend to RAM

Suspend to RAM is working out of the box with the standard Arch Linux kernel after installing pm-utils from extra.

# pacman -S pm-utils

Issue the command

# pm-suspend

as root to suspend to RAM. The laptop will wake up on any key press or on opening the lid.

Note: Very seldom after resuming the backlight won't come back on. The following page on ThinkWiki might provide information on how to solve this issue: Problem with display remaining black after resume.

Unsupported

Unlike those on older models, the fingerprint reader on the X200 ("Authentec 2810") is unsupported on linux as there are no working drivers either in the kernel or outside[1].

Troubleshooting

System feels unresponsive

If your system feels unresponsive and lagging, you can try creating a file called /etc/modprobe.d/drm_kms.conf:

options drm_kms_helper poll=N

PM device: Resume from hibernation error: Failed to restore -19

This is likely to be related to the tpm_tis and tpm modules not being properly unloaded before hibernation. These modules are required by the device listed in the error as 00:0a:

# dmesg | grep 00:0a
[    0.377877] pnp 00:0a: Plug and Play ACPI device, IDs PNP0c31 (active)
[   10.746742] tpm_tis 00:0a: 1.2 TPM (device-id 0x1020, rev-id 6)
[   10.746751] tpm_tis 00:0a: Intel iTPM workaround enabled
[   10.866734] tpm_tis 00:0a: TPM is disabled/deactivated (0x6)

To unload the module create the following executable file called /usr/lib/systemd/system-sleep/tpm.sh, assuming the use of the systemd hibernation procedure:

#!/bin/sh
case $1/$2 in
  pre/*)
    echo "Going to $2..."
    modprobe -r tpm
    modprobe -r tpm_tis
    ;;
  post/*)
    echo "Waking up from $2..."
    modprobe tpm
    modprobe tpm_tis
    ;;
esac

See also