DeprecatedBuildAndroid » History » Version 26
Aaron Williamson -, 09/30/2009 09:55 PM
1 | 16 | Denis 'GNUtoo' Carikli | Edit: |
---|---|---|---|
2 | We have now a temporary git repository at gitorious: |
||
3 | http://gitorious.org/replicant |
||
4 | |||
5 | 18 | Denis 'GNUtoo' Carikli | == Before starting == |
6 | 25 | Aaron Williamson - | * Root your phone |
7 | 1 | Denis 'GNUtoo' Carikli | * Backup your current system!!! |
8 | 25 | Aaron Williamson - | * Install git |
9 | 1 | Denis 'GNUtoo' Carikli | |
10 | 25 | Aaron Williamson - | == Setting up the build environment and getting source code == |
11 | 1 | Denis 'GNUtoo' Carikli | |
12 | 25 | Aaron Williamson - | These instructions assume that you are building replicant in your home directory (~). If you are building it in another directory, modify path names accordingly. |
13 | |||
14 | === Get the repo tool === |
||
15 | repo is a front-end to git which is used to manage several git repositories. |
||
16 | 15 | Aaron Williamson - | {{{ |
17 | 20 | Denis 'GNUtoo' Carikli | mkdir bin |
18 | 1 | Denis 'GNUtoo' Carikli | cd bin |
19 | wget http://android.git.kernel.org/repo |
||
20 | chmod a+x repo |
||
21 | cd .. |
||
22 | 25 | Aaron Williamson - | }}} |
23 | |||
24 | === Check out the Replicant repository === |
||
25 | This step will download the Android source (minus the kernel) and the Replicant patches. |
||
26 | {{{ |
||
27 | 1 | Denis 'GNUtoo' Carikli | mkdir replicant |
28 | cd replicant |
||
29 | ../bin/repo init -u git://gitorious.org/replicant/manifest.git |
||
30 | ../bin/repo sync |
||
31 | }}} |
||
32 | 25 | Aaron Williamson - | |
33 | == Optional: building the kernel and wireless LAN driver == |
||
34 | |||
35 | By default, the Android build system uses a pre-compiled kernel and wireless driver rather than compiling these components from scratch. If you want to compile your own copy of either of these components, you have to compile both: the wireless driver sources included with Android are incompatible with the pre-compiled kernel. |
||
36 | |||
37 | === Get the kernel source === |
||
38 | |||
39 | To download the kernel sources, create a file in your replicant/.repo directory called "local_manifest.xml" containing the following: |
||
40 | {{{ |
||
41 | <?xml version="1.0" encoding="UTF-8"?> |
||
42 | <manifest> |
||
43 | <project path="kernel" name="kernel/msm" revision="refs/heads/android-msm-2.6.27"/> |
||
44 | </manifest> |
||
45 | }}} |
||
46 | |||
47 | Then from the ~/replicant/ directory, run: |
||
48 | {{{ |
||
49 | ../bin/repo sync |
||
50 | }}} |
||
51 | |||
52 | This will create a directory called replicant/kernel and download the kernel sources to it. |
||
53 | |||
54 | === Build the kernel === |
||
55 | |||
56 | To build the kernel: |
||
57 | |||
58 | {{{ |
||
59 | cd ~/replicant/kernel |
||
60 | export ARCH=arm |
||
61 | export CROSS_COMPILE=arm-eabi- |
||
62 | export PATH=$PATH:~/replicant/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin |
||
63 | cp arch/arm/configs/msm_defconfig .config |
||
64 | make oldconfig && make |
||
65 | }}} |
||
66 | |||
67 | Wait several hours. |
||
68 | |||
69 | === Point the build system to your kernel === |
||
70 | |||
71 | Create a file called `~/replicant/buildspec.mk` containing the following: |
||
72 | {{{ |
||
73 | TARGET_PRODUCT:=htc_dream |
||
74 | TARGET_PREBUILT_KERNEL:=kernel/arch/arm/boot/zImage |
||
75 | }}} |
||
76 | |||
77 | This will instruct the build process to use your kernel rather than the pre-compiled kernel. |
||
78 | |||
79 | === Build the wifi module === |
||
80 | |||
81 | To build the wifi module: |
||
82 | {{{ |
||
83 | cd ~/replicant/system/wlan/ti/sta_dk_4_0_4_32 |
||
84 | export KERNEL_DIR=~/replicant/kernel/ |
||
85 | make |
||
86 | }}} |
||
87 | |||
88 | (If make can't find your compiler, re-run same PATH export command you ran before compiling the kernel.) |
||
89 | |||
90 | Replace the pre-built wifi module with the one you just built: |
||
91 | {{{ |
||
92 | cp wlan.ko ~/replicant/vendor/htc/dream-open |
||
93 | }}} |
||
94 | |||
95 | == Build the firmware == |
||
96 | |||
97 | === Change the build scripts to include some important missing packages === |
||
98 | |||
99 | ''(This section will be removed once these changes are committed to the replicant repository)'' |
||
100 | |||
101 | Open the file {{{~/replicant/vendor/htc/dream-open/htc_dream.mk}}} and at the following text to the beginning of the file: |
||
102 | {{{ |
||
103 | PRODUCT_PACKAGES := \ |
||
104 | Calculator \ |
||
105 | Email \ |
||
106 | ImProvider \ |
||
107 | SdkSetup \ |
||
108 | VoiceDialer |
||
109 | }}} |
||
110 | |||
111 | This will include packages in the build which would otherwise be missing (including the SdkSetup package, which will enable incoming calls). |
||
112 | |||
113 | {{{ |
||
114 | cd ~/replicant |
||
115 | make |
||
116 | }}} |
||
117 | |||
118 | Wait and wait and wait. |
||
119 | |||
120 | 26 | Aaron Williamson - | == Flashing the new firmware == |
121 | |||
122 | [to be written] |
||
123 | |||
124 | == Building individual pieces == |
||
125 | |||
126 | === Each time you want to build something === |
||
127 | 22 | Denis 'GNUtoo' Carikli | * open a new console |
128 | * Then type: |
||
129 | 5 | Denis 'GNUtoo' Carikli | {{{ |
130 | cd ~/replicant |
||
131 | export ANDROID_JAVA_HOME=$JAVA_HOME |
||
132 | lunch htc_dream-eng |
||
133 | make |
||
134 | 1 | Denis 'GNUtoo' Carikli | }}} |
135 | * The files to flash are in ~/replicant/out/target/product/dream,flash them and then clear the cache |
||
136 | * boot and push the wifi firmware if you want it |
||
137 | |||
138 | |||
139 | 26 | Aaron Williamson - | === If you want to build a particular project === |
140 | 24 | Denis 'GNUtoo' Carikli | * open a new console |
141 | * build everything if it was not done before |
||
142 | * Then type: |
||
143 | {{{ |
||
144 | cd ~/replicant |
||
145 | source build/envsetup.sh |
||
146 | export ANDROID_JAVA_HOME=$JAVA_HOME |
||
147 | lunch htc_dream-eng |
||
148 | #go into the directory containing an Android.mk |
||
149 | mm |
||
150 | 1 | Denis 'GNUtoo' Carikli | }}} |
151 | |||
152 | == Status == |
||
153 | 18 | Denis 'GNUtoo' Carikli | * ril works more or less: |
154 | 19 | Denis 'GNUtoo' Carikli | * * calls should work(in/out) |
155 | * * sms should work(in/out) |
||
156 | 26 | Aaron Williamson - | * * headphones not supported |
157 | 18 | Denis 'GNUtoo' Carikli | |
158 | * sound works even with headphones(beware calls's sound don't work with headphones) |