[GUIDE][Ubuntu] Compiling Android from Source

triptosyll

Well-known member
Jan 7, 2012
48
1
0
Visit site

aight i got another big question. i was in the middle of downloading the source when i made that last post, and when done with the post, i went back to my terminal to check progress, and the download had froze in the middle of one of those strings of tags that it showed all the time. i closed the terminal after about ten mins of nothing happening, and i dont have the source. it didnt download it, it wont let me download it again using the previos commands. what do i do:confused:
 

triptosyll

Well-known member
Jan 7, 2012
48
1
0
Visit site

maybe im just comfused. im on 12.04 so i had to download the master branch. now if i initialize a build for the master branch, wont it end up being a jb rom that is built? im building for my cdma mesmerize and it cant handl jb i dont think, so i just want ics. how do i make sure that it just builds an ics rom and not a jb rom. again maybe im confused, and if so, enlighten me wouldja?
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
aight i got another big question. i was in the middle of downloading the source when i made that last post, and when done with the post, i went back to my terminal to check progress, and the download had froze in the middle of one of those strings of tags that it showed all the time. i closed the terminal after about ten mins of nothing happening, and i dont have the source. it didnt download it, it wont let me download it again using the previos commands. what do i do:confused:

Hi,

I've run into this a few times where it would time out, using repo sync. What you can do is run a repo sync -f . I had to do this quite a few times as I have issues with my internet connection at night.

Hope this helps
 
  • Like
Reactions: triptosyll

triptosyll

Well-known member
Jan 7, 2012
48
1
0
Visit site
Hi,

I've run into this a few times where it would time out, using repo sync. What you can do is run a repo sync -f . I had to do this quite a few times as I have issues with my internet connection at night.

Hope this helps

where do u run that command from? the terminal thats doing the download? or a new terminal? and if its a new terminal, do i need to b in a specific directory?
 

triptosyll

Well-known member
Jan 7, 2012
48
1
0
Visit site
where do u run that command from? the terminal thats doing the download? or a new terminal? and if its a new terminal, do i need to b in a specific directory?

the terminal i was using to download doest allow me to mak commands....i dont think anyway. im on a completely blank line. i tried running it from a new terminal and no luck. i imagine u have to do it from the existing terminal. do i need the $ before the command?
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
where do u run that command from? the terminal thats doing the download? or a new terminal? and if its a new terminal, do i need to b in a specific directory?

Hi,

What you do if repo sync gets stuck is close that window, open up a new window, cd to the directory where you want repo to sync the files to and type that command in "repo sync -f"
 

triptosyll

Well-known member
Jan 7, 2012
48
1
0
Visit site
Hi,

What you do if repo sync gets stuck is close that window, open up a new window, cd to the directory where you want repo to sync the files to and type that command in "repo sync -f"

all i get from doing that is "no command 'repo' found, did you mean:..........and then some crap that i know doesnt apply
 

indy328

Member
Dec 29, 2011
9
0
0
Visit site
Just an update, IT WORKS!!! Okay, so I got all excited and so far have only tested the camera, which now works! But in all my excitement forgot one little detail,, GAPPS, so is using Kejar gapps good for a stock AOSP build, or should I get the latest one from goo.im?

how do you create a makefile for the 5 missing files and where do i put them once they are made?!
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
the terminal i was using to download doest allow me to mak commands....i dont think anyway. im on a completely blank line. i tried running it from a new terminal and no luck. i imagine u have to do it from the existing terminal. do i need the $ before the command?

I was googling for a guide since you are using 12.04, there are a few differences from what I am using (10.04) but if you google "how to compile ics in ubuntu 12.04" (without the quotes) there is a thread over on another forum that will help you out (it's the first one that comes up)

Hope this helps
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
how do you create a makefile for the 5 missing files and where do i put them once they are made?!

Hi,
A few posts back in this thread letM3in explains it better than I can:

Originally Posted by letM3in
I was in the same boat last week. Here's what I did (roughly -- I don't have my build machine in front of me right now). Hope it helps.

I performed a full build and then wrote a script that checks each blob listed under device/samsung/toro/proprietary-blobs.txt with what was output by the build under system/out. That identified six missing files:
Code:
/system/app/CellBroadcastReceiver.apk
/system/bin/fRom
/system/vendor/etc/sirfgps.conf
/system/vendor/firmware/ducati-m3.bin
/system/vendor/firmware/libpn544_fw.so
/system/vendor/lib/hw/gps.omap4.so
Then the hunt began for these files... it's up to you to find them.

CellBroadcastReceiver.apk: I haven't had a chance to look into this one, so it's still missing. However, it is also missing from the other toro ROMs I've seen. My build seems to run fine without it.
fRom: is present under vendor/samsung/toro/proprietary/ but was being copied to the wrong location by the Android.mk file, so I corrected that.
sirfgps.conf: GPS. Get from toro 4.0.4 ROM.
ducati-m3.bin: Camera. Get from maguro 4.1 ROM.
libpn544_fw.so: NFC. Get from maguro 4.1 ROM.
gps.omap4.so: GPS. Get from toro 4.0.4 ROM.

Once you find the blobs you will need to create makefiles for them. Luckily, AOSP contains the skeleton makefiles for these under device/samsung/toro/self-extractors/. Create the necessary directories under vendor/ and copy these makefiles there along with blobs. I believe one of the makefiles under vendor/samsung/toro already looks for these makefiles and includes them if present.

Once you have everything setup it's time to make clobber and run another build. Re-check the files listed in proprietary-blobs.txt and ensure you have at least the 5/6 that I mentioned. If you're satisfied with the results, try flashing it.

Good luck.
 

indy328

Member
Dec 29, 2011
9
0
0
Visit site
Hi,
A few posts back in this thread letM3in explains it better than I can:

Originally Posted by letM3in
I was in the same boat last week. Here's what I did (roughly -- I don't have my build machine in front of me right now). Hope it helps.

I performed a full build and then wrote a script that checks each blob listed under device/samsung/toro/proprietary-blobs.txt with what was output by the build under system/out. That identified six missing files:
Code:
/system/app/CellBroadcastReceiver.apk
/system/bin/fRom
/system/vendor/etc/sirfgps.conf
/system/vendor/firmware/ducati-m3.bin
/system/vendor/firmware/libpn544_fw.so
/system/vendor/lib/hw/gps.omap4.so
Then the hunt began for these files... it's up to you to find them.

CellBroadcastReceiver.apk: I haven't had a chance to look into this one, so it's still missing. However, it is also missing from the other toro ROMs I've seen. My build seems to run fine without it.
fRom: is present under vendor/samsung/toro/proprietary/ but was being copied to the wrong location by the Android.mk file, so I corrected that.
sirfgps.conf: GPS. Get from toro 4.0.4 ROM.
ducati-m3.bin: Camera. Get from maguro 4.1 ROM.
libpn544_fw.so: NFC. Get from maguro 4.1 ROM.
gps.omap4.so: GPS. Get from toro 4.0.4 ROM.

Once you find the blobs you will need to create makefiles for them. Luckily, AOSP contains the skeleton makefiles for these under device/samsung/toro/self-extractors/. Create the necessary directories under vendor/ and copy these makefiles there along with blobs. I believe one of the makefiles under vendor/samsung/toro already looks for these makefiles and includes them if present.

Once you have everything setup it's time to make clobber and run another build. Re-check the files listed in proprietary-blobs.txt and ensure you have at least the 5/6 that I mentioned. If you're satisfied with the results, try flashing it.

Good luck.

yeah, i saw that but i think i am a bit confused. in my device/samsung/toro/self-extractors/ i only have one make file which is android.mk. even if i open that up with gedit it opens, but nothing is there.
 

Ing222

Member
Jul 30, 2012
9
3
0
Visit site
yeah, i saw that but i think i am a bit confused. in my device/samsung/toro/self-extractors/ i only have one make file which is android.mk. even if i open that up with gedit it opens, but nothing is there.

It's a little more involved than that. You need to make sure you have these folders

vendor/csr/toro/proprietary/Android.mk
vendor/csr/toro/proprietary/gps.omap4.so
vendor/csr/toro/proprietary/sirfgps.conf
vendor/csr/toro/BoardConfigPartial.mk
vendor/csr/toro/device-partial.mk

You'll get the build files for csr inside the device/samsung/toro/self-extractors/csr/staging folder. Just copy the files from there into the vendor/csr/toro folder. Then copy the sirfgps.conf and gps.omap4.so files that you got elsewhere.

You'll need to make sure that you do this for the vendor/nxp and vendor/ti folders.

For the CellBroadcastReceiver I just added it into the vendor/samsung/toro/device-partial.mk file.

For the fROM file, i just edited the vendor/samsung/toro/proprietary/Android.mk file and I changed the LOCAL_MODULE_PATH to $(TARGET_OUT)/bin for the fRom section.

Does that make sense? I'm doing this from memory, so it's not fresh in my head so I hope this helps.
 
Last edited:
  • Like
Reactions: indy328 and dmmarck

indy328

Member
Dec 29, 2011
9
0
0
Visit site
thank you much, i understand very clearly. i guess this just isn't for me because i don't have those folders. i am fairly frustrated as i have synced and resynced and started anew at least 3 times. i have compiled a working 4.1.1 build but this is the last piece that i am missing. great write up and great instructions from other members!
 

Ing222

Member
Jul 30, 2012
9
3
0
Visit site
thank you much, i understand very clearly. i guess this just isn't for me because i don't have those folders. i am fairly frustrated as i have synced and resynced and started anew at least 3 times. i have compiled a working 4.1.1 build but this is the last piece that i am missing. great write up and great instructions from other members!

Maybe I can explain it a little better.

Create these folders:
vendor/csr/toro/
vendor/nxp/toro/
vendor/ti/toro/

Then copy the files and folder from device/samsung/toro/self-extractors/csr/staging to vendor/csr/toro.

You'll also need to copy the files and folders from device/samsung/toro/self-extractors/nxp/staging to vendor/nxp/toro.

And then copy the files and folders from device/samsung/toro/self-extractors/ti/staging/ to vendor/ti/toro.

Once you get all that in place, you need to grab the proprietary binaries and copy these files:

gps.omap4.so and sirfgps.conf should be copied to vendor/csr/toro/proprietary/
libpn544_fw.so should be copied to vendor/nxp/toro/proprietary/
ducati-m3.bin should be copied to vendor/ti/toro/proprietary/

I've done all this and all the proprietary binaries are in place, however the camera app won't load (it crashes). Has anyone else encountered this problem?
 
  • Like
Reactions: indy328

rthach

New member
Jul 30, 2012
2
1
0
Visit site
Thanks for the great guide, I manage to get everything working so far, this still needs a lot of tweaking (figuring out what other files need to be install).

I've done all this and all the proprietary binaries are in place, however the camera app won't load (it crashes). Has anyone else encountered this problem?

The camera is working fine here for me.
 
  • Like
Reactions: dmmarck

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Just so folks know--I haven't really developed my rom past compiling and getting a few things to work. Be sure to read through the guide for tips/tricks concerning "development," for right now that's outside my scope of "expertise" (if you can even call it that lol).
 

Ing222

Member
Jul 30, 2012
9
3
0
Visit site
Thanks for the great guide, I manage to get everything working so far, this still needs a lot of tweaking (figuring out what other files need to be install).



The camera is working fine here for me.

I figured out my problem-user error. :)

I was using the ducati-m3 file from Android 4.0.4 and not the newer one. It's working now.

Thanks!
 

indy328

Member
Dec 29, 2011
9
0
0
Visit site
Maybe I can explain it a little better.

Create these folders:
vendor/csr/toro/
vendor/nxp/toro/
vendor/ti/toro/

Then copy the files and folder from device/samsung/toro/self-extractors/csr/staging to vendor/csr/toro.

You'll also need to copy the files and folders from device/samsung/toro/self-extractors/nxp/staging to vendor/nxp/toro.

And then copy the files and folders from device/samsung/toro/self-extractors/ti/staging/ to vendor/ti/toro.

Once you get all that in place, you need to grab the proprietary binaries and copy these files:

gps.omap4.so and sirfgps.conf should be copied to vendor/csr/toro/proprietary/
libpn544_fw.so should be copied to vendor/nxp/toro/proprietary/
ducati-m3.bin should be copied to vendor/ti/toro/proprietary/

I've done all this and all the proprietary binaries are in place, however the camera app won't load (it crashes). Has anyone else encountered this problem?

Holy guacamole! Thank you for explaining that and spelling it out for me. I've finally got a fully working build. You are the man!

Sent from my Full AOSP on Toro-VZW using Android Central Forums
 

genuinejd

Member
Jan 6, 2012
6
1
0
Visit site
Holy guacamole! Thank you for explaining that and spelling it out for me. I've finally got a fully working build. You are the man!

Sent from my Full AOSP on Toro-VZW using Android Central Forums

I get copying the files and folders but I'm confused about where you get the blobs? The original solution said to get a couple of them from maguro 4.1 builds, as in, download a maguro 4.1 ROM and literally copy the files? Or build a maguro 4.1 ROM from source? Same with the toro 4.0.4 blobs?

Aside from that, I finally got through issues syncing the source and getting a full build. I haven't tried flashing it because I'd like to at least get the files for the camera and GPS. I'm running Ubuntu 11.10 as a VM inside VirtualBox on a MacBook Pro. The successful build took about 3.5 hours when allocating 4 GB RAM and 4 CPUs.

I had more problems syncing than I did with the build. One thing this guide doesn't mention is the quotas Google enforces on syncing with their servers. If you're behind a corporate firewall, you likely share IPs and the IP has a quota enforced. On the Google site they indicate how you can init a repo using authentication and you'll keep the quota to your account instead of sharing it.

Also, I had some issues with VirtualBox when using NAT instead of a bridged adaptor. Once I changed to bridged on my VM, I had much more success. Otherwise, I just had to power through with repo sync -f until it all got sync'd. Hope that helps someone!
 
Last edited:

indy328

Member
Dec 29, 2011
9
0
0
Visit site
I get copying the files and folders but I'm confused about where you get the blobs? The original solution said to get a couple of them from maguro 4.1 builds, as in, download a maguro 4.1 ROM and literally copy the files? Or build a maguro 4.1 ROM from source? Same with the toro 4.0.4 blobs?

Aside from that, I finally got through issues syncing the source and getting a full build. I haven't tried flashing it because I'd like to at least get the files for the camera and GPS. I'm running Ubuntu 11.10 as a VM inside VirtualBox on a MacBook Pro. The successful build took about 3.5 hours when allocating 4 GB RAM and 4 CPUs.

I had more problems syncing than I did with the build. One thing this guide doesn't mention is the quotas Google enforces on syncing with their servers. If you're behind a corporate firewall, you likely share IPs and the IP has a quota enforced. On the Google site they indicate how you can init a repo using authentication and you'll keep the quota to your account instead of sharing it.

Also, I had some issues with VirtualBox when using NAT instead of a bridged adaptor. Once I changed to bridged on my VM, I had much more success. Otherwise, I just had to power through with repo sync -f until it all got sync'd. Hope that helps someone!

Are you already running a 4.1.1 ROM? If so, you can just get root explorer from the play store (or similar root browser app) and navigate to the blobs from the previously posted paths and copy the files to your Downloads folder on your SD card. Then adb pull those files to your machine. That's what I did.

Sent from my Full AOSP on Toro-VZW using Android Central Forums
 

Trending Posts

Forum statistics

Threads
942,402
Messages
6,913,886
Members
3,158,396
Latest member
calvinxander08