[YU Yureka Q&A, Help & Troubleshooting] Rohan459:
This is My first post on XDA :p

From the day I owned YUreka I always wished to compile my own kernel. I searched on the web for compiling 64bit android kernel but didn't get satisfying results. So I did some research and asked some android developers, I got help from some developers but some of the developer refused may be due to their attitude or may be they didn't want to share their ideas / knowledge. Anyways here's a guide for compiling 64 bit kernel. I have also made a video tutorial check that out [ status == uploaded ].

[YOUTUBE]OG41hMstx8o[/YOUTUBE]

What will YU need :

1. Ubuntu 64 Bit OS

2. Good Internet Connection.

3. Usable Brain.

4. Basic Knowledge of Linux.

Lets Start

First we need to get some important stuff / tools / software .

1. Open Ubuntu Software center and install JDK 7 or JDK 8

2. Open terminal and run the following command

sudo apt-get install libncurses5-dev

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386

sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

sudo apt-get install -y ccache &&echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc &&source ~/.bashrc && echo $PATH

export USE_CCACHE=1

mkdir ~/bin

export PATH=~/bin:$PATH

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

chmod a+x ~/bin/repo

Now YU'r Linux machine is all set to compile kernel.

3. Now YU need to download a toolchain. I have uploaded the toolchain that i used for compiling the kernel. Click from here > h t t p s ://drive.google.com/open?id=0B9D4jOdpRzZHOURMTS1VaXplc0U

4. Time to download Kernel sources. For this tutorial I am using Varun Chitre's Thunderzap kernel. Here is the link for thunderzap's sources > h t t p s ://github.com/varunchitre15/thunderzap_tomato

.Select branch as cm 12.1 from left and press download on the right.

5. Make a directory "android-kernel" under "/Home" and place both the zips in "android-kernel" directory.

6. Extract both the zips. Now YU will have two folders one of toolchain and other of kernel source.

7. YU no more need the zip files just delete both the zips.

8. Open the kernel source folder and type the following code.

9. Run the following command to point the variable to toolchains path :

export CROSS_COMPILE=/home/r0h4n/android-kernel/aarch64-linux-android-4.9-uber-master/bin/aarch64-linux-android-

If YU followed along with me YU will just have to change the name of the user ( replace <r0h4n> with <YU'r username> )

10. Time to Compile your kernel :

export ARCH=arm64

export SUBARCH=arm64

export USE_CCACHE=1

make cyanogenmod_tomato-64_defconfig

The name of defconfig file may be different check it in "kernel_source/arch/arm64/defconfig/"

make menuconfig

Here YU can explore various options. I'll not explain everything in detail here.

Now the final command make. It takes a parameter -jn. Where ( n = # of threads per core + 1 )

I have a Dual core processor with 2 thread per processor so for me it is " make -j3 ".

make -j3

Now sit back and relax.......let the kernel compile

Got a compilation error ?

Post it here.

Now we need to create a flashable zip. Download this kernel flash zip from here > h t t p s : //drive.google.com/open?id=0B9D4jOdpRzZHdTJibndqQzhVdFk

1. Extract kernel.zip.

2. Navigate to tools in "/kernel".

3. Open "kernel_source/arch/arm64/boot/".

4. Copy "Image".

5. Replace it with the "Image" in "/kernel/tools/Image".

6. Copy "kernel_source/driver/stagging/prima/wlan.ko" and replace it with "kernel/system/lib/modules/wlan.ko".

7. Goto "/kernel" select all the three folders "META-INF", "system", "tools" and rezip it.

8. Flash the zip via recovery and now YU'r Phone rocks YU'r own compile kernel.