Introduction to fastboot
fastboot is a way to quickly upgrade Android, fastboot protocolfastboot_protocol.txtYou can find it in the source code directory./bootable/bootloader/legacy.
fastboot is a client that is the Android system compiler. After compilation, it is located in the ./out/host/Linux-x86/bin/fastboot directory.
fastboot instance command: sudo fastboot flash kernel path-to-kernel/uImage
Firm rootfs similar to: sudo fastboot flash system path-to-system/
Cell phone split
All partitions can be burned and have corresponding img files:
- Boot the boot screen area (splash1)
- Data recovery area (recovery)
- Kernel area (boot)
- System area (system)
- Data cache area (cache)
- User data area (userdata)
Order
2.1 Check the help of fastboot command
Enter fastboot to display the following information:
update <filename> from Refresh the device flashall flash boot + recovery + system flash <partition> [ <filename> ] Write files to flash Partition erase <partition> Erase flash Partition getvar <variable> Show bootloader variables boot <kernel> [ <ramdisk> ] Download and start the kernel flash:raw boot <kernel> [ <ramdisk> ] create bootimage And refresh equipment 列出所有连接的equipment 正常重启重启equipment reboot-bootloader 将equipment重启到引导加载程序 Options: -w Erase用户数据和缓存 -s <serial number> Specifyequipment序列号 -p <product> Specify product name -c <cmdline> Overwrite the kernel command line -i <vendor id> Specify customization USB supplier id -b <base_addr > Specify customization内核基地址 -n <page size> Specifynand Page size。default value:2048</span></span></span></span>
2.2 Partition: fastboot erase <partition>
sudo fastboot Erase boot xx/ $ sudo fastboot Erase system xx/ $ sudo fastboot Erase user data xx/ $ sudo fastboot Erase cache xx/</span></span></span></span>
2.3 Fry the specified partition: fastboot flash <partition> [*.img]
$ sudo fastboot flash boot path-to-kernel/ $ sudo fastboot flash zimage path-to-kernel/arch/arm/boot/zImage $ sudo fastboot flash system path-to-system/ $ sudo fastboot flash splash1Guide screen</span></span></span></span>
2.4 Firm all partitions: fastboot flashall
Note: This command will find all img files in the current state, write these imgs into files in all directories, and then restart the phone.
sudo fastboot flashall
2.5 Burn the boot, system, recovery partition at once: fastboot update <*.zip>
Create a file containing,.
sudo fastboot update
2.6 Restart the phone
sudo Quick start and restart
2.7 Start the system with the specified img or bin, usually used for debugging
In addition to flashing eMMC, Fastboot can also be used to boot from files that have been flashed into eMMC. To do this, start Fastboot on the target and run the command on the host PC, such as starting u-boot:
sudo fastboot guide
2.8 Update the eMMC partition
The regions in the eMMC are named. Their offset and size are set in u-boot in the file of the board directory you are using. For example, for Blaze, this file is u-boot/board/omap4430sdp/:
static struct partition partitions[] = { { "-", }, { "xloader", }, { "bootloader", }, /* "misc" partitions is required for recovery */ { "misc", }, { " -", }, { "efs", }, { "recovery", * }, { "boot", * }, { "system", * }, { "cache", * }, { "userdata", } , { , }, };
Modify the above and execute:
sudo fastboot oem Format
2.9 Exit fastboot
- Usb
- Ctrl+C
- Resignation order
#fastboot 100 or #fastboot </span></span>
2.10 Get information client (mobile side)
sudo fastboot getvar version:version-bootloader:version-baseband:product:serialno:secure
Use after getvar and parameters: used separately, their meanings are as follows:
Version | Fastboot protocol version supported by the client |
Version bootloader | Bootloader version number |
Version baseband | Baseband version |
product | Product Name |
Serial number | Product serial number |
Safe | Return yes means that the signature needs to be obtained when flashing the machine |
2.11 How to check whether fastboot succeeds
Fastboot usually supports environment nand flash. Fastboot is written to variables, named quantities and sizes and writes environment variables.
- <partition name>_nand_offset
- <partition name>_nand_size
For example, after the kernel burn is completed, printenv can see:
- kernel_nand_offset=0x140000
- kernel_nand_size=0x1f70000
2.12 Offsets and addresses defined in u-boot
Name | offset | size | File Type | Normal files |
Loader | 0x00000000 | 0x00080000 | xloader binary file | MLO |
Bootloader | 0x00080000 | 0x00180000 | uboot binary | |
environment | 0x001C0000 | 0x00040000 | Text file | List of variables to set |
core | 0x00200000 | 0x01D00000 | Kernel or kernel + ramdisk | uImage、uMulti |
system | 0x02000000 | 0x0A000000 | yaffs2 | System.img |
User data | 0x0C000000 | 0x02000000 | yaffs2 | User data.img |
cache | 0x0E000000 | 0x02000000 | yaffs2 | ? |
fastboot reuses the kernel's Nand address allocation, and objects can be changed, but the xloader, bootloader, and environment addresses are unchanged.
2.13 File size limit
The maximum download file size is 240M.
This is the article about the introduction of fastboot Android burn command. For more related contents of the android fastboot command, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!