ThinkPad L13 Yoga Running Arch Linux Mini Review

ThinkPad L13 Yoga

The Lenovo ThinkPad L13 Yoga is a remarkable and quite popular little machine that is still being offered by multiple vendors. This post is all about my ownership experiences about a year after purchase and how I've installed a rock-solid and trouble-free Linux distribution on it.

1. Hardware

For the asking price (now well under $800), this light and portable convertible ThinkPad provides more than adequate performance in its class - even after over year since release. Let's have a quick look at the specifications:

  • 13.3" Full HD 10-point multitouch screen
  • 10th Gen Intel Core i5-10210U mobile processor
  • 8GB system memory for advanced multitasking
  • 256GB solid state drive (SSD)
  • 360° flip-and-fold design
  • 3.15 lbs. and 0.7" thin

While the Comet Lake Core i5 processor is entry-level the notebook also includes a Wacom pen which is stored in a very convenient built-in charging storage slot. Along for the ride is a fantastic backlit keyboard right in line with what one would expect from Lenovo's ThinkPad series of portables - consistent feel across all keys with a satisfying response. Unfortunately, the patented "lift-lock" system to retract the keyboard keys into the chassis in tablet mode (where the screen is folded all the way back) is missing in action, but that's an understandible sacrifice to keep the manufacturing costs down. To address enterprise needs Lenovo added a biometric fingerprint reader made by Goodix. It works well enough on the pre-loaded Windows 10 Home image, but Goodix' support for Linux is lacking here, and is the single blemish that I could find while getting Arch Linux installed.

ThinkPad L13 Yoga

2. Software

One of the ways Lenovo keeps the price reasonable on this entry-level ThinkPad (and still can keep calling it a ThinkPad!) is the default Windows 10 Home edition - which would need to be upgraded to at least the Pro version for deployments in the enterprise. SCCM packages are provided and regularly updated to track with the latest Windows releases on Lenovo's support site: https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-l-series-laptops/thinkpad-l13-yoga-type-20r5-20r6/downloads/driver-list/component?name=Enterprise%20Management

ThinkPads are traditionally business-oriented notebooks so there's nothing too surprising on that front.

What has been a rather pleasant surprise (for me at least) remains how Linux-friendly the L13 Yoga is, if you can do without the fingerprint biometric functionality. Touch, pen, auto screen rotation and power management (idle power consumption of around 4-5W is attainable without too much work) are fully supported by mainline Linux kernels released since around 2018.

3. Arch Linux installation with BTRFS, Timeshift, Hibernation, KVM Virtualization and the Cinnamon Desktop Environment

Arch is, of course, a rolling release distribution that requires some thought to keep things working reliably from a system administration perspective. In this case we'll stay pretty conseravative and stick to the LTS kernel, BTRFS and Timeshift for quick and relatively painless rollbacks, a separate swap partition large enough to store the RAM hibernation image, and a desktop environment that is actively being developed with low "churn." The following is taken directly from my installation notes, the ever-awesome Arch Wiki as well as other online sources and it should be fairly straightforward to convert to a script if the need arises.

You can download the latest ISO image from https://archlinux.org/download/ and write it to a USB key following the Arch Wiki. I've found that both the 'dd' shell command and balenaEtcher https://www.balena.io/etcher/ work equally well on my OS installation thumb drive collection.

In the BIOS setup turn off Secure Boot - Arch does not support it yet. Make sure Virtualization is turned on while you are in there if you want KVM to work properly. Then, boot from the thumb drive you just imaged and follow the installation steps (they assume the reader has some familiarity with installing Linux - this is Arch btw!). They work great for me, however I recommend that you carefully study the wonderful Arch Wiki https://wiki.archlinux.org/ to help understand what's happening at each step and of course YMMV with no guarantees whatsoever are given.

Installation

  1Set $HOSTNAME and $USERNAME to the values you want
  2
  3timedatectl set-ntp true
  4
  5reflector --country US --age 6 --protocol https --latest 5 --sort rate --save /etc/pacman.d/mirrorlist
  6
  7pacman -Syy
  8
  9gdisk /dev/nvme0n1
 10
 11Create a new GPT partition table and walk through the partitioning as follows:
 12/boot/efi 	/dev/nvme0n1p1 	EFI System Partition 	FAT32 	500 MiB
 13[SWAP] 	/dev/nvme0n1p2 	Linux swap 	SWAP RAM + 1GB for hibernation
 14/ 	/dev/nvme0n1p3 	Linux 	BTRFS 	whatever space is left
 15
 16mkfs.fat -F32 /dev/nvme0n1p1
 17
 18mkswap /dev/nvme0n1p2
 19
 20swapon /dev/nvme0n1p2
 21
 22mkfs.btrfs -L arch /dev/nvme0n1p3
 23
 24mount /dev/nvme0n1p3 /mnt
 25
 26cd /mnt
 27
 28btrfs subvolume create @
 29btrfs subvolume create @home
 30
 31cd ..
 32umount /mnt
 33
 34mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@ /dev/nvme0n1p3 /mnt
 35
 36mkdir -p /mnt/boot/efi
 37mkdir /mnt/home
 38
 39mount /dev/nvme0n1p1 /mnt/boot/efi
 40mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@home /dev/nvme0n1p3 /mnt/home
 41
 42pacstrap /mnt base base-devel linux-lts linux-firmware sysfsutils e2fsprogs efibootmgr dosfstools mtools mkinitcpio dhcpcd inetutils netctl grub os-prober device-mapper cryptsetup gptfdisk nano nvme-cli less lvm2 dialog reflector vim zsh grml-zsh-config neofetch
 43
 44pacstrap /mnt xorg xorg-apps xorg-server xorg-drivers xorg-xkill xorg-xinit xterm mesa
 45
 46pacstrap /mnt linux-lts-headers arch-install-scripts bind-tools intel-ucode dkms p7zip archiso mkinitcpio-archiso plocate haveged pacman-contrib pkgfile git diffutils usbutils jfsutils reiserfsprogs btrfs-progs f2fs-tools logrotate man-db man-pages mdadm perl s-nail texinfo which dvd+rw-tools udftools xfsprogs lsscsi sdparm sg3_utils smartmontools fuse2 fuse3 ntfs-3g exfatprogs gvfs gvfs-afc gvfs-goa gvfs-gphoto2 gvfs-mtp gvfs-nfs gvfs-smb unrar unzip unace xz xdg-user-dirs grsync ddrescue dd_rescue testdisk hdparm htop rsync hardinfo bash-completion lsb-release polkit bleachbit packagekit gparted papirus-icon-theme meld libburn libisofs libisoburn devtools
 47
 48arch-chroot /mnt systemctl enable haveged.service
 49
 50pacstrap -i /mnt virt-manager qemu qemu-arch-extra edk2-ovmf bridge-utils dnsmasq vde2 iptables-nft ebtables openbsd-netcat
 51
 52arch-chroot /mnt systemctl enable libvirtd.service
 53
 54pacstrap /mnt pulseaudio celluloid vlc cdrtools gstreamer gst-libav gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gstreamer-vaapi xvidcore frei0r-plugins cdrdao dvdauthor transcode alsa-utils alsa-plugins alsa-firmware pulseaudio-alsa pulseaudio-equalizer pulseaudio-jack ffmpeg ffmpegthumbnailer libdvdcss gimp guvcview imagemagick flac faad2 faac mjpegtools x265 x264 lame sox mencoder
 55
 56pacstrap /mnt b43-fwcutter broadcom-wl-dkms ipw2100-fw ipw2200-fw net-tools networkmanager networkmanager-openvpn nm-connection-editor network-manager-applet wget curl firefox thunderbird wireless_tools nfs-utils nilfs-utils dhclient dnsmasq dmraid dnsutils openvpn openssh openssl samba whois iwd filezilla avahi openresolv youtube-dl vsftpd wpa_supplicant
 57
 58arch-chroot /mnt systemctl enable NetworkManager.service
 59arch-chroot /mnt systemctl enable avahi-daemon.service
 60arch-chroot /mnt systemctl enable avahi-dnsconfd.service
 61arch-chroot /mnt systemctl enable sshd.service
 62
 63pacstrap /mnt ttf-ubuntu-font-family ttf-dejavu ttf-bitstream-vera ttf-liberation noto-fonts ttf-roboto ttf-opensans opendesktop-fonts cantarell-fonts freetype2 ttf-hack terminus-font
 64
 65pacstrap /mnt system-config-printer foomatic-db foomatic-db-engine gutenprint hplip simple-scan cups cups-pdf cups-filters cups-pk-helper ghostscript gsfonts python-pillow python-pyqt5 python-pip python-reportlab
 66
 67arch-chroot /mnt systemctl enable cups.service
 68
 69pacstrap /mnt cinnamon cinnamon-translations gnome-terminal adwaita-icon-theme adapta-gtk-theme arc-gtk-theme arc-icon-theme gtk-engine-murrine gnome-keyring nemo nemo-share xed file-roller nemo-fileroller tmux tldr transmission-gtk brasero asunder quodlibet gnome-disk-utility polkit-gnome gnome-packagekit evince viewnior lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings accountsservice dconf-editor metacity
 70
 71arch-chroot /mnt systemctl enable lightdm.service
 72
 73genfstab -U /mnt >> /mnt/etc/fstab
 74arch-chroot /mnt
 75
 76optionally remove any subvolids, and extra subvol= in /etc/fstab and review sane status
 77
 78ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
 79hwclock --systohc
 80
 81nano /etc/locale.gen
 82    uncomment en_US.UTF-8 and save
 83
 84locale-gen
 85
 86nano /etc/locale.conf
 87    LANG=en_US.UTF-8
 88
 89nano /etc/hostname
 90
 91nano /etc/hosts
 92    127.0.0.1       localhost
 93    ::1             localhost
 94    127.0.1.1       $HOSTNAME.localdomain  $HOSTNAME
 95
 96passwd
 97
 98nano /etc/mkinitcpio.conf
 99    MODULES=(i915 btrfs)
100    remove fsck from HOOKS line and add btrfs resume
101
102mkinitcpio -p linux-lts
103
104grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArchLinux
105
106grub-mkconfig -o /boot/grub/grub.cfg (check /etc/fstab for swap UUID to add resume partition to default kernel param in /etc/default/grub, for example:
107GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet resume=UUID=51f170b4-c5d3-4489-a862-e4a8857df30b"
108)
109
110pacman -S blueberry (not needed for KDE or Gnome)
111systemctl enable bluetooth
112
113nano /etc/bluetooth/main.conf
114    under [Policy] AutoEnable=true
115
116useradd -mU -s /bin/zsh -G sys,log,network,floppy,scanner,power,rfkill,users,video,storage,optical,lp,audio,wheel,adm,libvirt $USERNAME
117
118passwd $USERNAME
119
120EDITOR=nano visudo
121    uncomment %wheel ALL=(ALL) ALL
122
123nano /etc/lightdm/lightdm.conf
124    under [LightDM] logind-check-graphical=true
125
126nano /etc/systemd/logind.conf
127    HandleLidSwitch=suspend-then-hibernate
128    HandleLidSwitchExternalPower=ignore
129
130nano /etc/systemd/sleep.conf
131    HibernateDelaySec=20min
132
133systemctl enable fstrim.timer
134
135cd /etc/xdg/reflector
136mv reflector.conf reflector.conf.orig
137nano reflector.conf
138--country US
139--age 6
140--protocol https
141--latest 5
142--sort rate
143--save /etc/pacman.d/mirrorlist
144
145systemctl enable reflector.timer
146systemctl enable reflector.service
147
148exit
149umount -a
150reboot
151
152***Log in to your new system***
153
154git clone https://aur.archlinux.org/yay
155cd yay
156makepkg -si PKGBUILD
157cd ..
158rm -fr yay
159
160yay -S timeshift timeshift-autosnap
161
162launch TS and configure (all defaults for btrfs are fine to start with)
163
164Let's make sure we have a local backup copy of the boot partition for every kernel upgrade:
165sudo mkdir /etc/pacman.d/hooks
166sudo nano /etc/pacman.d/hooks/50-bootbackup.hook
167
168    [Trigger]
169    Operation = Upgrade
170    Operation = Install
171    Operation = Remove
172    Type = Path
173    Target = usr/lib/modules/*/vmlinuz
174
175    [Action]
176    Depends = rsync
177    Description = Backing up /boot...
178    When = PreTransaction
179    Exec = /usr/bin/rsync -a --delete /boot /boot-backup
180
181yay -Syy
182yay -S pamac
183
184launch pamac and *uninstall* xf86-video-intel (Cinnamon and KDE) and xf86-input-synaptics
185install libva-utils and intel-media-driver for video encoding/decoding acceleration
186
187yay -S ttf-cascadia-code ttf-comic-mono-git ttf-ms-fonts gufw tlpui
188
189Thinkpad specific:
190sudo systemctl enable --now tlp.service
191sudo pacman -S acpi_call-dkms xf86-input-wacom
192sudo pacman -S iio-sensor-proxy (even Gnome needs this one!)
193yay -S screenrotator-git (for KDE, XFCE, Cinnamon etc, not Gnome)
194Go to Display settings and enable screen rotation in Cinnamon
195
196su -
197ufw default deny
198ufw allow from 10.1.10.0/24 (modify to suit your local network)
199ufw allow Transmission
200ufw limit ssh
201ufw enable
202
203All done!
204