[Wileyfox Swift] thomson.aa:
This is a guide for building LineageOS 14.1 for Wileyfox Swift.

The intention of this post is to give interested users a step-by-step guide to build LineageOS for Swift on their own.

It's seems to me that nowadays many contributors on XDA are not willing to share their expertise but they seem to forget that building a ROM is a collaboration of many people. While I was trying to build this ROM I experienced the lack of willingness to help so I am posting this guide to prevent other users to go through the same time-consuming trial-and-error processes.

Of course, some preconditions apply:

You need enough RAM to build the ROM

You need to set up a build environment (either by setting up a virtual machine or better by using Linux)

For building my own ROM, I was using Ubuntu 16.10 and 8GB of memory.

Let's go through the process step by step.

1. Setting up the building environment:

Execute the following commands inside your terminal:

sudo apt update

sudo apt upgrade

sudo apt install bison build-essential curl wget flex git gnupg libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libxml2 libxml2-utils lzop maven pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev bc ccache automake lzop gperf zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32readline6-dev lib32z1-dev python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools schedtool dpkg-dev liblz4-tool make optipng libwxgtk3.0-dev openjdk-8-jdk

2. Make a folder where you put the android source and change to that folder:

mkdir LineageOS

cd LineageOS

3. Download the repo-script from google and put it to /usr/bin:

wget https://storage.googleapis.com/git-repo-downloads/repo

sudo cp repo /usr/bin/repo

rm repo

4. Make it executable:

sudo chmod a+x /usr/bin/repo

5. Set up git:

git config --global user.name "YOUR USERNAME"

git config --global user.email YOUREMAIL@DOMAIN.COM

6. Fetch the sources:

repo init -u https://github.com/LineageOS/android.git -b cm-14.1

repo sync

source build/envsetup.sh

breakfast crackling

7. Modify the roomservice.xml (find it here: .repo/local_manifests/) to get a working ROM for Wileyfox Swift:

<?xml version="1.0" encoding="UTF-8"?>

<manifest>

<project name="LineageOS/android_device_wileyfox_crackling" path="device/wileyfox/crackling" remote="github" revision="cm-14.1" />

<project name="LineageOS/android_device_cyanogen_msm8916-common" path="device/cyanogen/msm8916-common" remote="github" revision="cm-14.1" />

<project name="LineageOS/android_kernel_cyanogen_msm8916" path="kernel/cyanogen/msm8916" remote="github" revision="cm-14.1" />

<project name="LineageOS/android_device_qcom_common" path="device/qcom/common" remote="github" revision="cm-14.1" />

<project name="TheMuppets/proprietary_vendor_wileyfox" path="vendor/wileyfox" remote="github" revision="cm-14.1" />

<project name="TheMuppets/proprietary_vendor_qcom_binaries" path="vendor/qcom/binaries" remote="github" revision="cm-14.1" />

</manifest>

8. Update the sources:

repo sync

breakfast crackling

9. Start the build process

brunch crackling

10. Finish

You will find the ROM under out/target/product/crackling

11. Optional: If you want to have root access with your ROM, also execute this in your terminal (before brunch):

export WITH_SU=true

12. Troubles: If you have 8GB RAM or less, the building process might stop and complain about jack-server.

export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"

export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"

./prebuilts/sdk/tools/jack-admin kill-server

./prebuilts/sdk/tools/jack-admin start-server