[GUIDE][Ubuntu] Compiling Android from Source

zero neck

The Ever-Living
Jan 13, 2011
3,127
1,386
0
Visit site
Can the OTA package just be flashed over stock ICS and not lose any data like a regular OTA update?

what this method compiles isnt an ota, it's a rom from source. (d - correct me if i'm wrong this isnt my area of expertise at all).

when the jb ota is available down the road, there will be a method in which you can update to jb from ics without wiping data, most likely ahead of the ota release itself or at least concurrent with it.
 

Andrew Ruffolo

Well-known member
Jan 5, 2010
3,567
172
0
Visit site
Can the OTA package just be flashed over stock ICS and not lose any data like a regular OTA update?

i wouldnt... you could try backing up and then wiping all 3 (data, cache, dalvik) and then install rom, then restore data from backup. this is very hit or miss with me, though... mostly miss.

Sent from my Transformer TF101 using Android Central Forums
 

Andrew Ruffolo

Well-known member
Jan 5, 2010
3,567
172
0
Visit site
Will this work on a VMware Ubuntu installation?


It should. I'm going to do a video tonight in a vmware installation on installing java, I'll test a build afterwards.

Sent from my Transformer TF101 using Android Central Forums
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Click to view quoted video

Here's my video how-to. Didn't go as in-depth as this tutorial (it rocks), but its at least a visual for those that may need something more like a class. I have other videos on my channel as well (shameless plug). Feel free to insert video wherever you like.

Thank you! I'll be sure
to check it out later.




Will this work on a VMware Ubuntu installation?


Yes. Make sure you have enough ram though!




Can the OTA package just be flashed over stock ICS and not lose any data like a regular OTA update?




No, you want to wipe everything.


Click to view quoted image


Dafuq did I just read?

I'd like to take this moment to thank all the people who do the hard work of building custom ROMs so I can just download a single file and select yes to install it.

Thank you for making my life easier. Click to view quoted image

Lol

Sent swiftly by Oliver using Android Central Forums
 

Andrew Ruffolo

Well-known member
Jan 5, 2010
3,567
172
0
Visit site
what this method compiles isnt an ota, it's a rom from source. (d - correct me if i'm wrong this isnt my area of expertise at all).

when the jb ota is available down the road, there will be a method in which you can update to jb from ics without wiping data, most likely ahead of the ota release itself or at least concurrent with it.

You can compile 2 different ways.
1) make otapackage -j* which makes a flashable .zip file
2) make -j* which makes a .img file you can flash through fastboot.

You could theoretically try installing this on top of a stock ROM, but I wouldn't even try it without a lot of free time, backup on the phone and on the computer (just in case you need to restore using a stock ICS image).

Sent from my Transformer TF101 using Android Central Forums
 
  • Like
Reactions: zero neck

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
You can compile 2 different ways.
1) make otapackage -j* which makes a flashable .zip file
2) make -j* which makes a .img file you can flash through fastboot.

You could theoretically try installing this on top of a stock ROM, but I wouldn't even try it without a lot of free time, backup on the phone and on the computer (just in case you need to restore using a stock ICS image).

Sent from my Transformer TF101 using Android Central Forums

I wouldn't even risk it. Test it properly and wipe everything including system.

Sent swiftly by Oliver using Android Central Forums
 

dually

Well-known member
Jan 16, 2011
57
4
0
Visit site
I removed the recovery folder, removed the 2 lines from the updater script that contained the word "recovery", put the su apk in /system/app, and replaced the su executable in /system/xbin, and then rezipped the ota.

But when I tried to flash with cwm, installation aborted. So I tried Nexus Bean instead and that works fine.
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
I removed the recovery folder, removed the 2 lines from the updater script that contained the word "recovery", put the su apk in /system/app, and replaced the su executable in /system/xbin, and then rezipped the ota.

But when I tried to flash with cwm, installation aborted. So I tried Nexus Bean instead and that works fine.

The best way I've done it is simply editing within the zip.

Sent swiftly by Oliver using Android Central Forums
 

zero neck

The Ever-Living
Jan 13, 2011
3,127
1,386
0
Visit site
yo d, if you want to add themed elements to the rom, you can compile that straight into the rom, right? you just replace the themed bits with the standard ones and go along as usual?
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
yo d, if you want to add themed elements to the rom, you can compile that straight into the rom, right? you just replace the themed bits with the standard ones and go along as usual?

Correct. Most of your theming is done right within the systemui, which is decompiled and modified.

Sent swiftly by Oliver using Android Central Forums
 
  • Like
Reactions: zero neck

cj100570

Spoken Word?
Nov 12, 2009
417
24
0
Visit site
First things first, thanks for the awesome guide.

When I use either of the make commands I get an error stating that I am "attempting to build with the incorrect version of java." It states that my version is 1.6.0_24 and the correct version is just 1.6. I followed the guide 100% and just copied and pasted the commands as you wrote them. Any ideas on the error? I am running Ubuntu 12.04 64-bit.

Thanks

I was having the same issue also. This guide here sorted me out How to install Oracle Java 6 JDK on Ubuntu 12.04 ? Marco Lackovic
 
  • Like
Reactions: dmmarck

cj100570

Spoken Word?
Nov 12, 2009
417
24
0
Visit site
Alas my endeavor has produced error after error. Time for sleep. Maybe I'll try again or just wait on that OTA from Verizon. Or perhaps someone here will share 1 of their magnificent builds. :cool:
 

plasmoidia

Member
Jul 6, 2010
13
4
0
Visit site
Excellent write up! I have been dabbling about with the source myself since it was released. Building on Fedora 17 since I prefer that to Ubuntu (the process is largely the same).

Some of the permissions problems may come from running the extracting the binary drivers as root (you have "sudo sh script.sh" specified). I don't know of any reason you need to be root to extract the binaries. I extracted them as my user.

The part that I have been trying to find more info on is the Google apps stuff. I'd like to do as much myself as I can (I'm still a little unsure about installing some random zip that I cannot verify on my phone). Anyone have any information about how the gapps .zip files are made? I have managed to unpack the 4.1 factory image for the Nexus7 (the 4.1.1 images aren't up yet) and could copy gapps from that. I have looked at some gapps .zip files I have downloaded and there is a bit more than just the APKs. Anyone have any pointers about this?

Also, has anyone played with pulling in any of the Verizon stuff? Not sure what I might want. Definitely not Backup Assistant. MyVerizon can be useful, though.

The hardest part of this for me is finding the information I want/need. Someone knows it, it's just a matter of tracking it down. I want to do more than just download a zip that someone else has put together.
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Excellent write up! I have been dabbling about with the source myself since it was released. Building on Fedora 17 since I prefer that to Ubuntu (the process is largely the same).

Some of the permissions problems may come from running the extracting the binary drivers as root (you have "sudo sh script.sh" specified). I don't know of any reason you need to be root to extract the binaries. I extracted them as my user.

The part that I have been trying to find more info on is the Google apps stuff. I'd like to do as much myself as I can (I'm still a little unsure about installing some random zip that I cannot verify on my phone). Anyone have any information about how the gapps .zip files are made? I have managed to unpack the 4.1 factory image for the Nexus7 (the 4.1.1 images aren't up yet) and could copy gapps from that. I have looked at some gapps .zip files I have downloaded and there is a bit more than just the APKs. Anyone have any pointers about this?

Also, has anyone played with pulling in any of the Verizon stuff? Not sure what I might want. Definitely not Backup Assistant. MyVerizon can be useful, though.

The hardest part of this for me is finding the information I want/need. Someone knows it, it's just a matter of tracking it down. I want to do more than just download a zip that someone else has put together.

That's a great point about running it as sudo and not regular. Thanks!

Sent swiftly by Oliver using Android Central Forums
 

networkproblems

New member
Jun 27, 2011
3
2
0
Visit site
Should work. Also try a lowercase - r, was headed out the door when I replied. Keep me posted!

Sent swiftly by Oliver using Android Central Forums

Apparently root gets the permissions when you run the script with "sudo." I just deleted the folder, removed "sudo" from the "sudo sh nameofthebinaryfileyouneedtoextract.sh" and it worked.

Thanks for the guide. Just tried to build a zip and I got error 127. Back to google search.

Edit: Nevermind; the person above me said same thing haha
 
  • Like
Reactions: dmmarck

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Thanks to both of you! Putting sudo in is basically second nature at this point, so my apologies!

I have updated that post to reflect it accordingly. Thanks again!

Sent swiftly by Oliver using Android Central Forums
 

TauSigmaNova

Domo Arigato, Mr Roboto!
Mar 14, 2012
323
83
0
Visit site
Hey, DM, great guide.

I'm currently running a Windows Machine (Win 7, 8Core i7 @2.8, 8GB RAM, 1.5TB HDD) and wanted to build JB really badly! Could I install Oracle VirtualBox and build Android by running Ubuntu on a Virtual Machine?

Secondly, I want to build it for a different device. The latest OS my device officially had was 2.2.3 but through our lovely devs we have 4.0.4 currently running quite smoothly. I want to build JB for it though I have no idea exactly how I would do it. I need to have my device (thunderc) be read or w/e for it to work, but I know very little about Linux. Any insight on my situation?
 
  • Like
Reactions: dmmarck