Prerequisites
An OEM unlocked Xoom (Verizon or US Wifi), Nexus S (any), Galaxy Nexus (Verizon or factory unlocked international only)
A computer (ideally 64-bit multi-core and with 4GB RAM) with at least 50GB free disk space
A working installation of Ubuntu 10.04LTS
Basic computer skills and common sense
Be aware that you may screw everything up and wreck your phone
Setting up the computer
There's a common myth that you need a super-computer to build Ice Cream Sandwich. That's simply not the case -- our own Beezy has built ICS on an ATOM powered netbook, it just takes a little longer. For example:
- Quad-core i7 with 16GB RAM takes about 45 minutes
- Six-core AMD with 16GB RAM takes about 45 minutes
- Dual-core AMD with 8GB RAM takes about 120 minutes
- MSI netbook with 1GB RAM takes about 30 hours
The next thing to consider is RAM. The more the better, but huge amounts of physical RAM are not the only way to go here. You'll need a big swap file if you don't have a lot of RAM. If you're setting up an older computer, don't be afraid to give it 16GB of swap. It's slower, but still works. If you don't give enough RAM/Swap you'll get errors. My machine has 16GB RAM and a 1GB swap file, but 4GB RAM and a 16GB swap file will work just fine.[/INFO]
You'll need to install Ubuntu 10.04LTS (64-bit) to follow this guide. Other set-ups will work (I use Slackware as well) but we're going to focus on using the system Google recommends -- because it works well. Set up your build computer with enough swap (see the info box above) and a good Internet connection. You can set up an SSH server and run a headless installation, or use a full blown desktop -- either works. Once you have the machine set-up and connected to the Internet, start installing the required packages. Open the terminal, and enter the following one line at a time. When prompted for any password, it wants your Ubuntu user password.
Installing the Sun JDK
You have to add an extra repository to install the Sun JDK. That's what the first two lines are doing -- adding the repo and initializing it.
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
Installing required packages
You'll need an assortment of utilities and tools to build AOSP. Install them from the command line by copying this and pasting (right click) it into your terminal.
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc
Configure USB access
Normal users can't access the USB system by default. We're going to add in a set of rules that allows it. NEVER BUILD AOSP AS ROOT. Open nano (a terminal based text editor) with elevated permissions (we need to copy this file to the system as root) by typing the following at the command prompt:
Next comes some typing. Type these lines into the empty text file, being careful with spelling and syntax. When you see <username> in red, substitute your Ubuntu username (without brackets) instead.
When you've typed it all in and double-checked for errors, you want to save it. To save, press control+X, enter Y to save the file, then enter a file name and location. You need to use this for name and location:
press enter and the file is saved.
Code:
sudo nano
Code:
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="[COLOR="Red"]<username>[/COLOR]"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="[COLOR="red"]<username>[/COLOR]"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="[COLOR="red"]<username>[/COLOR]"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="[COLOR="red"]<username>[/COLOR]"
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="[COLOR="red"]<username>[/COLOR]"
# fastboot protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="[COLOR="red"]<username>[/COLOR]"
# adb protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="[COLOR="red"]<username>[/COLOR]"
# fastboot protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="[COLOR="red"]<username>[/COLOR]"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="[COLOR="red"]<username>[/COLOR]"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="[COLOR="red"]<username>[/COLOR]"
Code:
/etc/udev/rules.d/51-android.rules
Set up your .bashrc
the file /home/<username>/.bashrc is a resource file for the standard shell in Linux. Since it has a dot(.) as the first character, it's a hidden file. We need to edit it and add to your PATH (where the system looks automatically when you enter a file name). We'll use nano again, but this time we don;t need to be root because it's in our home folder. We're also creating a folder that we'll need later, but want to create it now so we can reference it in our .bashrc
-w means we plan to write to this file, and the tilde (~) is a Linux shortcut to your home folder. Using the arrow keys scroll to the end of the file and add the following lines, remembering that <username> needs your Ubuntu username without the <> brackets.
Save it like you did above -- control+x, then enter Y. You won't need to enter a file name, because it's already entered. Just hit the enter key.
The first line allows the use of compilier cache, which speeds up build times. A lot. We want this.
The second line puts ~/bin in your PATH, which we'll need in the next step.
Once you have the file saved, we need to source our new .bashrc file. At the command line again:
Code:
mkdir ~/bin
nano -w ~/.bashrc
Code:
export USE_CCACHE=1
export PATH=$PATH:/home/[COLOR="Red"]<username>[/COLOR]/bin
Code:
source ~/.bashrc
Now your computer is all set up, ready to install the source code -- which we'll do in post #2
Last edited: