What is the difference between android flashing through fastboot & recovery
Partition of Android system
The Android system generally divides the rom chip into 7 areas. If you add the built-in sd card partition, it will be 8:
1. Hboot partition //for booting.
2. Radio partition //for the driver.
3. Recovery partition //for recovery.
4. Boot partition //system kernel.
5. System partition //system files.
6. Cache partition //system cache.
7. Userdata partition //user data.
The 7 partition mainly installs some software and is a partition that users can use. The size of this partition directly affects the amount of software that can be installed. That is to say, the Userdate partition is what we often call "available rom". In Android, although the software can be installed to the SD card, some system software such as desktop software and desktop display plug-ins are best installed in the Userdata partition, otherwise there will be some loading problems. And even if you install all the software on the card, the Userdata partition will continue to be shrinked. Just like in the computer, even if you install the software to the D drive, some system files will still be generated in the C drive.
BootLoader
Simply put, BootLoader is a small program that runs before the operating system kernel runs. Through this small program, we can initialize the hardware device and establish the memory space map, so as to bring the software and hardware environment of the system to a suitable state, so as to prepare the correct environment for the final call to the operating system kernel.
In embedded systems, there is usually no firmware program like BIOS (note that some embedded CPUs also have a short startup program embedded), so the loading and starting tasks of the entire system are completely completed by BootLoader. For example, in an embedded system based on ARM7TDMI core, the system usually starts to execute from address 0x00000000 when it is powered on or reset, and the BootLoader program of the system is usually arranged at this address.
BootLoader & FastBoot
Literally speaking, Fastboot means "fast boot". Fastboot can be said to be a communication protocol, through which the computer can directly write files (.img) to different partitions of the mobile phone system.
Fastboot is mainly used as a PC command line tool for USB communication with Bootloader.It is generally mainly used to transfer flash files to Bootloader for file partition reburning. Therefore, when using it, there must be a PC and the USB cable must always be connected.
Bootloader support is required to use Fastboot, however, not every company's products support this feature.
Usually the Fastboot that everyone talks about usually refers to the Fastboot mode of Android phones. In Android phones, Fastboot is a lower-level flashing mode than Recovery. Simply put, it is a flashing mode that uses a USB data cable to connect to a computer.
In addition, Android phones also have a flashing method called "card flashing". The difference between the two is as follows:
Fastboot Flashing: Write the .img file directly to the hard disk of the mobile phone. I personally think this method is quicker and less troublesome. But you must use a computer and data cable.
Card Flashing: It is to use the function of Recovery to update the system from the SD card. If you want to flash a third-party ROM, you must flash a third-party Recovery. Only Fastboot mode can flash recovery.img. There is a limit to the card flashing, you must copy the ROM (Android system) you want to update to the SD card. If the phone is already bricked. It can only be flashed with Fastboot.
How to enter Fastboot (bootloader) mode?
1. Most Android phones can be turned off, then press and hold the [Power] button + [Volume +] button at the same time, about 2-3s later, you can enter Fastboot mode.
2. As a developer, you can type the following command when the phone is turned on:
adb reboot bootloader
.
Then you can execute the following Fastboot commands:
fastboot flashing unlock
//Device unlock.
fastboot erase {partition}
//Erase partition.
fastboot erase frp
//Erase the frp partition, frp is Factory Reset Protection, which is used to prevent user information from leaking after the phone is lost.
fastboot flash boot boot.img
//Flash the boot partition.
fastboot flash system system.img
//Flash the system partition.
fastboot flash recovery recovery.img
//Flash the recovery partition.
fastboot flashall
//Burn all partitions, note: This command will find all img files in the current directory, burn these img files to all corresponding partitions, and restart the phone.
fastboot format data
//Format the data partition.
fastboot flashing lock
//Lock the device, and the flashing is complete.
fastboot continue
//Reboot the device automatically.
fastboot reboot
//Reboot the device.
fastboot reboot-bootloader
//Reboot to bootloader.
fastboot devices
//Discover mobile phones, showing which mobile phones are currently connected through fastboot.
Burn the Boot, System, and Recovery partitions at one time.
1. Create a zip package containing boot.img, system.img, recovery.img files.
2. Execute fastboot update {*.zip}
command.
Introduction to Recovery Mode
Recovery is more like a small management system. But the function is simple and the management is limited. In the Recovery mode, part of the file system will be loaded, so you can read the update.zip in the SD card for flashing. Of course, you can also clear the cache and user data.
This mode can be modified according to the needs of users, so there are official Recovery modes and third-party Recovery modes. The third-party Recovery mode can recognize third-party ROM packages, so it can be used to flash the device. The official Recovery generally does not recognize third-party zip files.
When flashing with Recovery, the flashing package is usually placed in the SD card, so the flashing here is generally called card flashing.
Flash the REC
1. Enter the bootloader (fastboot) mode;
2. fastboot flash recovery recovery.img
.