Fastboot - Cyanogenmod

Refer to: http://wiki.cyanogenmod.com/wiki/Fastboot

Fastboot

Fastboot is a command line tool used to directlyflash the filesystem inAndroid devices from a host via USB. It allowsflashing of unsigned partition images. It is disabled in production devices since USB support has been disabled in the bootloader. You must have an EngineeringSPL, or an SPL that is S-OFF.

After installing the Android SDK orADB Standalone you can use 'fastboot' in addition to the more commonADB.

Contents

[hide]

Verify SPL S-OFF

With the exception of the Google Nexus One (which has an OEM unlock), when you boot the device into the bootloader, you should see S-OFF (security off) on the top line. If you see S-ON, or you see a four-color rainbow background, theSPL does not support fastboot. You will need to install afastboot compatable SPL, such as HardSPL or any of the Engineering SPLs for various devices. See the device specific page for further instructions.

Access bootloader

  1. Make sure you have ADB or theSDK installed.
  2. Linux & OS X only: Download fastboot for the appropriate operating system for your computer.
  3. Place the executable in the proper place, usually:
    • Linux: ~/android_sdk/tools/ or ~/bin/
    • OS X:
    • Windows: C:\Android_SDK\Tools or C:\Program Files\adb
  4. Turn off the device.
  5. Boot device into bootloader
  6. Make sure the device is inFASTBOOT and notHBOOT
  7. Connect the device to the computer via USB.
  8. On your computer, open terminal and run:
    fastboot devices
You should see something similar to:
List of devices attached 
HTXXXXXXXXXX	device

fastboot --help

usage: fastboot [ <option> ] <command>

commands:
 update <filename>				reflash device from update.zip
 flashall					flash boot + recovery + system
 flash <partition> [ <filename> ]		write a file to a flash partion
 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

options:
 -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

Typical Partition Layout

For Reference when flashing partitions

NameNandroid .imgInformation ContainedMount PointNotes
splash1N/ABoot image ("T-mobile G1" image)mtdblock0?size: 320x480x2. Different from bootanimation.zip.
recoveryN/AA 'backup' kernel, initrd, and OS
for system recovery / maintenance
mtdblock1Can flash custom recovery.img (Amon_Ra, ClockworkMod, etc).
Accessed by holding [home] while booting.
bootboot.imgThe main kernel and initrdmtdblock2Can flash custom boot.img
systemsystem.imgThe main OSmtdblock3This is the /system partition
cachecache.imgTemp storagemtdblock4Unused. Can be re-partitioned.
userdatadata.imgUser data and settingsmtdblock5This is the /data partition

Examples

Manual Nandroid restore

Make a Nandroid backup, and copy the folder off your SD card to your desktop.

cd ~/Desktop/path/to/backup/
fastboot flash userdata data.img
fastboot flash system system.img
fastboot flash boot boot.img
fastboot reboot

Flash Custom Recovery.img

fastboot flash recovery /path/to/<recovery>.img
fastboot reboot

Flash Custom boot.img

You should make a Nandroid backup first, in case you need to recover your boot.img

fastboot flash boot /path/to/<boot>.img
fastboot reboot

Development

If you are developing a kernel, you may find it helpful to delete your boot.img and recovery.img to force booting intofastboot:

fastboot erase boot
fastboot erase recovery

You can then manually boot from your custom kernel and a ramdisk:

fastboot boot <kernel> <ramdisk>

Once you have a working kernel and ramdisk, you can automagically combine them withinfastboot:

fastboot flash:raw boot <kernel> <ramdisk>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值