Skip to content

Instantly share code, notes, and snippets.

@daxpryce
Last active June 14, 2023 16:46
Show Gist options
  • Save daxpryce/5a3141dfcb3cb166cd54766f69c4d72e to your computer and use it in GitHub Desktop.
Save daxpryce/5a3141dfcb3cb166cd54766f69c4d72e to your computer and use it in GitHub Desktop.
X1 Carbon Gen 7 Linux Mint 19 Setup Guide(ish)

Purpose

Most of this is just notes for my own use, since I'm sure to reformat/reinstall at some point in the future and I don't want to have to rediscover everything I did the first time(s) around. It's kind of a guide to getting my entire env setup the way I like it. For those who aren't me and wanting to use this for your own X1 Carbon Gen7 setup, you can ignore some of the parts if you want, like vim and the IDE installations and openjdk and whatnot. I'd still install snapd and get fwupd from there though, if you want your fingerprint scanner to work at all.

This is basically the exact same for Ubuntu as well.

Lenovo X1 Carbon Gen7 Specific Setup

Bios

Ensure that sleep mode is set to Linux not Windows. I can't remember where I set this but it's in there somewhere and it isn't hard to find.

Kernel

5.3.18 works, download from Ubuntu mainline

I will update this with other kernels known to work in the future. The big problem is the Intel 9560 wifi didn't work with specific linux-firmware packages for earlier versions, and then a regression in some versions of the kernel also caused problems. https://bugzilla.kernel.org/show_bug.cgi?id=205749 is a decent enough entry point at following up with this.

Vim

I can't stand the default vi key bindings. I'm just a dumb pleb who can't figure them out at all.

sudo apt install vim

Python

This isn't technically necessary but I hate installing python modules into the global cache.

sudo apt install python3.8-dev python3-pip python3.8-venv

Snapcraft

To get the latest fwupd, which is necessary for the testing versions of the Synaptics fingerprint firmware. Also useful for other things.

sudo apt install snapd

Fwupd

snap install fwupd --classic

Fingerprint Scanner

Install each of those cabs with fwupdmgr install <filename>.

sudo apt install build-essential libpam-fprintd  ninja-build libglib2.0-dev libgusb-dev libcairo2-dev libnss3-dev gobject-introspection gtk-doc-tools valgrind gir1.2-gio-2.0 libgirepository1.0-dev cmake libpolkit-gobject-1-dev libdbus-glib-1-dev libsystemd-dev libpam0g-dev libpam-wrapper libxml2-utils python3-pam 
sudo ldconfig
wget -O Downloads/libfprint-1.90.1.tar.xz  https://gitlab.freedesktop.org/libfprint/libfprint/uploads/662cd834e76c02c4d74ad01c50412759/libfprint-1.90.1.tar.xz 
wget -O Downloads/fprintd-1.90.1.tar.xz https://gitlab.freedesktop.org/libfprint/fprintd/uploads/a47c31c844e23e070665a8a85dae0144/fprintd-1.90.1.tar.xz
cd Downloads/
tar -xvf libfprint-1.90.1.tar.xz
tar -xvf fprintd-1.90.1.tar.xz
python3.8 -m venv venv
source venv/bin/activate
pip install -U pip setuptools wheel
pip install meson pycairo dbus-python python-dbusmock
cd libfprint-1.90.1
meson build
cd build
ninja -v
sudo ninja -v install
cd ../../fprintd-1.90.1
vi meson.build
# remove python3-pam or whatever from the pip modules. required when doing pam/test but somehow wasn't?  it's unclear.  just delete from the build file.
meson build
cd build
ninja
sudo ninja install
sudo pam-auth-update # add the fingerprint module to pam
fprintd-enroll

Audio

sudo vi /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common

Add the following above [Element PCM].

+ [Element Master]
+ switch = mute
+ volume = ignore
+ 
[Element PCM]

Power Management

Battery life seems to be measured in tens of minutes without this, and with it it's many hours.

sudo add-apt-repository ppa:linrunner/tlp
sudo apt update && sudo apt install tlp

General Dev Setup

Git

Apt often takes too long during serious vulnerabilities to get updated. Always use the ppa.

sudo add-apt-repository ppa:git-core/ppa
sudo apt update && sudo apt install git

JDK 11

sudo apt install openjdk-11-jdk

IDE and Vital Productivity Snaps

sudo snap install intellij-idea-ultimate --classic
sudo snap install clion --classic
sudo snap install code --classic
sudo snap install spotify
@daxpryce
Copy link
Author

daxpryce commented Mar 8, 2020

Re: python-pam - I figured installing it via apt would work, but it couldn't find it no matter what I did. Commenting the requirement out didn't fail the build at all so you can probably just leave it out.

@daxpryce
Copy link
Author

daxpryce commented Mar 8, 2020

I should also note you need the new "in testing" Synaptic firmware items; I installed them on an ubuntu instance prior to this (which is why I installed the snap of fwupd, since I knew that was a prerequisite to install the testing firmware items).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment