Wednesday, August 8, 2012

Upgrade Galaxy Nexus to Jelly Bean with fastboot on OS X.

Great news for Galaxy Nexus owners that are still waiting for their Over The Air (OTA) update to Jelly Bean. Last week Google released Jelly Bean 4.1.1 factory images for most Nexus devices (no image for CDMA/LTE Galaxy Nexus yet). This is particularly useful for folks that didn't buy their GNex from Play Store (i.e. the yakju / takju variant) and have one of the regional/carrier variants (like yakjuxw, yakjuxs, yakjuux, yakjusc, yakjuzs, yakjudv, yakjukr and yakjujp), which will take even longer to get an OTA update.

The only requirements are: GSM version of Galaxy Nexus, factory image and fastboot utility in your PATH (I'll make a separate post on how to setup fastboot utility on Mac OS X).

First step is... backup your phone. The described procedure will wipe your device clean of all apps, settings and personal data, so do a thorough backup! You've been warned.

Download the latest yakju or takju image from Factory Images for Nexus Devices page. In this example I will use yakju image for GSM Galaxy Nexus, so the file name is yakju-jro03c-factory-3174c1e5.tgz

Untar the image using either Unarchiver or command line:

tar zxvf yakju-jro03c-factory-3174c1e5.tgz

This creates a new directory yakju-jro03c with a few image files and the flash-all.sh script. Go to command line and change into this new directory.

Switch GNex into fastboot mode by shutting it down first, then holding: Volume Up + Volume Down + Power button. Your phone should show a green droid lying on his back with his chest plate open. From here you have a few basic options (Start, Restart bootloader, Recovery mode, Power off) that could be selected with volume keys and activated with power key.

Connect your phone to your Mac with USB cable.

To see whether device is properly recognized, from command line run:

fastboot devices

If everything is in order, you'll see something like this:

DEVICESERIALNUMBER fastboot

We now need to unlock our bootloader in order to flash new image. Run:

fastboot oem unlock

You will get a warning that this step will completely wipe your phone. Accept it on the phone (volume keys to select and power key to confirm) and your bootloader will be unlocked:

...
OKAY [ 18.009s]
finished. total time: 18.009s

Now we flash the Jelly Bean by running the aforementioned script:

./flash-all.sh

The script will begin installing new bootloader, baseband firmware and operating system (once again all user data will be erased).

sending 'bootloader' (2308 KB)...
OKAY [  0.252s]
writing 'bootloader'...
OKAY [  0.289s]
finished. total time: 0.541s
rebooting into bootloader...
OKAY [  0.007s]
finished. total time: 0.007s
sending 'radio' (12288 KB)...
OKAY [  1.334s]
writing 'radio'...
OKAY [  1.375s]
finished. total time: 2.709s
rebooting into bootloader...
OKAY [  0.007s]
finished. total time: 0.007s
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
--------------------------------------------
Bootloader Version...: PRIMELC03
Baseband Version.....: I9250XXLF1
Serial Number........: DEVICESERIALNUMBER
--------------------------------------------
checking product...
OKAY [  0.007s]
checking version-bootloader...
OKAY [  0.008s]
checking version-baseband...
OKAY [  0.008s]
sending 'boot' (4366 KB)...
OKAY [  0.473s]
writing 'boot'...
OKAY [  0.268s]
sending 'recovery' (4708 KB)...
OKAY [  0.513s]
writing 'recovery'...
OKAY [  0.314s]
sending 'system' (396675 KB)...
OKAY [ 42.561s]
writing 'system'...
OKAY [ 36.033s]
erasing 'userdata'...
OKAY [  0.290s]
formatting 'userdata' partition...
Creating filesystem with parameters:
    Size: 14539534336
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8144
    Inode size: 256
    Journal blocks: 32768
    Label: 
    Blocks: 3549691
    Block groups: 109
    Reserved block group size: 871
Created filesystem with 11/887696 inodes and 97200/3549691 blocks
sending 'userdata' (137559 KB)...
writing 'userdata'...
OKAY [ 28.331s]
erasing 'cache'...
OKAY [  0.013s]
formatting 'cache' partition...
Creating filesystem with parameters:
    Size: 452984832
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 6912
    Inode size: 256
    Journal blocks: 1728
    Label: 
    Blocks: 110592
    Block groups: 4
    Reserved block group size: 31
Created filesystem with 11/27648 inodes and 3566/110592 blocks
sending 'cache' (8832 KB)...
writing 'cache'...
OKAY [  3.621s]
rebooting...

finished. total time: 112.474s

At this point Google recommends to lock the bootloader with fastboot oem lock command, but if you're planning to root your phone in the near future, leave it unlocked. Locking bootloader means your phone will be wiped next time you unlock it, so unless you planning to return your phone to the store - don't.