24

[GUIDE/HOW-TO] Building LineageOS for an Unsupported Device

 1 year ago
source link: https://forum.xda-developers.com/t/guide-how-to-building-lineageos-for-an-unsupported-device.4419263/page-3#post-87968323
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Top Liked Posts

Foreword:
This is my own notes I created to build LOS for my device (SM-T713 or gts28vewifi). After reading this, I encourage you to create your own notes as it will help you better understand the build process.

I followed the official guide here with additional reading here since we are building this for a device no longer officially supported by LOS.

Requirements:
A fast CPU. How fast? All depends on how long you can wait for the build.
At least 16Gb RAM is a must.
Around 300Gb 50Gb disk space since at least 100Gb of it will be devoted to "ccache".
*nix system, mine is on Ubuntu so the commands below are Debian-based.

Step 1: Setup the environment.
sudo apt install -y bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev python-is-python3

mkdir -p ~/bin
mkdir -p ~/android/lineage

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

cd ~/android/lineage
repo init -u https://github.com/LineageOS/android.git -b lineage-17.1

Step 2: Get the device manifest file. ...and save to ~/android/lineage/.repo/local_manifests/gts28vewifi.xml

Then do:
repo sync

Step 3: Turn on caching to speed up build. Note that I used 300Gb instead of 100Gb (just personal preference).
mkdir ~/ccache
export CCACHE_DIR=~/ccache
export USE_CCACHE=1
export CCACHE_EXEC=/usr/bin/ccache
ccache -M 300G 50G

Step 4: Select Build.
source build/envsetup.sh
lunch
select lineageos_gts28vewifi-userdebug (whatever number it's identified under)

Step 5: Prepare the output:
make clean-apache-xml
make clean
make apache-xml
make ims-common

Step 6: Build it!
brunch gts28vewifi

Now go have a few coffees and come back later.

Epilogue:
I'm sure there are many different ways to build this but this method works for me. Just want to get the knowledge out so you can find a way that works for you.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK