usage: fastboot [ <option> ] <command>
1. commands:
2. update <filename> reflash device from update.zip
3. flashall "flash boot" + "flash system"
4. flash <partition> [ <filename> ] write a file to a flash partition
5. erase <partition> erase a flash partition
6. getvar <variable> display a bootloader variable
7. boot <kernel> [ <ramdisk> ] download and boot kernel
8. flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
9. devices list all connected devices
10. reboot reboot device normally
11. reboot-bootloader reboot device into bootloader
12. options:
13. -w erase userdata and cache
14. -s <serial number> specify device serial number
15. -p <product> specify product name
16. -c <cmdline> override kernel commandline
17. -i <vendor id> specify a custom USB vendor id
二. 具体分析
1 升级系统
fastboot flash bootloader u-boot.bin
fastboot flash kernel uImage
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot flash ramdisk ramdisk-uboot.img
fastboot erase cache
fastboot flash {partition} {*.img} 例:fastboot flash boot boot.img或fastboot flash system system.img等。
fastboot flashall 注意:此命令会在当前目录中查找所有img文件,将这些img文件烧写到所有对应的分区中,并重新启动手机。
一次烧写boot,system,recovery分区:
(1)创建包含boot.img,system.img,recovery.img文件的zip包。
(2)执行:fastboot update {*.zip}
烧写开机画面:
fastboot flash splash1 开机画面
9 环境变量
fastboot支持环境变量文件,通常在fastboot烧写nand flash时,会将偏移量和大小写入环境变量中,命名格式为:<partition name>_nand_offset
< partition name>_nand_size
例如,内核烧写完成后printenv可以看到:
kernel_nand_offset=0x140000
kernel_nand_size=0x1f70000
10 查看USB设备
查看连接到OTG的USB设备情况,lsusb:
Bus 008 Device 030: ID 0451:cafe Texas Instruments, Inc. <----- fastboot
更多细节查看cat /proc/bus/usb/devices
11 静态模块地址
fastboot重用内核的nand地址分配方式,并且大部分是可以变化的,但是下面列出来的这些地址是不变的。
name offset size
xloader 0x00000000 0x00080000
bootloader 0x00080000 0x00180000
environment 0x001C0000 0x00040000
12 文件大小限制
最大下载文件大小为240M。
13 擦除分区:
fastboot erase {partition} 例:fastboot erase boot或fastboot erase system等。
14 烧写指定分区:
fastboot flash {partition} {*.img} 例:fastboot flash boot boot.img或fastboot flash system system.img等。
15 . 烧写所有分区:
fastboot flashall 注意:此命令会在当前目录中查找所有img文件,将这些img文件烧写到所有对应的分区中,并重新启动手机。
16 一次烧写boot,system,recovery分区:
(1)创建包含boot.img,system.img,recovery.img文件的zip包。
(2)执行:fastboot update {*.zip}
17 烧写开机画面:
fastboot flash splash1 开机画面
18 重启手机:
fastboot reboot
fastboot reboot-bootloader。