#+BLOG: wordpress #+POSTID: 513 #+OPTIONS: toc:3 #+OPTIONS: todo:t #+TITLE: Installing and configuring Arch Linux on Thinkpad X1 Carbon #+DATE: <2016-06-04 Sat> #+AUTHOR: Robert Kozikowski #+EMAIL: r.kozikowski@gmail.com * Introduction I configured Arch Linux on the new Thinkpad X1 Carbon (4th generation) with dual booting to the pre-installed Windows 10 (for games I occasionally play). I got close to the 100% of laptop functionality working on the Arch Linux, confirming the rumor that Thinkpads work well with Linux. Setup should be very similar on modern laptops with GPT/UEFI. Even if Arch wiki is very comprehensive, it needs a bit of reading to decide what is right for the particular hardware. Dual booting with windows and UEFI/GPT are not as well documented as the plain old linux installations. To see my thoughts after a few months of usage you can jump to [[*Conclusion][Conclusion]]. [[https://raw.githubusercontent.com/kozikow/kozikow-blog/master/arch.org][This post was written in and is readable in the Emacs org mode format]]. * Why Arch Linux? This section is for informative purposes only. If you are only interested in the installation you can skip to [[*Base installation of Arch Linux][Base installation of Arch Linux]]. ** Minimalist distributions teach you Linux When some people hear that Arch starts without a GIU they think that using it is "masochistic". Firstly, you probably don't need majority of packages bundled with distributions like ubuntu. Secondly, while Ubuntu may take you "75%" there, you don't understand how different things got there and treat your OS like magical box, so you can't improve it. While Arch starts from "20%", by going "20%->75%" the learning experience allows you to eventually reach "100%" faster than users who want to go from "75% -> 100%". Therefore, majority of users of distributions like Ubuntu are stuck around "80%". *** Vs other minimalistic distributions - Gentoo and Slackware **** systemd is the future Other "minimalist" distributions like Gentoo or Slackware did not adapt the systemd yet. You may not like systemd, but you can't deny it's winning. **** No need to compile packages (Gentoo) What's the benefit of waiting a week until all packages compile for your OS? On Arch you can choose between pre-installing packages via pacman and building them with makepkg. If I want to just check out some program, or use it once per month (e.g. gimp) I wouldn't want to compile it. **** No manual dependency resolution (Slackware) Understanding dependencies of your packages is good. You can simply run =pacman -Si gtk3= to see dependencies of a package. Resolving each package manually is too time consuming to be worth it. ** Rolling release schedule is good If you need to run the same Linux version on 100s of machines in the large organization I get why you wouldn't want rolling release schedule. - I was much more frequently hit by missing this "new cool flag" in old distributions, rather than I am hit by the bleeding edge packages in Arch Linux. - If something goes wrong, you can always open a bug and [[https://wiki.archlinux.org/index.php/Downgrading_packages][downgrade to older version]]. - In the new containerised world servers have less "intervined" dependencies, so it's easier to just run the latest software from Arch. - Bugs caused by upgrades in distributions with huge releases are harder to debug. Since everything changes at once it's harder to isolate the failure. ** Arch wiki is awesome Even when I was using different Linux distributions I was using Arch wiki as my primary source of Linux knowledge. Any other distribution is not nearly as well documented as Arch. If you end up getting majority of your info about Linux from Arch wiki, why not switch to Arch? * Hardware specification of the laptop This section is for informative purposes only. If you are only interested in the installation you can skip to [[*Base installation of Arch Linux][Base installation of Arch Linux]]. ** Serial number #+BEGIN_SRC bash :results output sudo cat /sys/devices/virtual/dmi/id/product_serial #+END_SRC #+BEGIN_EXAMPLE R90KNV08 #+END_EXAMPLE ** Desktop management information Extracted from: #+BEGIN_SRC bash :results output sudo dmidecode #+END_SRC *** System Information #+BEGIN_EXAMPLE System Information Manufacturer: LENOVO Product Name: 20FBCTO1WW Version: ThinkPad X1 Carbon 4th Serial Number: R90KNV08 UUID: 8648D14C-33F4-11B2-A85C-EDB510BB0156 Wake-up Type: Power Switch SKU Number: LENOVO_MT_20FB_BU_Think_FM_ThinkPad X1 Carbon 4th Family: ThinkPad X1 Carbon 4th #+END_EXAMPLE *** Processor #+BEGIN_EXAMPLE Handle 0x0007, DMI type 4, 48 bytes Processor Information Socket Designation: U3E1 Type: Central Processor Family: Core i7 Manufacturer: Intel(R) Corporation ID: E3 06 04 00 FF FB EB BF Signature: Type 0, Family 6, Model 78, Stepping 3 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (FXSAVE and FXSTOR instructions supported) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Multi-threading) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz Voltage: 1.0 V External Clock: 100 MHz Max Speed: 8300 MHz Current Speed: 2500 MHz Status: Populated, Enabled Upgrade: Other L1 Cache Handle: 0x0004 L2 Cache Handle: 0x0005 L3 Cache Handle: 0x0006 Serial Number: None Asset Tag: None Part Number: None Core Count: 2 Core Enabled: 2 Thread Count: 4 Characteristics: 64-bit capable Multi-Core Hardware Thread Execute Protection Enhanced Virtualization Power/Performance Control #+END_EXAMPLE *** Memory 8gb in total, 2x of following: #+BEGIN_EXAMPLE Memory Device Array Handle: 0x0008 Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: 4096 MB Form Factor: Chip Set: None Locator: ChannelB-DIMM0 Bank Locator: BANK 2 Type: LPDDR3 Type Detail: Synchronous Speed: 1867 MHz Manufacturer: Samsung Serial Number: None Asset Tag: None Part Number: K4E6E304EE-EGCF Rank: 2 Configured Clock Speed: 1867 MHz Minimum Voltage: Unknown Maximum Voltage: Unknown Configured Voltage: 1.2 V #+END_EXAMPLE *** Motherboard #+BEGIN_EXAMPLE Base Board Information Manufacturer: LENOVO Product Name: 20FBCTO1WW Version: SDK0J40697 WIN Serial Number: W1KS65P10SY Asset Tag: Not Available #+END_EXAMPLE *** Plugs - HDMI - 3 USB (no type C) - Mini DisplayPort - Mini jack - OneLink *** Battery #+BEGIN_EXAMPLE Portable Battery Location: Front Manufacturer: SMP Name: 00HW029 Design Capacity: 52060 mWh Design Voltage: 15200 mV SBDS Version: 03.01 Maximum Error: Unknown SBDS Serial Number: 057C SBDS Manufacture Date: 2016-05-24 SBDS Chemistry: LiP OEM-specific Information: 0x00000000 #+END_EXAMPLE *** Cards slots #+BEGIN_EXAMPLE Handle 0x0021, DMI type 9, 17 bytes System Slot Information Designation: Media Card Slot Type: Other Current Usage: Available Length: Other Characteristics: Hot-plug devices are supported Bus Address: 0000:00:00.0 Handle 0x0022, DMI type 9, 17 bytes System Slot Information Designation: SmartCard Slot Type: Other Current Usage: Available Length: Other Characteristics: Hot-plug devices are supported Bus Address: 0000:00:00.0 Handle 0x0023, DMI type 9, 17 bytes System Slot Information Designation: SimCard Slot Type: Other Current Usage: Available Length: Other Characteristics: None Bus Address: 0000:00:00.0 #+END_EXAMPLE *** BIOS #+BEGIN_EXAMPLE BIOS Information Vendor: LENOVO Version: N1FET38W (1.12 ) Release Date: 03/30/2016 Address: 0xE0000 Runtime Size: 128 kB ROM Size: 16384 kB Characteristics: PCI is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed Boot from CD is supported Selectable boot is supported EDD is supported 3.5"/720 kB floppy services are supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) CGA/mono video services are supported (int 10h) ACPI is supported USB legacy is supported BIOS boot specification is supported Targeted content distribution is supported UEFI is supported BIOS Revision: 1.12 Firmware Revision: 1.8 #+END_EXAMPLE *** No ethernet, but converter is provided OneLink to ethernet converter have been provided. I didn't test it on Arch. #+BEGIN_EXAMPLE Handle 0x0019, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: Not Available Internal Connector Type: None External Reference Designator: Ethernet External Connector Type: RJ-45 Port Type: Network Port #+END_EXAMPLE *** CPU Cache #+BEGIN_EXAMPLE Handle 0x0003, DMI type 7, 19 bytes Cache Information Socket Designation: L1 Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 64 kB Maximum Size: 64 kB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Parity System Type: Data Associativity: 8-way Set-associative Handle 0x0004, DMI type 7, 19 bytes Cache Information Socket Designation: L1 Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 64 kB Maximum Size: 64 kB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Parity System Type: Instruction Associativity: 8-way Set-associative Handle 0x0005, DMI type 7, 19 bytes Cache Information Socket Designation: L2 Cache Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 512 kB Maximum Size: 512 kB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 4-way Set-associative Handle 0x0006, DMI type 7, 19 bytes Cache Information Socket Designation: L3 Cache Configuration: Enabled, Not Socketed, Level 3 Operational Mode: Write Back Location: Internal Installed Size: 4096 kB Maximum Size: 4096 kB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Multi-bit ECC System Type: Unified Associativity: 16-way Set-associative #+END_EXAMPLE *** Pointing devices #+BEGIN_EXAMPLE Handle 0x0034, DMI type 21, 7 bytes Built-in Pointing Device Type: Track Point Interface: PS/2 Buttons: 3 Handle 0x0035, DMI type 21, 7 bytes Built-in Pointing Device Type: Touch Pad Interface: PS/2 Buttons: 2 #+END_EXAMPLE * Base installation of Arch Linux I mostly followed steps from https://wiki.archlinux.org/index.php/beginners'_guide with customization for Windows dual booting, uefi, gpt and HiDPI screen. ** Prepare USB stick (on other computer with Ubuntu Linux 14.04) *** Download I downloaded the =2016.06.01= image via torrent from https://www.archlinux.org/download/. *** Upload it to the usb stick Since the laptop don't have the CD, USB is the best booting option. More detailed description is at [[https://wiki.archlinux.org/index.php/USB_flash_installation_media][Arch wiki article about USB flash installation media.]] **** Find out the name of your USB drive with lsblk #+BEGIN_SRC bash :results output lsblk | grep media #+END_SRC **** If USB stick got auto-mounted ***** See that it got auto mounted #+BEGIN_SRC bash :results output dmesg -wH #+END_SRC ***** Make sure that it is not mounted. #+BEGIN_SRC bash :results output umount /dev/sdb1 #+END_SRC **** Burn the image with dd #+BEGIN_SRC bash :results output cd ~/Downloads sudo dd bs=4M if=archlinux-2016.06.01-dual.iso of=/dev/sdb && sync #+END_SRC **** Verify Re-plug the usb and: #+BEGIN_SRC bash :results output ls /media/kozikow/ARCH* #+END_SRC #+BEGIN_EXAMPLE arch EFI isolinux loader #+END_EXAMPLE ** Prepare Windows 10 (for computer games) for dual booting You may want to take a look at [[https://wiki.archlinux.org/index.php/Dual_boot_with_Windows][Dual boot with Windows wiki entry]]. *** Shrink the Windows partition from Windows Even if partition resizing is also supported from Linux, I feel like it's safer to do it from Windows. 1. Press start button 2. Search for "Create and format hard disk partitions" 3. Right click C:/ and "Shrink Volume" **** Shrinking limitations Windows only lets me to reclaim 233 gb out of 474 gb. I tried defragmentation or cleaning up some unnecessary files with no luck. I think it's not that bad, since I can mount the NTFS partition from arch. Therefore, I can keep the most space hungry files like movies on this partition. *** Check that Windows boots into the UEFI/GPT mode You can check it on Windows in System Information->BIOS mode You may consider reading about [[https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface][UEFI]] and [[https://wiki.archlinux.org/index.php/GUID_Partition_Table][GPT]]. If we want to dual boot with the existing Windows we need to use UEFI for Arch as well. *** [[https://wiki.archlinux.org/index.php/Dual_boot_with_Windows#Fast_Start-Up][Disable Fast Startup]] If you don't, Linux NTFS driver may damage the NTFS disk. [[http://www.tenforums.com/tutorials/4189-fast-startup-turn-off-windows-10-a.html][Windows 10 instructions.]] ** Boot Arch Linux *** Disable secure boot It prevents Arch from booting. 1. Restart computer 2. Press Enter 3. F1->Security->Secure Boot 4. Change to disabled 5. Save and restart *** Boot 1. Press Enter 2. F12 3. Choose usb stick 4. Arch ** Adjust tty font size Default tty font size if very small due to the [[https://wiki.archlinux.org/index.php/HiDPI][HiDPI]] resolution. You can adjust it with: #+BEGIN_SRC bash :results output cd /usr/share/kbd/consolefonts ls | grep -P "[2-9]\d+\.ps" # Find big fonts. setfont latarcyrheb-sun32 # The biggest one I found. #+END_SRC It's a good idea to persist the font. Add it later to =/etc/vconsole.conf=, after you install a new OS: #+BEGIN_SRC bash :results output KEYMAP=us FONT=latarcyrheb-sun32 #+END_SRC ** Create partitions *** [[*Shrink the Windows partition from Windows][I already shrinked the Windows partition from Windows]] *** Create the swap I thought that swap may not be necessary, but 8gb is not that much of ram nowadays. **** Later, after installing the system I created a swap file afterwards. I followed instructions at https://wiki.archlinux.org/index.php?title=Swap&redirect=no#Swap_file . #+BEGIN_SRC bash :results output fallocate -l 8192M /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile #+END_SRC You may also need to create systemd service to do it automatically. Create =/etc/systemd/system/swap.service=: #+BEGIN_EXAMPLE [Unit] Description=Enable swap file [Service] Type=oneshot TimeoutStartSec=300 User=root ExecStart=/usr/bin/swapon /swapfile ExecStop=/usr/bin/swapoff /swapfile RemainAfterExit=yes [Install] WantedBy=multi-user.target #+END_EXAMPLE =sudo systemctl enable swap.service= *** [[https://wiki.archlinux.org/index.php/EFI_System_Partition][EFI system partition]] already exists Since laptop came with the UEFI support, the EFI system partition already exists. You can check it by #+BEGIN_SRC bash gdisk /dev/sda #+END_SRC *p* to list partition table. See that the first entry (/dev/sda1) is the "EFI system partition" *** Create partition for Arch with [[https://wiki.archlinux.org/index.php/Fdisk#GPT_.28gdisk.29][gdisk]] I decided I'll go with a single Linux partition, since my movies and music will be stored on the NTFS partition. I used gdisk to create a new partition. gdisk is installed by default on the usb stick. #+BEGIN_SRC bash gdisk /dev/sda #+END_SRC *p* to list all partition tables. Based on this I found that my new partition should be placed between sectors 507793408 and 998166527. *n* to create a new partition. All default options were reasonable. *w* to save **** Verify that the new partition is there #+BEGIN_SRC bash :results output lsblk #+END_SRC ** Format and mount partitions [[https://wiki.archlinux.org/index.php/Solid_State_Drives][You may want to read an arch wiki about SSDs.]] *** I went for ext4. *** Why not F2FS? Since the laptop have the SSD, I was contemplating trying out the [[https://wiki.archlinux.org/index.php/F2FS][F2FS]]. It's only [[https://www.phoronix.com/scan.php?page=news_item&px=Linux-4.4-FS-4-Way][slightly faster according to some benchmarks]]. ext4 have [[https://en.wikipedia.org/wiki/Ext4#Features][additional features]] and is more standard so it seems like safer bet. I have been thinking that maybe F2FS would result in less "SSD tear". I have been reading than in "desktop" usage SSD tear is almost never an issue and other components in laptop would fail first, so we don't have to worry about it. *** Why not ext3? [[https://en.wikipedia.org/wiki/Ext4#Compatibility_with_Windows_and_Macintosh][There exist some drivers that let windows read and copy files from ext filesystem.]] Even if support for using ext4 from Windows is worse than ext3, I won't be using Windows often. If you plan to frequently boot to Windows you may consider ext3 for better Windows compatibility. *** Format and mount the Linux partition #+BEGIN_SRC bash :results output lsblk /dev/sda mkfs.ext4 /dev/sda5 mount /dev/sda5 /mnt #+END_SRC *** Boot partition **** What is this EFISTUB about? Section about EFISTUB may be a bit confusing. Note that most EFI boot loaders are EFISTUBs themselves (they both create EFI entries). In particular, systemd-boot will create EFISTUB entries for itself. Bootling Linux using the kernel EFISTUB means you just skip the bootloader. In almost all cases you want to go for bootloader like systemd-boot. **** Mount existing [[*%5B%5Bhttps://wiki.archlinux.org/index.php/EFI_System_Partition%5D%5BEFI%20system%20partition%5D%5D%20already%20exists][EFI system partition]] to /mnt/boot Since I don't plan to use EFISTUB as a bootloader and use systemd-boot, I just need to mount our EFI system partition at /mnt/boot. #+BEGIN_SRC bash :results output mkdir -p /mnt/boot mount /dev/sda1 /mnt/boot #+END_SRC **** Do not format the /mnt/boot systemd-boot will be installed on top of existing Windows boot loader. It will detect the existing windows boot loader and set up the dual booting. ** Connect to internet #+BEGIN_SRC bash iw dev # Find an interfrace wifi-menu -o wlp4s0 # pass an interface from the previous command #+END_SRC ** Run the installer #+BEGIN_SRC bash :results output pacstrap -i /mnt base base-devel #+END_SRC ** genfstab #+BEGIN_SRC bash :results output genfstab -U /mnt >> /mnt/etc/fstab #+END_SRC ** Netctl #+BEGIN_SRC bash :results output cp -R /etc/netctl /mnt/etc/netctl #+END_SRC ** arch-chroot #+BEGIN_SRC bash :results output arch-chroot /mnt /bin/bash #+END_SRC ** Locale and time zone #+BEGIN_SRC bash :results output # Uncomment en_GB.UTF-8 UTF-8 in /etc/locale.gen locale-gen echo "LANG=en_GB.UTF-8" > /etc/locale.conf tzselect ln -s /usr/share/zoneinfo/Europe/London /etc/localtime hwclock --systohc --utc #+END_SRC I must admit that I had some issues with GB locale after the installation. I switched to US locale and I did not have problems with it yet. IMO, even if you are in the UK, more things will work as you expect when you go with the US locale. Also, if you install gnome, it stores it's own locale settings and you need to set them later. To set it, I recommend installing =gnome-initial-setup= and restarting the X server. ** [[https://wiki.archlinux.org/index.php/beginners'_guide#Initramfs][initramfs]] Run: #+BEGIN_SRC bash :results output mkinitcpio -p linux #+END_SRC *** Problem with missing vmlinuz-linux Initially I have been getting an error: #+BEGIN_EXAMPLE ERROR: specified kernel image does not exist; /boot/vmlinuz-linux #+END_EXAMPLE The problem was that I mounted the /mnt/boot after running the pacstrap. Pacstrap writes the vmlinuz-linux to /mnt/boot. *** Problem with missing firmware I also got some warnings about some missing firmware. #+BEGIN_EXAMPLE Warning: Possibly missing firmware wd719x Possibly missing firmware aic94xx #+END_EXAMPLE Strangely the problem somehow resolved itself. Some installation must have pulled the package. As [[https://bbs.archlinux.org/viewtopic.php?id=194977][this post mentions]], missing firmware can be found in AUR. After it is installed: #+BEGIN_SRC bash :results output modinfo wd719x | grep description modinfo aic94xx | grep description #+END_SRC #+BEGIN_EXAMPLE description: Western Digital WD7193/7197/7296 SCSI driver description: Adaptec aic94xx SAS/SATA driver #+END_EXAMPLE ** Boot Loader After brief investigation, I decided that I prefer the [[https://wiki.archlinux.org/index.php/Systemd-boot][systemd-boot]] as an x86_64 [[https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface][UEFI]] bootloader. *** It will be installed on top of existing bootloader [[*Boot partition][I previously mounted EFI system partition to /boot.]] This partition has a pre-existing Windows boot loader. systemd-boot will be installed on top of that and it will auto-detect and properly handle the previously installed boot loader. *** Install systemd-boot #+BEGIN_SRC bash :results output bootctl install #+END_SRC *** =/boot/loader/loader.conf= #+BEGIN_EXAMPLE timeout 4 default arch editor 0 #+END_EXAMPLE *** =/boot/loader/entries/arch.conf= #+BEGIN_SRC bash :results output title Arch Linux linux /vmlinuz-linux initrd /initramfs-linux.img options root=PARTUUID=c0181663-6019-4a2c-b45a-ab6c112f1aa0 rw #+END_SRC PARTUUID is a GUID of your new partition. Beware that GUID is case sensitive in this case. You can find it using: #+BEGIN_SRC bash :results output blkid -s PARTUUID -o value /dev/sdb5 #+END_SRC *** No need for windows entry in =/boot/loader/entries/= systemd-boot auto-detects Windows, so there is no need for the windows entry. My =/boot/loader/entries/= directory only contains arch.conf and I can dual boot to Windows. *** Windows plays along well I heard stories that in such setup Windows does not like to play along and messes up the EFI system partition. I did not experience it. I am running "bleeding edge" Windows 10 develop preview, so it may have been fixed at some point. ** Network [[https://wiki.archlinux.org/index.php/beginners'_guide#Configure_the_network][Follow steps from the wiki.]] *** Suspicious Unnamed/non-netdev interface At some point later I noticed a suspcious device when running "iw dev": #+BEGIN_EXAMPLE Unnamed/non-netdev interface wdev 0x3 addr ... type P2P-device #+END_EXAMPLE [[https://growworkinghard.com/2016/04/01/iw-dev-unnamednon-netdev-interface/][There is a post about it. It's probably harmless.]] Just in case, I disabled the p2p interface: #+BEGIN_SRC bash :results output sudo echo "p2p_disabled=1" >> /etc/wpa_supplicant/wpa_supplicant.conf #+END_SRC ** Set root password #+BEGIN_SRC bash :results output passwd #+END_SRC * Configuring Arch Linux after booting to the new system At this point I am able to dual boot to Arch/Windows. A few more things after rebooting: ** Create the user account #+BEGIN_SRC bash :results output useradd -m kozikow passwd kozikow visudo # in this file configure your user as a sudoer reboot #+END_SRC ** Hardware support *** Input devices There are two alternative input libraries =x86-input-evdev= and =x86-input-libinput=. After reading [[https://wiki.archlinux.org/index.php/Libinput][two]] [[https://www.reddit.com/r/archlinux/comments/48tqj9/difference_between_libinput_and_evdev/][articles]] I decided to go with =x86-input-libinput=. [[https://www.reddit.com/r/archlinux/comments/48tqj9/difference_between_libinput_and_evdev/d0o266t][Some user mentioned: "With xf86-input-libinput, the trackpoint(and middle button scrolling) works out of the box on my ThinkPad, while xf86-input-evdev requires some additional settings".]] Indeed, with libinput everything reasonably worked after the installation. **** Keyboard hardware buttons Almost all keyboard "hardware" buttons work as expected, including sound and brightness. There are two minor problems: ***** Airplane mode button It sucesfully turns on the airplane mode, but turning it off doesn't work well. After turning the airplane mode off I have to run: #+BEGIN_SRC bash :results output sudo systemctl restart netctl-auto@wlp4s0.service #+END_SRC ***** F11 and F12 I don't know what these buttons supposed to do, but pressing them currently have no effect. **** Adjust trackpoint sensitivity The only annoyance was too slow trackpoint. Methods from arch wiki didn't work for me, probably since they were meant for the old evdev. ***** Xinput method #+BEGIN_SRC bash :results output pacman -S xorg-xinput xinput list | grep TrackPoint # Find an id of tracpoint. 12 in my case. xinput --set-prop 12 'libinput Accel Speed' 1.0 #+END_SRC Persisting this method requires adding the set-prop command to the .xinitrc (before =exec gnome-session=). ***** Device parameters method =/usr/local/bin/my_init.sh=: #+BEGIN_SRC bash :results output echo 180 > /sys/bus/serio/devices/serio2/sensitivity #+END_SRC Even if there are multiple devices in /sys/bus/serio/devices/, only the touchpad have a sensitivity file present. [[https://bugzilla.redhat.com/show_bug.cgi?id=1200717#c2][Also see this post]]. I tried to persist it using systemd, but it's a wrong way to go in this case. You need [[https://wiki.archlinux.org/index.php/Udev#Writing_udev_rules][udev rule]]. See https://bbs.archlinux.org/viewtopic.php?id=165213. You can see existing udev description using =udevadm info -a -p /sys/bus/serio/devices/serio2=. My =/etc/udev/rules.d/10-trackpoint.rules=: #+BEGIN_EXAMPLE ACTION=="add",SUBSYSTEM=="input",ATTR{name}=="TPPS/2 IBM TrackPoint",ATTR{device/sensitivity}="180",ATTR{device/speed}="180" #+END_EXAMPLE ***** Recomended values xinput method ranges between -1.0 and 1.0. I went for 1.0. sensitivity ranges between 128 and 250. I went for 180. It is quite speedy and it took me a few days to adjust, but now it's much more efficient. *** Graphics Almost everything worked as expected after installing xorg and gnome. **** libgl I had to choose a libgl library when install xorg. There were 4 alternative libgl implementations. I went for mesa-libgl, since alternatives were from nvidia and this thinkpad has an integrated intel graphics card. **** Screen Resolution To verify that you are running the best resolution, WQHD (2560x1440), run: #+BEGIN_SRC bash :results output xrandr 1 ↵ #+END_SRC #+BEGIN_EXAMPLE Screen 0: minimum 320 x 200, current 2560 x 1440, maximum 8192 x 8192 eDP-1 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 310mm x 174mm 2560x1440 60.00*+ ... #+END_EXAMPLE **** Some applications have problems with HiDPI [[https://wiki.archlinux.org/index.php/HiDPI][You make take a look first at the Arch Wiki HiDPI section]]. Majority of applications, including chromium, emacs and termite correctly handled the HiDPI. Some apps, like xscreensaver or xterm were displaying too small windows, not aware of the HiDPI screen. It seems that HiDPI is correctly handled system wide (xdpyinfo reports correct dpi and resolution), but just some old apps did not adapt yet. I tried messing with ~/.Xresources. After no success, I decided that it's not worth it, since the only affect app I use is xscreensaver. ***** TODO Try =xrdb ~/.Xresources &= I didn't add =&= when adding this line to xrdb. *** Sound Sound and microphone worked without any special setup. *** HDMI The laptop comes with built in HDMI port. **** Video (4K TV) When I plug the HDMI it "just works". Resolution is not auto detected and by default I only see "part" of the screen. In gnome, I had to go to Settings->Displays and change the resolution of the secondary screen. 4K resolution (4096x2160) is supported. Mirroring displays works as expected on the TV, although I had some issues with mirroring using a projector. **** Sound over HDMI By default, sound plays from the laptop speaker. In gnome, I can choose to play it over HDMI in Settings->Sound. ** Auto starting - For init scripts that apply system wide you need to create a [[https://wiki.archlinux.org/index.php/autostarting#Systemd][systemd service]] (Type=oneshot for just init scripts) - For init scripts that interact with devices you need to create a [[https://wiki.archlinux.org/index.php/Udev#Writing_udev_rules][udev rule]]. - For user specific configuration that applies to graphical interface, add it to =~/.xinitrc= . - For you shell configuration add it to =~/.bashrc= (or =~/.zshrc= in my case). - To auto start [[https://wiki.archlinux.org/index.php/autostarting#GNOME][gnome apps]]: #+BEGIN_SRC bash :results output mkdir -p ~/.config/autostart cp /usr/share/applications/emacs.desktop ~/.config/autostart # Some apps may also be in ~/.local/share/applications #+END_SRC ** Auto-connect to wifi It's nice to automatially connect to wifi when you boot, rather than run =wifi-menu= every time. #+BEGIN_SRC bash :results output sudo pacman -S wpa_actiond # find an interface name with iv dev sudo systemctl enable netctl-auto@wlp4s0.service #+END_SRC Also see: [[https://wiki.archlinux.org/index.php/Netctl][Netctl wiki entry]] [[https://wiki.archlinux.org/index.php/Wireless_network_configuration][Wireless network configuration wiki entry]] To disable the service and add a new wifi entry I simply use this bash alias: #+BEGIN_SRC bash :results output wifi() { sudo systemctl disable netctl-auto@wlp4s0.service sudo wifi-menu sudo systemctl enable netctl-auto@wlp4s0.service } #+END_SRC ** My personal preferences about desktip software *** Window manager Mass installing "gnome" package is against the arch philosophy, as it pulls many unnecessary things with it. If you have extra time you should pick invididual gnome packages or go for lighter WM. If you want an easy way out you can just: #+BEGIN_SRC bash :results output pacman -S gnome gnome-initial-setup xorg-xinit xterm xorg-utils echo "exec gnome-session" >> ~/.xinitrc startx #+END_SRC **** Remove not used gnome packages Gnome pulls lots of stuff that I never used. You may want to uninstall some packages that you don't use from gnome: #+BEGIN_SRC bash :results output pacman -Q | grep gnome # See how much things you have just installed. pacman -Rc gnome-keyring gnome-contacts gnome-calculator empathy gnome-terminal #+END_SRC **** Problem with gnome-terminal not starting gnome-terminal worked initially, but then it refused to start. I much more prefer [[https://wiki.archlinux.org/index.php/Termite][termite]] as an terminal and it didn't experience the same issue. [[https://github.com/kozikow/kozikow-blog/blob/master/termite_config][My ~/.config/termite/config.]] **** Tiling window manager Personally, I just spend 99% of my time in 3 programs: emacs, chromium and termite+tmux. I do the tiling and workspace management inside Emacs or tmux. I would get minimal additional benefit out of a tiling wm. The only things I need from the window manager are supplied by plain gnome: - Switch focus to emacs/chromium/termite with [[https://www.archlinux.org/packages/community/i686/wmctrl/][wmctrl]]. - Move window one monitor left (=gsettings set org.gnome.desktop.wm.keybindings move-to-monitor-left=) and right (=move-to-monitor-right=) - Auto maximize windows and remove decorations with https://aur.archlinux.org/packages/maximus/. **** Auto start apps *** Screen lock gnome-screensaver was buggy when I tried to use it and I decided to use xscreensaver instead. If you want a xscreensaver with an image as a screensaver: #+BEGIN_SRC bash :results output sudo pacman -S xscreensaver sudo pacman -S libgnome # Required if you use gnome. Pacman do not pick it by default. # See http://askubuntu.com/questions/74200/how-do-i-use-a-photos-directory-as-my-screensaver xscreensaver-demo # Opens a GUI to configure echo "xscreensaver -no-splash &" >> ~/.xinitrc # Make sure it's before any exec entry. xscreensaver-command -lock # Command to lock screen #+END_SRC [[https://wiki.archlinux.org/index.php/XScreenSaver][Also see XScreenSaver wiki entry.]] You can bind it to a key in gnome settings->keyboard->custom shortcuts. You may also bind it using =gsettings set= command. *** File manager I didn't like the default gnome nautilus file manager and I installed thunar instead. *** Video player vlc is the most reasonable choice in this category. ** Things I didn't configure yet *** TODO [[https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_4)][Verify that SSD trims are aplied.]] Optimize for SSDs *** TODO Auto mount windows disk and choose the the ntfs implementation Basic mount works. I did not configure auto mounting yet. I've also heard that alternative ntfs impelementation, [[https://wiki.archlinux.org/index.php/NTFS-3G][NTFS-3G]], is better than kernel version. *** TODO Try fingerprint sensor *** TODO Try card readers. - SimCard - SmartCard - Media Card *** TODO Disk encryption https://wiki.archlinux.org/index.php/disk_encryption *** TODO Benchmark battery Althought it seems to last pretty long. *** TODO Figure out power management Currently I just use some settings from xscreensaver https://wiki.archlinux.org/index.php/Power_management#Power_management_with_systemd * Conclusion ** The laptop itself After a few months of usage my thoughts about the laptop are: WQHD screen: - Almost all apps I use regularly handle it well, including chromium, emacs, termite (terminal), thunar and transmission - The only two apps that don’t handle WQHD well are xscreensaver and gimp. I feel that there would be a way of making them work if I really wanted. Keyboard: After few months of I use I must say that keyboard does not feel “as good”. I may be overly snobish regarding keyboards, as I bought over 5 mechanical keyboards. I never expected laptop keys to feel as good as mechanical keyboard, but I slightly preferred feeling of the mac book keyboard. Others: - As I got used to trackpoint I find it more efficient than trackpad or mouse - I didn’t try the sim card of fingerprint readers yet - I didn’t have any other problems with anything hardware related - battery life seems to be ok, but I didn’t measure it - I believe accidental damage coverage to be a good deal. For 10% of the laptop cost I bought a 4 year coverage that will cover fixing my laptop in any scenario, even if I drop it or spill water on it. ** Arch Linux I like the choice of Arch as the operating system. In addition to my laptop I also run arch in docker on all my servers and it’s beneficial to use the same OS at home and at work. I didn't have any big problems with running random software packages I needed at some point, including things like connecting to the vpn or watching movies. * Additional links ** Thinkpad Carbon arch wiki entries https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_2) https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_3) [[https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_4)][https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_4)]] ** Thinkwiki Many links on http://www.thinkwiki.org/wiki/ThinkWiki are interesting, for example: http://www.thinkwiki.org/wiki/X1_Linux_Tweaks