Building your own ROM

Okay. This thread has formally been succeeded by two things:

1.) The wiki entry located here.
2.) The porting IHO to a different Optimus phone thread on XDA.

Like the official thread dev threads the move to the wiki is designed to encourage people to develop a single reference where usable build instructions can be found instead of spreading it out through a lengthy forum thread. As usual I'd like to request that any significant changes to the wiki be coordinated with Centinel.

Re: Building your own ROM

Edit: I cleaned up this post to make it easier to understand. It now includes all of Blarf's recomendations for a simpler cleaner build process, thanks Blarf!

@Blarf: I'm a noob at repo, git, and compiling Android, so I really appreciate your efforts to help people learn how to build from source.

Here's what you need to do to use Wubi on a Windows 7 computer to build the InferiorHumanOrgans repository and create your own ROM.

1) Download and install the Wubi installer for Ubuntu, this will partition your hdd (virtual partition), and install Ubuntu10.xx in the new partition. It does it all automatically, so you don't have to follow any arcane instructions. Just be sure you choose 64bit, I don't know if you can compile Android on 32bit installs.

2) Boot into Ubuntu and open the package manager, and update everything

11) Final setup of build environment, be sure that you have a space after the period and before build:

Code:

. build/envsetup.sh

12) Run lunch and select VM670

13) Run make -j2 bacon

Once it finished compiling (about an hour later), there was a beautiful zip file in ~/android/system/out/target/product/thunderc with an accompanying md5 checksum. I used adb to push it to my phone's sdcard, booted into recovery, made a nandroid backup, wiped cache, wiped dalvik cache, formated boot, system, data, and cache, then flashed my new zip file, and gapps. Rebooted the phone, and I'm now running on my first build.

Re: Building your own ROM

Only init with the one repository you want to track, and, yes, even with the IHO stuff you should use the gingerbread branch. You only really need to sync once unless there are a bunch of changes being committed while you're syncing the first time... and syncing with the CM repo first will leave you with a bunch of junk you don't need, slowing down the build and download process.

You don't need to reboot after chmod.

You don't need ROM Manager as it won't be included by the IHO config files. It's useless until someone puts a ROM up for Koush to include in his manifest. I'd rather have the live wallpaper than ROM Manager, so.

And I would consider running make bacon instead of make otapackage because it looks like a bit more optimization may be done this way. If you pass -jN where N is a number to make it'll run that many processes in parallel. The CM guys recommend one per virtual core (hyperthreading and all that), but I'd say even one per core (ex: -j2 on a dual core machine) should be plenty.

Post your ROM. As I've said I've no interest (for now) in pushing out binary ROMs, especially as it looks like most people want lighter weight ones.

Re: Building your own ROM

Thanks for the tips to clean up my process, I edited the above post directing them to your response.

I discussed it with KermikalElite, and I agree that if this is a CM port, it should remain as close to CM source as possible, so we both think everything you have in here should stay. Except for FM radio till you have it working, otherwise it will confuse people having it there. There is already a bloatware removal script, so people can use something like that if they want a slimed down installation.

I guess I have to cross Optimus V off my list of phones that will most likely never get a "build your own AOSP rom" thread.

I would have posted a VM670 build hours ago but my linux install is broken again. To make my luck even worse the ubuntu installer keeps crashing. I'm going to blindly blame Microsoft Windows for no reason just because it's on my computer. (Whenever you're having a bad day it's always a good idea to blame Windows because with it being the most popular OS, it also brings us crashing, instability, and viruses. Thanks

On a brighter note, stop and think about how we've had multiple builds of CyanogenMod; The world's most popular custom Android distribution - on our Optimus V. That's pretty good development progress for a prepaid budget phone.

I wish I could get building. I can't wait to try out the new kernel and separate lockscreen wallpaper feature!

Re: Building your own ROM

Re: Building your own ROM

I tried building, and got the same error as JerryScript did a couple
of days ago. I wonder what he did to fix it.

I removed the ../vendor/lge/thunderc/proprietary tree, and did a repo sync.
The proprietary tree was recreated. But still got that error.
I also tried copying the entire system folder from stock 2.2.2 to the
proprietary area with no luck.

Okay, much earlier today I powered on my build computer and after the grub bootloader screen linux tried to load but the system just stopped at a black screen.

I thought that a hard shutdown or bad updates may broken my install. At first I didn't believe it was much of an issue because this wasn't the first time I had damaged ubuntu. I would just use my startup usb drive to run the "upgrade 11.04" and reinstall the system files while keeping my /home directory intact.

So I loaded my pen drive which I used about two weeks ago to install ubuntu 11.04 x64. Once I got to the first screen of the gui install process I click next and the installer just hangs there and never continues. That just doesn't make sense because this the same exact install media I used two weeks ago without any issues.

I rebooted into Windows and checked the md5 on the download and it was a negative match. I proceeded to download another image and write that to my usb. This time it hangs at the boot splash screen.

Now I go back into Windows again to check the community documentation and learn that there is an issue with the sandisk u3 bloatware. I formatted the drive to remove that and it still doesn't help the problem. I tried using my 1 tb ext hdd and still had the same outcome.

Next I downloaded a third ubuntu image and burned it to a DVD. This was a last resort seeing as my DVD drive sounds like a broken floppy disk drive attached to a chainsaw. This last time the install gui hangs after clicking next for the first time. (Same as the first attempt)

So with that much bad luck I think the only way I can build android again would be through either virtualization or wubi (both of which I dislike).
I can't believe it. I've never had this many problems at once with linux on a desktop computer.

Re: Building your own ROM

first and foremost:
I want to say thanks to blarf for this informative thread, it's harder than it should be to find clean build info and this is a nice addition to what's out there.
Thanks!

@KemikalElite:
you might try a live ubuntu on your pen drive instead of just the installer, I had better luck that way when there was still a micro$oft install on my hard drive. hate glitchy installers, good luck!

keep the wife happy with my dev time:donate!
the THANKS button is quite acceptable if you're as stingy as me, too.

Re: Building your own ROM

I was looking at the original android source and been staring at the extract-files.sh that they use for the passion. Although this would have to be updated for our device how would we implement this into the source code. Seems like it would be a good thing. A

Re: Building your own ROM

Originally Posted by asadullah

I was looking at the original android source and been staring at the extract-files.sh that they use for the passion. Although this would have to be updated for our device how would we implement this into the source code. Seems like it would be a good thing. A

We get around that step when we copy files from the stock rom over to the vendor's proprietary file. For the latest builds, Blarfie has pulled the blobs into his repository, but LG could ask him to remove them, so keep a backup somewhere if you're syncing from inferiorhumanorgans!

If necessary, we can mod the extract-files.sh to work with the OV's mounts, but as of now we are ok.

Re: Building your own ROM

Originally Posted by JerryScript

We get around that step when we copy files from the stock rom over to the vendor's proprietary file. For the latest builds, Blarfie has pulled the blobs into his repository, but LG could ask him to remove them, so keep a backup somewhere if you're syncing from inferiorhumanorgans!

If necessary, we can mod the extract-files.sh to work with the OV's mounts, but as of now we are ok.

I noticed in their script they include some files that are in our phones /system/bin but not in the proprietary folder of the source code. I'm just asking cuz I'm bored today and can't do nothing with none of my roms till they release the 2.2.2 source so I was thinking about making the extract-files script.

Re: Building your own ROM

Couldn't hurt to grab them. So long as the build compiles without errors, you should have everything you need in the blobs in the repository. Thanks for taking on the extract-files.sh translation, that should especially come in handy if/when Optimus S's arrive with Gingerbread, allowing us to grab the needed files much easier.

Re: Building your own ROM

So I randomly discovered that I have enough C knowledge to understand at least some of the IHO source code lol...

Because of that I couldn't resist the urge to tinker with it a bit, before trying to make any of my own changes I decided to first just see if I could get something to compile and quite frankly I'm starting to feel stupid (I don't like feeling stupid; I'm not stupid lol)...

Anyway if I'm reading my log file properly it almost looks like it's claiming my computer isn't 64 bit which is just not the case as I'm building this on a custom built i3 machine I did a few months ago (I assure it's 64 bit ). Before I go about redownloading and reinstalling ubuntu I thought I'd throw this up here and see if maybe I'm missing something else entirely.

Unfortunately terminal chops the log in the buffer so I don't have the first half of it, but if someone doesn't mind taking a look through what I do have anyway any sort of feedback would be totally awesome.

Re: Building your own ROM

Originally Posted by sblood86

So I randomly discovered that I have enough C knowledge to understand at least some of the IHO source code lol...

Because of that I couldn't resist the urge to tinker with it a bit, before trying to make any of my own changes I decided to first just see if I could get something to compile and quite frankly I'm starting to feel stupid (I don't like feeling stupid; I'm not stupid lol)...

Anyway if I'm reading my log file properly it almost looks like it's claiming my computer isn't 64 bit which is just not the case as I'm building this on a custom built i3 machine I did a few months ago (I assure it's 64 bit ). Before I go about redownloading and reinstalling ubuntu I thought I'd throw this up here and see if maybe I'm missing something else entirely.

Unfortunately terminal chops the log in the buffer so I don't have the first half of it, but if someone doesn't mind taking a look through what I do have anyway any sort of feedback would be totally awesome.

Re: Building your own ROM

A few months ago, I tried to build cm7 for the Nook Color on 32bit
Ubuntu. Then I learned 64bit was required.

Btw, in post #3, JerryScript talks about 64bit in step 1

Alright that was my thought/and question, thanks a lot!
It's been awhile since I did the OS install for linux on the machine in question and while I could have sworn I installed the 64 bit version when I saw the above errors I was, well lets just say concerned

I actually started downloaded the 64 bit version of ubuntu to reinstall it but I was hoping for a second opinion before doing so. Shouldn't take awfully long to do so than I can restart to rebuild my environment, again thanks for the input.

Edit: and yes I was aware 64 bit was required just a matter of not keeping up with my own software

Well, after 18 hours of trying countless methods and about 30 reboots to repair/reinstall ubuntu 11.04; I've realized that after getting over stressed from a build error I did a hard shutdown and it broke all the data on my ext4 partition. EVERY 11.04 installer either doesn't boot or hangs infinitely during the process.

I've decided that only way to get a regular install working is to fall back to 10.10 LTS. Then decide if I think I can upgrade without breaking the OS. With 4 years of using ubuntu I've never had an installation issue this complex.

Maybe I should contact the technical support? lol.

EDIT: Now my Windows is broken. I am now officially an ***** because I deleted my complete Windows Backup image to make space for the ubuntu install. I can't think of a way this can get worse. (Nevermind, I can imagine a few more possibilities.)

Portions of this page are modifications based on work created and shared by the Android Open Source Project
and used according to terms described in the Creative Commons 2.5 Attribution License. AndroidCentral is an independent site
that is not affiliated with or endorsed by Google.