Saturday, October 6, 2012

Using Fastboot to download binaries

Hey Guys,

Recently I have been experimenting a lot with The Nexus S. I have also compiled Jellybean Source code in my local machine running on Ubuntu 10.04 (64bit). But unfortunately, the build does not allow you to attach google acount to it :-( . And the default google apps like Play store/Gmail/Maps/Gtalk are absent in the binary. Will look for a method to integrate the Market !!!!

Its easier to flash using Odin (just tar the boot.img, system.img, recovery.img and userdata.img) in Windows platform. For Linux we have two options:

1. Use Fastboot (http://source.android.com/source/building-devices.html)
2. Use Heimdall (http://www.glassechidna.com.au/products/heimdall/)

To download binary using Fastboot:
Download the android-sdk from http://developer.android.com/sdk/index.html
Add tools and platform-tools to PATH variable to use it from any location.

$ gedit ~/.bashrc & and add the following line:
export PATH=$PATH:/home/jai/bin:/home/jai/Android/android-sdk-linux/tools:/home/jai/Android/android-sdk-linux/platform-tools

Now, Download the Nexus Factory image binary from https://developers.google.com/android/nexus/images#sojujro03l

Unzip it. It would have the following 5 files:
  1. bootloader-crespo-i9020xxlc2.img - bootloader binary
  2. flash-all.sh - shell script to install radio, bootloader and platform
  3. flash-base.sh - shell command to install radio and bootloader
  4. image-soju-jro03l.zip - the Platform package
  5. radio-crespo-i9020xxki1.img - Radio binary

I have skipped the bootloader and Radio binary, as its not good to mess with the bootloader. The device will be useless if the bootloader is corrupted. So better don't mess with it. Then unzip image-soju-jro03l.zip to get the following files:
  1. android-info.txt
  2. boot.img
  3. recovery.img
  4. system.img
  5. userdata.img

I modified android-info.txt to add a check my bootloader version:
require board=herring
require version-bootloader=I9020XXLC2|I9020XXKL1
require version-baseband=I9020XXKI1|I9020UCKJ1|M200KRKC1
and zipped them to JAI.zip
 zip JAI.zip android-info.txt boot.img recovery.img system.img userdata.img
Now we are ready to flash the binary. Get the device in fastboot mode using the key combination vol up + power button or just type:
fastboot reboot bootloader
fastboot -w update JAI.zip
To flash the binary made from the workspace.
export ANDROID_PRODUCT_OUT=/home/jai/NexusS/out/target/product/crespo/

fastboot -w flashall 
Now my self compiled binary is flashed. It feels great to see it working :-). For any queries mail me.

Jai

No comments:

Post a Comment