Bootloader mode

The previous sections guided you to your first system images, ready to be flashed to your hardware. These images will be deployed to the device memory. The Nexus 6 has an internal Nand memory. The UDOO has a pretty standard SD card. The first step of the deployment is switching the device into the bootloader mode.

Bootloader mode is a particular state of the device that allows us to transfer and deploy a system image to the device itself, using the fastboot utility. Every device running Android has this mode, but not every device will let us access it. Some devices come with a locked bootloader, for security reasons or simply because of a short-sighted manufacturer.

Obviously, we will be able to access the bootloader on our devices: Google is a generous manufacturer and every Nexus device comes with an unlocked or unlockable bootloader; UDOO, as a development board, is designed to be developer friendly, as well.

Nexus devices

Every Nexus device will let us to access bootloader mode, but every device will do it in its own way. According to the model, we will need a specific sequence of steps to boot the device in bootloader mode. The following table shows how to do it for every Nexus device. Be sure to turn off your device and unplug the USB cable, pick the model from the table, and press the right buttons:

Device

Keys

shamu

Press and hold Volume Down, then press and hold Power

fugu

Press and hold Power

volantis

Press and hold Volume Down, then press and hold Power

hammerhead

Press and hold both Volume Up and Volume Down, then press and hold Power

flo

Press and hold Volume Down, then press and hold Power

deb

Press and hold Volume Down, then press and hold Power

manta

Press and hold both Volume Up and Volume Down, then press and hold Power

mako

Press and hold Volume Down, then press and hold Power

grouper

Press and hold Volume Down, then press and hold Power

tilapia

Press and hold Volume Down, then press and hold Power

phantasm

Power the device, cover it with one hand after the LEDs light up and until they turn red

maguro

Press and hold both Volume Up and Volume Down, then press and hold Power

toro

Press and hold both Volume Up and Volume Down, then press and hold Power

toroplus

Press and hold both Volume Up and Volume Down, then press and hold Power

panda

Press and hold Input, then press Power

wingray

Press and hold Volume Down, then press and hold Power

crespo

Press and hold Volume Up, then press and hold Power

crespo4g

Press and hold Volume Up, then press and hold Power

For our Nexus 6, we need to press Volume Down then also press Power and keep both pressed. The smartphone will boot and you will land on a screen like the one in the following screenshot:

Nexus devices

Here we are in Bootloader Mode!

The first thing you will notice is the quite explicit:

Device is LOCKED

As we said, Nexus devices come with an unlockable bootloader. We just need to connect the device to our computer with a standard USB cable, open a terminal and run the following command:

$ fastboot oem unlock

You will see a notice message that will warn you that unlocking the bootloader will erase everything on your device. Yes, it will. That's unfortunate, but, from a security and system point of view, it's necessary.

Note

This is the right moment to think about a data backup. You can still abort the process, restart your smartphone, save your data and try again. We will wait for you!

If you are brave enough and you just don't need all those pictures of little kitties on your phone anymore, just select YES and the bootloader will unlock smoothly. If for any reason you'd like the bootloader to lock again, you can use the following command:

$ fastboot oem lock

The moment we unlocked the bootloader, we gained full control of the Nand memory—we can erase partitions or flash the system images we have created. Unfortunately, Google does not release the source code of the bootloader, so we wouldn't know how they implement the whole fastboot protocol. Luckily for us, we are going to figure it out thanks to UDOO. The UDOO manufacturer provides us with the full source base, even the one for the bootloader.

UDOO family boards

UDOO comes as an open book. We can access every partition on its memory, with basically zero effort. There is no such thing as a "button ninja combination" to switch to bootloader mode. We can use a serial connection to analyze the whole boot process, stop it, and interact with it using the control console:

  1. Connect the serial interface
  2. Stop the boot sequence
  3. Access the uboot console
  4. Run fastboot

We now have the fastboot server ready to go. With the server in place, we will be able to connect to fastboot from our computer, using the fastboot client we already know.

This process could seem a bit harder than the one from Nexus. That's true. The fact is that UDOO does not ship with a default secret bootloader like the Nexus or any other mainstream smartphone on the market does. UDOO is mainly a development board and, as with lots of such devices, gives you the freedom and power to choose the bootloader you prefer. However, in an effort to be more developer friendly, UDOO can perfectly work with the most popular open source bootloader solution—uboot.

The uboot solution is fully compliant with the standard requirements for a bootloader to properly launch an operating system—hardware initialization, memory test, and so on. It also implements the fastboot protocol and the extraction of the kernel contained in the boot.img, generated by the build system. These last two features make it fully compatible with Android.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.152.58