• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [Discussion - Developers _ONLY_] Building ICS from source (Isaac's github).

This is what Ive been doing to no avail...


# export PATH="$HOME/android-sdk-linux/tools:$HOME/android-sdk-linux/platform-tools:$PATH"

# mkdir ~/bin

# PATH=~/bin:#PATH

# curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

# chmod a+x ~/bin/repo

# mkdir ICS_SOURCE

# cd ICS_SOURCE

# repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1

repo: command not found

am i STILL doing it wrong??
:confused:

The highlighted line above should read

Code:
# export PATH=~/bin:$PATH

That's why the variable wasn't set, and when you would invoke repo, it had no idea what you wanted done. You could also add the path lines to the .bashrc file in the home directory, so you wouldn't need to type them each time you went into the terminal.
 
Here's an outline of what I'm guessing Mantera did to build from Isaac & edowar's repos.

1. Follow the instructions to build for CM7/gingerbread in the other thread. Except with 'ics' instead of 'gingerbread'.
2. Repo sync -j2 (this may take many hours).
3. cd to the device/motorola/triumph path
4. 'git remote add edowar git://github.com/edowar/android_device_fb0.git'
5. 'git pull edowar ICS'
6. go to all of the paths for any repo that isaac tracks, but hasn't updated:

android/frameworks/base
android/hardware/libhardware
android/hardware/libhardware/legacy
android/hardware/msm7k
android/hardware/qcom/media
android/hardware/qcom/gps
android/system/netd

and do this:

git remote add cm git://github.com/CyanogenMod/"repo_name"
git pull cm ics

Then you have to get a kernel working, try cloning edowar or Isaac's kernel or just drop a pre-built one into the path: device/motorola/triumph/kernel Or to build one:

cd ~/android/kernel
git clone git://github.com/edowar/FIH-msm7x30-ics.git (edowar's)
git clone git://github.com/ikarosdev/triumph-kernel-msm7x30.git (Isaac's)

Or better may be to clone one, merge changes from the other like for ROM repos above.

Follow cyanogenmod's guide for building kernels: Building Kernel from source - CyanogenMod Wiki

There may be other repos that have updates, try browsing Isaac, edowar, and even mantera's github pages for clues. Do the same 'git pull' to merge changes from them.

BTW, when doing git pull and there's a merge conflict. you have to edit that file, there'll be something like:

<<<<<<<<<<<<<<
old content
===========
new content
>>>>>>>>>>>>>>
Manually delete the old content, including <<<< and ===. keep new content. then 'git add <file just edited>. Repeat for all conflicting files, then do 'git commit' to save the changes to your repo.

The important config files for building is device/motorola/triumph/BoardConfig.mk and for kernel ./config or ./.config. They should be specific to the MT.
 
Apparently, hardware acceleration is already enabled in the kernel:
# DEVICE_PROVISIONED=1
debug.sf.hw=1
ro.dev.dmm=1
For some reason it is not being detected.

I think we can all be sure by this point that Isaac is not coming back.
As a community, I believe this should be our list of priorities for this device, from greatest to least:
  1. Get hardware acceleration working
  2. Get calling working
  3. Get WiFi or 3G working
  4. Get SD card working

So, we're all on the first one. If we get each one done at a pace of one for every five days, we should be done by the beginning of next month (with a fairly workable build)!!!

Of course, minor things like vibration and brightness can be fixed later. Those should be the least of our worries. If everyone follows this guideline, then we should be golden soon!
 
how much HDD space do you need to build ics? i heard 40 gb free space, but i can only put ubuntu on a 40 gb HDD. which will leave me with like 30 gb free before pulling the source :(
 
how much HDD space do you need to build ics? i heard 40 gb free space, but i can only put ubuntu on a 40 gb HDD. which will leave me with like 30 gb free before pulling the source :(

That should work. I have Ubuntu on a 37.xxGB hard drive partition and I have been able to create a copy.
 
Im starting with cm9 from scratch and im going to try and put a build together from that.
I was gonna use vanilla but I think since everyone is working off of cm9 its gonna be easier to merge there changes. If anybody has an actual guide to making a cm9 build environment let me know.

So far I have cm9 repoed fresh, my next step is to set up our device folder, then get the changes from edward and pull that in. My next step would be to set up the kernel and build. Am I missing anything?
I really wish I had that 3.0 kernel Isaac was working with.
So if your reading this Isaac please shoot me a pm and I will be glad to take tha 3.0 kernel off your hands.
 
Im starting with cm9 from scratch and im going to try and put a build together from that.
I was gonna use vanilla but I think since everyone is working off of cm9 its gonna be easier to merge there changes. If anybody has an actual guide to making a cm9 build environment let me know.

So far I have cm9 repoed fresh, my next step is to set up our device folder, then get the changes from edward and pull that in. My next step would be to set up the kernel and build. Am I missing anything?
I really wish I had that 3.0 kernel Isaac was working with.
So if your reading this Isaac please shoot me a pm and I will be glad to take tha 3.0 kernel off your hands.

You probably have to merge Isaac's other repos (that has Tickerguy and Isaac's fixes for MT) with CM's latest repos for frameworks_base, android_hardware_*...etc like I mentioned a few posts above. Kernel 3.0 sounds nice, but it's better to start with something that works (Mantera's build confirmed 2.6.32.9 does on a basic level).
 
You probably have to merge Isaac's other repos (that has Tickerguy and Isaac's fixes for MT) with CM's latest repos for frameworks_base, android_hardware_*...etc like I mentioned a few posts above. Kernel 3.0 sounds nice, but it's better to start with something that works (Mantera's build confirmed 2.6.32.9 does on a basic level).

Well all the changes should be in the Triumph device folder right? I thought that you had to have the basic source and the device folder works around that source. Or is that why the MT isnt officially apart of cyanogenmod.


Im gonna try to build without merging Isaacs stuff besides the device folder and see what happens. If it fails then I will merge all of his changes then re merge with cm9
 
Well all the changes should be in the Triumph device folder right? I thought that you had to have the basic source and the device folder works around that source. Or is that why the MT isnt officially apart of cyanogenmod.


Im gonna try to build without merging Isaacs stuff besides the device folder and see what happens. If it fails then I will merge all of his changes then re merge with cm9

Most changes are in the device_motorola_triumph, and esp since CM doesn't have that repo. But there are a few other fixes that TG worked on that went into other parts of the repo to get a working Gingerbread CM7. (Check out his github commit history) A good starting point would be to included those changes, then if something isn't working, examine it more. If on the slight chance that CM9's source includes properly working source for the MT (without TG's changes), then that'd be great, but I doubt it.

Official CM support depends on other factors, like the way all the repo structure is layed out and some other stuff the CM team is picky about (not sure about specifics).

Here's a conceptual layout:

CM: frameworks_base android_core dalvik packages_apps_* vendor ... etc
TG: device_motorola_triumph frameworks_base kernel ... etc (cloned from CM & IS)
IS: device_motorola_triumph frameworks_base kernel ... etc (merged from TG & CM)

Final layout: New tweaks for ICS + merge of layers above (may ignore TG's layer since ISaac already merged)
 
Okay so something up.
I thought I deleted my gingerbread build folder and re did a repo init with cyanogenmod
I guess somehow it kept my device folder but I still had to pull the prpetairy files and I had to manually get rommanager.apk from the trash.
I have been building successfully and I havent had to hack away to get it to build like last time. Im so confused. I guess the audio has been fixed?

Edit I re ran the get prebuilts script and its still building,
The kernel isnt there so I guess Im gonna need to flash a kernel to.
 
Stuck on this

Code:
Install: out/target/product/triumph/system/bin/fsck_msdos
target Executable: gzip (out/target/product/triumph/obj/EXECUTABLES/gzip_intermediates/LINKED/gzip)
Install: out/target/product/triumph/system/lib/libiprouteutil.so
target Executable: ip (out/target/product/triumph/obj/EXECUTABLES/ip_intermediates/LINKED/ip)
Install: out/target/product/triumph/system/lib/libnetlink.so
target Executable: ip6tables (out/target/product/triumph/obj/EXECUTABLES/ip6tables_intermediates/LINKED/ip6tables)
target Executable: iptables (out/target/product/triumph/obj/EXECUTABLES/iptables_intermediates/LINKED/iptables)
target StaticExecutable: linker (out/target/product/triumph/obj/EXECUTABLES/linker_intermediates/LINKED/linker)
target Executable: logwrapper (out/target/product/triumph/obj/EXECUTABLES/logwrapper_intermediates/LINKED/logwrapper)
target Executable: lsof (out/target/product/triumph/obj/EXECUTABLES/lsof_intermediates/LINKED/lsof)
Install: out/target/product/triumph/system/bin/mksh
target PrefixSymbols: linker (out/target/product/triumph/obj/EXECUTABLES/linker_intermediates/LINKED/linker)
target Executable: mkyaffs2image (out/target/product/triumph/obj/EXECUTABLES/mkyaffs2image_intermediates/LINKED/mkyaffs2image)
target Executable: ping (out/target/product/triumph/obj/EXECUTABLES/ping_intermediates/LINKED/ping)
target StaticExecutable: run-as (out/target/product/triumph/obj/EXECUTABLES/run-as_intermediates/LINKED/run-as)
target Executable: schedtest (out/target/product/triumph/obj/EXECUTABLES/schedtest_intermediates/LINKED/schedtest)
target Executable: sdcard (out/target/product/triumph/obj/EXECUTABLES/sdcard_intermediates/LINKED/sdcard)
Symlink: out/target/product/triumph/system/bin/sh -> mksh
target Executable: showlease (out/target/product/triumph/obj/EXECUTABLES/showlease_intermediates/LINKED/showlease)
target Executable: simg2img (out/target/product/triumph/obj/EXECUTABLES/simg2img_intermediates/LINKED/simg2img)
target Executable: tc (out/target/product/triumph/obj/EXECUTABLES/tc_intermediates/LINKED/tc)
Copying: out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/classes-jarjar.jar
Install: out/target/product/triumph/system/framework/core.jar
target SharedLib: libspeexresampler (out/target/product/triumph/obj/SHARED_LIBRARIES/libspeexresampler_intermediates/LINKED/libspeexresampler.so)
Install: out/target/product/triumph/system/lib/libc_malloc_debug_leak.so
Install: out/target/product/triumph/system/lib/libc_malloc_debug_qemu.so
target SharedLib: libctest (out/target/product/triumph/obj/SHARED_LIBRARIES/libctest_intermediates/LINKED/libctest.so)
target SharedLib: libpagemap (out/target/product/triumph/obj/SHARED_LIBRARIES/libpagemap_intermediates/LINKED/libpagemap.so)
target SharedLib: libpng (out/target/product/triumph/obj/SHARED_LIBRARIES/libpng_intermediates/LINKED/libpng.so)
/bin/bash: out/host/linux-x86/bin/clang: Permission denied
/bin/bash: out/host/linux-x86/bin/clang: Permission denied
make: *** [out/target/product/triumph/obj/SHARED_LIBRARIES/libclcore.bc_intermediates/rs_cl.bc] Error 126
make: *** Waiting for unfinished jobs....
make: *** [out/target/product/triumph/obj/SHARED_LIBRARIES/libclcore.bc_intermediates/rs_core.bc] Error 126
host SharedLib: libbcc (out/host/linux-x86/obj/lib/libbcc.so)

EDIT: manually editing the files permissions fixed it.

still building had to fix another permission after but its still chugging.
 
Build finished I had to re sync and make clean and those previous errors went away. flashing now.


Doesnt boot just shuts itself off
im going to retry another kernel.
 
I'm on step #5 of Whyzor's guide above me.
1. Follow the instructions to build for CM7/gingerbread in the other thread. Except with 'ics' instead of 'gingerbread'.
2. Repo sync -j2 (this may take many hours).
3. cd to the device/motorola/triumph path
4. 'git remote add edowar git://github.com/edowar/android_device_fb0.git'
5. 'git pull edowar ics'
6. go to all of the paths for any repo that isaac tracks, but hasn't updated:
I get this error trying to pull edowar's stuff! Any ideas?
Pastebin link to error: Motorola Triumph ICS Git Error - Pastebin.com
Code:
Code:
tusing-macbookpro:system tusing$ ls
[COLOR="DimGray"]Makefile    android     bootable    dalvik      device      frameworks  libcore     packages    sdk         vendor
abi         bionic      build       development external    hardware    ndk         prebuilt    system[/COLOR]
tusing-macbookpro:system tusing$ cd device/motorola/triumph
tusing-macbookpro:triumph tusing$ ls
[COLOR="DimGray"]AndroidBoard.mk    CleanSpec.mk       cm.mk              extract-files.sh   init.triumph.rc    keylayout          overlay            recovery.fstab     setup-makefiles.sh vendorsetup.sh
AndroidProducts.mk README             device_triumph.mk  files              kernel             liblights          prebuilt           recovery_kernel    system.prop        vold.fstab
BoardConfig.mk     audio_policy       egl.cfg            include            keychars           modules            recovery           releasetools       ueventd.triumph.rc [/COLOR]
tusing-macbookpro:triumph tusing$ git remote add edowar git://github.com/edowar/android_device_fb0.git
tusing-macbookpro:triumph tusing$ git pull edowar ics
[B][COLOR="DarkRed"]fatal: Couldn't find remote ref ics[/COLOR][/B]
tusing-macbookpro:triumph tusing$ git remote add edowar git://github.com/edowar/android_device_fb0.git
fatal: remote edowar already exists.
tusing-macbookpro:triumph tusing$ sudo git pull edowar ics
Password:
fatal: Couldn't find remote ref ics
tusing-macbookpro:triumph tusing$
 
try:

git pull edowar ICS

I see that his github repo's branch is named 'ICS' instead of default 'ics'.

Worked! Yay!
Also, did you try out your steps / did they worked?
I don't understand what you mean by the "BTW, delete..." with the <<< === and >>> signs.
Because, I got this error:
Code:
Automatic merge failed; fix conflicts and then commit the result.
And I imagine that step has to do with this.
 
Worked! Yay!
Also, did you try out your steps / did they worked?
I don't understand what you mean by the "BTW, delete..." with the <<< === and >>> signs.
Because, I got this error:
Code:
Automatic merge failed; fix conflicts and then commit the result.
And I imagine that step has to do with this.

Exactly, depending on what new changes went into the CM9 source tree when you attempt the merge, it'll be different (part of the reason why I haven't attempted to build ICS yet, it's still unstable). The error message should tell you which files need to have the merge conflicts resolved manually. Or if you do a 'git status -s', it'll also point out those lines (I think most should be 'MM', the files that need attention have 'UU' or something similar.
 
Eg. for this...
Code:
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

<<<<<<< HEAD
file := $(INSTALLED_KERNEL_TARGET)
ALL_PREBUILT += $(file)
$(file): $(TARGET_PREBUILT_KERNEL) | $(ACP)
	$(transform-prebuilt-to-target)
=======
ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET)
>>>>>>> cdc8f3187b0698f3a2ce902f67c339943519e238

# include the non-open-source counterpart to this file
-include vendor/motorola/triumph/AndroidBoardVendor.mk
What should the new file look like? I'll do the rest on my own.
 
Eg. for this...
Code:
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

<<<<<<< HEAD
file := $(INSTALLED_KERNEL_TARGET)
ALL_PREBUILT += $(file)
$(file): $(TARGET_PREBUILT_KERNEL) | $(ACP)
    $(transform-prebuilt-to-target)
=======
ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET)
>>>>>>> cdc8f3187b0698f3a2ce902f67c339943519e238

# include the non-open-source counterpart to this file
-include vendor/motorola/triumph/AndroidBoardVendor.mk
What should the new file look like? I'll do the rest on my own.

Assuming you want the new version on the bottom, modify the file & delete everything <<<< & >>>> inclusive except the new stuff. So in this example you'd only have these left in that section:

Code:
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET)

# include the non-open-source counterpart to this file
-include vendor/motorola/triumph/AndroidBoardVendor.mk
But that's assuming that's the correct version for our device, which I'm not sure about. Usually the newer version (repo) is the one that should be kept. The top portion is your current version, the bottom part is from the 'git pull' repo.
 
I use mergetool meld. Its a graphical interface.


I messed something up with the merging device folder because im getting this error.

Whyzor maybe you can help me find witch file I need to correct?


Code:
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc -mthumb-interwork -Ibionic/libc/private -DCRT_LEGACY_WORKAROUND -Ibionic/libc/private -o out/target/product/triumph/obj/lib/crtbegin_static.o -c bionic/libc/arch-arm/bionic/crtbegin_static.S
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc -mthumb-interwork -Ibionic/libc/private -DCRT_LEGACY_WORKAROUND -Ibionic/libc/private -o out/target/product/triumph/obj/lib/crtbegin_so.o -c bionic/libc/arch-arm/bionic/crtbegin_so.S
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc -mthumb-interwork -Ibionic/libc/private -DCRT_LEGACY_WORKAROUND -Ibionic/libc/private -o out/target/product/triumph/obj/lib/crtend_so.o -c bionic/libc/arch-arm/bionic/crtend_so.S
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc -mthumb-interwork -Ibionic/libc/private -DCRT_LEGACY_WORKAROUND -Ibionic/libc/private -o out/target/product/triumph/obj/lib/crtend_android.o -c bionic/libc/arch-arm/bionic/crtend.S
Notice file: system/core/init/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//root/init.txt
Notice file: system/core/liblog/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//system/lib/liblog.a.txt
Notice file: system/core/libcutils/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//system/lib/libcutils.a.txt
Notice file: bionic/libc/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//system/lib/libc.a.txt
Notice file: bionic/libc/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//system/lib/libc.so.txt
Notice file: bionic/libc/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//system/lib/libc_common.a.txt
Notice file: bionic/libdl/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//system/lib/libdl.so.txt
Notice file: bionic/libstdc++/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//system/lib/libstdc++.so.txt
Notice file: bionic/libm/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//system/lib/libm.so.txt
Notice file: system/core/adb/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//root/sbin/adbd.txt
Target buildinfo: out/target/product/triumph/root/default.prop
build/tools/post_process_props.py out/target/product/triumph/root/default.prop
Notice file: bootable/recovery/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//recovery/root/sbin/nandroid-md5.sh.txt
Notice file: bootable/recovery/NOTICE -- out/target/product/triumph/obj/NOTICE_FILES/src//recovery/root/sbin/killrecovery.sh.txt
make: *** No rule to make target `bootable/recovery/../../device/fih/fb0/recovery/recovery_ui.c', needed by `out/target/product/triumph/obj/EXECUTABLES/recovery_intermediates/../../device/fih/fb0/recovery/recovery_ui.o'.  Stop.
make: *** Waiting for unfinished jobs....
shane@shane-TA990FXE:~/android$
 
If you ever want to know how out of shape you are.... Try an all day motocross ride in the middle of January after a lot of couch time on a bike that just got rebuilt, bored, tweaked, & feels completely foreign.
I feel like I've been run thru a meat grinder then reassembled a couple inches shorter. Even my hair hurts.

Just deleted everything & starting over. Looks like a fresh sync from Isaac's work is going thru without errors now. Not sure why all the sync problems were happening, but will assume it wasn't on my end. Thinking I'm beginning to understand git a little more, so hopefully I can get the right code in the right places. (Thanks Whyzor)

Will be making an attempt tomorrow at merging Isaac's work with Edowar's & Mantera's. If anyone has any results from specific commits feel free to speak up. Also doing some digging to find out what phones we can pull code from. May have something interesting to throw in the mix soon.
 
I use mergetool meld. Its a graphical interface.


I messed something up with the merging device folder because im getting this error.

Whyzor maybe you can help me find witch file I need to correct?

You should probably have a prebuilt kernel placed as "device/motorola/triumph/kernel" too, so it can build the recovery & regular image with it, not sure if it'll blow up if there isn't one there. Your errors look like it's missing /android/bionic repo (yeah it's weird), but it's one of the repos listed in Isaac's original manifest.xml file.

Will be making an attempt tomorrow at merging Isaac's work with Edowar's & Mantera's. If anyone has any results from specific commits feel free to speak up. Also doing some digging to find out what phones we can pull code from. May have something interesting to throw in the mix soon.

Speaking of other devices in the family as the MT for possible searching for ROMs and github repos. Here's a pretty comprehensive list:

xda-developers - View Single Post - [ROM] Stock 2.3.5 from Taiwan Sharp SH8188U
 
Whyzor.... You are an endless supply of valuable information. Almost capable of making me look like I know what I'm doing! :D

Just spewing as much as I know in the hopes that some of it will stick and others can help contribute in whatever way they can. Some people are good at debugging, others creating themes, others writing new code...etc. I was there not long ago learning from more experienced devs than me.
 
Just spewing as much as I know in the hopes that some of it will stick and others can help contribute in whatever way they can. Some people are good at debugging, others creating themes, others writing new code...etc. I was there not long ago learning from more experienced devs than me.

Same man... I learned my theming skills from my friends from another forum. One of which being our very own b_randon14 :D. I'm looking to learn more, so every post that you make. I pick up more and more. And I like to thank-you for that! :)
 
Same man... I learned my theming skills from my friends from another forum. One of which being our very own b_randon14 :D. I'm looking to learn more, so every post that you make. I pick up more and more. And I like to thank-you for that! :)

+1
I just started picking up in this but my laptop "broke". might be a delay, but oh well.
On the other hand, whyzor, I'm confused. Could I just use Isaac's git and get a booting ROM or pull from other sources? This is probably a noob question that has an obvious answer somewhere in this thread, but I'm just asking :D


Edit: I just noticed that SD card wasn't mounting properly. Has anybody tried taking vold from cm7 (system/bin), changing permissions to 777, then putting it in ics using adb push?
 
Back
Top Bottom