Skip to main content

Is it possible to flash a custom ROM without a custom recovery image [Resolved]

For an un-rooted device, almost all articles/forum posts I've read say that in order to flash a custom ROM you first need to flash (or boot) a custom recovery image like TWRP.

I'm not sure I understand why. If the bootloader is unlocked shouldn't it be possible to manually flash images that make up the custom ROM to the required partitions with fastboot flash [ ], and leave the stock recovery untouched.

I realize that this may be difficult and that there is no benefit in doing it this way, but I'm curious to know whether or not it is possible, and if not, why?


Question Credit: catanman
Question Reference
Asked February 11, 2019
Posted Under: Android
84 views
2 Answers

This question isn't as straightforward as it seems. The answer really depends on the contents of the custom ROM zip (assuming it comes in zip format) that you're trying to flash.

Most custom ROMs are not provided as image files. While almost all custom ROM zips include a boot.img which includes the kernel and is fastboot flashable, the system portion is where you run into an issue without a custom recovery. Stock-based custom ROMs typically include system files in a folder, which a custom recovery (like TWRP) will then extract to the system partition of the device. There is no way to complete that operation via fastboot. In order to flash such a system using fastboot, you would have to create an empty image based on the size of your system partition, format it using the expected filesystem for your device, loop mount it to a folder (if using a Linux system - in Windows you may have trouble finding a tool to do this, though OSFMount may work), and then copy the contents to that folder, so that they are included in the image. Once you unmount the image, you'll have a raw system image of the custom ROM that is flashable via fastboot. See an example of this process described here.

For AOSP-based custom ROMs, system files are typically included as a block-based full OTA dat (or dat.br) file. These can also be converted into an image file, using a tool like sdat2img for a dat file, and the same tool for a dat.br file, after using the Brotli tool to decompress it.

As you can see, while it is possible to flash a custom ROM without a custom recovery, it's certainly simpler to use one, especially since most custom ROM zips are built with the expectation that a custom recovery is how it will be installed.


credit: Captain_Throwback
Answered February 11, 2019

Yes it is possible to flash images via Fastboot ?

With an unlocked bootloader you should be able to flash some partitions without overwriting the stock recovery, however each system usually requires a unique recovery to handle factory resets etc..

I have had issue's in the past with Maximum flash size, it wouldn't let me use Fastboot because my system.IMG file was too large to send via Fastboot.. That then required splitting the image into smaller files and flashing the smaller files.

You don't specifically need a custom recovery, however it makes everything a lot easier... For example, most custom firmware requires you to do a full backup of your device prior to installing, you need a custom recovery or rooted device to be able to make a full backup...

Why do they say " Use a custom recovery " ... Well this is probably determined by the firmware creator, they've most likely built everything into a single Flashable Zip file, using Fastboot won't work because the zip file contains more than just .IMG files, usually a ZIP firmware will have a folder called system, the system folder is copied to your device by the recovery, not flashed .. each firmware usually contains 3 parts ( boot.IMG, System folder, additional files)... However some firmware's contain a complete system.IMG file instead of a folder.. These files can be pulled from the firmware and flashed via Fastboot, however Fastboot can not flash folders ( only a custom recovery can do that )

... I'm starting to get lost here...


credit: Zillinium
Answered February 11, 2019
Your Answer
D:\Adnan\Candoerz\CandoProject\vQA