forked from coolya/android_kernel_samsung
-
Notifications
You must be signed in to change notification settings - Fork 18
/
How_to_build_JB
100 lines (68 loc) · 3.19 KB
/
How_to_build_JB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
How to build
-------------------------------------------------------------------------------
Prerequisites
-------------
Basic knowledge of Linux and compiling is required to be able to build a kernel.
You need a modern Linux box (preferably) with git and linaro toolchain installed
(www.linaro.org).
First you need to setup the directory that within you will clone the kernel and
initramfs repository. In this guide we will setup them in ~/semaphore but you
can do it in any directory you want.
1. Setup build environment
In your home directory (~/) create the directories:
mkdir -p semaphore/output/galaxys
mkdir -p semaphore/output/captivate
mkdir -p semaphore/output/vibrant
The above will be the output directories for galaxy s, captivate and vibrant
versions.
Build script also needs a symbolic link to your toolchain bin directory:
cd semaphore
ln -s gcc-linaro-arm-linux-gnueabihf-2012.09-20120921_linux/bin/ toolchain
The directory structure is complete. Now, you are ready to clone Semaphore code.
2. Setting up repositories
While you are still in ~/semaphore directory do the following.
Clone the main kernel repository branch jellybean:
git clone -b jellybean git://github.com/stratosk/samsung-kernel-aries
Clone the initramfs:
git clone git://github.com/stratosk/ics-ramdisk
Due to the fact that github does not preserve file permissions, I also included
initramfs for each SGS variant as a tarball. You need to do the following
only the first time you clone the ics-ramdisk repo. Of course, you can safely
do this every time you fetch new code.
cd ics-ramdisk
tar zxvf jb_combo.tar.gz
tar zxvf jb_combo_c.tar.gz
tar zxvf jb_combo_v.tar.gz
3. Kernel configuration
I use 3 files to keep kernel's configuration for each variant.
The files are placed in arch/arm/configs directory and they are named:
semaphore_galaxys_defconfig
semaphore_captivate_defconfig
semaphore_vibrant_defconfig
When, you will run the build script, the proper configuration will be used
according to the selected variant (please see next section).
If you need any change kernel configuration, you have to edit these files
before the building procedure.
Leave these files unchanged, if you want Semaphore's default settings.
You are ready to build!
4. Building the kernel
I create a script that automates the building procedure. The script can accept
2 arguments:
a) Kernel variant: galaxys, captivate, vibrant
b) s argument to build the kernel for hugemem compatible ROMs
If you run the script without arguments will build the normal version
for galaxys.
To build the kernel for galaxys:
cd ~/semaphore/samsung-kernel-aries
./sbuild galaxys
and for 's' version:
./sbuild galaxys s
Wait few minutes (time depends on the machine - on my laptop 15-20) and hopefully
the compilation will end.
Watch the output for possible errors. A successful compilation must NOT have any
error. It may have some warnings, but you can safely ignore them.
If everything was OK, you must have the zImage file in
~/semaphore/samsung-kernel-aries/arch/arm/boot directory.
Also the script will automatically prepare the CWM flashable zip and the
ODIN/Heimdall flashable in ~/semaphore/output directory (in respective variant)
Now, you are ready to flash the kernel!