Thursday, February 16, 2012

Delving Deeper into Android: Building Ice Cream Sandwich for the Nook Color

It was only a matter of time before the siren's call lured me to install the source for Ice Cream Sandwich (ICS, Android 4) and attempt to create my own version for my Nook Color. There are two links I've been following to install ICS from its git repository and then building from the repository. I need to list several caveats before we go much futher;
  1. I am a complete novice (otherwise known as "a noob") when it comes to the use of git[1] and building Android. So I'm depending on a lot of hand-holding at this point in time, meaning reading lots of xda forum threads and wiki pages to piece together a process that works with my Fedora setup.
  2. My Dell Latitude D630 isn't some awesome build machine. It's now considered a modest little notebook powered by an Intel Core 2 Duo T7700 processor running at 2.4GHz. It took a long time to pull the git repository, and it's going to take a long time to build the project. Right now as I type this the system load is about 2.5 and both cores are running at 100%. Half of the 4GB of system memory is in use (the rest taken up by cache), with about 5MB on swap.
Building Android 4.0.3

The Adventure Begins

The three links I've been referring to so far:
  1. CM9/ICS Nightly Builds
  2. CM9 for NookColor Build Instructions
  3. [Wiki] Barnes & Noble Nook Color: Compile CyanogenMod (Linux)
The instructions, both implicitly and explicitly, assume you're using Ubuntu. Since I'm using Fedora, I have to adjust accordingly. This is what I've done so far under Fedora 14.
  1. Read all three of the links listed above at least once and in the order given. Pay particular attention to the directions of link 2 as it makes heavy reference and some changes to the Wiki directions in link 3.
  2. Go back and re-read (or read again if you skipped step 0) what I just wrote in step 0.
Now that you're thoroughly familiar with the content of the three links, I will go through all the steps I performed.
  1. Start with the Wiki link above, step 3. Install the Android SDK if you haven't already. I've had it installed for so long now on my Dell that I'd have to go back to my Android posts (see android in the category cloud to the right) for general directions and any special tips.
  2. Wiki link step "Install the Build Packages" tells you to install a series of build packages. Fedora 14 installs with nearly everything the Wiki calls for out-of-the-ISO. The exception is schedtool, which you can install with a simple 'yum install schedtool' as root. I need to note that gcc on Fedora 14 is version 4.5.1. I download and install the Java RPM from the Oracle website. For the build I have Java 1.6.0 update 31 installed, the absolute latest and greatest at this time.
  3. Wiki link step "Create Directories" assumes you're going to create the 'bin' and 'android/system' directories in your home directory. I didn't and you don't have to either. I already have an ~/Android directory with the sdk and other Android content organized underneath. So I create a build subdirectory (~Android/build) and created my bin and android/system subdirectories inside build (~/Android/build/bin and ~/Android/build/android/system).
  4. Wiki link step "Install the Repository" is the step where you fetch the repo command. The assumption is it's done in your home directory. I did this in the build subdirectory. When you change the execute permissions on the file that is placed in the bin subdirectory, make sure you add a path to the bin subdirectory to execute repo. The simplest way to do this is to step into bin and type in your shell "export PATH=`pwd`:$PATH" or "export PATH=$PWD:$PATH", it's your call. If you haven't recognized the syntax, I'm in the bash shell. For permanence you need to add this to your .bashrc (something without pwd or $PWD, where you explicitly call out the path into bin).
  5. Step back into the build subdirectory and execute the command:

    repo init -u git:// -b ics

    This basically initializes the repository environment and executes pretty fast.
  6. The next step is to create an XML file that references the nook (encore) device folder and add it to the ICS build environment. The file is android/system/.repo/local_manifest.xml, and the contents of local_manifest.xml are
    <?xml version="1.0" encoding="UTF-8"?>
      <!-- note:  no longer need to replace CM9 Trebuchet launcher with AOSP's Launcher 2 -->
        <remote name = "gh"
               fetch="git://" />
        <project path="device/bn/encore"

    Cut and paste this XML snippet into the file.
  7. In the build directory perform a full synchronize of the repository with the command

    repo sync -j16

    This took a few hours to fully execute and download. When it was finished the downloaded repository files took up some 5.6GB of disk space.
  8. When the repository sync is finished, turn on your Nook Color with CM7 and plug it into the development system. I'm using the Nook Color with CM7 on the µSDHC card I created in the prior blog post. Move to android/system/device/bn/encore and execute ./ This will download the Nook Color's proprietary binary blobs and place them in the ICS build environment for later use.
  9. Change directory to android/system/vendor/cm and execute get-prebuilts.
  10. Change directory back to android/system, and execute the following commands

    . build/
    brunch encore

    And then prepare to wait a good three to four hours for everything to build. I didn't sit with a stopwatch or start a timer. All I know is that I started this around 3pm and it finished right before 7pm. By the time it was finished the Android footprint had grown to 21GB of disk space.
After all this I am now the proud owner of my very own Android ICS file:

I'm not quite certain what to do with it at the moment. The next step for me is to learn how to create a new µSDHC with this running on my Nook Color. After all, just because it built is no guarantee it will execute properly.

I'd like to thank everyone who's worked on this so far, especially the XDA developers. Without all their heavy lifting to start with I'd have had one hell of a time just getting to this point.

[1] I am quite familiar with rcs, cvs, subversion, and ClearCase and know how to work with CM systems in a small to large development efforts. I just have no experience with git.

1 comment:

  1. That is one advantage of the Nook Color versus the Nook Tablet. The latter can't boot from the micro SD card. I had to root mine the hard way.


All comments are checked. Comment SPAM will be blocked and deleted.

Note: Only a member of this blog may post a comment.