2

I try to install a custom ROM on my Motorola Moto E5+. To do that, I'm following this tutorial (and check what is said online on the tools used): https://www.getdroidtips.com/lineage-os-17-motorola-moto-e5-plus/. So I'm at the step where I need to flash the TWRP image, but it seems to don't work.

   $ ./adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
ZL5225HPHW  device
   $ ./adb reboot bootloader
   $ sudo ./fastboot flash recovery ../twrp-3.6.0_9-0-hannah.img
(bootloader) is-logical:recovery: not found
Sending 'recovery' (20972 KB)                      OKAY [  0.851s]
Writin 'recovery'                                  (bootloader) Image recovery failed validation
(bootloader) Preflash validation failed
FAILED (remote: '')
fastboot: error: Command failed
   $ sudo ./fastboot boot ../twrp-3.6.0_9-0-hannah.img
Sending 'boot.img' (20972 KB)                      OKAY [  0.685s]
Booting                                            (bootloader) permission denied!
FAILED (remote: '')
fastboot: error: Command failed

Original screenshot of the terminal screen

So I try to use the command: ./fastboot flash recovery ../../Downloads/twrp-3.6.0_9-0-hannah.img (I'm sudo because it doesn't recognize my phone without) and I try to boot with the image as proposed here: Can't flash custom TWRP recovery image on Motorola Moto G7 Power phone But it doesn't work either. On my phone, it says "Mismatched partition size (recovery)" when I try to flash. And when I try to boot, it just say download and boot and that it.

Btw, I download the file from here: https://twrp.me/motorola/motorolamotoe5plus.html.

So do you know what I'm missing and what I need to do? Or even if I'm doing it right?

PS: when I'm trying with the official guide of LineageOS, it's doing the same:

   $ sudo ./fastboot flash recovery ../lineage-18.1-20220104-recovery-hannah.img
(bootloader) is-logical:recovery: not found
Sending 'recovery' (15432 KB)                      OKAY [  0.666s]
Writing 'recovery'                                 (bootloader) Image recovery failed validation
(bootloader) Preflash validation failed
FAILED (remote: '')
fastboot: error: Command failed

And it's say the same on the phone:

cmd: download: number
cmd: boot
cmd: getvar:has-slot:recovery
cmd: getvar:max-download-size
cmd: getvar:is-logical:recovery
cmd: download: another number
cmd: flash:recovery
Mismatched partition size (recovery)

PS²: I'm not sure if it's recognize in the good way, since, when I try the command sudo ./fastboot devices, it's listed as ZL5225HPHW Motorola Fastboot Interface, but I'm not sure that the Motorola Fastboot Interface is good or not?

PS³: Here are some more commands and the output (I made them under the guidance of @alecxs): So here is the output:

$ sudo fastboot getvar unlocked
(bootloader) unlocked: not found
getvar:unlocked FAILED (remote failure)
finished. total time: 0.003s
$ sudo fastboot getvar securestate
securestate: oem_locked
finished. total time: 0.009s

So, what I'm understanding is that my phone is not unlocked? How I can do that?

Unixcorn
  • 31
  • 6
  • I don't know how accurate the guide on Get Droid Tips is, but there's an official guide for LineageOS on https://wiki.lineageos.org/devices/hannah/ – Andrew T. Jan 06 '22 at 13:03
  • Ho, thank @AndrewT. to your edit, I have added the other command that I'm doing before. And I will check the official guide – Unixcorn Jan 06 '22 at 13:09
  • But it doesn't work either, here is my command:
       $ sudo ./fastboot flash recovery ../lineage-18.1-20220104-recovery-hannah.img
    (bootloader) is-logical:recovery: not found
    Sending 'recovery' (15432 KB)                      OKAY [  0.666s]
    Writing 'recovery'                                 (bootloader) Image recovery failed validation
    (bootloader) Preflash validation failed
    FAILED (remote: '')
    fastboot: error: Command failed
    

    And it's say the same "Mismatched partition size (recovery)

    – Unixcorn Jan 06 '22 at 13:15
  • 2
    I'm a bit curious about the "Preflash validation failed" message. Note that we have a few questions related to that message, but I'm not sure if it may help since I don't have experience with Moto devices. – Andrew T. Jan 07 '22 at 16:01
  • Hello, sorry, I think I'm quite lost in how it's working. I was thinking I just need the file lineage-18.1-20220105-recovery-hannah.img and the image of the OS (like an iso). First of all, I'm not sure what the recovery file? And why "Sam", in the link who send @AndrewT., try to flash so many files??? – Unixcorn Jan 08 '22 at 00:06
  • And when I do the command fastboot oem fb_mode_set, this return OKAY [ 0.002s] Finished. Total time: 0.002s in my terminal and oem fb_node_set on my phone. So this one seems OK. But, when I'm doing the command sudo ./fastboot flash recovery ../lineage-18.1-20220104-recovery-hannah.img after, it's return the same error. – Unixcorn Jan 08 '22 at 21:25
  • 1
    check output of 'fastboot getvar unlocked' and 'fastboot getvar securestate' – alecxs Jan 10 '22 at 19:11
  • Hello @alecxs good idea to test these command. So here is the output: $ sudo fastboot getvar unlocked (bootloader) unlocked: not found getvar:unlocked FAILED (remote failure) finished. total time: 0.003s $ sudo fastboot getvar securestate securestate: oem_locked finished. total time: 0.009s – Unixcorn Jan 13 '22 at 19:40
  • 1
    on your linked tutorial there is a section Pre-Requirements - there you will find another link under "You will require to unlock the device bootloader at first" – alecxs Jan 13 '22 at 20:02
  • But, I did that, I have put the key from Motorola to unlock it ?? I will try it again in the next days. – Unixcorn Jan 14 '22 at 21:16
  • 1
    Ok, Thanks @alecxs, I try again to unlock the device bootloader. And there is it: ➜ ~ fastboot oem unlock ********** (bootloader) WARNING: This command erases all user data. (bootloader) Please re-run this command to continue. OKAY [ 0.002s] Finished. Total time: 0.002s ➜ ~ fastboot oem unlock ********** (bootloader) Bootloader is unlocked! Rebooting phone OKAY [ 0.165s] Finished.

    So, I run the command twice and it works, thanks

    – Unixcorn Jan 19 '22 at 23:21
  • please add your last comment to answer, thx – alecxs Jan 20 '22 at 03:46

1 Answers1

1

Thanks to @alecxs, I just don't unlock the device bootloader correctly.

I just need to run the command fastboot oem unlock ******** twice. And after that, it's working well.

Here the command and the output I have done to resolve the issue

➜ ~ fastboot oem unlock **********
(bootloader) WARNING: This command erases all user data.
(bootloader) Please re-run this command to continue.
OKAY [ 0.002s] Finished.
Total time: 0.002s
➜ ~ fastboot oem unlock **********
(bootloader) Bootloader is unlocked! Rebooting phone
OKAY [ 0.165s] Finished.

So, I run the command twice, and it works, thanks to all of you in the comments.

Unixcorn
  • 31
  • 6