How to compile kernel for Note 3 N9005 Kit Kat – Step by Step Guide

N9005-442-01

Compile kernel from sources for Note 3 N9005 Kit Kat
Step by step guide!!

This guide is made with Ubuntu 12.04 LTS 64 bit

Copy and paste the orange colored text to Ubuntu 64 bit terminal and execute.

1.
Open terminal and download the necessary tools:
$ sudo apt-get install git-core gnupg openjdk-6-jdk openjdk-6-jre flex bison gperf libesd0-dev libwxgtk2.8-dev libxml2 libxml2-utils libwxgtk2.6-dev build-essential zip curl zlib1g-dev ia32-libs squashfs-tools pngcrush schedtool xsltproc lzop

2.
Download kernel sources
Create a directory where you will install the kernel sources, example:
$ mkdir -p ~/kernel/note3
$ cd ~/kernel/note3/

Get sources:
$ sudo git clone https://github.com/omega-roms/N9005_Stock_Kernel_KK_4.4.2.git

3.
Install Toolchain:
(info: http://source.android.com/source/building-kernels.html)

Create a directory where you will install the to Toolchain, example:
$ mkdir -p ~/kernel/Toolchain
Move to this new Toolchain directory:
$ cd ~/kernel/Toolchain/

Download Toolchain 4.7
$ sudo git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7

4.
Change directory to the one you downloaded the kernel sources (step 3)
$ cd ~/kernel/note3/N9005_Stock_Kernel_KK_4.4.2
Edit Makefile to add your Toolchain directory, execute:
$ sudo gedit Makefile
this command will open the Makefile file and we have to edit the following line:
CROSS_COMPILE ?=/home/opensource.m/toolchains/arm-eabi-4.7/bin/arm-eabi-
and put your Toolchain directory, example:
CROSS_COMPILE ?=/home/user/kernel/Toolchain/arm-eabi-4.7/bin/arm-eabi-
(The green colored text, is the text you have to change with your Toolchain directory)

5.
Prepare to build:
$ export ARCH=arm
$ sudo make VARIANT_DEFCONFIG=msm8974_sec_hlte_eur_defconfig msm8974_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig

6.
All is ready to compile the kernel.
Give root rights:
$ sudo su
Start the build:
$ make

7.
If build is successful kernel will be at directory > Kernel/arch/arm/boot/zImage

8.
If you want to clean the build, execute:
$ Make clean

9,607 total views, 2 views today



Bookmark the permalink.
  • Garbis Tapacian

    as much as i would love to do this, it all looks pretty chinese to me