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

Gytis

Administrator
Staff member
#1
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:

Code:
gytis@gytis-pc ~ $ cat /etc/*release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18.1
DISTRIB_CODENAME=serena
DISTRIB_DESCRIPTION="Linux Mint 18.1 Serena"
NAME="Linux Mint"
VERSION="18.1 (Serena)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 18.1"
VERSION_ID="18.1"
HOME_URL="http://www.linuxmint.com/"
SUPPORT_URL="http://forums.linuxmint.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/linuxmint/"
VERSION_CODENAME=serena
UBUNTU_CODENAME=xenial
cat: /etc/upstream-release: Is a directory
So the dependencies to start a uild are following:

Code:
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:
Code:
git config --global user.email "gytis@repecka.com"
git config --global user.name "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/ninja.mk:151: 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:
HTML:
<project name="TheMuppets/proprietary_vendor_motorola" path="vendor/motorola" remote="github" />
So in the end file looks like this:
HTML:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <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" />
</manifest>
Now resync sources from repositories by executing:
Code:
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 addonsu-arm-signed.zip from extras and install it via TWRP too. Just in case you want to unroot it, have addonsu-remove-arm-signed.zip 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.
 
Top