Flashing your own Android builds (and cupcake): A quick guide


Last Updated: 2009-04-03 00:01:53
  1. devolio

    devolio Well-Known Member

    If you've paid any attention to the Android scene at all lately, you know there's open source repos you can pull and compile the source code from, with a few little changes.

    I'm not going to cover any of the source pull/compile/assembly instructions here, that will be in another thread coming soon enough.

    This is pretty much a guide to fastbooting - the process of flashing the specific parts of the system you want to flash, quickly.


    Prerequisites
    Your phone must be rooted (or a developer phone,) and you should know how to get back from a custom flashed build, though I'll be covering it briefly.

    Having a JesusFreke build recovery mode and the engineering bootloader is highly recommended.

    You'll also need fastboot, which can be obtained in a multitude of places. The easiest way is to get them straight from HTC. They're also a by-product of a compile.

    It's also important to note, as in the rooting guide, that if you're not comfortable flashing or poking around with your device, do not try this, as you can do nasty things to your phone.


    Safety net
    Now, because we're going to be using fastboot to do the flashing, it would be a good idea to make a backup of your current system.

    You can do this with...
    - a nandroid backup (flashable via fastboot,)
    - mybackuppro (to reload your stuff after reflashing a build you want,)
    - or with good ol' CLI tools.


    The idea here is to set up an SD card that you can quickly and easily fall back to in the event that you want to switch back to a 'normal' build (most likely,) or really screw something up.

    Because I'm running JF RC33 1.42, my 'safety net' is as easy as booting into recovery mode (home+power) and wiping/updating via the update script, and everything is sane again.

    Obviously, depending on your set up, your methods may vary.


    Download fastboot (Linux, Mac, Win32)

    My Cupcake Images


    Installing
    1) Download a set of images, or compile some yourself.

    2) Boot into the bootloader and get it into fastboot mode. With the phone off (and connected to your computer,) hold down the camera button and press power. Once the screen is up, press back a few times until it says FASTBOOT

    3) Make sure fastboot sees your device with fastboot devices

    4)
    Below are the commands to flash the various partitions with the image files:

    Code (Text):
    1. [SIZE=4][SIZE=2][SIZE=3]chmod a+x fastboot (if needed)[/SIZE][/SIZE][/SIZE][SIZE=3]
    2. ./fastboot flash system system.img
    3. ./fastboot flash boot boot.img
    4. ./fastboot flash userdata userdata.img
    5. ./fastboot reboot[/SIZE]
    6.  

    After running ./fastboot reboot, your phone will restart itself, and within a few minutes (be patient on first boot, it can take time) - you'll be running a brand new build.

    To revert
    As mentioned in the safety net section, you can pretty much revert to where you were before assuming you actually backed your stuff up.

    To restore a nandroid image
    Code (Text):
    1. [SIZE=3]Turn the phone off
    2. Hold down camera+power to get into the bootloader
    3. Hit back a few times until it says FASTBOOT
    4. [/SIZE][SIZE=3]./fastboot flash system /path/to/nandroid/system.img
    5. ./fastboot flash boot [/SIZE][SIZE=3]/path/to/nandroid/[/SIZE][SIZE=3]boot.img
    6. ./fastboot flash userdata [/SIZE][SIZE=3]/path/to/nandroid/[/SIZE][SIZE=3]userdata.img
    7. ./fastboot reboot[/SIZE]
    To revert with JF 1.42 RC33
    Code (Text):
    1. [SIZE=3]Turn the phone off
    2. Hold down home+power to get into recovery mode
    3. Alt+W to wipe the data
    4. Alt+S to load up the update[/SIZE][SIZE=3]
    5. [/SIZE]


    Advertisement

Share This Page