How to build Lineage OS 14.1 for Motorola Nexus 6 (shamu)


Staff member
This weekend I decided to replace stock Android 7.1.1 running on my Motorola Nexus 6 device to Lineage OS which is successor of CyanogenMod - probably the most famous custom Android ROM ever.

Lineage OS wiki has a great article on how to build Lineage for shamu (this is the codename for Motorola Nexus 6 phablet). However, when building I came across several issues I want to give heads up.

Environment which I was building on was 64-bit Linux Mint 18.1 which indeed corresponds to Ubuntu 16.04.2 LTS (Xenial Xerus), so whenever some OS-specific instructions described, use ones for Ubuntu Xenial.

Here's how I check version:

gytis@gytis-pc ~ $ cat /etc/*release
DISTRIB_DESCRIPTION="Linux Mint 18.1 Serena"
NAME="Linux Mint"
VERSION="18.1 (Serena)"
PRETTY_NAME="Linux Mint 18.1"
cat: /etc/upstream-release: Is a directory
So the dependencies to start a uild are following:

sudo apt-get install bc bison build-essential curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline6-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
Now follow steps provided in Lineage OS wiki, I'll provide only intermediary parts I needed to figure out on my building process.

Before initializing git repository I needed to set some values for git:
git config --global ""
git config --global "Gytis"
Next part I got stuch on was extracting proprietary blobs. Information on how to extract proprietary blobs from block-based OTAs didn't helpme fully because I was receiving this error:

ninja: error: 'vendor/motorola/shamu/proprietary/bin/mm-qcamera-daemon', needed by 'android/lineage/out/target/product/shamu/system/bin/mm-qcamera-daemon', missing and no known rule to make it
build/core/ recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
This was indicating not all required proprietary binaries were pulled from existing installation zip. Luckily, I've found a solution on XDA forums describing how to add additional GitHub repository to get missing blobs: all you need is to remove vendor/motorola subdirectory from the folder you've pulled sources and add following line to .repo/local_manifests/roomservice.xml file:
<project name="TheMuppets/proprietary_vendor_motorola" path="vendor/motorola" remote="github" />
So in the end file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
  <project name="LineageOS/android_device_moto_shamu" path="device/moto/shamu" remote="github" />
  <project name="LineageOS/android_kernel_moto_shamu" path="kernel/moto/shamu" remote="github" />
  <project name="TheMuppets/proprietary_vendor_motorola" path="vendor/motorola" remote="github" />
Now resync sources from repositories by executing:
repo sync --force-sync
And continue building. After doing so I managed to perform successful build which generated me installation ZIP which I've flashed to Nexus 6 via TWRP.

In case you need root on fresh Lineage OS installation, grab from extras and install it via TWRP too. Just in case you want to unroot it, have in your installation media too.

Happy use of nice, fresh and bloatware-free device ;)

And don't forget to read my articles about rooting Motorola Nexus 6 device as well as manually updating Android system on Nexus 6 device which also shows the structure of Android partitions.