Slackware on a Lenovo ThinkPad X1 carbon 6th generation

posted on Apr 23, 2018

This post is about setting up Slackware Linux on the ultrabook Lenovo ThinkPad X1 carbon 6th generation. This is an extremely light laptop with top-end performance, including a superfast 1Tb NVMe drive. I like the fact that this is incredibly thin and light, but yet has two full USB 3 ports, two USB C and a full size HDMI port. The battery holds a pretty good runtime. Check the table at the end to see details of the hardware configuration.

Preparation

The computer came with Windows 10 Home pre-installed. In the event that I may need to run something on Windows (occasionally I need to use Word with Endnote), I decided to virtualize this and try to have it available as a VM. VMWare has a tool that can do this: VMware vCenter Converter Standalone. Running this in Windows (started with Run as adminstrator) created a VM image that I wrote out to an external drive, hoping to be able to run it with VMPlayer. This worked well as you can see below.

In order to be able to restore the full system, I also made a backup of the recovery partition. To achieve this I booted the system using a GParted thumbdrive and used FSArchiver to archive the partition to an external USB drive (SBo also has a slackbuild of FSArchiver).

Having got all I wanted from the original system, I could now remove the original OS to give way to my Slackware system. Still using the GParted thumbdrive, I deleted all partitions except the EFI System Partition. I created a small 128Mb boot partition formatted with ext4, and another large one, with the rest of the disk size, to be encrypted and store root and swap.

Just to make sure everything will work best with Linux, I changed two settings in the BIOS:

  • disabled "Secure Boot"
  • enabled "Thunderbolt BIOS Assist Mode"

Slackware64 14.2

There are some issues with installling Slackware on this machine such that it boots off of UEFI and from an NVMe solid state drive (a new and faster version of the SSD protocol). Due to work requirements, the disk also needs to be encryted, which I do using the LVM+LUKS method.

  • Slackware 14.2 does not have support for NVMe drives but Didier Spaier created an ISO image for a USB that deals with it. I installed it on a USB stick and booted the computer from this. For more information see the whole discussion thread at Linux Questions (but make sure you get to post #32 with the updated version!)
  • because I need disk encryption I followed the instructions on the README_CRYPT.TXT file in the installation folder; I use the LVM+LUKS method that encrypts both swap and root. I created a plain ext4 partition (128 Mb) to mount /boot and another one with the rest of the entire disk to encrypt for swap and root. Note that this method will always require an initrd, it won't boot without one (even with the huge kernel).
  • now that I have a partition to encrypt I followed the instructions of README_CRYPT.TXT to encrypt the partition and create two LVM volumes for swap and root. Because I want to be able to hibernate to disk, the swap file has 16Gb (the amount of RAM on this laptop).
  • at this point I inserted another USB with the full Slackware64 14.2 installation (fortunately this laptop has two full USB 3 slots!), mounted it and then started the setup command (from Didier's USB that booted the system). At the point where it asks for the Slackware installation folder I pointed it to the second USB.
  • at this point I just installed the full package. The install went smoothly and it recognized most of the hardware (but we will need a new kernel for the wifi adapted...)
  • then I applied all the patches available at this time (except the kernel since we will need a more updated version).
  • finally I created an appropriate initrd.gz. Note that this laptop needs to load the modules nvme-core and nvme in the initrd, otherwise it cannot read from the solid state drive and it will not boot!
  • after having made the initrd.gz I've put it and the (generic) kernel in the /boot/efi/EFI/Slackware folder. At this point the system is ready to reboot; the newly installed Slackware 14.2 boots like a gem!

Kernel 4.14.34

The kernel that comes in Slackware 14.2 (or the one in the patch folder) does not have a driver that works with the wifi adapter in this machine (Intel Wireless 8265). Fortunately at this time Slackware-current has a kernel that has the driver, so I've installed that one.

  • Maybe I could have just used the Slackware-current kernel packages, but I feared this may depend on a different glibc, etc. To be on the safe side I decided to compile the kernel myself. To avoid going through all of the kernel configuration, I got the .configure file from Pat's Slackware-current kernel packages. You can get this file from the kernel source package and drop it in your kernel build directory. Then just do the typical make, make modules_install and copied the kernel file to /boot/efi/EFI/Slackware.
  • A new initrd.gz needs to be built with this kernel, though the parameters are the same as before. Copy the initrd.gz to /boot/efi/EFI/Slackware
  • adjust the elilo.conf to load the new kernel and initrd.gz. I've added the option "resume=/dev/cryptvg/swap" to enable hibernation to disk
  • there are other options to pass to the kernel too; one is to to better configure CPU turbo mode and another for cooling. I have not done this yet and will update this entry when I figure it out.
  • after booting the new kernel the wifi works fine.

Summary

At this point I have a really nice laptop setup. It is increadibly light and fast. I've got the touch screen and that works perfectly well, including with the stylus from the X230t that I had previously (or if you prefer any stylus for tablet will work with it too). I use the stylus to sign documents at work, or to edit photos at home. At this point only the fingerprint reader does not work under Slackware. The specs and functionality of the hardware are listed below.

Hardware details and usability chart

devicehardwarestatusmodule/drivercomments
laptopLenovo X1 carbon 6th generation model 20KHCTO1WW worksThinkPad BIOS N23ET37W (1.12 )Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
diskSamsung 1Tbworksnvme_core, nvmesee notes for how to setup Slackware on an NVMe disk
USBIntel Sunrise Point-LP USB 3.0 xHCI, Realtek Semicondictorworksehci_pci, ohci_pci, ehci_pci, xhci_pci2x USB 3.0 and 2x USB C (see photo); charging through USB C
ethernetintegrated Intel 82579LM Gigabitunknowne1000ethe ethernet connector is hidden behind a plastic cap, next to a USB C (see photo with cap still on). Remove cap reveals a mini ethernet, needs an adaptor to connect to RJ-45...
wifiIntel Dual Wireless AC 8265worksiwlwifineeds kernel 4.14 or above
Bluetooth??? worksbluetooth
videointegrated Intel Sky Lake worksi915,hid-multitouch,input,hiddev96,hidraw0I have the 1920x1080 touch screen; touch works
sound cardintegrated Intel HDAworkssnd-hda-intelintegrated microphone works; external mic and heaphones requires single jack.
cameraChicony Electronics 04f2:b61eworksuvcvideoworks up to 1280x720
hotkeyskeyboardpartialthinkpad_acpivolume and brightness work; wifi and bluetooth kill switches work; mic mute does not work
fingerprint reader???does not work apparently can work but needs a driver and software
touch padSynPS/2 Synaptics TouchPadworkspsmousethis one works flawlessly, I hear about othe models that did not; possibly different hardware and I got lucky!
track pointTPPS/2 Elan TrackPointworkspsmousethis is the red "nipple" between keys G,H and B...