FORUMS
Remove All Ads from XDA

[NOOBPROOF] Compile LOS/Based for jactivelte

305 posts
Thanks Meter: 348
 
Post Reply Email Thread
Here we are. Many were expecting CM14.1 for jactivelte. I compiled LineageOS 14.1 for jactivelte (check it out here). It has some bugs, but at least it works.
Unfortunately I think I cannot update it anymore, because of my low specs pc and my lack of time, so I made a noobproof guide on how to compile it, or any other LineageOS 13/14.1 based ROM.

A lot of guides on XDA don't show some steps, and for a n00b (like me) understand them is almost impossible without a step-by-step guide. So here we are, a COMPLETE guide on HOW TO BUILD for GT-I9525 (jactivelte).
It could be applied for any other device, but with some changes.

You can find this guide too on my Github, precisely in the local_manifest repository or on my Github Page. However, let's start.

Setup the machine

Download any Debian based distro, burn it in a USB and install it or just create a virtual machine. I advice you to install Ubuntu 16.04.2 Xenial. Don't install it on virtual machine if you've got a low specs PC.

Now, open a terminal and write the command:
sudo apt-add-repository ppa:openjdk-r/ppa -y; sudo apt update -y; sudo apt install git-core python gnupg flex bison gperf libsdl1.2-dev libesd0-dev \
squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-8-jre openjdk-8-jdk pngcrush \
schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32ncurses5-dev \
gcc-multilib liblz4-* pngquant ncurses-dev texinfo gcc gperf patch ccache libtool \
automake g++ gawk subversion expat libexpat1-dev python-all-dev bc libcloog-isl-dev \
libcap-dev autoconf libgmp-dev build-essential gcc-multilib g++-multilib pkg-config libmpc-dev libmpfr-dev lzma* \
liblzma* w3m android-tools-adb maven ncftp htop repo lib32z1-dev -y


Note that this one is a SINGLE giant command. There isn't any wrap between. Once you did it, do it again.



If some package like lib32z1-dev causes error code (1), just remove it from the command. Note that it could compromise the build, if it's an important one. I'd advice you to Google it for solving.

Now, you successfully setted up your building machine.

Manage your repos

First of all we need to setup the repo binary, with the commands:
mkdir ~/bin
PATH=~/bin:$PATH
curl http://commondatastorage.googleapis....downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo


Now create a folder for the sources where you want. I created mine in a subfolder inside my home. To do so, open your terminal and type mkdir LOS or change LOS to whatever you want.

Then enter in the folder just created with cd "FOLDER NAME"

You have now to configure your github account. To do so:
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR EMAIL ADDRESS"


Now init the project, in this case I'll use the JDCTeam's project. To do so type in terminal
repo init -u git://github.com/JDCTeam/manifests.git -b opt-cm-14.1
If you want to repo sync RR
repo init -u https://github.com/ResurrectionRemix...m_manifest.git -b nougat
Instead, for clean LineageOS
repo init -u git://github.com/LineageOS/android.git -b cm-14.1

After this, you have to repo sync, with the command
repo sync -f --force-sync --no-clone-bundle
It will take some hours, it depends by your connection speed. When it will finish, repo sync again (just for being sure).



Now open any file manager (if you're on Ubuntu, it will be Nautilus), press CTRL+H, open the folder .repo, create a new folder called "local_manifests". In base of the OS you want to build, choose between by LineageOS, Resurrection Remix OS, Side or OptimisedLOS local_manifests. Now rename the file you downloaded into local_manifest.xml and move it to the local_manifests folder you just created.



Repo sync again. If there are some duplicates, just comment them. To do so, put !-- and -- respectively before and after the duplicate paths. So <project *blablablahere* /> would become <!--project *blablablahere* /-->.



Now, go to LOS/device/samsung/jf-common and open BoardConfigCommon.mk
Here, if the BOARD_RECOVERYIMAGE_PARTITION_SIZE := is not set to 11300000 or more, change it, otherwise the build will fail.

That's what I'm talking about


Setting Ccache
This step should improve the building speed, but it require some space (just like a cache, considering that it IS a cache).
echo "export USE_CCACHE=1" >> ~/.bashrc
~/RR/prebuilts/misc/linux-x86/ccache/ccache -M 100G

If you don't have so much space, I advice you to give 50G instead of 100G. Less is useless IMHO.

Configure the repos

CyanogenMod (RIP) left the show to LineageOS. Unfortunately someone still didn't notice it. The sources, indeed, could still be setted up for CyanogenMod. Don't mind, it's not that difficult, we could solve together.

In terminal type:

cd LOS/device/samsung
ls


You should see jactivelte, jf-common and qcom-common. Well, if you don't, you missed some step. Now, open these folders. Rename any cm.dependencies into lineage.dependencies, without editing anything. If there is cm.mk too (but it shouldn't), rename it lineage.mk, then open it and at the bottom replace cm_jactivelte with lineage_jactivelte.

Building the ROM

Now, prepare yourself for the building itself. Type in the terminal

sudo -s

Write your password and press enter. This will enable the root access to every command. Type

export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX: +TiePurpleCompilation -Xmx4g"
. build/envsetup.sh
./prebuilts/sdk/tools/jack-admin kill-server
rm -rf /home/"yournamehere"/.jack-server
export USE_PREBUILT_CACHE=1
export ANDROID_JACK_VM_ARGS="-Xmx3g -Dfile.encoding=UTF-8 -XX:+TiePurpleCompilation"
croot
brunch jactivelte


Now wait some hours (or some minutes if your PC is a beast), and you'll get your ready-to-flash ROM zip! You can find it in home/LOS/out/target/product/jactivelte

If you want to build again, with updated sources:

make clean
repo sync -f --force-sync --no-clone-bundle
. build/envsetup.sh && brunch jactivelte





You can find it in home/CM14.1/out/target/product/jactivelte

Here's the output

Remember to put in your credit EVERYONE who helped you or provided you the sources, like CyanogenMod, LineageOS, XOSP, RR and so on and so on.

Remember also that if you want to publish a ROM, you also have to publish the sources, if you made some commits.

Have fun compiling!
The Following 10 Users Say Thank You to IvanCristina For This Useful Post: [ View ] Gift IvanCristina Ad-Free
4th January 2017, 08:40 PM |#2  
Member
Flag Helsinki
Thanks Meter: 36
 
More
Thank you! This will be my first build. I want to learn to build RR too.
The Following 2 Users Say Thank You to quubee For This Useful Post: [ View ] Gift quubee Ad-Free
4th January 2017, 09:09 PM |#3  
IvanCristina's Avatar
OP Senior Member
Flag Catania
Thanks Meter: 348
 
Donate to Me
More
Quote:
Originally Posted by quubee

Thank you! This will be my first build. I want to learn to build RR too.

Well, consider that the latest RR is based on LineageOS. Unfortunately, I'm getting some error while building LineageOS. Anyway, for any CM14.1 based, this guide works fine.

Hope you all the best
The Following User Says Thank You to IvanCristina For This Useful Post: [ View ] Gift IvanCristina Ad-Free
4th January 2017, 09:15 PM |#4  
Member
Flag Helsinki
Thanks Meter: 36
 
More
I got some errors eith CM14.1 too.
build / core / ninja.mk: 166: error is the recipe for «/home/linux/CM14.1/out/build-cm_jactivelte.ninja» goal
make: *** [/home/linux/CM14.1/out/build-cm_jactivelte.ninja] Error 1
make: a way out of the catalog «/home/linux/CM14.1»
4th January 2017, 11:58 PM |#5  
IvanCristina's Avatar
OP Senior Member
Flag Catania
Thanks Meter: 348
 
Donate to Me
More
Quote:
Originally Posted by quubee

I got some errors eith CM14.1 too.
build / core / ninja.mk: 166: error is the recipe for «/home/linux/CM14.1/out/build-cm_jactivelte.ninja» goal
make: *** [/home/linux/CM14.1/out/build-cm_jactivelte.ninja] Error 1
make: a way out of the catalog «/home/linux/CM14.1»

Unfortunately, I cannot understand the error from these lines. Please copy your entire log on hastebin.com and send it.
Anyway, it's weird, because that's everything I do, nothing less, nothing more. You should not get any error
The Following User Says Thank You to IvanCristina For This Useful Post: [ View ] Gift IvanCristina Ad-Free
6th January 2017, 04:35 PM |#6  
Senior Member
Flag Kiev
Thanks Meter: 480
 
Donate to Me
More
Quote:
Originally Posted by quubee

I got some errors eith CM14.1 too.
build / core / ninja.mk: 166: error is the recipe for «/home/linux/CM14.1/out/build-cm_jactivelte.ninja» goal
make: *** [/home/linux/CM14.1/out/build-cm_jactivelte.ninja] Error 1
make: a way out of the catalog «/home/linux/CM14.1»

export USE_NINJA=false fix error
The Following User Says Thank You to tsvetkov_vlad For This Useful Post: [ View ] Gift tsvetkov_vlad Ad-Free
6th January 2017, 06:05 PM |#7  
Member
Flag Helsinki
Thanks Meter: 36
 
More
I thing it was small swap partition on my laptop. Thanks, I saw similar advice it on 4pda forums.

I will try to build something simple first, like CM for nexus, to learn more.
12th February 2019, 05:44 PM |#8  
Junior Member
Thanks Meter: 2
 
More
Thanks for the guide!
I'm trying to build a Lineage ROM for my Galaxy S4 active following your guide. But after several attempts it didn't work out, the building process fails always with the following messages:

Code:
. build/envsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/samsung/jactivelte/vendorsetup.sh
: command not found
including vendor/cm/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/cm/bash_completion/git.bash
including vendor/cm/bash_completion/repo.bash
Code:
brunch jactivelte

including vendor/cm/vendorsetup.sh
Trying dependencies-only mode on a non-existing device tree?

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
LINEAGE_VERSION=14.1-20190212-UNOFFICIAL-jactivelte
TARGET_PRODUCT=lineage_jactivelte
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-45-generic-x86_64-with-Ubuntu-16.04-xenial
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/home/testuser/android/out
============================================
make: Verzeichnis „/home/testuser/android“ wird betreten
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
LINEAGE_VERSION=14.1-20190212-UNOFFICIAL-jactivelte
TARGET_PRODUCT=lineage_jactivelte
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-45-generic-x86_64-with-Ubuntu-16.04-xenial
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/home/testuser/android/out
============================================
prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -DDECAY_TIME_DEFAULT=0 -m64 -Wa,--noexecstack -fPIC -no-canonical-prefixes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 -fstack-protector-strong    --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot -Bprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/bin -target x86_64-linux-gnu   -Wsign-promo  -Wno-inconsistent-missing-override   --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8 -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/x86_64-linux -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/backward -target x86_64-linux-gnu -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o /home/testuser/android/out/host/linux-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o build/kati/affinity.cc

//

Running kati to generate build-lineage_jactivelte.ninja...
/home/testuser/android/out/build-lineage_jactivelte.ninja is missing, regenerating...
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
LINEAGE_VERSION=14.1-20190212-UNOFFICIAL-jactivelte
TARGET_PRODUCT=lineage_jactivelte
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-45-generic-x86_64-with-Ubuntu-16.04-xenial
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/home/testuser/android/out
============================================
Checking build tools versions...
frameworks/av/camera/cameraserver/Android.mk:18: Target has integrated cameraserver into mediaserver. This is weakening security measures introduced in 7.0
find: "/home/testuser/android/out/target/common/obj/SHARED_LIBRARIES/libwifi-hal-mock_intermediates": Datei oder Verzeichnis nicht gefunden
./vendor/qcom/binaries/Android.mk:1: *** This repo is now deprecated. Move your blobs to your device's vendor repo..
build/core/ninja.mk:166: die Regel für Ziel „/home/testuser/android/out/build-lineage_jactivelte.ninja“ scheiterte
make: *** [/home/testuser/android/out/build-lineage_jactivelte.ninja] Fehler 1
make: Verzeichnis „/home/testuser/android“ wird verlassen

#### make failed to build some targets (18 seconds) ####
Any ideas?
Post Reply Subscribe to Thread

Tags
cm14.1, compile, guide, jactivelte, lineageos

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes