Difference between revisions of "Lenovo ThinkPad X230"

From ArchWiki
Jump to navigation Jump to search
(update status of external links (interactive))
Tag: wiki-scripts
 
(99 intermediate revisions by 17 users not shown)
Line 1: Line 1:
 
[[Category:Lenovo]]
 
[[Category:Lenovo]]
Lenovo ThinkPad X230 comes with a wide range of available configurations. Since Lenovo's acquisition of the ThinkPad brand from IBM, it has received lots of negative criticism for not maintaining the original quality and compromising the brand itself. Regardless, ThinkPad still is one of the first preferences for many geeks, students (mainly due to student discounts) and Linux users. It is the standard option available in Lenovo's X Series under 12-13 inches display category.
+
[[ja:Lenovo ThinkPad X230]]
 +
{{Related articles start}}
 +
{{Related|Laptop}}
 +
{{Related|ThinkPad docks}}
 +
{{Related|HiDPI}}
 +
{{Related articles end}}
  
== Hardware ==
+
Lenovo ThinkPad X230 [https://pcsupport.lenovo.com/en/en/products/laptops-and-netbooks/thinkpad-x-series-laptops/thinkpad-x230 official page], [https://psref.lenovo.com/syspool/Sys/PDF/withdrawnbook/ThinkPad_X230.pdf datasheet], [https://us.download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/x230_x230i_hmm_en_0b48666_01.pdf hardware maintenance manual], [https://www.thinkwiki.org/wiki/Category:X230 ThinkWiki]. [https://forum.thinkpads.com/viewtopic.php?t=121522 PCB schematic] has been leaked too.
=== Tested Configuration ===
 
{{Tip|Below were the tested configurations at the time. If you are interested in more details and review, see the gist [https://gist.github.com/bassu/8478346 A Hacker's Ongoing Review for Lenovo ThinkPad X230] for full details.}}
 
{| class="wikitable sortable"
 
! Feature !! Configuration
 
|-
 
|System||X230 2306CTO
 
|-
 
|CPU||Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
 
|-
 
|Graphics||Intel HD 4000 - Ivy Bridge
 
|-
 
|Ram||3.5GB (Kingston)
 
|-
 
|Disk||Crucial M4 120GB SSD
 
|-
 
|Display||12.5" IPS
 
|-
 
|Wireless||2x2 Centrino Wireless-N 2200
 
|-
 
|Built-in Battery||9 Cell
 
|-
 
|Additional Plugable Battery||6 Cell 19+
 
|-
 
|Backlit Keyboard||No
 
|-
 
|ThinkLight||Yes
 
|-
 
|Fingerprint Scanner||Yes
 
|-
 
|Bluetooth||Yes
 
|-
 
|Cam||Yes
 
|}
 
  
== System Configuration ==
+
== Configuration ==
 
 
=== Fingerprint scanner ===
 
Works out of the box. See [[fprint]] article for installation instructions. No extrac actions are needed.
 
  
 
=== Kernel ===
 
=== Kernel ===
{{Note|You may want to run patched kernels instead of the default kernel to conserve power. See power saving section below}}
+
Enable Intel [[kernel mode setting]] driver:
 
{{hc|/etc/mkinitcpio.conf|2=<nowiki>
 
{{hc|/etc/mkinitcpio.conf|2=<nowiki>
 
MODULES="i915"
 
MODULES="i915"
BINARIES="badblocks"
 
FILES="/etc/modprobe.d/modprobe.conf"
 
HOOKS="base udev autodetect block filesystems keyboard fsck"
 
 
</nowiki>
 
</nowiki>
 
}}
 
}}
{{hc|/etc/modprobe.d/modprobe.conf|2=<nowiki>
+
 
options i915 enable_rc6=1 enable_fbc=1 lvds_downclock=1
+
After saving the above files, make sure to regenerate your initram image by the command {{ic|mkinitcpio -p linux}}, and follow the steps in [[kernel parameters]].
options iwlwifi 11n_disable=1
+
 
 +
=== Screen ===
 +
 
 +
X230 has IPS or TN screen with 125.37 DPI. Refer to [[HiDPI]] page for more information. It can be set with command {{ic|xrandr --dpi 125.37}} using {{ic|[[.xinitrc]]}}, {{ic|[[Xsession|.xsession]]}} or other autostarts.
 +
 
 +
=== Brightness ===
 +
 
 +
If you experience that your brightness setting is not restored on resume from suspend, then create config:
 +
 
 +
{{hc|/usr/share/X11/xorg.conf.d/20-intel.conf|
 +
Section "Device"
 +
Identifier "card0"
 +
Driver "intel"
 +
Option "Backlight" "intel_backlight"
 +
BusID "PCI:0:2:0"
 +
EndSection
 +
}}
 +
 
 +
=== Suspend to ram ===
 +
 
 +
There is an issue with system shutdown with power saving tools that cannot distinguish sys devices. You will need to add to the systemd shutdown trigger on this machine or else you'll get a system reboot when you shutdown the machine. Put this in /etc/rc.local.shutdown and update and enable its service, if not already.
 +
 
 +
{{hc|/etc/rc.local.shutdown|2=<nowiki>
 +
#!/bin/bash
 +
# /etc/rc.local.shutdown: Local shutdown script.
 +
# A script to act as a workaround for the bug in the runtime power management module, which causes thinkpad laptops to restart after shutting down.
 +
# Bus list for the runtime power management module.
 +
buslist="pci i2c usb"
 +
for bus in $buslist; do                                                           
 +
  for i in /sys/bus/$bus/devices/*/power/control; do                             
 +
    echo on > $i
 +
  done
 +
done
 
</nowiki>
 
</nowiki>
 
}}
 
}}
The {{ic|badblocks}} binary helps fix logical bad blocks if detected by fsck during system startup. The first line in modprobe.conf file enables different Intel HD power saving options. To see what each of the parameters does, issue the command {{ic|modinfo i915}}. The second line disables the wifi N mode as the Intel wireless driver suffers connection loss due to possible bugs. You can comment out this line if you want to transfer data at wireless N speeds.
 
  
After saving the above files, make sure to regenerate your init ram image by the command {{ic|mkinitcpio -p linux}}.
+
{{hc|/usr/lib/systemd/system/rc-local-shutdown.service|2=<nowiki>
 +
[Unit]
 +
Description=/etc/rc.local.shutdown Compatibility
 +
ConditionFileIsExecutable=/etc/rc.local.shutdown
 +
DefaultDependencies=no
 +
After=rc-local.service basic.target
 +
Before=shutdown.target
 +
 
 +
[Service]
 +
Type=oneshot
 +
ExecStart=/etc/rc.local.shutdown
 +
StandardInput=tty
 +
RemainAfterExit=yes
 +
 
 +
[Install]
 +
WantedBy=shutdown.target
 +
</nowiki>
 +
}}
  
If you have the [[Linux-ck]] kernel installed, don't forget to regenerate the initcpio as well using {{ic|mkinitcpio -p linux-ck}}.
+
=== UMTS Modem ===
 +
::''Main article: [[ThinkPad mobile Internet]]''
  
Then, to update grub2 with the new kernels you have to run {{ic|grub-mkconfig -o /boot/grub/grub.cfg}}.
+
{{Warning|Official UEFI comes with whitelist of PCI boards (e.g. Wi-Fi and UMTS miniPCI cards). After installing unapproved PCI device boot will be interrupted with error: {{ic|1802: Unauthorized network card is plugged in - Power off and remove the miniPCI network card (0AF0/7201). System is halted.}}}}
  
{{Note|Using '''enable_rc6&#61;1''' will enable basic power saving with first stage of [http://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface#Processor_states C-state 6] [http://software.intel.com/en-us/blogs/2013/06/03/intel-xeon-phi-coprocessor-power-management-part-2a-core-c-states-the-details (sleeping state)].  The stages vary by the depth of sleep, that can be attained by setting the value of '''enable_rc6''' between 1 to 7 in ascending order as can be seen in its documentation with '''modinfo i915''' command shown above.}}
+
Some models come with an integrated USB UMTS modem.
{{Warning|Keep in mind that c-state power saving always comes at performance sacrifice and setting a higher value can cause a jittery display or some other unexplained and unexpected misbehavior with i915 so you may want to experiment with different values to find out what suits your needs.}}
 
  
=== TrackPoint scrolling (wheel emulation) ===
+
{{hc|$ lsusb -d 0bdb:1926|
 +
Bus 003 Device 004: ID 0bdb:1926 Ericsson Business Mobile Networks BV H5321 gw Mobile Broadband Driver}}
 +
 +
In order for it to work with [[NetworkManager]], you will need to install [https://www.archlinux.org/packages/?name=modemmanager ModemManager] from the official repositories.
  
{{Merge|TrackPoint}}
+
For it to be recognized by ModemManager, you also need to set the kernel module option to:
  
To enable scrolling with the TrackPoint while holding down the middle mouse button, create a new file /etc/X11/xorg.conf.d/20-thinkpad.conf with the following content:
+
{{hc|/etc/modprobe.d/umts-modem.conf|output=
 +
options cdc_ncm prefer_mbim=N
 +
}}
  
Section "InputClass"
+
== Input devices ==
    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
 
  
There are more details about how this works on the [[Xorg#InputClasses|Xorg]] page.
+
=== TrackPoint ===
 +
::''Main article: [[TrackPoint]]''
 +
Laptop equipped with combined pointing device called [https://thinkwiki.org/wiki/UltraNav UltraNav™]. It incorporates small touchpad, three hardware buttons and TrackPoint.
  
 
=== Touchpad ===
 
=== Touchpad ===
The original configuration renders the touchpad quite useless, as it behaves very jumpily. [[https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-synaptics/+bug/1042069/comments/5 Ubuntu Bugtracker]] offers a solution for this issue. Add the following
+
{{Note|[[Touchpad Synaptics]] superseded by [[libinput]].}}
 +
 
 +
The original configuration renders the touchpad quite useless, as it behaves very jumpily. [https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-synaptics/+bug/1042069/comments/5 Ubuntu Bugtracker] offers a solution for this issue. Add the following:
  
 
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|2=<nowiki>
 
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|2=<nowiki>
Line 96: Line 110:
 
         Driver "synaptics"
 
         Driver "synaptics"
 
         # fix touchpad resolution
 
         # fix touchpad resolution
         # Option "VertResolution" "100"
+
         Option "VertResolution" "100"
         # Option "HorizResolution" "65"
+
         Option "HorizResolution" "65"
 
         # disable synaptics driver pointer acceleration
 
         # disable synaptics driver pointer acceleration
 
         Option "MinSpeed" "1"
 
         Option "MinSpeed" "1"
Line 103: Line 117:
 
         # tweak the X-server pointer acceleration
 
         # tweak the X-server pointer acceleration
 
         Option "AccelerationProfile" "2"
 
         Option "AccelerationProfile" "2"
         Option "AdaptiveDeceleration" "1000"
+
         Option "AdaptiveDeceleration" "16"
 
         Option "ConstantDeceleration" "16"
 
         Option "ConstantDeceleration" "16"
         Option "VelocityScale" "30"
+
         Option "VelocityScale" "20"
 
         Option "AccelerationNumerator" "30"
 
         Option "AccelerationNumerator" "30"
 
         Option "AccelerationDenominator" "10"
 
         Option "AccelerationDenominator" "10"
 
         Option "AccelerationThreshold" "10"
 
         Option "AccelerationThreshold" "10"
        # Disable two fingers right mouse click
+
# Disable two fingers right mouse click
        Option "TapButton2" "0"
+
Option "TapButton2" "0"
         Option "HorizHysteresis" "20"
+
         Option "HorizHysteresis" "100"
         Option "VertHysteresis" "20"
+
         Option "VertHysteresis" "100"
 +
        # fix touchpad scroll speed
 +
        Option "VertScrollDelta" "500"
 +
        Option "HorizScrollDelta" "500"
 
EndSection
 
EndSection
 
</nowiki>
 
</nowiki>
 
}}
 
}}
  
Setting e.g. the motion-acceleration value in dconf to 2.8 works nicely.
+
Setting e.g. the motion-acceleration value in ''dconf'' to 2.8 works nicely.
  
=== Backlight Control Keys ===
+
=== Keyboard backlight control keys ===
 +
{{Accuracy|Working out of the box now?}}
 +
<!-- On my device keyboard lit keys {{ic|Fn+Space}} controlled by UEFI and working without an OS. Can be switched off by the kernel though. -->
 
{{Note| On most X230 models, backlight works by default without any issues. Use below only in case of any problems.}}
 
{{Note| On most X230 models, backlight works by default without any issues. Use below only in case of any problems.}}
Due to an issue with the firmware of several ThinkPads the backlight control keys (fn + F8/F9 on the X230) don't work correctly. Setting the brightness via e.g. the GNOME power control panel or altering the brightness value in sysfs is possible.
 
  
The issue can be temporarily and partially fixed in adding the acpi_osi="!Windows 2012" kernel parameter in  
+
Due to an issue with the firmware of several ThinkPads the backlight control keys ({{ic|Fn}} + {{ic|F8/F9}} on the X230) sometimes don't work correctly. Setting the brightness via e.g. the GNOME power control panel or altering the brightness value in ''sysfs'' is possible. The issue can be temporarily and partially fixed in adding the {{ic|<nowiki>acpi_osi="!Windows 2012"</nowiki>}} [[kernel parameter]]. The fix is partial in that only 8 steps are accessible via the keys. See [https://bugzilla.kernel.org/show_bug.cgi?id=51231] for details.
 +
 
 +
Power saving [[kernel parameters]] in addition to graphics card power saving, are shown below. {{ic|<nowiki>acpi_backlight=vendor</nowiki>}} loads the vendor specific [[Backlight#ACPI]] driver (i.e. thinkpad_acpi) so the brightness keys (Fn + F8 and Fn + F9) work correctly.
 +
 
 +
Note that the {{ic|<nowiki>acpi_backlight=vendor</nowiki>}} kernel option also works with the standard Arch kernel (currently 3.7.10-1) and has the additional bonus that ({{ic|Fn+Space}}) controls the keyboard lighting.
 +
 
 +
=== Sound control buttons ===
 +
{{Note|Laptop has single TRRS CTIA/Apple 3.5 mm audio jack (sleeve for a microphone).}}
  
{{hc|/etc/default/grub|2=<nowiki>
+
Red LED mute indicators light up automatically, if corresponding channel ''muted'' in {{ic|[[Advanced Linux Sound Architecture|alsamixer]]}}. Easiest way to make buttons work is to install [[PulseAudio]] and it's plugin for your [[desktop environment]].
GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=\"!Windows 2012\""
 
  
sudo grub-mkconfig -o /boot/grub/grub.cfg
+
* [[GNOME]] - works out of the box
</nowiki>
+
* [[Xfce]] - install {{pkg|pulseaudio}} {{pkg|xfce4-pulseaudio-plugin}}, add plugin to panel and reboot. Additionally  {{pkg|xfce4-pulseaudio-plugin}} uses {{pkg|pavucontrol}} as mixer and {{pkg|xfce4-notifyd}} for sound level popups
}}
+
* Handle ACPI events with [[acpid]] the [https://makandracards.com/makandra/47162-how-to-enable-the-thinkpad-microphone-mute-key-on-ubuntu-16-04 hard way]. Some functions like {{ic|thinkpad-mutemic}} implemented in {{AUR|thinkpad-scripts}}
 +
* See also [[ThinkPad: Mute button]]
  
The fix is partial in that only 8 steps are accessible via the keys.
+
=== Fingerprint reader ===
 +
Supported by [[fprint]] out of the box. Used with [[PAM]] for authentication, eliminating necessity of password input (logon, sudo). Though it's impossible to turn laptop on and boot Arch right into a [[desktop environment]] by just one finger swipe.
  
For more information see https://bugzilla.kernel.org/show_bug.cgi?id=51231 .
+
=== X230T (tablet version) ===
 +
==== Wacom tablet input ====
 +
Works out of the box with {{Pkg|xf86-input-wacom}}. See [[Wacom tablet]].
  
=== Power Saving ===
+
==== Multitouch screen for the X230t ====
 +
Some X230t models have a multitouch screen in addition to the Wacom tablet. Works out of the box with {{Pkg|xf86-input-libinput}}.
  
{{Stub|many different tweaks combined into a single section}}
+
== OpenCL ==
 +
Thinkpad X230 based on Intel [[wikipedia:Ivy_Bridge_(microarchitecture)|Ivy Bridge]] (3rd generation) platform which meets [[OpenCL]] 1.2 specification. Unfortunately GPU support in Linux is broken, so {{pkg|beignet}} and {{AUR|intel-opencl}} won't work. Use CPU-only {{AUR|intel-opencl-runtime}} instead.
  
Follow the main article: [[Power saving]]
+
OpenCL computation performance differ between CPU and GPU, depending on task. In many cases GPU is preferable. For ''Core(TM) i5-3210M'' CPU, which incorporates ''HD Graphics 4000'' GPU:
  
{{Tip|<nowiki>The parameter pcie_aspm may not be needed in the more recent 3.9+ kernels. Don't enable pcie_aspm if dmesg | grep -i "doesn't support pcie aspm" is true because even if you do, kernel will still keep it disabled.</nowiki>}}
+
* GPU {{ic|[[hashcat]] -m2500 -b -D 2 --force}} reports 3095 H/s (checked in Windows)
{{Tip|You can select a different patched kernel for desired speed vs performance requirement. See [[Kernels]] for details. There is also [[Power_saving]] wiki for reducing battery usage.}}
+
* CPU {{ic|[[hashcat]] -m2500 -b -D 1}} reports only 2660 H/s, which is the same as no-OpenCL {{ic|aircrack-ng -S}}
  
One option is to use [[Powerdown]] to save power. On this setup, it gave 14+ hours on a 9 cell battery and 6+ hours on plugable 6 cell external battery, with normal usage of cmus, firefox and thunderbird.
+
In this example OpenCL don't give any advantage and better look for other options like [[Makepkg#Building_optimized_binaries|building native binary]] for your system.
Power saving kernel parameters in addition to graphics card power saving, are shown below.
 
{{hc|grep GRUB_CMDLINE /etc/default/grub|2=<nowiki>
 
GRUB_CMDLINE_LINUX_DEFAULT="quiet ipv6.disable=1 elevator=bfq"
 
GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd pcie_aspm=force acpi_backlight=vendor"
 
</nowiki>
 
}}
 
The parameter {{ic|<nowiki>elevator=bfq</nowiki>}} enables the Budget Fair Queueing storage IO scheduler, see http://algo.ing.unimo.it/people/paolo/disk_sched/ for details. {{ic|<nowiki>pcie_aspm=force</nowiki>}} forcefully enables the [[Laptop#PCI-e_ASPM|PCIE Active State Power Management]] and {{ic|<nowiki>acpi_backlight=vendor</nowiki>}} loads the vendor specific [[Backlight#ACPI]] driver (i.e. thinkpad_acpi) so the brightness keys (Fn + F8 and Fn + F9) work correctly. After editing the grub file, make sure to regenerate your grub configuration by the command {{ic|grub-mkconfig -o /boot/grub/grub.cfg}}.
 
  
Note that the {{ic|<nowiki>acpi_backlight=vendor</nowiki>}} kernel option also works with the standard Arch kernel (currently 3.7.10-1) and has the additional bonus that (Fn + spacebar) controls the keyboard lighting.
+
== Power Saving ==
 +
::''Main article: [[Power saving]]''
  
 
=== TLP ===
 
=== TLP ===
 
+
Users of [[TLP]] need to pay attention to a hardware bug according to which it is recommended to only use either the upper or lower charging threshold. The following configuration is recommended by the developer of TLP.[http://thinkpad-forum.de/threads/184510-elementary-OS-Thinkpad-X230-einrichten?p=1865345&viewfull=1#post1865345]
Users of [[TLP]] need to pay attention to a hardware bug according to which it is recommended to only use either the upper or lower charging threshold. The following configuration is recommended by the developer of TLP.[http://thinkpad-forum.de/threads/184510-elementary-OS-Thinkpad-X230-einrichten?p=1865345&viewfull=1#post1865345 [1]]  
 
  
 
{{hc|/etc/default/tlp|2=<nowiki>
 
{{hc|/etc/default/tlp|2=<nowiki>
Line 166: Line 189:
 
}}
 
}}
  
=== Suspend to ram ===
+
=== Charge thresholds ===
Sleep/suspension and unsuspension can be easily managed by systemd without setting it up in Desktop Environment applet or pm-utils. But there are some modules that must be loaded off and on every time the system is put to sleep or is awaken. There's also a need to kill wpa_supplicant by adding {{ic|<nowiki>systemctl restart wpa_supplicant.service</nowiki>}} in the {{ic|<nowiki>sleep.sh</nowiki>}} file below. And it is quite fast with systemd anyway.
+
In order to prolong battery lifespan, especially if laptop always connected to AC power supply, it's possible to keep battery charge between 40-80 %. You can use {{pkg|tpacpi-bat}} (written in Perl) for [[tp_smapi#2nd option, tpacpi-bat|setting charge thresholds]]. This tool was superseded by {{ic|[https://linrunner.de/en/tlp/docs/tlp-faq.html natacpi]}}, which included in kernel 4.17 and supported by [[TLP]]. Though it's possible to change thresholds directly. Values will be stored in battery microcontroller and will survive reboot, but reset if you remove the battery.
 +
 
 +
# echo 40 > /sys/class/power_supply/BAT0/charge_start_threshold
 +
# echo 80 > /sys/class/power_supply/BAT0/charge_stop_threshold
 +
 
 +
=== Fan control ===
  
{{hc|/usr/lib/systemd/system-sleep/sleep.sh|2=<nowiki>
+
To optimize fan control, install and setup [[Fan_speed_control#ThinkPad_laptops|thinkfan]]. Then use the following configuration:
#!/bin/bash
 
if [ "$1" = "pre" ]; then
 
killall -9 wpa_supplicant #nm-applet bug's workaround
 
fi
 
  
if [ "$1" = "post" ]; then
+
{{hc|/etc/thinkfan.conf|output=
        /sbin/modprobe -rvf iwldvm
 
        /sbin/modprobe -rvf iwlwifi
 
/sbin/modprobe -v iwldvm
 
/sbin/modprobe -v iwlwifi
 
  
fi
+
tp_fan /proc/acpi/ibm/fan
 +
hwmon /sys/class/thermal/thermal_zone0/temp
  
</nowiki>
+
(0, 0,  60)
}}
+
(1, 53, 65)
Put vboxdrv in it too, if you use VirtualBox.
+
(2, 55, 66)
There is also an issue with system shutdown with power saving tools that cannot distinguish sys devices. You will need to add to the systemd shutdown trigger on this machine or else you'll get a system reboot when you shutdown the machine. Put this in /etc/rc.local.shutdown and update and enable its service, if not already.
+
(3, 57, 68)
{{hc|/etc/rc.local.shutdown|2=<nowiki>
+
(4, 61, 70)
#!/bin/bash
+
(5, 64, 71)
# /etc/rc.local.shutdown: Local shutdown script.
+
(7, 68, 32767)
# A script to act as a workaround for the bug in the runtime power management module, which causes thinkpad laptops to restart after shutting down.
 
# Bus list for the runtime power management module.
 
buslist="pci i2c"
 
for bus in $buslist; do                                                           
 
  for i in /sys/bus/$bus/devices/*/power/control; do                             
 
    echo on > $i
 
  done
 
done
 
</nowiki>
 
 
}}
 
}}
  
{{hc|/usr/lib/systemd/system/rc-local-shutdown.service|2=<nowiki>
+
== UEFI ==
[Unit]
+
Laptop incorporates InsydeH2O® UEFI BIOS with classic text interface. It supports [[UEFI]] with [[Secure Boot]], UEFI-CSM and Legacy BIOS modes.
Description=/etc/rc.local.shutdown Compatibility
+
 
ConditionFileIsExecutable=/etc/rc.local.shutdown
+
=== Boot configuration ===
DefaultDependencies=no
+
UEFI boot options can be safely (no bricking) set with {{pkg|efibootmgr}} or [[Unified Extensible Firmware Interface#UEFI Shell|UEFI Shell]] v2 (checked with ''BIOS 2.77 (G2ETB7WW) EC 1.15''). Though you can delete ''any'' boot variable, so be careful!
After=rc-local.service basic.target
+
 
Before=shutdown.target
+
X230 in UEFI-non-CSM mode installed with [[EFISTUB]] on [[Solid state drive|SSD disk]] boots into [[display manager]] in less than 25 seconds. Small [[ESP]] (100 MiB fat32) also supported.
 +
 
 +
=== USB UEFI update ===
 +
{{Tip|There are unofficial firmware available, such as [https://doc.coreboot.org/mainboard/lenovo/xx30_series.html Coreboot]{{Dead link|2020|03|29|status=404}} or Heads in order to remove hardware whitelists and provide trusted boot.}}
 +
 
 +
All official updates, including Windows utility, Bootable CD and documentation can be found [https://pcsupport.lenovo.com/gb/en/downloads/ds029187 here]. You can use {{AUR|geteltorito}} to create bootable USB images from the Bootable CD:
 +
 
 +
$ geteltorito.pl g2uj24us.iso > update.img
 +
# dd bs=512K if=update.img of=/dev/sdX
  
[Service]
+
Insert USB stick, reboot and press {{ic|F12}}, choose your USB. Follow the instructions.
Type=oneshot
 
ExecStart=/etc/rc.local.shutdown
 
StandardInput=tty
 
RemainAfterExit=yes
 
</nowiki>
 
}}
 
  
==== Suspend to ram fails ====
+
=== Trusted Platform Module ===
 +
Laptop has dedicated [[TPM]] 1.2 chip onboard[https://www.st.com/en/secure-mcus/st33tpm12lpc.html][https://trustedcomputinggroup.org/membership/certification/tpm-certified-products/]. It doesn't looks like it can be upgraded to TPM 2.0. Chip itself disabled by default sometimes, also owner clearing won't appear without ''Supervisor password'' set:
  
As of kernel 3.10 and 3.11 suspend may fail because the kernel tries to switch off the onboard ethernet device twice (see http://forums.fedoraforum.org/archive/index.php/t-293457.html).
+
# Enter Thinkpad UEFI Setup by pressing {{ic|F1}}
 +
# Set ''Security > Password'' > ''Supervisor password''
 +
# Set ''Security > Security Chip > Security Chip [Active]''
 +
# Save settings by pressing F10 and reboot
 +
# '''Turn laptop off''', turn on and UEFI option ''Security > Security Chip > Clear Security Chip'' eventually will appear.
  
A workaround is to unload the driver manually and reload it on wake.
+
Process described in "ThinkPad X230 and X230i User Guide", ''Chapter 4. Security > Setting the security chip''.
  
{{hc|/usr/lib/systemd/system-sleep/e1000e-probe.sh|2=<nowiki>
+
== Known issues ==
#!/bin/bash
+
* There is a BIOS bug that gets in the way of the boot process with [[LUKS]] and full-disk encryption. The user is stuck at the "Loading initial ramdisk" step, and does not see a password prompt to unlock the encrypted device. You can actually enter your password at this step, and boot-up will continue. However, updating the BIOS will resolve this completely.
# /usr/lib/systemd/system-sleep/e1000e-probe.sh
+
* UEFI option to clear [[TPM]] not working. STM chip datasheet describes physical presence pin, which, probably, can be used as workaround.
# handles e1000e driver suspend problems:
 
# pci_pm_suspend(): e1000_suspend+0x0/0x20 [e1000e] returns -2
 
# dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns -2
 
# PM: Device 0000:00:19.0 failed to suspend async: error -2
 
# PM: Some devices failed to suspend
 
  
case "$1" in
+
== See also ==
  "pre") rmmod e1000e
+
* [https://gist.github.com/bassu/8478346 A Hacker's Ongoing Review for Lenovo ThinkPad X230]
  ;;
+
* [http://osresearch.net/Installing-Heads.html Installing "Heads" and using TPM]
  "post") modprobe e1000e
 
  ;;
 
esac
 
</nowiki>
 
}}
 

Latest revision as of 06:59, 30 March 2020

Lenovo ThinkPad X230 official page, datasheet, hardware maintenance manual, ThinkWiki. PCB schematic has been leaked too.

Configuration

Kernel

Enable Intel kernel mode setting driver:

/etc/mkinitcpio.conf
MODULES="i915"

After saving the above files, make sure to regenerate your initram image by the command mkinitcpio -p linux, and follow the steps in kernel parameters.

Screen

X230 has IPS or TN screen with 125.37 DPI. Refer to HiDPI page for more information. It can be set with command xrandr --dpi 125.37 using .xinitrc, .xsession or other autostarts.

Brightness

If you experience that your brightness setting is not restored on resume from suspend, then create config:

/usr/share/X11/xorg.conf.d/20-intel.conf
Section "Device"
Identifier "card0"
Driver "intel"
Option "Backlight" "intel_backlight"
BusID "PCI:0:2:0"
EndSection

Suspend to ram

There is an issue with system shutdown with power saving tools that cannot distinguish sys devices. You will need to add to the systemd shutdown trigger on this machine or else you'll get a system reboot when you shutdown the machine. Put this in /etc/rc.local.shutdown and update and enable its service, if not already.

/etc/rc.local.shutdown
#!/bin/bash
# /etc/rc.local.shutdown: Local shutdown script.
# A script to act as a workaround for the bug in the runtime power management module, which causes thinkpad laptops to restart after shutting down. 
# Bus list for the runtime power management module.
buslist="pci i2c usb"
for bus in $buslist; do                                                             
  for i in /sys/bus/$bus/devices/*/power/control; do                              
    echo on > $i
  done
done
/usr/lib/systemd/system/rc-local-shutdown.service
[Unit]
Description=/etc/rc.local.shutdown Compatibility
ConditionFileIsExecutable=/etc/rc.local.shutdown
DefaultDependencies=no
After=rc-local.service basic.target
Before=shutdown.target

[Service]
Type=oneshot
ExecStart=/etc/rc.local.shutdown
StandardInput=tty
RemainAfterExit=yes

[Install]
WantedBy=shutdown.target

UMTS Modem

Main article: ThinkPad mobile Internet
Warning: Official UEFI comes with whitelist of PCI boards (e.g. Wi-Fi and UMTS miniPCI cards). After installing unapproved PCI device boot will be interrupted with error: 1802: Unauthorized network card is plugged in - Power off and remove the miniPCI network card (0AF0/7201). System is halted.

Some models come with an integrated USB UMTS modem.

$ lsusb -d 0bdb:1926
Bus 003 Device 004: ID 0bdb:1926 Ericsson Business Mobile Networks BV H5321 gw Mobile Broadband Driver

In order for it to work with NetworkManager, you will need to install ModemManager from the official repositories.

For it to be recognized by ModemManager, you also need to set the kernel module option to:

/etc/modprobe.d/umts-modem.conf
options cdc_ncm prefer_mbim=N

Input devices

TrackPoint

Main article: TrackPoint

Laptop equipped with combined pointing device called UltraNav™. It incorporates small touchpad, three hardware buttons and TrackPoint.

Touchpad

Note: Touchpad Synaptics superseded by libinput.

The original configuration renders the touchpad quite useless, as it behaves very jumpily. Ubuntu Bugtracker offers a solution for this issue. Add the following:

/etc/X11/xorg.conf.d/50-synaptics.conf
Section "InputClass"
        Identifier "touchpad"
        MatchProduct "SynPS/2 Synaptics TouchPad"
        # MatchTag "lenovo_x230_all"
        Driver "synaptics"
        # fix touchpad resolution
        Option "VertResolution" "100"
        Option "HorizResolution" "65"
        # disable synaptics driver pointer acceleration
        Option "MinSpeed" "1"
        Option "MaxSpeed" "1"
        # tweak the X-server pointer acceleration
        Option "AccelerationProfile" "2"
        Option "AdaptiveDeceleration" "16"
        Option "ConstantDeceleration" "16"
        Option "VelocityScale" "20"
        Option "AccelerationNumerator" "30"
        Option "AccelerationDenominator" "10"
        Option "AccelerationThreshold" "10"
	# Disable two fingers right mouse click
	Option "TapButton2" "0"
        Option "HorizHysteresis" "100"
        Option "VertHysteresis" "100"
        # fix touchpad scroll speed
        Option "VertScrollDelta" "500"
        Option "HorizScrollDelta" "500"
EndSection

Setting e.g. the motion-acceleration value in dconf to 2.8 works nicely.

Keyboard backlight control keys

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: Working out of the box now? (Discuss in Talk:Lenovo ThinkPad X230#)
Note: On most X230 models, backlight works by default without any issues. Use below only in case of any problems.

Due to an issue with the firmware of several ThinkPads the backlight control keys (Fn + F8/F9 on the X230) sometimes don't work correctly. Setting the brightness via e.g. the GNOME power control panel or altering the brightness value in sysfs is possible. The issue can be temporarily and partially fixed in adding the acpi_osi="!Windows 2012" kernel parameter. The fix is partial in that only 8 steps are accessible via the keys. See [1] for details.

Power saving kernel parameters in addition to graphics card power saving, are shown below. acpi_backlight=vendor loads the vendor specific Backlight#ACPI driver (i.e. thinkpad_acpi) so the brightness keys (Fn + F8 and Fn + F9) work correctly.

Note that the acpi_backlight=vendor kernel option also works with the standard Arch kernel (currently 3.7.10-1) and has the additional bonus that (Fn+Space) controls the keyboard lighting.

Sound control buttons

Note: Laptop has single TRRS CTIA/Apple 3.5 mm audio jack (sleeve for a microphone).

Red LED mute indicators light up automatically, if corresponding channel muted in alsamixer. Easiest way to make buttons work is to install PulseAudio and it's plugin for your desktop environment.

Fingerprint reader

Supported by fprint out of the box. Used with PAM for authentication, eliminating necessity of password input (logon, sudo). Though it's impossible to turn laptop on and boot Arch right into a desktop environment by just one finger swipe.

X230T (tablet version)

Wacom tablet input

Works out of the box with xf86-input-wacom. See Wacom tablet.

Multitouch screen for the X230t

Some X230t models have a multitouch screen in addition to the Wacom tablet. Works out of the box with xf86-input-libinput.

OpenCL

Thinkpad X230 based on Intel Ivy Bridge (3rd generation) platform which meets OpenCL 1.2 specification. Unfortunately GPU support in Linux is broken, so beignet and intel-openclAUR won't work. Use CPU-only intel-opencl-runtimeAUR instead.

OpenCL computation performance differ between CPU and GPU, depending on task. In many cases GPU is preferable. For Core(TM) i5-3210M CPU, which incorporates HD Graphics 4000 GPU:

  • GPU hashcat -m2500 -b -D 2 --force reports 3095 H/s (checked in Windows)
  • CPU hashcat -m2500 -b -D 1 reports only 2660 H/s, which is the same as no-OpenCL aircrack-ng -S

In this example OpenCL don't give any advantage and better look for other options like building native binary for your system.

Power Saving

Main article: Power saving

TLP

Users of TLP need to pay attention to a hardware bug according to which it is recommended to only use either the upper or lower charging threshold. The following configuration is recommended by the developer of TLP.[2]

/etc/default/tlp
START_CHARGE_THRESH_BAT0=67
STOP_CHARGE_THRESH_BAT0=100

Charge thresholds

In order to prolong battery lifespan, especially if laptop always connected to AC power supply, it's possible to keep battery charge between 40-80 %. You can use tpacpi-bat (written in Perl) for setting charge thresholds. This tool was superseded by natacpi, which included in kernel 4.17 and supported by TLP. Though it's possible to change thresholds directly. Values will be stored in battery microcontroller and will survive reboot, but reset if you remove the battery.

# echo 40 > /sys/class/power_supply/BAT0/charge_start_threshold
# echo 80 > /sys/class/power_supply/BAT0/charge_stop_threshold

Fan control

To optimize fan control, install and setup thinkfan. Then use the following configuration:

/etc/thinkfan.conf
tp_fan /proc/acpi/ibm/fan
hwmon /sys/class/thermal/thermal_zone0/temp

(0, 0,  60)
(1, 53, 65)
(2, 55, 66)
(3, 57, 68)
(4, 61, 70)
(5, 64, 71)
(7, 68, 32767)

UEFI

Laptop incorporates InsydeH2O® UEFI BIOS with classic text interface. It supports UEFI with Secure Boot, UEFI-CSM and Legacy BIOS modes.

Boot configuration

UEFI boot options can be safely (no bricking) set with efibootmgr or UEFI Shell v2 (checked with BIOS 2.77 (G2ETB7WW) EC 1.15). Though you can delete any boot variable, so be careful!

X230 in UEFI-non-CSM mode installed with EFISTUB on SSD disk boots into display manager in less than 25 seconds. Small ESP (100 MiB fat32) also supported.

USB UEFI update

Tip: There are unofficial firmware available, such as Coreboot[dead link 2020-03-29 ⓘ] or Heads in order to remove hardware whitelists and provide trusted boot.

All official updates, including Windows utility, Bootable CD and documentation can be found here. You can use geteltoritoAUR to create bootable USB images from the Bootable CD:

$ geteltorito.pl g2uj24us.iso > update.img 
# dd bs=512K if=update.img of=/dev/sdX

Insert USB stick, reboot and press F12, choose your USB. Follow the instructions.

Trusted Platform Module

Laptop has dedicated TPM 1.2 chip onboard[3][4]. It doesn't looks like it can be upgraded to TPM 2.0. Chip itself disabled by default sometimes, also owner clearing won't appear without Supervisor password set:

  1. Enter Thinkpad UEFI Setup by pressing F1
  2. Set Security > Password > Supervisor password
  3. Set Security > Security Chip > Security Chip [Active]
  4. Save settings by pressing F10 and reboot
  5. Turn laptop off, turn on and UEFI option Security > Security Chip > Clear Security Chip eventually will appear.

Process described in "ThinkPad X230 and X230i User Guide", Chapter 4. Security > Setting the security chip.

Known issues

  • There is a BIOS bug that gets in the way of the boot process with LUKS and full-disk encryption. The user is stuck at the "Loading initial ramdisk" step, and does not see a password prompt to unlock the encrypted device. You can actually enter your password at this step, and boot-up will continue. However, updating the BIOS will resolve this completely.
  • UEFI option to clear TPM not working. STM chip datasheet describes physical presence pin, which, probably, can be used as workaround.

See also