[CLK]Android 4.3.1 (CM10.2) and how to build your own version -

walter79

Recognized Developer
Dec 18, 2006
4,100
4,618
263
First you can use my source or my roms to build your own rom only say thanks in your own thread.

I like to share my way to compile Android 4.3.1 for the HTC LEO.

First thanks to mark1706, sportsstar89, evervolv team, devs that make CLK possible and tytung.

YOU CAN FIND "MY" CM-10.2 build here: DEV-HOST

Kernel soure and leo files: GITHUB


This "how to build your own Android" will work with a updated 2.6.35 kernel by mark1706. It use some parts of sportsstar89 kernel.


First setup your 64bit Linux.
I use Linux-Mint (the DEBIAN 7 based version)

You have to install Oracle Java 7: http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html

After Java install follow this how to: https://www.techsomnia.net/2012/11/building-android-on-debian-7/

!! BUT do not install OPEN JDK (sudo apt-get install openjdk-6-jdk) !!

And stop at this point: "Now, prepare the repo:"

Next step get adb working: http://bernaerts.dyndns.org/linux/75-debian/280-debian-wheezy-android-tools-adb-fastboot-qtadb


Now we can start to sync the Android source. (based on this:)

To install Repo:
  1. Make sure you have a bin/ directory in your home directory and that it is included in your path:
    Code:
    mkdir ~/bin
    PATH=~/bin:$PATH
  2. Download the Repo tool and ensure that it is executable:
    Code:
    curl [URL]http://commondatastorage.googleapis.com/git-repo-downloads/repo[/URL] > ~/bin/repo
    chmod a+x ~/bin/repo
After installing Repo, set up your client to access the Android source repository:

  1. Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:
    $ mkdir WORKING_DIRECTORY
    $ cd WORKING_DIRECTORY
  2. Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.
    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
  3. To pull down the Android source tree to your working directory
    Code:
    repo sync


We have to load the leo device tree, vendor files and the leo kernel.


Attached you find my local.xml View attachment local_manifests.zip.
Put this file at this place:
Code:
WORKING_DIRECTORY/.repo/local_manifests/...
Now sync again:
Code:
repo sync
Next you have to connect your Leo with running Android and Adb to your PC
We need to download some special files (This will fixed in future)
Go to this folder:
Code:
Working_Directory/device/htc/leo
and run the this script
Code:
sh extract_files.sh
We have to clean the kernel folder:
Go to this folder:
Code:
Working_Directory/kernel/htc/leo
and run this command
Code:
make mrproper
One step more:
Go to this folder: Working_Directory/vendor/cm
and run the this script
Code:
sh get-prebuilts
It is time to start compiling:
Make sure you are in this folder "Working_Directory"

run this commands:

Code:
. build/envsetup.sh
brunch leo 

[SIZE=3]** you can use brunch leo -jX   too X = numbers of cpu core (or threads) **[/SIZE]


Now wait and you will find your working Android 4.3.1 in this folder:
Working_Directory/out/target/product/leo
 
Last edited:

walter79

Recognized Developer
Dec 18, 2006
4,100
4,618
263
Problems with this Android builds:

- auto select GSM network
- mobile data not working well
- switch between wifi and mobile data
- AGPS (GPS works)

You can fix this problems by using files from tytungs NexusHD2 rom.
(AGPS, auto select GSM network)


Auto select GSM network is a telephony_common.jar framework problem.
But there are no source how it was fixed in tytungs rom. Maybe someone find a way to fix it again.

If you like to use 3.x kernel change this in local_manifest.xml:

Code:
  <project path="kernel/htc/leo" name="walter79/android_kernel_htc_leo_2.6.35-mark1706-based" remote="github" revision="cm-10.2" />

to

  <project path="kernel/htc/leo" name="walter79/android_kernel_htc_leo" remote="github" revision="cm-10.2" />
 
Last edited:

chautruongthinh

Senior Member
Oct 12, 2012
390
1,372
0
Ben Tre
@walter79

- Can i use your instruction to built Slimroms for HD2??

- How to compile slimroms for HD2??

---------- Post added at 05:24 PM ---------- Previous post was at 05:17 PM ----------

Auto select GSM network is a telephony_common.jar framework problem.
But there are no source how it was fixed in tytungs rom. Maybe someone find a way to fix it again.
You can ask Macs18max. I used telephony_common.jar of Macs18max's compile and it work great with 4.3.1!!
 

macs18max

Senior Member
Apr 3, 2010
1,084
3,487
0
Problems with this Android builds:

- auto select GSM network
- mobile data not working well
- switch between wifi and mobile data
- AGPS (GPS works)

You can fix this problems by using files from tytungs NexusHD2 rom.
(AGPS, auto select GSM network)


Auto select GSM network is a telephony_common.jar framework problem.
But there are no source how it was fixed in tytungs rom. Maybe someone find a way to fix it again.

If you like to use 3.x kernel change this in local_manifest.xml:

Code:
  <project path="kernel/htc/leo" name="walter79/android_kernel_htc_leo_2.6.35-mark1706-based" remote="github" revision="cm-10.2" />

to

  <project path="kernel/htc/leo" name="walter79/android_kernel_htc_leo" remote="github" revision="cm-10.2" />
I havent tried in 4.3.1 but in 4.2.2 I merge evervolvs telephony-common.jar. It was ril.java.. use meld-diff software to compare everolvs ril.java with your own. and merge required codes.. (Note I also used hardware/ril from evervolv)
 
  • Like
Reactions: -pixelfreak-

NxStep

Senior Member
Oct 15, 2012
143
380
0
Nice thread @walter79 ! :)

I was wondering wether you ever had a similar error:
Code:
target thumb C: libhardware_legacy <= hardware/libhardware_legacy/power/power.c
target thumb C: libhardware_legacy <= hardware/libhardware_legacy/uevent/uevent.c
arm-linux-androideabi-gcc: error: ": No such file or directory
 make: *** [/home/adam/android/pa43/out/target/product/leo/obj/SHARED_LIBRARIES/libhardware_legacy_intermediates/power/power.o] Error 1
make: *** Waiting for unfinished jobs....
arm-linux-androideabi-gcc: error: ": No such file or directory
 make: *** [/home/adam/android/pa43/out/target/product/leo/obj/SHARED_LIBRARIES/libhardware_legacy_intermediates/uevent/uevent.o] Error 1
It has been bugging me for a week and I cannot find a solution... Do you have any idea about it? (I'm building PA 4.3)
 

walter79

Recognized Developer
Dec 18, 2006
4,100
4,618
263
Maybe this help try the carbon rom version.

/device/htc/qsd8k-common/BordConfigCommon.mk

Code:
# only for cyanogenmod
TARGET_KERNEL_CUSTOM_TOOLCHAIN := arm-eabi-4.4.3

# only for carbon rom
# TARGET_KERNEL_CUSTOM_TOOLCHAIN := arm-eabi-4.4.3/bin/arm-eabi-
 

NxStep

Senior Member
Oct 15, 2012
143
380
0
Maybe this help try the carbon rom version.

/device/htc/qsd8k-common/BordConfigCommon.mk

Code:
# only for cyanogenmod
TARGET_KERNEL_CUSTOM_TOOLCHAIN := arm-eabi-4.4.3

# only for carbon rom
# TARGET_KERNEL_CUSTOM_TOOLCHAIN := arm-eabi-4.4.3/bin/arm-eabi-
Thanks! Unfortunately, it's still the same. I tried it with nearly all possible toolchains...
 

gilbert32

Senior Member
Apr 4, 2011
1,037
1,436
153
In the universe
Nice thread @walter79 ! :)

I was wondering wether you ever had a similar error:
Code:
target thumb C: libhardware_legacy <= hardware/libhardware_legacy/power/power.c
arm-linux-androideabi-gcc: error: ": No such file or directory

It has been bugging me for a week and I cannot find a solution... Do you have any idea about it? (I'm building PA 4.3)[/QUOTE]

i'd open hardware/libhardware_legacy/power/power.c to find out if any dependancy is unmet (any missing file). i've never compiled a rom myself (hoping soon i will) but for the error you're getting (i'm not sure if it's from toolchain or because of missing toolchain), maybe see if the toolchain path is hardcoded somewhere and try to change it:confused:
 

walter79

Recognized Developer
Dec 18, 2006
4,100
4,618
263
Nice thread @walter79 ! :)

I was wondering wether you ever had a similar error:
Code:
target thumb C: libhardware_legacy <= hardware/libhardware_legacy/power/power.c
target thumb C: libhardware_legacy <= hardware/libhardware_legacy/uevent/uevent.c
arm-linux-androideabi-gcc: error: ": No such file or directory
 make: *** [/home/adam/android/pa43/out/target/product/leo/obj/SHARED_LIBRARIES/libhardware_legacy_intermediates/power/power.o] Error 1
make: *** Waiting for unfinished jobs....
arm-linux-androideabi-gcc: error: ": No such file or directory
 make: *** [/home/adam/android/pa43/out/target/product/leo/obj/SHARED_LIBRARIES/libhardware_legacy_intermediates/uevent/uevent.o] Error 1
It has been bugging me for a week and I cannot find a solution... Do you have any idea about it? (I'm building PA 4.3)

Check you local.xml

I used wrong repo for toolchain. Replace it

Code:
<!-- Toolchain -->
  <project path="prebuilts/gcc/linux-x86/arm" name="walter79/toolchains" remote="github" revision="master" />
I will upload later a new local.xml
 

-pixelfreak-

Senior Member
Aug 1, 2010
2,223
3,433
0
Glashütten
mistake since two days

since yesterday i we have a compiling mistake and have no idea for this problem.

Code:
[COLOR="DarkRed"]target thumb C: wpa_supplicant <= external/wpa_supplicant_8/wpa_supplicant/src/drivers/driver_wext.c
target thumb C: wpa_supplicant <= external/wpa_supplicant_8/wpa_supplicant/src/l2_packet/l2_packet_linux.c
external/wpa_supplicant_8/wpa_supplicant/src/drivers/driver_wext.c: In function 'wpa_driver_wext_set_key_ext':
external/wpa_supplicant_8/wpa_supplicant/src/drivers/driver_wext.c:1708:14: error: 'IW_ENCODE_ALG_AES_CMAC' undeclared (first use in this function)
external/wpa_supplicant_8/wpa_supplicant/src/drivers/driver_wext.c:1708:14: note: each undeclared identifier is reported only once for each function it appears in
external/wpa_supplicant_8/wpa_supplicant/src/drivers/driver_wext.c: In function 'wpa_driver_wext_associate':
external/wpa_supplicant_8/wpa_supplicant/src/drivers/driver_wext.c:2135:11: error: 'IW_AUTH_MFP_DISABLED' undeclared (first use in this function)
external/wpa_supplicant_8/wpa_supplicant/src/drivers/driver_wext.c:2138:11: error: 'IW_AUTH_MFP_OPTIONAL' undeclared (first use in this function)
external/wpa_supplicant_8/wpa_supplicant/src/drivers/driver_wext.c:2141:11: error: 'IW_AUTH_MFP_REQUIRED' undeclared (first use in this function)
external/wpa_supplicant_8/wpa_supplicant/src/drivers/driver_wext.c:2144:42: error: 'IW_AUTH_MFP' undeclared (first use in this function)
make: *** [/home/pixelfreak/htc-leo/carbon/4.3/out/target/product/leo/obj/EXECUTABLES/wpa_supplicant_intermediates/src/drivers/driver_wext.o] Error 1
make: *** Waiting for unfinished jobs....[/COLOR]
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
target StaticLib: libc_nomalloc (/home/pixelfreak/htc-leo/carbon/4.3/out/target/product/leo/obj/STATIC_LIBRARIES/libc_nomalloc_intermediates/libc_nomalloc.a)
[email protected] ~/htc-leo/carbon/4.3 $

pixelfreak
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone