[Huawei P10 Guides, News, & Discussion] Jannomag:
Hi,

this is a small tutorial to show you how to flash the recovery, also eRecovery, via command line / adb shell within Android.

Flashify and other apps never worked for me, so I used commands to flash it without the need of fastboot.

It's a small tutorial for those who never worked with commands like this.

Please notify me if something went wrong or if you found any other issues.

I wanted to make a small script but I stopped it because of the lack of available commands in Android.

DISCLAIMER:

Read this tutorial first.

Never flash custom recovery to eRecovery.

Never flash recoveries from different devices.

Don't try to flash other partitions with this commands if you don't want to risk a brick.

Requirements:

- Oreo / EMUI 8 installed, Nougat hast other partition names. Pie isn't supported by me until final release.

- working root access

- terminal emulator app (I recommend Termius, it's easy to use and has nice features, it's free to use)

> or a PC, and USB cable and working ADB, also USB Debugging enabled in developer settings

- recovery img files on your phone, I recommend it to put them into your user root /data/media/0/ (internal memory)

NOTE: All commands are case sensitive!

Now open your terminal app or open the adb shell.

Type following command to enable root access:

su

SuperSU will ask you for root access, grant it.

Following command is needed to figure out, which type of memory your phone has:

ls /dev/block/platform

There are two possible outputs:

If you've a device with the faster UFS memory, it's ff3b0000.ufs, if eMMC it's hi_mci.0.

From now I'll write MEMORY instead of ff3b0000.ufs or hi_mci.0.

For flashing the recovery fire up following command:

dd if=/PATH/TO/YOUR/RECOVERY.IMG of=/dev/block/platform/MEMORY/by-name/recovery_ramdisk_a

Example: dd if=/data/media/0/twrp_3.2.1.img of=/dev/block/platform/ff3b0000.ufs/by-name/recovery_ramdisk_a

The output should look like this:

65536+0 records in
65536+0 records out
33554432 bytes transferred in 0.247 secs (135847902 bytes/sec)

If not, check your command and file paths.

For flashin the eRecovery fire up following command:

dd if=/PATH/TO/YOUR/ERECOVERY.IMG of=/dev/block/platform/MEMORY/by-name/erecovery_ramdisk_a

Example: dd if=/data/media/0/ERECOVERY_RAMDI.IMG of=/dev/block/platform/ff3b0000.ufs/by-name/erecovery_ramdisk_a

IMPORTANT NOTE: DO NOT INSTALL TWRP IN THIS! Flash only stock eRecovery!

The dd command won't give you any progress output, so be a bit patient. It should be done in a few second, but don't close the terminal app or connection before you got any output.

Unix systems like Android will give an output if something went wrong, always.

I use this to flash new TWRP versions or to flash stock recovery before I update.

If you recently updated your phone, you still need to flash via fastboot, because you lost root during the update.

The dd commands also work with fastboot. Mostly you'll use "fastboot flash recovery_ramdisk", but if you need to flash eRecovery, you can use the dd command.

23. February 2019:

Pie should also work, but you have to remove the "_a" after the partition name.

Example:

dd if=/data/media/0/twrp_3.2.1.img of=/dev/block/platform/ff3b0000.ufs/by-name/recovery_ramdisk

Please report if it's working or not.