FreeBSD on the Lenovo ThinkPad X270

Last modified: 2020/03/01

back


Most features of the ThinkPad X270 are supported by FreeBSD 12. You can find some hints regarding the system configuration here. For further information, see the FreeBSD wiki.

Table of Contents

  1. Specifications
  2. Overview
  3. Trackpoint
  4. Power Management
  5. Suspend/Resume
  6. Audio
  7. Volume Keys
  8. Screen
  9. Screen Brightness
  10. Wi-Fi

Specifications

Overview

NameCommentStatus
Audiosnd_hda(4) driverworks
Bluetoothunsupported
Camerauntested
Docking stationuntested
Ethernetem(4) driverworks
Finger print sensoruntested
Fn keyswith acpi_ibm(4)works
HDMIuse xrandr(1)works
Hibernateunsupported
SD card readeruntested
Suspend/resumeacpiconf(8)works
Touchpaduntested
TrackPointworks
USB-Cuntested
USBworks
Wi-Fiiwm(4) driverworks

TrackPoint

You may want to disable the Touchpad in BIOS in order to use the TrackPoint of the X270. Install x11-servers/xorg-server with udev support and x11-drivers/xf86-input-libinput. For evdev support, add:

# echo 'kern.evdev.rcpt_mask="12"' >> /etc/sysctl.conf

Also, enable the TrackPoint by:

# echo 'hw.psm.trackpoint_support="1"' >> /boot/loader.conf

If desired, enable the Trackpad with:

# echo 'hw.psm.synaptics_support="1"' >> /boot/loader.conf

You can change the mouse acceleration with x11/xinput (values between [-1.0, 1.0]):

$ xinput set-prop 9 "libinput Accel Speed" 0.05

Add the line to your ~/.xsession to make the changes permanent.

Power Management

For power management, you can either use powerd(8) or sysutils/powerdxx. To use powerd, edit /etc/rc.conf and add:

powerd_enable="YES"
powerd_flags="-a hiadaptive -b adaptive"
performance_cx_lowest="C2"

Or install powerd++ with:

# pkg install powerdxx
# sysrc powerdxx_enabled="YES"

Suspend/Resume

While hibernate fails, suspend/resume works on the X270. You can test the power management with:

# acpiconf -s 3

This should perform a suspend to RAM. Press the power button to resume. Install security/doas to suspend with non-root privileges. Edit /usr/local/etc/doas.conf and add:

permit nopass <username> as root cmd /usr/sbin/zzz

Edit your .cshrc and define new alias:

alias zzz /usr/local/bin/doas /usr/sbin/zzz

You can now suspend as a user by running zzz. Execute zzz from your Window Manager by calling tcsh -c zzz.

Audio

Audio output is provided by the snd_hda(4) driver. Load the kernel module at boot time by editing /boot/loader.conf:

snd_hda_load="YES"

Change between speakers and headphones manually:

# sysctl hw.snd.default_unit=1
hw.snd.default_unit: 0 -> 1

Device hints are required to make the switching work automatically (todo).

Volume Keys

Load the acpi_ibm(4) kernel module to use the volume keys above the keyboard. Edit /boot/loader.conf and add:

acpi_ibm_load="YES"

Or add kld_list+="acpi_ibm" in /etc/rc.conf:

# sysrc kld_list+="acpi_ibm"

Raising and lowering the volume using the volume keys will work now in applications like VLC. You have to configure your Window Manager to map keypress events. For FVWM, add to ~/.fvwm/config:

Key XF86AudioRaiseVolume A A Exec exec mixer vol +10
Key XF86AudioLowerVolume A A Exec exec mixer vol -10

After restarting FVWM, the volume keys can be used to change the soundcard mixer values.

Screen

Install and enable graphics/drm-kmod:

# pkg install graphics/drm-kmod
# sysrc kld_list+="/boot/modules/i915.kms.ko"

You can connect an external screen by HDMI or USB-C (DisplayPort). Use x11/xrandr to enable video output and set display resolutions. The default output is eDP-1. List all outputs with:

$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
eDP-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 276mm x 155mm
   1920x1080     60.00*+
   1400x1050     59.98
   1280x1024     60.02
   1280x960      60.00
   1024x768      60.04    60.00
   960x720       60.00
   928x696       60.05
   896x672       60.01
   800x600       60.00    60.32    56.25
   700x525       59.98
   640x512       60.02
   640x480       60.00    59.94
   512x384       60.00
   400x300       60.32    56.34
   320x240       60.05
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)

Set the resolution of the HDMI output with:

$ xrandr --output HDMI-1 --mode 1920x1080

Screen Brightness

Set the screen brightness with:

# sysctl hw.acpi.video.lcd0.brightness=80

You can use the Fn keys to increase/decrease the screen brightness by loading acpi_ibm(4). Add to /boot/loader.conf:

acpi_ibm_load="YES"

Or add kld_list+="acpi_ibm" to /etc/rc.conf.

Wi-Fi

Wi-Fi is supported by the iwm(4) driver. Add the following lines to /boot/loader.conf:

if_iwm_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"

Assumed your WiFi uses the WPA2 protocol, add the network to /etc/wpa_supplicant.conf:

network={
    ssid="Your WiFi"
    psk="correcthorsebatterystaple"
    key_mgmt=WPA-PSK
}

Create a new wireless LAN device with:

# ifconfig wlan0 create wlandev iwm0

You can add the device to /etc/rc.conf:

# sysrc wlans_iwm0="wlan0"

Scan for networks with:

# ifconfig wlan0 up scan

For better signal quality add your country code, for instance:

# ifconfig wlan0 country DE

Connect to your Wi-Fi network:

# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B

Obtain an IP address with:

# dhclient wlan0

Optionally, set a custom DNS:

# echo "nameserver 8.8.8.8" > /etc/resolv.conf

You should be connected now. For more information on Wi-Fi networks, see the FreeBSD online handbook.


Valid XHTML 1.0 Valid CSS