Monday, December 19, 2011

Galaxy Nexus : installing ICS 4.0.2 from factory image on the GSM/HSPA+'s model (« yakju » / « maguro »)

UPDATE 04-04-2012 :
Be aware that :
  • All your personal data (files, photos, mp3, ...) will be erased during the process and a factory reset will be done.
  • You should make a backup before starting the install.
  • You should also ensure that your account's information are backed up on Google's server and that all the account have been synchronized on Google's server.
  • You will have to parameter again all your applications : social networks account (sign in into Twitter, Facebook, or whatever account you use), cloud service account (sign in into Ubuntu One, Dropbox, Evergreen, or whatever service account you use), library account (sign in into Kindle or whatever service account you use). So, you should ensure you have all those account sign-in information with you. And be prepared to spend some time on this task.
Good luck if you decide to continue with the manual update process instead of waiting for the OTA.

I've just updated my GSM/HSPA+ Galaxy Nexus (« yakju » / « maguro » model) to Android ICS 4.0.2 by flashing the factory image. I've decided to flash the factory image because manual install requires to unlock the bootloader and this single action will erase my data (userdata partition) on the device whether I flash the factory image or the OTA archive.

First of all, prepare everything :
  • download the yakju / maguro icl53f Android 4.0.2 factory image and verify the checksum (MD5 or SHA-1)
  • then expand the archive in a folder on your desktop computer
  • download the fastboot application for Windows or Mac on your desktop computer, unzip it and copy the unzipped contents to the folder where the factory image has been expanded to. It seems the fastboot application is now in the Android SDK folder : android-sdk/platform-tools. So you just have to ensure this folder is in your PATH environment variable
  • install the Android SDK on your computer. I don't know if this is a required step but who knows, it will be ready if things goes wrong ...
  • open the script file from the directory where the factory image has been expanded to in a text editor
  • open a command shell and go to the directory where the factory image has been expanded to

Now everything has been prepared, you're ready to proceed.

Here are the steps :
0) boot in fastboot mode following the instructions from Building for devices (shutdown your Galaxy Nexus then hold volume-up and volume-down, then press power while maintaining volume-up and volume-down until the phone vibrate)

1) unlock the bootloader following the instructions from Building for devices (the "Unlocking the bootloader" section). The Galaxy Nexus will display a warning screen and you'll have to confirm on the phone you still want to unlock the bootloader using the volume-up button then the power button)

$ fastboot oem unlock
OKAY [ 33.912s]
finished. total time: 33.912s

At the next Galaxy Nexus reboot, you will see an unlocked locker on the black screen with the « Google » logo.

2) flash the bootloader following the script's commands provided in the factory image archive

$ fastboot flash bootloader bootloader-maguro-primekk15.img
sending 'bootloader' (2308 KB)...
OKAY [ 0.347s]
writing 'bootloader'...
OKAY [ 0.291s]
finished. total time: 0.637s

wait for a few seconds

3) reboot the bootloader following the script

$ fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.007s]
finished. total time: 0.007s

wait for a few seconds

4) flash the radio image following the script

$ fastboot flash radio radio-maguro-i9250xxkk6.img
sending 'radio' (12288 KB)...
OKAY [ 1.749s]
writing 'radio'...
OKAY [ 1.376s]
finished. total time: 3.124s

wait for a few seconds

5) reboot the bootloader following the script

$ fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.006s]
finished. total time: 0.006s

wait for a few seconds

6) flash the android 4.0.2 (icl53f) image following the script

$ fastboot -w update
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
Bootloader Version...: PRIMEKK15
Baseband Version.....: I9250XXKK6
Serial Number........: 0xxxxxxxxxxxxxx
checking product...
OKAY [ 0.007s]
checking version-bootloader...
OKAY [ 0.008s]
checking version-baseband...
OKAY [ 0.008s]
sending 'boot' (4074 KB)...
OKAY [ 0.591s]
writing 'boot'...
OKAY [ 0.249s]
sending 'recovery' (4406 KB)...
OKAY [ 0.648s]
writing 'recovery'...
OKAY [ 0.295s]
sending 'system' (317594 KB)...
OKAY [ 34.419s]
writing 'system'...
OKAY [ 33.115s]
erasing 'userdata'...
OKAY [ 0.193s]
erasing 'cache'...
OKAY [ 0.015s]

finished. total time: 69.582s

Wait for a few seconds and your phone will reboot by itself, then restart.

7) As everything has been erased, and specially your personal information, apps, data and so on, you are asked a few information to configure your Android phone as it is a very first start.

This restoration process takes quite some time.

8) After the phone has been parametered and it has restored your data (contacts, emails, ...), apps, and the likes from Google's servers, it is strongly suggested to lock your phone's bootloader (as recommended by Jean-Baptiste Queru).

At the command prompt, execute the following command :

$ fastboot oem lock
OKAY [ 0.203s]
finished. total time: 0.203s

wait for a few seconds then reboot your phone

$ fastboot reboot

finished. total time: 0.005s

While the phone reboots you should not see any unlocked locker on the black screen with the « Google » logo.

That's it. Enjoy.

fastboot commands

$ fastboot -?
usage: fastboot [ <option> ] <command>

update <filename> reflash device from
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message

-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address
-n <page size> specify the nand page size. default: 2048

Sunday, December 18, 2011

Galaxy Nexus : how to get the 4.0.2 update on the GSM/HSPA+ "yakju" / "maguro" model, NOT for Verizon's CDMA/LTE "mysid" / "toro" model

There are different methods out there on how to bring your GSM/HSPA+'s Galaxy Nexus (« yakju » / « maguro » model) to 4.0.2 if you can't wait for the OTA update :
According to Jean-Baptiste M. "JBQ" Queru, a software engineer working on Android Open-Source Project (AOSP) at Google, the factory image contains a script. Here is the script that can be found in the yakju-icl53f factory image (just expand the archive to see the contents) :

fastboot flash bootloader bootloader-maguro-primekk15.img
fastboot reboot-bootloader
sleep 5
fastboot flash radio radio-maguro-i9250xxkk6.img
fastboot reboot-bootloader
sleep 5
fastboot -w update

Notice the « -w » in the last script line « fastboot -w update ». This command line option ask fastboot to "erase userdata and cache" partitions aka wipe out the "userdata and cache" (Android Partitions Explained: boot, system, recovery, data, cache & misc).

In the instructions given in the article HOWTO Manual update to 4.0.2 using factory imgs, w/o wiping phone, the « -w » has been removed from the last script line :

fastboot flash bootloader bootloader-maguro-primekk15.img
fastboot reboot-bootloader
(wait for bootloader to reboot)
fastboot flash radio radio-maguro-i9250xxkk6.img
fastboot reboot-bootloader
(wait for bootloader to reboot)
fastboot update

As stated by Jean-Baptiste Queru in his post about the Factory images available for Galaxy Nexus,
Don't forget that after flashing back to a factory state, your bootloader is still unlocked. Don't forget to lock it back in order to secure your device ("fastboot oem lock").

Unlock the Galaxy Nexus bootloader
For both procedures, before manually updating to 4.0.2, your bootloader will have to be unlocked first. The procedure can be found here HOW-TO OEM unlock the Galaxy Nexus.

As stated in Building for devices from the « Android Open Source Project » reference site,

The procedure must be confirmed on-screen, and deletes the user data for privacy reasons. It only needs to be run once.

On Nexus One, the operation voids the warranty and is irreversible.

On Nexus S, Nexus S 4G, Xoom, and Galaxy Nexus, the bootloader can be locked back with

The ClockworkMod Recovery
The procedure to manually install the OTA requires to install the latest version of the ClockworkMod Recovery for the GSM/HSPA+ "maguro" Galaxy Nexus.

Here is a rather complete guide on the « ClockworkMod Recovery » : What Is ClockworkMod Recovery And How To Use It On Android [Complete Guide]. Here is the pitch on « ClockworkMod Recovery » :

All Android devices ship with a recovery console that is basically a partition on the device’s internal memory and can be booted into. The stock recovery of almost all Android devices provides a few basic yet handy options that allow you to factory reset your device and also to recover its operating system using an official ROM in zip format, but that’s all you can do with it. That’s where a custom recovery comes handy.

A custom Android recovery basically replaces the stock recovery with one that lets you do all you can do with the stock recovery, plus a plethora of more options to give you a lot more control on your device. With a custom recovery, you can install official and unofficial ROMs as well as other updates including apps, themes, kernels etc. using zip files, wipe not just user data but pretty much every partition on your device, mount the storage card for USB mass storage access without leaving recovery, partition your SD card, wipe Dalvik cache and battery stats, fix permissions, perform, manage and restore backups and so on.

In most cases, the simplest method to install the « ClockworkMod Recovery » on your device is provided in How To Install ClockworkMod Recovery On Your Android Phone. If it does not work, alternative method can be found in What Is ClockworkMod Recovery And How To Use It On Android [Complete Guide]

By the way, here are other useful resources about Android :

Sunday, December 11, 2011

Is the Galaxy Nexus still a "Nexus" ?

XDA Developers has discovered that some Galaxy Nexus - the Google's new flagship - don't have the right « yakju » software configuration. The other software configurations - « yakjusc » and « yakjuxw » - are from Samsung.

As stated in the full story Is the Galaxy Nexus Still a “Nexus?”
The true, Google-controlled version is yakju—the rest being Samsung-controlled variants, thereof. All carry the hardware code name maguro, so it is plausible that they can be flashed to yakju. However, according to Android software engineer Jean-Baptise Queru, it is unclear at this time whether this is actually possible.

yakjusc and yakjuxw are indeed the two Samsung-prepared builds I’m aware of at the moment, but I’m discovering them as they get released. I only have some visibility over the builds that are prepared by Google, i.e. yakju. Everything else comes from Samsung and I don’t know what their schedules and release plans are. I can’t guarantee that flashing the yakju files that I posted would work on a device that originally shipped with yakjuxw, as I don’t have access to such devices. The hardware is supposed to be close, but I don’t know for sure that it’s close enough. JBQ

The software version is in the /system/build.prop property file in the property which should looks like . An full copy of a /system/build.prop property file can be found here in post #5.

Here are some ways to check your /system/build.prop property file's software version :
  • easiest way : use a file manager on the device as stated in post #41
  • upload the /system/build.prop file on your desktop computer using adb and look for the property value there as stated in post #27

Follow the whole story on XDA Developers forum My Galaxy Nexus came with Samsung ICS build rather then google...

Saturday, December 10, 2011

Google Galaxy Nexus : How to unlock bootloader & root GSM Nexus - how to restore official factory image

Google Galaxy Nexus resources can be found on XDA Developers forum.

There are detailed instructions on [HOW TO] Unlock Bootloader & Root GSM Nexus. Take care that this is for the i9250 model (the european model with the i9250XXKK1 baseband version and the ITL41F build number)

There are also instructions on how to restore the [ROM] Official Factory Image ITL41F.