DeprecatedPortingGuideMSMQSD » History » Version 14
Denis 'GNUtoo' Carikli, 12/25/2010 12:07 AM
1 | 1 | Denis 'GNUtoo' Carikli | == Introduction == |
---|---|---|---|
2 | Many people bought many different phones, and some of them whish to help replicant and/or to port replicant to their phones or devices. |
||
3 | This guide will show what was done for the htc dream, so theses people could understand the process better. |
||
4 | |||
5 | 6 | Denis 'GNUtoo' Carikli | == Build the source == |
6 | 2 | Denis 'GNUtoo' Carikli | |
7 | The first thing to do is to download the replicant sources: |
||
8 | [wiki:BuildDream] can be used as a reference: download and build the sources for your device. |
||
9 | Let's say the user has an htc wildfire. |
||
10 | |||
11 | The main difference will be that instead of doing that: |
||
12 | {{{ |
||
13 | lunch cyanogen_dream_sapphire-eng |
||
14 | }}} |
||
15 | you would need to identify the right command that correspond to your device, so in order to do that: |
||
16 | when you run the following command look at the output. |
||
17 | {{{ |
||
18 | $ source build/envsetup.sh |
||
19 | including device/geeksphone/one/vendorsetup.sh |
||
20 | including device/htc/ace/vendorsetup.sh |
||
21 | including device/htc/bravoc/vendorsetup.sh |
||
22 | including device/htc/bravo/vendorsetup.sh |
||
23 | including device/htc/buzz/vendorsetup.sh |
||
24 | including device/htc/glacier/vendorsetup.sh |
||
25 | including device/htc/heroc/vendorsetup.sh |
||
26 | including device/htc/inc/vendorsetup.sh |
||
27 | including device/htc/legend/vendorsetup.sh |
||
28 | including device/htc/liberty/vendorsetup.sh |
||
29 | including device/htc/supersonic/vendorsetup.sh |
||
30 | including device/htc/vision/vendorsetup.sh |
||
31 | including device/motorola/sholes/vendorsetup.sh |
||
32 | including device/nvidia/harmony/vendorsetup.sh |
||
33 | including vendor/cyanogen/vendorsetup.sh |
||
34 | }}} |
||
35 | The output include the list of supported(by cyanogenmod) devices. |
||
36 | For instance if you have the bravo phone do: |
||
37 | {{{ |
||
38 | $ cat device/htc/buzz/vendorsetup.sh |
||
39 | # |
||
40 | # Copyright (C) 2008 The Android Open Source Project |
||
41 | # |
||
42 | # Licensed under the Apache License, Version 2.0 (the "License"); |
||
43 | # you may not use this file except in compliance with the License. |
||
44 | # You may obtain a copy of the License at |
||
45 | # |
||
46 | # http://www.apache.org/licenses/LICENSE-2.0 |
||
47 | # |
||
48 | # Unless required by applicable law or agreed to in writing, software |
||
49 | # distributed under the License is distributed on an "AS IS" BASIS, |
||
50 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||
51 | # See the License for the specific language governing permissions and |
||
52 | # limitations under the License. |
||
53 | # |
||
54 | |||
55 | # This file is executed by build/envsetup.sh, and can use anything |
||
56 | # defined in envsetup.sh. |
||
57 | # |
||
58 | # In particular, you can add lunch options with the add_lunch_combo |
||
59 | # function: add_lunch_combo generic-eng |
||
60 | |||
61 | add_lunch_combo generic_buzz-eng |
||
62 | }}} |
||
63 | 3 | Denis 'GNUtoo' Carikli | Note that the developper is supposed to know the code of his device, that is to say that the htc wildfire correspond to the "buzz" codename. |
64 | 4 | Denis 'GNUtoo' Carikli | then instead of typing that: |
65 | {{{ |
||
66 | lunch cyanogen_dream_sapphire-eng |
||
67 | }}} |
||
68 | type what correspond to your device: |
||
69 | 3 | Denis 'GNUtoo' Carikli | {{{ |
70 | lunch generic_buzz-eng |
||
71 | }}} |
||
72 | 2 | Denis 'GNUtoo' Carikli | Then build the source, backup what's on your device, including the operating system, and flash the new replicant image. |
73 | 5 | Denis 'GNUtoo' Carikli | |
74 | 1 | Denis 'GNUtoo' Carikli | Then test what works and what doesn't. |
75 | 6 | Denis 'GNUtoo' Carikli | |
76 | 9 | Denis 'GNUtoo' Carikli | The images are located in |
77 | {{{ |
||
78 | out/target/product/dream_sapphire |
||
79 | }}} |
||
80 | in the case of the htcdream, look in the path that correspond to your device. |
||
81 | |||
82 | 8 | Denis 'GNUtoo' Carikli | == Trying free replacements == |
83 | 9 | Denis 'GNUtoo' Carikli | |
84 | 10 | Denis 'GNUtoo' Carikli | As you built The source code you now have some libraries that could replace the proprietary libraries. |
85 | The list of proprietary libraries are available in |
||
86 | {{{ |
||
87 | device/htc/dream_sapphire/extract-files.sh |
||
88 | }}} |
||
89 | Note: don't run this file, just look at it, if you run it, not only you would make a build containing proprietary libraries,putting you and your users at risk, but is is also illegal to redistribute such build, because the libraries are not redistributable(the copyright owner didn't allow you to redistribute them) |
||
90 | 1 | Denis 'GNUtoo' Carikli | |
91 | 10 | Denis 'GNUtoo' Carikli | === Ril test === |
92 | 11 | Denis 'GNUtoo' Carikli | I will take the example of how to use the free ril to see if it works fine without modifications: |
93 | The proprietary ril library(which you don't have in the phone) location is found looking at the extract-files.sh |
||
94 | here's a part of extract-files.sh: |
||
95 | {{{ |
||
96 | adb pull /system/lib/libhtc_ril.so ../../../vendor/htc/$DEVICE/proprietary/libhtc_ril.so |
||
97 | }}} |
||
98 | Note: don't run this command, just look at it, if you run it, not only you would make a build containing proprietary libraries,putting you and your users at risk, but is is also illegal to redistribute such build, because the libraries are not redistributable(the copyright owner didn't allow you to redistribute them) |
||
99 | 12 | Denis 'GNUtoo' Carikli | So looking at the above line the proprietary ril is located here: |
100 | {{{ |
||
101 | /system/lib/libhtc_ril.so |
||
102 | }}} |
||
103 | while the free ril is located here(known fact): |
||
104 | {{{ |
||
105 | /system/lib/libreference-ril.so |
||
106 | }}} |
||
107 | 14 | Denis 'GNUtoo' Carikli | In order to test the free ril you could be tempted to do that: |
108 | 12 | Denis 'GNUtoo' Carikli | {{{ |
109 | 13 | Denis 'GNUtoo' Carikli | # ./adb remount |
110 | # ./adb shell |
||
111 | 1 | Denis 'GNUtoo' Carikli | mv /system/lib/libreference-ril.so /system/lib/libhtc_ril.so |
112 | }}} |
||
113 | 14 | Denis 'GNUtoo' Carikli | But that wouldn't work as it wouldn't be using the right serial port, the correct way to try that is to use getprop/setprop: |
114 | 13 | Denis 'GNUtoo' Carikli | {{{ |
115 | 1 | Denis 'GNUtoo' Carikli | # ./adb shell |
116 | 14 | Denis 'GNUtoo' Carikli | # setprop |
117 | usage: setprop <key> <value> |
||
118 | }}} |
||
119 | |||
120 | {{{ |
||
121 | # ./adb shell |
||
122 | 13 | Denis 'GNUtoo' Carikli | # getprop | grep ril |
123 | [ro.ril.hsxpa]: [2] |
||
124 | [ro.ril.gprsclass]: [10] |
||
125 | [rild.libpath]: [/system/lib/libreference-ril.so] |
||
126 | [rild.libargs]: [-d/dev/smd0] |
||
127 | [init.svc.ril-daemon]: [running] |
||
128 | [ro.ril.def.agps.mode]: [2] |
||
129 | 1 | Denis 'GNUtoo' Carikli | [gsm.version.ril-impl]: [android reference-ril 1.0] |
130 | }}} |
||
131 | 14 | Denis 'GNUtoo' Carikli | Then change the properties and reboot: |
132 | 13 | Denis 'GNUtoo' Carikli | {{{ |
133 | ./adb shell reboot |
||
134 | }}} |
||
135 | 14 | Denis 'GNUtoo' Carikli | Then tryout the reference ril. |
136 | 12 | Denis 'GNUtoo' Carikli | |
137 | == Replace proprietary libraries for real == |
||
138 | 7 | Denis 'GNUtoo' Carikli | |
139 | On the htcdream the following proprietary libraries were replaced: |
||
140 | 1 | Denis 'GNUtoo' Carikli | ( Refer to [wiki:ProprietaryHtcDreamLibsReplacement] for more up to date details(or fix it if it's less recent) ) |
141 | |||
142 | 10 | Denis 'GNUtoo' Carikli | The first thing you will have to do is to modify the build system. |
143 | The key thing to do is to change |