Tutorial Installing a Custom Recovery


Status
Not open for further replies.

Igor Eisberg

Lead Developer
Staff member
Oct 6, 2016
8,127
322
All custom recoveries come in the format of an IMG file (some are released as a flashable ZIP, like OrangeFox, but there's still an IMG inside).
However, installation method will differ, depending on where the recovery ramdisk resides on your device specifically.
Failing to install the custom recovery correctly will result in a system/recovery boot failure/malfunction or being stuck in fastboot mode.
You can usually find a custom recovery for your device HERE.

Notes:
* Never use an outdated fastboot tool. You can get the latest version HERE.
* Remember to prepend ".\" (PowerShell) or "./" (Linux/macOS) to all fastboot commands, except if you're using the Command Prompt.
* Your custom recovery image file is referred to as "recovery.img" in this guide, but the file name could be anything.

Devices with Dedicated Recovery Partitions (A/B):
These devices have dedicated "recovery_a" and "recovery_b" partitions.
The custom recovery image can be flashed to "recovery_a" and "recovery_b" partitions directly.
Flashing to "recovery_ab" will flash to both "recovery_a" and "recovery_b" with a single command.
The custom recovery will persist across ROM updates.

Platforms: Snapdragon 8/8+ Gen 1
Devices: cupid, diting, ingres, mayfly, thor, unicorn, zeus
Image size: 100 MiB (104,857,600 bytes)
Installation:
Code:
fastboot flash recovery_ab recovery.img
fastboot reboot recovery
Never try to "fastboot boot" these images. If you do that, you will get a "Bad Buffer Size" error and your device will be stuck in fastboot mode.
To get out of being stuck in fastboot mode, run these commands:
Code:
fastboot erase misc
fastboot set_active a
Then install the recovery correctly.

Devices with Boot as Recovery (A/B):
These devices don't have a dedicated partition for recovery.
The recovery ramdisk resides in the "boot_a" and "boot_b" partitions.
A shared kernel is used for both the system and the recovery.
Due to that, you should never flash a custom recovery image directly to the "boot_a" and/or "boot_b" partitions. If you do that, the system will fail to boot.

Platforms: Snapdragon 678/680/695/778G/778G+/780G/870/888/888+
Devices: alioth, haydn, lisa, mona, munch, odin, psyche, spes(n), star/mars, sunny, taoyao, thyme, venus, veux/peux, vili
Image size: 192 MiB (201,326,592 bytes), or 96/128 MiB (100,663,296/134,217,728 bytes) for low-mid devices
Installation:
Code:
fastboot boot recovery.img
In the recovery interface: Advanced -> Install Recovery Ramdisk

Devices with Vendor Boot as Recovery (A/B):
These devices don't have a dedicated partition for recovery.
The recovery ramdisk resides in the "vendor_boot_a" and "vendor_boot_b" partitions.
The recovery ramdisk includes kernel modules compiled for the specific kernel that resides in the "boot_a" and "boot_b" partitions.
Due to that, you should never flash a custom recovery image that was built for a different kernel version. If you do that, the recovery will fail to boot or malfunction.
Coincidentally, these devices don't support the "fastboot boot" command, so the custom recovery images are built to be flashed to "vendor_boot_a" and "vendor_boot_b" partitions directly.
Flashing to "vendor_boot_ab" will flash to both "vendor_boot_a" and "vendor_boot_b" with a single command.

Platforms: Dimensity 8100/8100-Ultra/9000/9000+
Devices: daumier, matisse, rubens, xaga(pro/in)
Image size: 64 MiB (67,108,864 bytes)
Installation:
Code:
fastboot flash vendor_boot_ab recovery.img
fastboot reboot recovery

Devices with a Dedicated Recovery Partition (non-A/B):
These devices have a dedicated "recovery" partition.
The custom recovery image can be flashed to "recovery" partition directly.
The custom recovery will persist across ROM updates.

Platforms: Snapdragon 662/720G/730/730G/732G/750G/765G/768G/860/865
Devices: apollo, cas, citrus, cmi, courbet, gauguin(pro), lime/lemon/pomelo, lmi(pro), monet, phoenix, picasso, surya/karna, sweet, umi, vangogh, vayu/bhima
Image size: 128 MiB (134,217,728 bytes), or 64 MiB (67,108,864 bytes) for old devices
Installation:
Code:
fastboot flash recovery recovery.img
fastboot reboot recovery
You may also "fastboot boot" these images if you don't want to install the custom recovery.

* Older devices than these fit into "Devices with a Dedicated Recovery Partition (non-A/B)" but the image size is inconsistent.
 
Status
Not open for further replies.