Guide: Building Steel Droid from source
This guide is to help you build Steel Droid Gingerbread. There are three sections. The first two are links to VirtualBox images that contain the full build environment with all requirements already installed, as well as the base for the current source code.
Steel Droid Build Environment - No Source
This VirutualBox image contains a prebuilt Ubuntu environment, ready to download source and begin building Steel Droid. This image requires that you download the source yourself.
SDBE Guide - No Source
Steel Droid Build Environment - With Source
This VirutualBox image contains a prebuilt Ubuntu environment, ready to build Steel Droid. The source is already downloaded. It simply needs written out, and you can begin building immediately.
SDBE Guide - With Source
Setting up your own build environment from scratch
Installing Ubuntu 12.04.5 LTS
You can obtain Ubuntu 12.04 here:
Ubuntu 12.04.5 LTS
Be sure to download the appropriate 32 or 64 bit version, depending on your computers capabilities. Make sure you download the DESKTOP version.
Although its possible with Oracle VirtualBox, I would suggest you make a TRUE install to your system. Yes, I mean a true multi-boot setup. I will go over it a little here, as least how I set it up on my machine.
Here is how I currently have my laptop set up:
My laptop has 16GB of RAM, so I didn't bother to allocate anything for swap space, as it would have never been used. I would also suggest you set it up this way so that your source is on a separate partition from your system installs. That way, if something DOES go down, and your system crashes and you are forced to reinstall it, you will still have all your source in tact, and that could save you HOURS!
The System partitions for both Linux Mint and Ubuntu are fairly small, as they only need to be enough to hold the system, its updates, and possible files you work with when your building/modding. If you want to put your files somewhere for safe storage or backup, that's what the STORAGE partition is for.
For those of you who might have an Alienware laptop like me, or another device that currently has the hard drive partitioned as a GPT (only useful for those with a 2.2TB drive or larger), I would suggest your wipe the WHOLE drive from a live CD partition editor, and reformat it with an MBR (Master Boot Record) instead. Just saves some headache later on. You can always switch back later, through Windows Management Console.
Installing the Android SDK
Start by download the latest SDK for Linux from here:
Android SDK | Android Developers
and just save it to the default "Downloads" directory
Current version: r25.2.4
You are going to want to go into the SDK Manager, and update the SDK.
Once it's downloaded, open a new terminal and type:
Next, we will install gedit. This will be the text editor used in the rest of the guide, and is not preinstalled in Ubuntu. Open a terminal window and type:
Next we need to include the SDK tools and a couple other paths in our system path, so from the terminal type:
and add the following to the bottom of the document that opens:
and save and exit.
We need to add a device rule to allow our computer and ADB to communicate with our phone. Not necessary for building, but theres really no reason to skip this part.
In the terminal type:
and then copy the following in to the file, save and exit.
Now we need to install all the dependencies needed to do the builds. I added in PNGCrush, SchedTool, and OptiPNG and a few extras as the CM build environment needs them. Depending on which OS you have installed, chooose 32 or 64 bit.
in the terminal:
(for 32 bit)
To be honest, Im not sure what the 32 bit version requires. I used 64 bit for everything as any modern computer supports a 64 bit system.
(for 64 bit)
If you want the option to right click in a folder and have the option to open a terminal at that location, do this. Open the Software Sources app, and enable "Universe" if it isn't already. Then in terminal:
Nautilus will quit all open windows, and when you go back, the option to "Open Terminal Here" will be available.
Now we need to install the expected version of the Java Development Kit. Open a new terminal window, and type:
Next we need to verify the GIT tags. In a new terminal window type:
Nothing will appear to be happening, thats ok. Paste the following into the terminal window and then press CTRL+D (TWICE) to save. This will return you back to the terminal command prompt.
Setting up the Android SDK
Now we need to download the appropriate APIs for the Android SDK, so that it can build our source. Navigate to "~/android/sdk/tools/" and right click on the file called "android". If it just opens in a text editor, right click and go to "permissions" and make sure the box at the bottom that allows it to be opened as a progam is CHECKED. Then try again, and "Run In Terminal".
When the SDK Manager opens up and finishes loading the current repository list, put a check next to the following:
In the bottom right, hit "Install".
Getting the source
Now we have to do the fun part, get git installed and download the source code!
First open a new terminal window and type:
Next we need to initalize an empty folder for your source to be downloaded to. You dont have to have it on the same partition as your system or sdk. You can have it anywhere.
Close all terminal windows. Then navigate to the folder you want your source to be in, and right click, Open Terminal Here. Then type:
This will of course download the manifest for building Steel Droid. If you want to build something else, check with them and find out what their init command is, and use that instead. Remember, this guide is for building Gingerbread and prior, and in this case, CM7-based source.
To sync the source from GIT to your computer, just type the following:
This part of the process is what takes the longest. Depending on your connection, you could be waiting anywhere between an hour, to 8 hours or more. Ive done a LOT of work to reduce the amount of stuff that needs to be synced. That mean removing ANYTHING thats not relevant to the Droid 1. There is a LOT more that can be removed, but that will happen as I get time to test it.
Building the ROM
OK, so finally the part you've been waiting for. New we will actually do a build. Depending on your machine, this could take only a couple minutes, or 2 hours, depending on how you have it all set up. There are various tips and tricks to use along the way, and that will be discussed in another section.
For now, lets just do a basic build. Close all open terminal windows, and navigate to the root of your source directory. Right click and choose "Open Terminal Here" and type:
The first build will always take the longest. On the first build, ccache gets filled with initial data. After that, all subsequent builds will utilize ccache to speed up the build process.
If the build completed successfully, you should be left with something similar to this:
The file you want to flash for testing/release, in the screenshot, is in orange. Transfer that zip to your phone for flashing. No gapps, or anything are needed, its READY TO GO!
Congrats! You did it! Sit back and enjoy the fruits of your labor!