Title: Gentoo on a ThinkPad X200 Summary: This manual is intended to help user to configure the Gentoo distribution of GNU/Linux operating system for Lenovo X200 notebook. Besides X200 users, it may also be useful for users of ThinkPads based on the same Centrino platform: R400, T400, X200s, X301. Copyright: (c) 2009-2011 Vitaly Minko Content is available under GNU Free Documentation License 1.3 and Creative Commons Attribution-Share Alike 3.0 Unported License Date: 12 Nov 2011 Web: http://vminko.org/gentoo_manuals/thinkpad_x200 Introduction ============ This manual is intended to help user to configure Gentoo distribution of the GNU/Linux operating system for Lenovo ThinkPad X200 notebook. It's supposed that user is skilled enough to install bare system from stage, compile kernel from source code, apply patches, etc. Besides X200 users, this manual may also be useful for users of ThinkPads based on the same Centrino platform: R400, T400, X200s, X301. This article and all information and products in it are provided on an "as is" basis, without warranty of any kind, either express or implied. __Your use of this article is at your own risk.__ Content ======= * [Hardware info] * [Linux support summary] * [Kernel] * [Video] * [Sound] * [Networking] * [ACPI] * [Hot keys] * [Suspending] * [HDAPS] * [TrackPoint] * [Fingerprint reader] * [Web camera] * [Media cards reader] * [ThinkLight] * [Benchmarks] * [References] * [History of changes] Hardware info ============= | Type | Name | Technical info | | ------------- | ---------------- | ----------------------------------------- | | CPU | Intel Core2 Duo | CPU clock: 2,4 Ghz; Bus clock: 1066Mhz; | | | P8600 (Penryn) | Power: 25W; Features: SSE4.1, EM64T, IVT | | | | L2 cache: 3MB; [[1]][References] | | North bridge | Intel GM45 | [[2]][References] | | RAM | Lenovo 43R1988 | Size: 4GB; Type: DDR3; Bus clock: 533 Mhz | | | | Module name: PC3-8500; [[3]][References] | | South bridge | Intel ICH9-M | [[4]][References] | | Video | Intel GMA | Clock speed: 533Mhz; Vertex shader: 4.0; | | | 4500MHD | Pixel shader: 4.0; OpenGL support: 2.1; | | | (Cantiga) | Decoding acceleration: VC-1, AVC; | | | | Device id: 8086:2a42; | | | | [[5]][References], [[6]][References] | Storage | Samsung | Capacity: 128GB; R/W speed: 90/70 MB/s; | | device | MMCQE28G8MUP | Size: 1.8in; [[7]][References] | | Audio | Conexant CX20561 | Device id: 8086:293e | | | (Hermosa) | | | Ethernet | Intel 82567LM | Speed: 10/100/1000 MB/s; | | | | Device id: 8086:10f5; [[4]][References] | | WiFi | Intel 5100 | Protocols: 802.11b/g/n; | | | | Security: WEP, WPA, WPA2; | | | | Device id: 8086:1311; [[8]][References] | | | Atheros AR5BHB63 | Protocols: 802.11b/g; | | | | Security: WEP, WPA, WPA2; | | | | Device id: 168c:001c; [[9]][References] | | BlueTooth | Broadcom BCM2046 | Device id: 0a5c:2145; [[11]][References] | | WAN | Ericsson F3507g | Modes: HSPA/WCDMA/EDGE/GPRS; | | | | GPS:stand alone and assisted; | | | | Device id: 0bdb:1900; [[10]][References] | | Card reader | ? | Supported formats: MMC, SD, SDHC; | | Fingerprint | AuthenTec | On-sensor fingerprint matching; | | | AES2810 | Device id: 08ff:2810; [[12]][References] | | Web camera | Lenovo | Device id: 17ef:480c | | | | Manufacturer: Chicony | | Accelerometer | Analog Devices | Dual-axis; [[13]][References] | | | ADXL320 | | Logs: [scanpci -v](/storage/x200/logs/scanpci.log) [lsusb -v](/storage/x200/logs/lsusb.log) [cat /proc/cpuinfo](/storage/x200/logs/cpuinfo.log) Linux support summary ===================== | Feature || Status | | ------------------ | --------------------------------- | :-----------------: | | *UltraBase* | AC adapter | Works perfectly | | | Battery charger | Works perfectly | | | USB ports | Works perfectly | | | Video out VGA | Works perfectly | | | DisplayPort | Works perfectly | | | Speakers | Works perfectly | | | Audio out jack | Works perfectly | | | Audio mic jack | Works perfectly | | | Disk drive | Works perfectly | | | Eject handle | Works perfectly | | | Power button | Works perfectly | | *ACPI* | UltraBase insert/eject | Works perfectly | | | Hot keys | Works perfectly | | | Brightness control | Works perfectly | | | Battery | Works perfectly | | | Fan | Works perfectly | | *Power management* | Suspend to RAM | Works perfectly | | | Suspend to disk | Works perfectly | | | CPU frequency scaling | Works perfectly | | *Video* | 2D graphics | Works perfectly | | | 3D acceleration | __Minor issues__ | | | Video decoding acceleration | __Untested__ | | *Audio* | Internal speaker | Works perfectly | | | Audio out jack | Works perfectly | | | Audio mic jack | Works perfectly | | | Headphones mute speaker | Works perfectly | | *Networking* | Ethernet | Works perfectly | | | BlueTooth | Works perfectly | | | WiFi (Intel) | Works perfectly | | | WiFi (Atheros) | __Minor issues__ | | | GPRS/EDGE/HSDPA | Works perfectly | | | GPS | Works perfectly | | *Other* | ThinkLight | Works perfectly | | | Fingerprint reader | __Doesn't work__ | | | HDAPS | Works perfectly | | | TrackPoint | Works perfectly | | | SD card reader | Works perfectly | | | Web camera | Works perfectly | Kernel ====== Kernel config for version 2.6.38 is available [here][cfg_kernel]. Few notes regarding the kernel config: * I use no-op I/O scheduler, because I have no HDD (SSD instead). So if you use HDD, I recommend you to enable CFQ scheduler (set `CONFIG_DEFAULT_IOSCHED` to `"cfq"`). * Enable `CONFIG_ATH5K` instead of `CONFIG_IWL5000` ff you have the Atheros WiFi card instead of the Intel card. * If you have no Ericsson F3507g, you'll probably want to disable `CONFIG_USB_ACM`. * If you have no UltraBase, you'll probably want to disable `CONFIG_ACPI_DOCK`. * If you use ExpressCards, you need to enable `CONFIG_HOTPLUG_PCI_PCIE` and appropriate driver for the card. For example, eSATA cards based on the SiI 3132 chip require `CONFIG_SATA_SIL24`. * [BlueTooth] support is disabled since I don't use it. [Here][cfg_grub] is appropriate grub config. Special kernel parameters: * `rootfstype=ext4` - Optional parameter, which avoids error messages on startup. Not required for ext2/3. * `acpi_sleep=s3_bios` - Required to make suspend/resume work. * `thinkpad_acpi.fan_control=1` - Thinkpad acpi module parameter, described in the [Fan] control section. * `dock.immediate_undock=0` - Dock module parameter, described in the dock eject section. Not required for 2.6.31+. * `resume=UUID=6ebd5055c6694ab8986503d0edcbe2b5:0xe78000` - TuxOnIce parameter, described in the [Suspending] section. * `acpi_osi="Linux"` - ACPI parameter, described in the [Hot keys] section. * `i915.modeset=1 video=1280x800` - KMS settings, described the [Video] section. If you use 2.6.39+ and want to change PCI-E bus policy, for example: echo powersave > /sys/module/pcie_aspm/parameters/policy then you need to add `pcie_aspm=force` to the kernele command line. The following is a list of kernel patches related to X200: * [tuxonice-3.2-for-2.6.38.patch.bz2][patch_toi] - [TuxOnIce][toi] implements suspend features, described in the [Suspending] section. * [x200_dock.diff][patch_dock] - Fixes audio out on docking station, see [alsa-driver (Ubuntu) bug #285834][alsa_bug] for details. This patch is no longer required for kernel version 2.6.30 and later. * [ath5k_wifi_led-for-2.6.33.patch][patch_wifi] - Fixes led support by atk5k module, see [kernel bug #12841][wifi_bug] for details. Still required for 2.6.38, 2.6.39 and 3.0.4. * [drm-i915-ensure-objects-are-allocated-below-4GB-on-PAE.patch][patch_pae] - Enables GEM on PAE systems, see [this thread][pae_thread] for details. This patch is useful only for 32-bit systems with 4Gb+ RAM (when `CONFIG_X86_32` and `CONFIG_HIGHMEM64G` are set). * [cdc-acm-fix.patch][patch_acm] - Fixes USB ACM driver (`CONFIG_USB_ACM`), which is required for F3507g. This patch is required for 2.6.31 only, see [this thread][acm_thread] for details. * [suppress-e1000e-error.patch][patch_e1ke] - Suppresses useless error messages coming from e1000e driver. This patch is required for 2.6.31 only, see [this thread][e1ke_thread] for details. *Warning!* The kernels 2.6.39+ make 'OOPS' while hibernating to a file, see [this thread][oops_thread] for details. [iwl]: http://intellinuxwireless.org/ [bt]: http://www.gentoo.org/doc/en/bluetooth-guide.xml [toi]: http://www.tuxonice.net/ [alsa_bug]: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/285834 [wifi_bug]: http://bugzilla.kernel.org/show_bug.cgi?id=12841 [ws_thread]: http://kerneltrap.org/mailarchive/linux-kernel/2007/5/15/91449/thread [pae_thread]: http://patchwork.kernel.org/patch/26047/ [acm_thread]: http://www.spinics.net/lists/linux-usb/msg22102.html [e1ke_thread]: http://lkml.org/lkml/2009/9/1/345 [oops_thread]: http://permalink.gmane.org/gmane.linux.swsusp.general/9864 It's also necessary to compile two additional kernel modules: `tp_smapi` and `hdaps`, as described in [HDAPS] section. Video ===== The main config file for intel-video is [xorg.conf][cfg_xorg]. Few notes regadring xorg.conf: * `DisplaySize` option is required to set correct DPI of the built-in LCD (96). * The Virtual parameter specifies the virtual screen resolution to be used. I use 1280x800 internal screen and 1920x1200 external display, therefore max width is `1280 + 1920 = 3200` and max height is 1200. See details [here][dualhead]. The `VIDEO_CARDS` variable should include 'intel', see [make.conf][cfg_make] as example. DRI is not working at maximum speed by default, so you should save [this config][cfg_dri] as `~/.drirc` to get maximum performance. After that, glxgears shows approximately 1000fps. The current driver (xf86-video-intel-2.16.0) supports only OpenGL-1.4. DisplayPort is now supported by intel driver and works quite well. [video-out.sh][acpi_video] is updated to use DisplayPort instead of VGA-out. Unfortunately the hardware doesn't allow us to enable two external monitors when the build-in display is on, because there are only two CRTCs available. Kernel Mode-Setting (`CONFIG_DRM_I915_KMS`) works fine except one minor issue [issue][video_bug] (glitchy dark colors). No problems with switching from/to VT/Xorg, suspend-to-ram, suspend-to-disk, etc. Besides the parameter mentioned above, it's necessary to enable `CONFIG_FRAMEBUFFER_CONSOLE`, `CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY` and add `i915.modeset=1 video=1280x800` to your kernel command line. This enables inteldrmfb and sets the proper video mode. According to [this post][va_ready], VA-API acceleration support for G45 is finally available. [dualhead]: http://intellinuxgraphics.org/dualhead.html [va_ready]: http://www.phoronix.com/scan.php?page=news_item&px=OTQ1NA [video_bug]: https://bugzilla.kernel.org/show_bug.cgi?id=32412 Sound ===== Supported by `CONFIG_SND_HDA_INTEL`. I recommend to compile alsa-lib with all plugins (`ALSA_PCM_PLUGINS`, see [make.conf][cfg_make] as example). In general ALSA supports the conexant chip quite well: both internal speaker and mic work fine as well as audio in/out jacks. ALSA mutes the speaker when headphones are plugged in. The only problem I had with audio is the UltraBase audio out, which is already fixed (see kernel section for details). I recommend not to enable `CONFIG_SND_HDA_POWER_SAVE`, since it causes skipping of short sounds. So it's easy to miss beeps from an IM client and so on. Networking ========== The radio switch toggles all wireless network connections: BlueTooth, WiFi, WAN and GPS. Ethernet -------- Supported by `CONFIG_E1000E`. Configured via default gentoo net config. [Here][cfg_net] is an example of eth0 definition with static IP. See [Gentoo Network Configuration][net_manual] for details. `ethtool` may be used to detect whether ethernet cable is plugged or not. However, the `Link detected` field is reliable only when the `eth0` interface is up. [net_manual]: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4 BlueTooth --------- Supported by `CONFIG_BT_HCIBTUSB`. The card can be turned on/off via `/proc/acpi/ibm/bluetooth`. Note that the card cannot be turned on when it's powered off by radio switch. The radio switch toggles the card and starts bluetooth service by default. If you don't want to turn the card on when radio switch is on, do the following: * Remove the udev rule starting bluetooth service from `/etc/udev/rules.d/70-bluetooth.rules`. * Make the card turned on/off when bluetooth service is started/stopped, see [bluetooth][rc_bt] script for details. These are examples of configs for pairing with Nokia 6021: [hcid.conf][cfg_hcid], [rfcomm.conf][cfg_rfcomm]. See [Gentoo Linux Bluetooth Guide][bt_manual] for details. [bt_manual]: http://www.gentoo.org/doc/en/bluetooth-guide.xml WiFi ---- **Atheros AR5BHB63** `lspci` shows this card as _AR5001_, but the actual chipset name is _AR5007EG_ . This chipset is now supported by kernel (`CONFIG_ATH5K`). So there's no need to install madwifi driver. The in-kernel driver works quite well except one issue: WiFi led is not working. Apply [ath5k_wifi_led-for-2.6.33.patch][patch_wifi] to your kernel in order to fix the bug. Unfortunately, the driver does not support power management yet. But according to [ath5k TODO List][ath5k_todo], developers are working on it. **Intel 5100** It is also supported by kernel (`CONFIG_IWL5000`), but the kernel driver requires binary firmware: echo "net-wireless/iwl5000-ucode ~amd64" >> /etc/portage/package.keywords emerge -av iwl5000-ucode This driver does support power management, do the following to enable it on startup: echo "iwconfig wlan0 power on" >> /etc/local.d/baselayout1.start Regardless of the wifi card model being used, connection should be configured via wpa\_supplicant, here are config examples: [wpa_supplicant.conf][cfg_ws], [net][cfg_net] (preup function checks whether radio is enabled). See [Wireless Networking][wifi_manual] for details. [wifi_manual]: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4 WWAN/GPS -------- F3507g is supported by `CONFIG_USB_ACM`. This driver is broken in 2.6.31, the [cdc-acm-fix.patch][patch_acm] is required to make it work. There are three device files assosicated with the card: * `/dev/ttyACM0` - Ericsson F3507g Mobile Broadband Minicard Modem. * `/dev/ttyACM1` - Ericsson F3507g Mobile Broadband Minicard Modem. * `/dev/ttyACM2` - Ericsson F3507g Mobile Broadband Minicard GPS Port. The card needs to be turned on before you start using GPS or GPRS/EDGE/HSDPA. The script [f3507g][rc_f3507g] turns the card on/off. [Here][rc_gps]'s a bit modified `gpsd` script; it configures and turns GPS on/off. This script should be dependent on f3507g as well as net.ppp0. Both `f3507g` and `gpsd` use the same [config][cfg_f3507g]. GPS and WAN connections can be established simultaneously, so don't be afraid to start both `gpsd` and `net.ppp0`. The [net][cfg_net] mentioned above contains ppp0 interface config for GPRS/EDGE bearers. According to [this manual][wwan_hog], WWAN eats power even when the 3G led is off. Therefore the `net` scripts automatically turns the power on/off. See [the ThinkWiki manual][f3507g_manual] for detailed reference how to work with F3507g. There're several GPS clients available in portage. I recommend the TangoGPS, it works quite well with F3507g. [f3507g_manual]: http://www.thinkwiki.org/wiki/Ericsson_F3507g_Mobile_Broadband_Module [ath5k_todo]: http://linuxwireless.org/en/users/Drivers/ath5k#ath5k_TODO_List [wwan_hog]: http://www.thinkwiki.org/wiki/Extending_battery_life_on_X200#Turning_off_the_wireless_radios ACPI ==== Keys ---- First of all, you need to install the ACPI daemon and add it to the boot runlevel: emerge -av acpid rc-update add acpid boot In order to enable event reporting for all supported hot heys, you need to set correct bit mask: cat /sys/devices/platform/thinkpad_acpi/hotkey_all_mask > \ /sys/devices/platform/thinkpad_acpi/hotkey_mask All ACPI keys are configured in the [default.sh][acpi_def]. The main advantage of ACPI hot keys is that they're not dependant on WM (which handles multimedia keys) and work even in console and SDL programs. Here is a short description of the ACPI key bindings: * *Power* - Turns the system off. * *Lid* - Suspends to RAM (via TuxOnIce) if the system is not locked via Fn+F2. See [lid.sh][acpi_lid] for details. * *Fn+F2 (lock)* - Locks the system (via vlock) and starts tp-antitheft tool. See [lock.sh][acpi_lock] for details. * *Fn+F3 (battery)* - Toggles DPMS state of the built-in display (via vbetool). See [display.sh][acpi_disp] for details. * *Fn+F4 (sleep)* - Suspends the system to RAM (via TuxOnIce). * *Fn+F5 (radio)* - Establishes PPP connection (GPRS/EDGE). * *Fn+F7 (video)* - Toggles DisplayPort (via xrandr), external screen is located to the right of built-in screen. See [video-out.sh][acpi_video] for details. * *Fn+F8 (input)* - Does nothing, because X200 has no touchpad. * *Fn+F9 (eject)* - Tries to eject X200 from UltraBase station. Checks whether ultrabay disk drive or any USB devices connected via UltraBase hub are mounted. See [ultrabase_eject][tool_ub_ej] for details. This script should not be located in the /etc/acpi/ directory, because it also handles udev events. See [UltraBase] section for details. * *Fn+F12 (hibernate)* - Suspends the system to disk (via TuxOnIce). * *Fn+Home (brightness up)* - Increases brightness level. * *Fn+End (brightness down)* - Decreases brightness level. * *ThinkVantage* - Does nothing, just not binded. * *Fn+Space (zoom)* - Generates scancode via `acpi_fakekey`. The scancode is handled by WM and toggles windows between built-in and external monitors. See [Hot keys] section for details. * *RF kill switch* - Disables all wireless connections if activated and disables bluetooth if deactivated. See [wireless.sh][acpi_wl] for details. Notes: * Fn+PgUp (thinklight) is handled by kernel. * AC plug in/out events are handled by cpufreq daemon. All multimedia keys generate scancode and are described in [Hot keys] section. Brightness ---------- Brightness is controlled by ThinkPad ACPI driver (`CONFIG_THINKPAD_ACPI`) via `/proc/acpi/ibm/brightness`: * `echo up > /proc/acpi/ibm/brightness` increases brightness level, * `echo down > /proc/acpi/ibm/brightness` decreases brightness level * `echo "level X" > /proc/acpi/ibm/brightness` sets a particular brightness level, where X is a number from 1 upto 15. Battery ------- Barrery is supported by default ACPI driver (`CONFIG_ACPI_BATTERY`), which provides some info in `/proc/acpi/battery/BAT0/info` (capacity, voltage ,etc). However, this info is not very useful. I recommend to install `tp_smapi` kernel module (see [HDAPS] for details), which provides lots of useful info in the `/sys/devices/platform/smapi/BAT0/`, especially `remaining_percent`, `remaining_running_time` and `remaining_charging_time`. Temperature sensors ------------------- There are two ways to access sensors: via ACPI driver (`CONFIG_THINKPAD_ACPI`) and `tp_smapi` module. The first one provides `/proc/acpi/ibm/thermal` file: $ cat /proc/acpi/ibm/thermal temperatures: 43 48 -128 42 39 -128 37 -128 51 48 -128 -128 -128 ... The second one provides 16 files via /sys interface: `ls /sys/class/hwmon/hwmon3/device/temp*`.Here is a description of the values: | Index | Location | | :---: | -------------------------------------------------------------------- | | 1 | CPU 0 | | 2 | HDAPS | | 3 | Not available | | 4 | CPU 1 | | 5 | Battery (main sensor) | | 6 | Not available | | 7 | Battery (secondary sensor) | | 8 | Not available | | 9 | ? | | 10 | ? | | 11-16 | Not available | Notes: * 9 and 10 are supposed to be Northbridge and/or SSD. Unfortunately, smartctl can't detect the temperature of Samsung MMCQE28G8MUP yet, therefore we don't know this for sure. Fan --- ThinkPad ACPI driver supports auto fan control: echo 'level auto' > /proc/acpi/ibm/fan But if you want to tweak, for example, the temperature fan start spinning at, then do the following: * Install fancontrol tool: `emerge -av lm_sensors`. * Use `pwmconfig` to create a config file or just use [this][cfg_fan] one, which specifies to use CPU core #1 as temperature sensor, to start fan spinning at minimum speed at 45° C and to set it at maximum speed at 60° C. * Add `thinkpad_acpi.fan_control=1` to your kernel command line. * Add this into `/etc/conf.d/local.start` in order to disable auto fan control: `echo level 1 > /proc/acpi/ibm/fan` UltraBase --------- Supported by `CONFIG_THINKPAD_ACPI_BAY` and `CONFIG_ACPI_DOCK`. Do the following to undock from the UltraBase: echo 1 >/sys/devices/platform/dock.0/undock The eject button located on the UltraBase doesn't generate ACPI events, it generates udev events instead. In order to handle it properly do the following: * Add corresponding udev [rules][cfg_ub]. The rules assign [ultrabase_eject][tool_ub_ej] and [ultrabase_insert][tool_ub_ins] scripts on eject/insert events accordingly. The `ultrabase_eject` is used as ACPI Fn+F9 handler. The `ultrabase_insert` establishes eth0 connetion. * Add `dock.immediate_undock=0` to your kernel command line. It will cause the driver to wait for userspace to write the undock sysfs file before undocking. CPU frequency ------------- Supported by `CONFIG_X86_ACPI_CPUFREQ`. There are three CPU frequencies available: 2.40 GHz, 1.60 GHz and 800 MHz. Install cpufreq packages in order to use frequency scaling: `emerge -av cpufreqd cpufrequtils`. cpufreqd is required, cpufrequtils is an optional package and provides useful tools like cpufreq-info and cpufreq-set. [Here][cfg_cf] is an example of cpufreqd config file. Config description: | AC | Battery, % | Brightness level | Governor | Exec | | ----- | ------------ | ---------------: | --------------: | ---------------: | | on | | 12 | ondemand | | | | 30-100 | 9 | conservative | | | off | 3-30 | 6 | powersave | | | | 0-3 | 1 | powersave | hibernate | Hot keys ======== All multimedia keys except the mute button generate scancode and all we need to do is to assign proper symnames via xmodmap. See [.Xmodmap][cfg_xmodmap] as example. The mute button is handled by firmware by default and doesn't generate scancode, add `acpi_osi="Linux"` to your kernel command line to fix the issue. The [rc.xml][cfg_openbox] is an example of symnames to actions bindings. XF86ZoomIn key (Fn+Space) toggles window between external and built-in displays. Works only in OpenBox patched with [openbox-3.4.7.2-nextprev-xinerama.patch][patch_ob]. ACPI hot keys are described in the [ACPI] section. Suspending ========== Suspend-to-RAM (aka sleep or ACPI S3 state) is supported by `CONFIG_SUSPEND`. TuxOnIce seems to be the best implementation of suspend-to-disk (aka hibernate). It can be used without initrd and allows you to suspend on a regular file (useful feature if you don't use swapping and have an SSD instead of an HDD). TuxOnIce comes as hibernate scripts and kernel patch. The patch for kernel v2.6.36 is availavle here: [tuxonice-3.2-for-2.6.38.patch.bz2][patch_toi]. In order to install TuxOnIce, you need to: * Apply the patch to your kernel sources. * Install hibernate-script and s2ram: `emerge -av hibernate-script suspend` The hibernate scripts deal with both suspend-to-RAM (that's why it requires s2ram) and suspend-to-disk. Therefore there're common suspend configs located in the `/etc/hibernate/` directory. The examples of config can be downloaded [here][cfg_hs] Here are few notes regarding the config files: * `Compressor lzo` is set, because LZF compression is no longer supported by TuxOnIce since LZO is now provided by kernel (2.6.25 and later). * `OnResume 00 echo level 1 > /proc/acpi/ibm/fan` is required to disable auto fan control. Remove this line if you don't use fancontrol. * `UnloadModules ehci_hcd` is a workaround of a problem with Trendnet TK-207 switch. You don't need this probably. * `VerifyFilewriterResume2 no` is no longer required for tuxonice-3.2-rc2 since it successfully resumes when the resume device is specified via UUID. * `FilewriterLocation /hibernation_file 2048` specifies location of the hibernation file. 2048 is the amount of disk space reserved for the hibernation file. This is used for the file allocator only. For the file allocator it's also necessary to create a hibernation file: hibernate --no-suspend The last thing to do is to add the `resume` kernel parameter in the [grub.conf][cfg_grub] or as `CONFIG_PM_STD_PARTITION` value in the [kernel config][cfg_kernel]. Take a look at the `/sys/power/tuxonice/resume` to figure out its value. If you use TOI 3.0.99.32 or later, you will see something like this: `UUID=6ebd5055c6694ab8986503d0edcbe2b5:0xe78000`. See the [TuxOnIce - Gentoo Linux Wiki][toi_manual] manual for details. [toi_manual]: http://en.gentoo-wiki.com/wiki/TuxOnIce HDAPS ===== HDAPS (Hard Drive Active Protection System) becomes unnecessary when an SSD is used as a storage device. However, there are few other interesting applications for the sensor (see below). Moreover, the package with HDAPS drivers (tp_smapi) also contains the [SMAPI][smapi] (System Management Application Program Interface) driver, which provides unique access to some hardware control functionality like remaining running time, list `/sys/devices/platform/smapi/` for details. Don't use in-kernel support of HDAPS (`CONFIG_SENSORS_HDAPS`), because this module is obsolete and does not work with X200. Use the `app-laptop/tp_smapi-0.40` package instead, which provides another `hdaps` module implementing HDAPS support. It works very well with X200. In order to install the package, you need to do the following: * Unmask the package (`echo 'app-laptop/tp_smapi ~amd64' >> /etc/portage/package.keywords`) and install it (`emerge -av tp_smapi`) * Add `tp_smapi` and `hdaps` in the `/etc/modules.autoload.d/kernel-2.6` file to make gentoo load both modules automatically. * Set correct HDAPS axis orientation: `echo 'echo 7 > /sys/devices/platform/hdaps/invert' >> /etc/conf.d/local.start`. Now HDAPS should be correctly configured. It can be tested using hdaps-gl tool (`emerge -av hdaps-gl`). There are several programs that use HDAPS, for example, [Neverball][neverball] game (`emerge -av neverball`). It requires joystick device (`/dev/input/js0`), therefore the `CONFIG_INPUT_JOYDEV` flag should be enabled in kernel config, `joystick` should be added in the `USE` variable as well as in `INPUT_DEVICES`, see [make.conf][cfg_make] for details. Joystick can be calibrated using `jscal /dev/input/js0 -c`. It's very fun to play neverball using HDAPS as joystick. See these two videos as example: [video1][nb_video1], [video2][nb_video2]. Another useful utility which uses HDAPS is tp-antitheft, something like [this][at_video]. You can download it [here][tool_at]. I binded it on Fn+F2 combination, see the [ACPI] section for details. [neverball]: http://neverball.org/ [nb_video1]: http://tinyogg.com/watch/R301X/ [nb_video2]: http://tinyogg.com/watch/k7jLF/ [at_video]: http://tinyogg.com/watch/QVBBa/ [smapi]: http://www.thinkwiki.org/wiki/SMAPI_support_for_Linux TrackPoint ========== Supported by `CONFIG_MOUSE_PS2_TRACKPOINT`. You may also want to emulate mouse wheel, see example in the TrackPoint section of the [xorg.conf][cfg_tp]. If you use HAL, you may find [this config][cfg_tp] for TrackPoint useful. Fingerprint reader ================== Unfortunately, fprint doesn't support AuthenTec AES 2810, according to [this page][unsupp_devs]. But I hope some day it will. [unsupp_devs]: http://reactivated.net/fprint/wiki/Unsupported_devices Web camera ========== Supported by `CONFIG_V4L_USB_DRIVERS`. Works fine via V4L2 interface. The webcam is capable to capture video in resolution up to 1280x960. MPlayer package can be used to capture video (`v4l2` USE flag is required): mplayer tv:// -tv driver=v4l2:width=1280:height=800 The following command records video into a file (`encode` USE flag is required): mencoder tv://1 -tv driver=v4l2:width=640:height=480:device=/dev/video0:\ fps=24:alsa:forceaudio:amode=0:adevice=hw.0,0:audiorate=22050 -oac mp3lame\ -lameopts vbr=3:br=32:mode=3 -ovc lavc -lavcopts vcodec=mpeg4:\ vbitrate=1200:keyint=300 -o webcamvideo.avi Options description: * `tv://1` - TV capture module * `-tv` - TV capture mode properties * `driver=v4l2` - TV input driver * `width=640:height=480` - output window resolution * `device=/dev/video0` - device to capture video from * `alsa` - capture audio from ALSA * `forceaudio` - capture audio even if there are no audio sources reported by v4l * `amode=0` - capture mono sound * `adevice=hw.0,0` - name of device to capture sound from * `audiorate=22050` - audio capture bitrate * `-oac mp3lame` - encode audio to MP3 (using LAME) * `-lameopts` - audio codec properties * `vbr=3` - average bitrate method * `br=32` - bitrate in Kbps * `mode=3` - encode mono sound * `-ovc lavc` - encode video with a libavcodec codec * `-lavcopts` - video codec properties * `vcodec=mpeg4` - encode video to MPEG-4 * `vbitrate=1200` - bitrate in Kbps * `keyint=300` - maximum interval between IDR-frames (specifies seeking precision) * `-o webcamvideo.avi` - output file name [Ekiga][ekiga] works fine with video translation using h264 codec. Don't forget to load `ehci_hcd` if it's compiled as module, web camera won't work otherwise. [ekiga]: http://ekiga.org/ Media cards reader ================= Supported by `CONFIG_MMC_BLOCK`. Works fine with SD and SDHC cards. It should also support MMC cards, but haven't such one to test. ThinkLight ========== Supported by the thinkpad ACPI kernel driver. It is controlled by Fn+PgUp combination or via `/proc/acpi/ibm/light`. Don't forget to set proper permissions to the light control file , because it's not accessible for ordinary user by default: echo 'chmod 666 /proc/acpi/ibm/light' >> /etc/conf.d/local.start The ThinkLight is required for th-antitheft utility. If you use pidgin IM client, you may want to install plugin, which uses ThinkLight to signal on new messages. [Here][lednot] is the source code of the plugin. TBD: create ebuild. [lednot]: http://github.com/Sitwon/led-notification Benchmarks ========== Here are few relevant benchmarks: | Test conditions | Results | | -------------------------------------------------------------- | ----------: | | Bootup (from grub to X11 WM) | 25 sec | | STD aka hibernate (TOI-3.0.99.41, linux-2.6.32) | 18 sec | | Resume from STD (from grub, TOI-3.0.99.41, linux-2.6.32) | 14 sec | | Suspend-to-RAM (linux-2.6.32) | 3 sec | | Resume from suspend-to-RAM (linux-2.6.32) | 5 sec | | emerge -eav [world](/storage/x200/logs/equery.log) | 7 h 20 m | | Quake 3 (1280x800, high quality, xf86-video-intel-2.16.0, xorg-server-1.10.4) | 104 fps | | glxgears (linux-2.6.38, xf86-video-intel-2.16.0, xorg-server-1.10.4) | 1313 fps | | Idle consumption (SSD, CCFL panel, min brightness, no radios) | 7.0 W | References ========== 1. [Intel® Core™2 Duo Mobile Processor P8600](http://processorfinder.intel.com/details.aspx?sSpec=SLB3S) 2. [Mobile Intel® GM45 Express Chipset](http://www.intel.com/Products/Notebook/Chipsets/GM45/GM45-overview.htm) 3. [Lenovo 2GB PC3-8500 1066MHz DDR3 SODIMM Memory](http://www5.pc.ibm.com/europe/products.nsf/$wwwPartNumLookup/_43R1988) 4. [Intel® I/O Controller Hub 9 (ICH9) Family](http://www.intel.com/Assets/PDF/datasheet/316972.pdf) 5. [Mobile Intel® 4 Series Express Chipset Family](http://www.intel.com/Assets/PDF/datasheet/320122.pdf) 6. [Intel GMA - Wikipedia, the free encyclopedia](http://en.wikipedia.org/wiki/Intel_GMA) 7. [ThinkPad 128 GB Solid State Drive Supplemental information](http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=AN&subtype=CA&htmlfid=897/ENUS108-535&appname=lenovous&language=en#h2-obi01) 8. [Intel Wi-Fi Link 5100: Product Brief](http://www.intel.com/content/dam/doc/product-brief/wifi-link-5100-brief.pdf) 9. [Atheros AR5BHB63](http://www.wikidevi.com/wiki/Atheros_AR5BHB63) 10. [Mobile Broadband Module F3507g](http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf) 11. [Broadcom Corporation - BCM2046 - Single-Chip Bluetooth® EDR HCI Solution](http://www.broadcom.com/products/Bluetooth/Bluetooth-RF-Silicon-and-Software-Solutions/BCM2046) 12. [AuthenTec AES2810 Sensor](http://www.authentec.com/products-pcsandperipherals-aes2810.cfm) 13. [Analog Devices ADXL320](http://www.analog.com/en/mems-and-sensors/imems-accelerometers/adxl320/products/product.html) History of changes ================== __12 Nov 2011__ Added few notes about _Intel 5100_ . Updated information regarding the Atheros WiFi card. __01 Sep 2011__ The [Kernel] section, related patches and configs are updated for the versions 2.6.38+. Updated the [fancontrol][Fan] config. Updated the [Benchmarks] section. Added a note in the [Video] section regarding VA-API. __01 Apr 2011__ The [Kernel] section, related patches and configs are updated for the version 2.6.36. Added few notes regarding power consumption (in the following sections: [Sound], [WiFi], [WWAN/GPS]). Added a note in the [Video] section regarding the kernel bug caused by KMS. Updated the [Web camera] section (there is no more problems with capturing video at 1280x960). __06 Nov 2010__ The [Kernel] section, related patches and configs are updated for the version 2.6.35. __26 Aug 2010__ Added a note regarding SSD in the [HDAPS] section. Thanks to Anton Bolshakov. __19 Jul 2010__ Added a note regarding ExpressCards in the [Kernel] section. Thanks to HK J. __13 Jul 2010__ The fancontrol [config][cfg_fan] is updated for lm_sensors-3.1.2. __10 Jul 2010__ The [Kernel] section, related patches and configs are updated for the version 2.6.34. __02 May 2010__ Added a missing [config][cfg_f3507g] for the F3507g-related scripts. Added a clarification regarding the `tp_smapi` package in the [HDAPS] section. Thanks to WOLfgang Schricker. __28 Apr 2010__ The [Kernel] section and related patches are updated for the version 2.6.33. __19 Mar 2010__ Updated the cpufreqd config, because `/proc/acpi/ibm/brightness` is no longer provided by kernel, now the /sys is used interface instead. __15 Mar 2010__ Added a note regarding video decoding acceleration. Small update in the [Ethernet] section regarding `ethtool`. __14 Feb 2010__ Added a note regarding ACPI daemon in the [Keys] section. Thanks to HK J. __15 Dec 2009__ Small update in the [Web camera] section regarding high resolutions. __13 Dec 2009__ Added few notes regarding kernel 2.6.32 and KMS. __20 Nov 2009__ The article is reformatted in MultiMarkdown syntax. __13 Sep 2009__ Added few notes regarding kernel 2.6.31. __16 Jul 2009__ Added HAL config for TrackPoint. __06 Jul 2009__ Added the [drm-i915-ensure-objects-are-allocated-below-4GB-on-PAE.patch][patch_pae]. Thanks to Michael Fritzsch. Added a note in the [Kernel] section regarding [x200_dock.diff][patch_dock] and the latest kernel. Added a note in the [Suspending] section about TuxOnIce for 2.6.30. Added a note in the [Video] section regarding DisplayPort capabilities. Added a note in the [Video] section regarding DRI2 support. Slightly updated the [kernel][cfg_kernel], [grub][cfg_grub], [xorg][cfg_xorg] configs and the ultrabase [eject script][tool_ub_ej]. Fixed wrong dates, which were specified in y/d/m format instead of y/m/d. __13 May 2009__ First public release. [acpi_def]: /storage/x200/tools/default.sh [acpi_disp]: /storage/x200/tools/display.sh [acpi_lid]: /storage/x200/tools/lid.sh [acpi_lock]: /storage/x200/tools/lock.sh [acpi_video]: /storage/x200/tools/video-out.sh [acpi_wl]: /storage/x200/tools/wireless.sh [cfg_cf]: /storage/x200/configs/cpufreqd.conf [cfg_dri]: /storage/x200/configs/drirc [cfg_fan]: /storage/x200/configs/fancontrol [cfg_grub]: /storage/x200/configs/grub.conf [cfg_hcid]: /storage/x200/configs/hcid.conf [cfg_kernel]: /storage/x200/configs/config-2.6.38 [cfg_make]: /storage/x200/configs/make.conf [cfg_net]: /storage/x200/configs/net [cfg_openbox]: /storage/x200/configs/rc.xml [cfg_rfcomm]: /storage/x200/configs/rfcomm.conf [cfg_hs]: /storage/x200/configs/hibernate-configs.tar.bz2 [cfg_tp]: /storage/x200/configs/10-tracking-ball.fdi [cfg_ub]: /storage/x200/configs/99-ultrabase.rules [cfg_xmodmap]: /storage/x200/configs/Xmodmap [cfg_xorg]: /storage/x200/configs/xorg.conf [cfg_ws]: /storage/x200/configs/wpa_supplicant.conf [cfg_f3507g]: /storage/x200/configs/f3507g [patch_acm]: /storage/x200/patches/cdc-acm-fix.patch [patch_dock]: /storage/x200/patches/x200_dock.diff [patch_e1ke]: /storage/x200/patches/suppress-e1000e-error.patch [patch_ob]: /storage/x200/patches/openbox-3.4.7.2-nextprev-xinerama.patch [patch_pae]: /storage/x200/patches/drm-i915-ensure-objects-are-allocated-below-4GB-on-PAE.patch [patch_toi]: http://tuxonice.net/files/tuxonice-3.2-for-2.6.38.patch.bz2 [patch_wifi]: /storage/x200/patches/ath5k_wifi_led-for-2.6.33.patch [rc_bt]: /storage/x200/tools/bluetooth [rc_f3507g]: /storage/x200/tools/f3507g [rc_gps]: /storage/x200/tools/gpsd [tool_at]: /storage/x200/tools/tp-antitheft [tool_ub_ej]: /storage/x200/tools/ultrabase_eject [tool_ub_ins]: /storage/x200/tools/ultrabase_insert