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

Root Build CyanogenMod7 from source | Development area

OK, finally got that part done. It spit this out at me at the end:
Code:
fatal: This operation must be run in a work tree
Traceback (most recent call last):
  File "/home/agentc13/android/system/.repo/repo/main.py", line 366, in <module>
    _Main(sys.argv[1:])
  File "/home/agentc13/android/system/.repo/repo/main.py", line 346, in _Main
    result = repo._Run(argv) or 0
  File "/home/agentc13/android/system/.repo/repo/main.py", line 137, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/agentc13/android/system/.repo/repo/subcmds/sync.py", line 443, in Execute
    project.Sync_LocalHalf(syncbuf)
  File "/home/agentc13/android/system/.repo/repo/project.py", line 975, in Sync_LocalHalf
    self._InitWorkTree()
  File "/home/agentc13/android/system/.repo/repo/project.py", line 1758, in _InitWorkTree
    raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
Is that going to mess me up if I want to continue?
 
The code for CWM in tickerguy's source should support ext4 right? Is it pretty much up to date with you CWM build?
 
OK, finally got that part done. It spit this out at me at the end:
Code:
fatal: This operation must be run in a work tree
Traceback (most recent call last):
  File "/home/agentc13/android/system/.repo/repo/main.py", line 366, in <module>
    _Main(sys.argv[1:])
  File "/home/agentc13/android/system/.repo/repo/main.py", line 346, in _Main
    result = repo._Run(argv) or 0
  File "/home/agentc13/android/system/.repo/repo/main.py", line 137, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/agentc13/android/system/.repo/repo/subcmds/sync.py", line 443, in Execute
    project.Sync_LocalHalf(syncbuf)
  File "/home/agentc13/android/system/.repo/repo/project.py", line 975, in Sync_LocalHalf
    self._InitWorkTree()
  File "/home/agentc13/android/system/.repo/repo/project.py", line 1758, in _InitWorkTree
    raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
Is that going to mess me up if I want to continue?

Run repo sync again. You haven't completely pulled the source code.

EDIT: Is that the entire error? It seems like you truncated some of it.
 
Thanks Isaac, you are so helpful. This makes me feel like a total noob. I did another repo sync and got this:
Code:
Fetching projects: 100% (314/314), done.  
Checking out files: 100% (3865/3865), done.ut files:  42% (1638/3865)   
Syncing work tree:   3% (10/314)  fatal: This operation must be run in a work tree
Traceback (most recent call last):
  File "/home/agentc13/android/system/.repo/repo/main.py", line 366, in <module>
    _Main(sys.argv[1:])
  File "/home/agentc13/android/system/.repo/repo/main.py", line 346, in _Main
    result = repo._Run(argv) or 0
  File "/home/agentc13/android/system/.repo/repo/main.py", line 137, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/agentc13/android/system/.repo/repo/subcmds/sync.py", line 443, in Execute
    project.Sync_LocalHalf(syncbuf)
  File "/home/agentc13/android/system/.repo/repo/project.py", line 975, in Sync_LocalHalf
    self._InitWorkTree()
  File "/home/agentc13/android/system/.repo/repo/project.py", line 1758, in _InitWorkTree
    raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree

Same sort of issue. I don't believe I missed any of the error the first time, but I might have left something out unknowingly.
 
Thanks Isaac, you are so helpful. This makes me feel like a total noob. I did another repo sync and got this:
Code:
Fetching projects: 100% (314/314), done.  
Checking out files: 100% (3865/3865), done.ut files:  42% (1638/3865)   
Syncing work tree:   3% (10/314)  fatal: This operation must be run in a work tree
Traceback (most recent call last):
  File "/home/agentc13/android/system/.repo/repo/main.py", line 366, in <module>
    _Main(sys.argv[1:])
  File "/home/agentc13/android/system/.repo/repo/main.py", line 346, in _Main
    result = repo._Run(argv) or 0
  File "/home/agentc13/android/system/.repo/repo/main.py", line 137, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/agentc13/android/system/.repo/repo/subcmds/sync.py", line 443, in Execute
    project.Sync_LocalHalf(syncbuf)
  File "/home/agentc13/android/system/.repo/repo/project.py", line 975, in Sync_LocalHalf
    self._InitWorkTree()
  File "/home/agentc13/android/system/.repo/repo/project.py", line 1758, in _InitWorkTree
    raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
Same sort of issue. I don't believe I missed any of the error the first time, but I might have left something out unknowingly.

Oh, well that's not good. Most of the time repo can recover from a failed pull attempt, but in this case it's really confused.

Before I suggest something to try, are there any folders in your Android source code folder? Or is it empty?
 
Yes, I just tried running it again and I can see a system folder with the following
folders in it:
  • android
  • bionic
  • bootable
  • build
  • dalvik
  • development
  • device
  • makefile
There are also sub-folders in many of those.

They were not there after I finished the first try at the repo sync. My terminal is saying
HTML:
Fetching projects:  99% (311/314)
So it isn't quite done this time around.
 
Yes, I just tried running it again and I can see a system folder with the following
folders in it:
  • android
  • bionic
  • bootable
  • build
  • dalvik
  • development
  • device
  • makefile

They were not there after I finished the first try at the repo sync. My terminal is saying
HTML:
Fetching projects:  99% (311/314)
So it isn't quite done this time around.

Oh, okay. I think this is fixable. Go ahead and stop repo syncing (press ctrl+z) and type:

Code:
killall -9 repo && killall -9 python
Then, go ahead and delete all the folders in your Android source directory and try repo syncing again.

What repo does is grab all 300 or so individual projects in a "one-shot-one-kill" manner. One of the projects got corrupted during the download (a.k.a one of the folders you listed should be empty; that folder would be the offending problem). It's difficult to track down which project got corrupted during download. The best thing todo would be to start all over from scratch, but I know that's not what you want to hear. ;)
 
I kinda figured it would be something like that. At least I can have it repo sync overnight while I get some sleep!

Thanks again for the help.
 
I kinda figured it would be something like that. At least I can have it repo sync overnight while I get some sleep!

Thanks again for the help.

Yeah, it didn't use to be this way, but recently, repo has become so damn picky... I wouldn't run repo sync with too many process threads. I would lower it down to 4:

Code:
repo sync -j4
It might take a little longer (not by much), but you're going to be counting sheep anyways. ;)
 
When I woke up, it still did the same thing. :mad:

BUT....
I decided to say to hell with the VMware stuff and I set up my notebook to dual boot Ubuntu instead. I Just finished the repo sync with no issues. I'm getting the SDK and ADB stuff all together yet again, and I should be good to go. Thanks for your help Isaac and Ziggy! It's been a while since I used any linux distro, so I am very rusty, and greatly appreciate the help.
 
When I woke up, it still did the same thing. :mad:

BUT....
I decided to say to hell with the VMware stuff and I set up my notebook to dual boot Ubuntu instead. I Just finished the repo sync with no issues. I'm getting the SDK and ADB stuff all together yet again, and I should be good to go. Thanks for your help Isaac and Ziggy! It's been a while since I used any linux distro, so I am very rusty, and greatly appreciate the help.


Yeah I decided against a VM. Dual booting is much easier. I got my laptop(core i5, 4gb ram) with windows 7 and Ubuntu 10.10. I installed the 3.0.1 64bit debian kernel but my broadcom wifi driver does not work on it!

The 3.0.1 Linux kernel is fast though. Buy on my machine I can build a kernel in about 5 minutes. I don't knoe about cm7 though!

Hey Isaac, how do you modify the recovery kernel? Is it just a zimage or is it got a ramdisk as well. If so how do you unpack it?
 
From what I see, the recovery_kernel file in the /device/motorola/triumph/ directory is the zImage file used in the kernel boot.img. I *think*...it looks like the ramdisk for the boot.img for the recovery is a really generic one that is in the /system/bootable/recovery directory.
 
From what I see, the recovery_kernel file in the /device/motorola/triumph/ directory is the zImage file used in the kernel boot.img. I *think*...it looks like the ramdisk for the boot.img for the recovery is a really generic one that is in the /system/bootable/recovery directory.

Okay thats what I thought. I know it wouldn't unpack it when i renamed it to boot.img and used dsixda's kitchen lol!! It probably is just the zImage!
 
Okay thats what I thought. I know it wouldn't unpack it when i renamed it to boot.img and used dsixda's kitchen lol!! It probably is just the zImage!

Actually, I know for sure that it's just the zImage. I've put my zImage (renamed to recovery_kernel) in its place and built the recovery when I was messing with it a while ago and it worked fine.
 
Oh, okay. I think this is fixable. Go ahead and stop repo syncing (press ctrl+z) and type:

Code:
killall -9 repo && killall -9 python
Then, go ahead and delete all the folders in your Android source directory and try repo syncing again.

What repo does is grab all 300 or so individual projects in a "one-shot-one-kill" manner. One of the projects got corrupted during the download (a.k.a one of the folders you listed should be empty; that folder would be the offending problem). It's difficult to track down which project got corrupted during download. The best thing todo would be to start all over from scratch, but I know that's not what you want to hear. ;)

After about 12 hours of syncing (over 1.5 Mbps connection), mine froze too at:

Code:
From git://github.com/CyanogenMod/android_packages_apps_VoiceDialer
 * [new branch]      froyo      -> github/froyo
 * [new branch]      froyo-stable -> github/froyo-stable
 * [new branch]      gingerbread -> github/gingerbread
 * [new branch]      gingerbread-release -> github/gingerbread-release
 * [new branch]      ics        -> github/ics
 * [new tag]         cm-7.0.0   -> cm-7.0.0
 * [new tag]         cm-7.0.1   -> cm-7.0.1
 * [new tag]         cm-7.0.2.1 -> cm-7.0.2.1
 * [new tag]         cm-7.0.3   -> cm-7.0.3
 * [new tag]         cm-7.1.0   -> cm-7.1.0
remote: Counting objects: 1123, done.
remote: Compressing objects: 100% (420/420), done.
remote: Counting objects: 37791, done.
remote: Compressing objects: 100% (11075/11075), done.
remote: Total 1123 (delta 437), reused 1118 (delta 432)
Receiving objects: 100% (1123/1123), 1.07 MiB | 22 KiB/s, done.
Resolving deltas: 100% (437/437), done.24.00 KiB | 18 KiB/s
From git://github.com/CyanogenMod/android_packages_experimental
 * [new branch]      gingerbread -> github/gingerbread
 * [new branch]      gingerbread-release -> github/gingerbread-release
 * [new branch]      ics        -> github/ics
 * [new tag]         cm-7.1.0   -> cm-7.1.0
Fetching projects:  89% (280/314)  Receiving objects:   9% (3491/37791), 844.00 remote: Counting objects: 1000, done.
remote: Compressing objects:  89% (180/202)
Can it be cleaned up a little for us to sync to? It seems that there's a lot of old stuff, or projects that don't apply to the Triumph, going forward included. I saw a lot of Eclair/Froyo lines. So I need to remove them all and resync again (another 12+ hours of blissful waiting?)
UPDATE: I just did killall python & regular 'repo sync' to try to continue from where it left off. Hopefully it'll be ok.

Also I'm not sure what the extract-files.sh includes, but can someone just post or send me those phone files that were extracted? It would save me the hassle of flashing back to Froyo & making ADB work on my linux machine with MT drivers.
 
Try this.
Yeah, it didn't use to be this way, but recently, repo has become so damn picky... I wouldn't run repo sync with too many process threads. I would lower it down to 4:

Code:
repo sync -j4
It might take a little longer (not by much), but you're going to be counting sheep anyways. ;)

I stopped having repo sync issues as soon as I decided to dual boot instead of using vmware.
 
Has anyone used debian instead of ubuntu for building ?

I prefer debian, (aptosid, 100% debian sid) ubuntu is not binary compatible with debian and nasty things happen when mixing ubuntu and debian repos or apps.

I just built a build of aptosid on the 4th and installed it, don't really want to bork it yet ;)
 
Getting this error while building...
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/bin/hciattach'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/bin/hciattach'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/bin/bluetoothd'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/bin/bluetoothd'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/bin/mm-vdec-omx-test'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/bin/mm-vdec-omx-test'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/bin/mm-venc-omx-test720p'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/bin/mm-venc-omx-test720p'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/bin/mm-video-driver-test'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/bin/mm-video-driver-test'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/bin/mm-video-encdrv-test'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/bin/mm-video-encdrv-test'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/lib/liba2dp.so'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/lib/liba2dp.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/lib/libOmxCore.so'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/lib/libOmxCore.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/bin/rild'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/bin/rild'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/lib/libril.so'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/lib/libril.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/lib/libreference-ril.so'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/lib/libreference-ril.so'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/usr/keychars/qwerty2.kcm.bin'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/usr/keychars/qwerty2.kcm.bin'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/usr/keychars/qwerty.kcm.bin'
build/core/base_rules.mk:473: warning: ignoring old commands for target `out/target/product/triumph/system/usr/keychars/qwerty.kcm.bin'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/usr/keylayout/qwerty.kl'
sdk/emulator/keymaps/Android.mk:13: warning: ignoring old commands for target `out/target/product/triumph/system/usr/keylayout/qwerty.kl'
build/core/Makefile:21: warning: overriding commands for target `out/target/product/triumph/system/usr/keylayout/AVRCP.kl'
sdk/emulator/keymaps/Android.mk:18: warning: ignoring old commands for target `out/target/product/triumph/system/usr/keylayout/AVRCP.kl'
No private recovery resources for TARGET_DEVICE triumph
Install: out/host/linux-x86/bin/mkbootfs
target Prebuilt: (out/target/product/triumph/root/init.rc)
target Prebuilt: (out/target/product/triumph/root/ueventd.rc)
target Prebuilt: (out/target/product/triumph/root/init.goldfish.rc)
target Prebuilt: (out/target/product/triumph/root/ueventd.goldfish.rc)
Install: out/host/linux-x86/bin/apriori
target Prelink: libdl (out/target/product/triumph/symbols/system/lib/libdl.so)
build/tools/apriori/prelinkmap.c(100): build/core/prelink-linux-arm-2G.map:26 base 0x6ff00000 out of range.
make: *** [out/target/product/triumph/symbols/system/lib/libdl.so] Error 1
 
I think it is Isaac's CM7.
Do you need to flash to stock to pull the files from your phone for this step:
Part II - Pull proprietary files from device

I could be way off, but I had those errors too. I just haven't gotten around to trying to fix that yet.
 
I pulled all the files from the stock rom. Yes its isaacs.
Also this repo is very cluttered but thats because i was babied with my OV
 
I think it is Isaac's CM7.
Do you need to flash to stock to pull the files from your phone for this step:
Part II - Pull proprietary files from device

I could be way off, but I had those errors too. I just haven't gotten around to trying to fix that yet.


Yup I believe your right cause I believe those are the files it pulls from the phone. Its not hard setting advanced up in Ubuntu though. Just gotta make some udev rules to allow adb to connect!!
 
The first time I did it, I still had CM7 on my phone. I don't know if that was the issue though, I remember getting a similar error to konspiracy. I just haven't had time to fool with it since. I just started a new build after flashing stock and doing all that, so we will see.

EDIT: still getting the same thing as Konspiracy.
 
are you guys sure you pulled the proprietary files? Like b_randon said, some of those files are the proprietary ones. Did you guys made sure that adb saw your phones before running the extractfiles.sh script?

And of course, you need to have debugging turned on on your phone.
 
Back
Top Bottom