[ROOT] How to flash recovery within Android with terminal / adb shell - Huawei P10 Guides, News, & Discussion

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:
Code:
su
SuperSU will ask you for root access, grant it.
Following command is needed to figure out, which type of memory your phone has:
Code:
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:
Code:
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:
Code:
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:
Code:
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.

How to know the path to the recovery_ramdisk?? Is all devices the same?? I didn't get it right the 1st time .. it shows path is invalid
Sent from my VTR-L29 using Tapatalk

fr3ker said:
How to know the path to the recovery_ramdisk?? Is all devices the same?? I didn't get it right the 1st time .. it shows path is invalid
Sent from my VTR-L29 using Tapatalk
Click to expand...
Click to collapse
Should be the same on every device. Remember, case sensitive and use _ and not -.
Maybe it's different on non UFS devices, which one do you have?
Are you able to post a screenshot of your command and output?

Jannomag said:
Should be the same on every device. Remember, case sensitive and use _ and not -.
Maybe it's different on non UFS devices, which one do you have?
Are you able to post a screenshot of your command and output?
Click to expand...
Click to collapse
Maybe @fr3ker is not on Oreo? The recovery_ramdisk partition is only for Oreo. In Nougat it is just called recovery. I don't know how the Pie partitions are called.

M1chiel said:
Maybe @fr3ker is not on Oreo? The recovery_ramdisk partition is only for Oreo. In Nougat it is just called recovery. I don't know how the Pie partitions are called.
Click to expand...
Click to collapse
Also my thought, I wanted to add this to the requirements when I created this post but apparently I forgot this. Now it's added as first point.

Hi.
I have a hard bricked p10. When I connect to laptop it's says USB SER. It doesn't not turn on I can't access recovery with power + vol. I can't get into fastboot. Anyway I can access fastboot to flash kernel and erecovery?

Jannomag said:
I use this to flash new TWRP versions or to flash stock recovery before I update.
Click to expand...
Click to collapse
Is it mandatory to flash stock recovery before update? Is it applies only to ota update or ff method?

Yes, FF or OTA are using stock recovery to flash the update. With TWRP it won't work.

Updated?
@ Jannomag:
Have you checked this for Pie meanwhile?
I currently have the problem, not being able to enter fastboot with:
Code:
sudo adb reboot bootloader
Additionally, there's something I do not understand. For the dd-command for flashing, why is the input-file (if=) the file in "/dev/block/platform/..." and the output on the sd-card? Wouldn't mean flashing an img to the device, that if= on the sd (or connected PC) and of= the path to the device (phone)?

Blümchen Blau said:
@ Jannomag:
Have you checked this for Pie meanwhile?
I currently have the problem, not being able to enter fastboot with:
Code:
sudo adb reboot bootloader
Additionally, there's something I do not understand. For the dd-command for flashing, why is the input-file (if=) the file in "/dev/block/platform/..." and the output on the sd-card? Wouldn't mean flashing an img to the device, that if= on the sd (or connected PC) and of= the path to the device (phone)?
Click to expand...
Click to collapse
WTF....Why didn't I notice this terrible mistake! Thank you for reading my post completely, you're 100% correct, I'll correct this directly after I submit this post.
Huawei did also a small change at naming the recovery partition, which I'll update, too.
I had also the problem that I wasn't able to boot into fastboot by command before I fried my phone - I couldn't figure out the reason for this.
Again, thank you!

Jannomag said:
Again, thank you!
Click to expand...
Click to collapse
Your'e welcome! I did update now, but didn't need your (correct ) way to fastboot, because the method described by borgerapper did the trick for me to get into fastboot and flash the needed original recovery.
Thanks anyway!

Related

KindleFire Bootloop

Hi Guys,
I have been reading and trying this for two weeks now and Im lost still. Never had an issue where I just couldnt figure it out now i need to ask for some help. I have a Kindle Fire HDX 7 ITS BEEN ROOTED AND USED FOR ABOUT A YEAR NOW WITH NO ISSUES. I decided to upgraade the ROM and installed the wrong version (apollo) how I done that is becide me, anyway now Im stuck in bootloop grey kindlefire screen. I do have ADB working whoever it is in a loop state so I have to be quick to insert commands. My bootloader is locked so im limited. I also am able to get into Fastboot and it works and also verified the device is locked. I have my download size 0x20000000 and I have my manfid 0x000045 and my device serial 0xf0bf7e1d . I just cant get the img created correctly or size correct c
would someone help me with the file creating and flashing procedure in fastboot to get my device working again? Im pure crosseyed at this point and about to use the Kindle as a Target at the range lol.
Thanks to anyone that can help
Which Fire OS version is on your HDX? The wrong Apollo version? Note that bootloader unlock is possible from 3.1.0 to 3.2.3.2 only.
The bootloader unlock procedure ist described here (might require these drivers). Note that you have to install the software mentioned, download the script and use it with your ID and serial to create the .unlock file.
Cl4ncy said:
Which Fire OS version is on your HDX? The wrong Apollo version? Note that bootloader unlock is possible from 3.1.0 to 3.2.3.2 only.
The bootloader unlock procedure ist described here (might require these drivers). Note that you have to install the software mentioned, download the script and use it with your ID and serial to create the .unlock file.
Click to expand...
Click to collapse
is there a commant in ADB or Fastboot that will tell me the OS Version?
iv got the product THOR
getvar version 0.5
Kernal 1K
getvar production 1
getvar serialno D0FBA0A03464QM7Q
GETVAR MAX DOWNLOAD 0X20000000
bowman1966 said:
is there a commant in ADB or Fastboot that will tell me the OS Version?
iv got the product THOR
getvar version 0.5
Kernal 1K
getvar production 1
getvar serialno D0FBA0A03464QM7Q
GETVAR MAX DOWNLOAD 0X20000000
Click to expand...
Click to collapse
I don't know, I'd hoped you'd still have the Apollo update file you flashed - it should have the version number right there in its file name.
Cl4ncy said:
I don't know, I'd hoped you'd still have the Apollo update file you flashed - it should have the version number right there in its file name.
Click to expand...
Click to collapse
ill check for the file but my issue now is the steps in Python27 for creating a file , i created but wrong size wrong number that kind of issue. Was hoping I could get someone to do a step by step in order using the cuberHDX.py
bowman1966 said:
ill check for the file but my issue now is the steps in Python27 for creating a file , i created but wrong size wrong number that kind of issue. Was hoping I could get someone to do a step by step in order using the cuberHDX.py
Click to expand...
Click to collapse
Well, if you don't have 3.1.0 - 3.2.3.2 it doesn't make any sense anyway, but ...
it's easier than you think.
You open a DOS box, change dir to your ADB directory (enter cd\adb) then enter the following commands:
adb shell
cat /sys/block/mmcblk0/device/manfid
cat /sys/block/mmcblk0/device/serial
then open another DOS box, change dir to your Python Directory with the .py script (enter cd\python27 or whatever the path of your Python directory is), then
python.exe cuberHDX.py 0xmmssssssss
with mm being the last two digits of your ID, and the ssssssss being your serial, the script should create the .unlock file then.
So assuming the numbers you mentioned are correct the python command would be
python.exe cuberHDX.py 0x45f0bf7e1d
Copy/move the .unlock file to your ADB directory then, open another DOS box for the adb reboot-bootloader command, and yet another DOS box for the fastboot commands (change dir cd\adb both times before you enter the adb & fastboot commands):
fastboot -i 0x1949 devices
fastboot -i 0x1949 flash unlock 0xmmssssssss.unlock
fastboot -i 0x1949 reboot
Cl4ncy said:
Well, if you don't have 3.1.0 - 3.2.3.2 it doesn't make any sense anyway, but ...
it's easier than you think.
You open a DOS box, change dir to your ADB directory (enter cd\adb) then enter the following commands:
adb shell
cat /sys/block/mmcblk0/device/manfid
cat /sys/block/mmcblk0/device/serial
then open another DOS box, change dir to your Python Directory with the .py script (enter cd\python27 or whatever the path of your Python directory is), then
python.exe cuberHDX.py 0xmmssssssss
with mm being the last two digits of your ID, and the ssssssss being your serial, the script should create the .unlock file then.
So assuming the numbers you mentioned are correct the python command would be
python.exe cuberHDX.py 0x45f0bf7e1d
Copy/move the .unlock file to your ADB directory then, open another DOS box for the adb reboot-bootloader command, and yet another DOS box for the fastboot commands (change dir cd\adb both times before you enter the adb & fastboot commands).
Click to expand...
Click to collapse
thanks for the help, Well I guess I have been doing this correctly the whole time. Still getting Unload code not correct in fastboot, so apparently I have the noncapadible bootloader.
is there anything I can do with it besides taking it to the range for target practice?
bowman1966 said:
thanks for the help, Well I guess I have been doing this correctly the whole time. Still getting Unload code not correct in fastboot, so apparently I have the noncapadible bootloader.
is there anything I can do with it besides taking it to the range for target practice?
Click to expand...
Click to collapse
Difficult to say, but it doesn't look good.
Did you figure out which Apollo update you flashed? Did you have Safestrap installed (probably not)?
Cl4ncy said:
Difficult to say, but it doesn't look good.
Did you figure out which Apollo update you flashed? Did you have Safestrap installed (probably not)?
Click to expand...
Click to collapse
apollo-nexus-rom-v2.0.5.zip yep the apollo version and it clearly says not to install with safstrap its a target now i just hate the fact that I have access to the bootloader but cant do anything with it
bowman1966 said:
apollo-nexus-rom-v2.0.5.zip yep the apollo version and it clearly says not to install with safstrap its a target now i just hate the fact that I have access to the bootloader but cant do anything with it
Click to expand...
Click to collapse
¡Ay caramba!
It says not for Safestrap, because it says "This is for users with TWRP installed." in the introduction. Do you have TWRP installed? That would help of course. How did you flash the Apollo ROM anyway?
Cl4ncy said:
¡Ay caramba!
It says not for Safestrap, because it says "This is for users with TWRP installed." in the introduction. Do you have TWRP installed? That would help of course. How did you flash the Apollo ROM anyway?
Click to expand...
Click to collapse
yes I do have TWRP installed,I used it to install the zip file
bowman1966 said:
yes I do have TWRP installed,I used it to install the zip file
Click to expand...
Click to collapse
Then start TWRP (press and hold Volume up and Power On, release when the Kindle Fire logo appears on the screen), connect the HDX to your PC, download the Thor ROM, copy it to the HDX, and flash it in TWRP.
Kinda weird though you can not unlock the bootloader. You sure you have the real TWRP installed?
Cl4ncy said:
Then start TWRP (press and hold Volume up and Power On, release when the Kindle Fire logo appears on the screen), connect the HDX to your PC, download the Thor ROM, copy it to the HDX, and flash it in TWRP.
Kinda weird though you can not unlock the bootloader. You sure you have the real TWRP installed?
Click to expand...
Click to collapse
I sure wish I could start TWRP ,the unit is in a bootloot grey kindle fire screen.Just reboots
bowman1966 said:
I sure wish I could start TWRP ,the unit is in a bootloot grey kindle fire screen.Just reboots
Click to expand...
Click to collapse
Tried to re-flash TWRP via adb? Dunno if flashing Apollo Nexus ROM could destroy TWRP. Do you know which Fire OS you were running when you installed TWRP, and before you flashed the Apollo Nexus ROM?
Cl4ncy said:
Tried to re-flash TWRP via adb? Dunno if flashing Apollo Nexus ROM could destroy TWRP. Do you know which Fire OS you were running when you installed TWRP, and before you flashed the Apollo Nexus ROM?
Click to expand...
Click to collapse
Man its been about a year or so since I rooted , I know I had to roll the update back before I could load the twrp rom.etc. I think it was the first Nex rom that was stable with kdx7
Cl4ncy said:
¡Ay caramba!
It says not for Safestrap, because it says "This is for users with TWRP installed." in the introduction. Do you have TWRP installed? That would help of course. How did you flash the Apollo ROM anyway?
Click to expand...
Click to collapse
thats right I did have TWRP , I used it to install the file.
remote unlock code is not correct, would that mean my bootloader is updated and not repairable at this time? my date size is 0x20000000 i keep sending 536870912 to it, this is the problem correct?
When i create the unlock .img file and flash the device goes through the motion of loading but fails saying the the unlock code is not correct. The file size is 536870912 and the kindle fastboot says its 0x20000000. Is this the problem? Am I using the wrong cuberHDX file or what any help would be greatly appreciated.
bowman1966 said:
When i create the unlock .img file and flash the device goes through the motion of loading but fails saying the the unlock code is not correct. The file size is 536870912 and the kindle fastboot says its 0x20000000. Is this the problem? Am I using the wrong cuberHDX file or what any help would be greatly appreciated.
Click to expand...
Click to collapse
What do you mean the file size is 536870912? The file size of the .unlock file should be 256 bytes.
Did you install all software mentioned in the unlock thread, i.e. Python 2.7 and GMPY2 for Python 2.7?
Yes and Yes, I DID exactly like thread said and I get that file size...... 536870912 doesnt matter what T F I D....either.....I dont understand whats happening here but I guess its just my luck...... Been doing this for about 3 years now I guess Its time for me to BRICK ONE lol......................

Nabi Jr S (SNBJR-MT5C) Help getting TWRP Running

Okay, so after a lot of reading I'm still unable to get TWRP to flash on this device.
Thus far I've got full root with Kingo, Updated SU Binaries, and Busybox installed.
Upon the recovery portion of the process, I adb reboot into bootloader, but my fastboot driver doesn't seem to be quite correct. My computer will see it as an ADB Interface, but if I try
"fastboot flash recovery.img"
it will just hang on "Waiting for Device."
NabiLab doesn't ever see anything with "fastboot devices" either.
Anyone have any suggestions? I'm not an expert by any means, but if someone needs me to dump anything from my model I'd be more than willing. Oh, I also have a copy of the Source for this model as well.
Corbow6 said:
Okay, so after a lot of reading I'm still unable to get TWRP to flash on this device.
Thus far I've got full root with Kingo, Updated SU Binaries, and Busybox installed.
Upon the recovery portion of the process, I adb reboot into bootloader, but my fastboot driver doesn't seem to be quite correct. My computer will see it as an ADB Interface, but if I try
"fastboot flash recovery.img"
it will just hang on "Waiting for Device."
NabiLab doesn't ever see anything with "fastboot devices" either.
Anyone have any suggestions? I'm not an expert by any means, but if someone needs me to dump anything from my model I'd be more than willing. Oh, I also have a copy of the Source for this model as well.
Click to expand...
Click to collapse
You will manually have to force the Windows driver from ADB to fastboot, if you are truly in fastboot, thats why it hangs at waiting for device. What recovery are you flashing? Did someone make a recovery for that version that I missed somewhere?
Ah, I thought that might be the case, but I was a little unsure of how to go about that. I believe it truly is in fastboot, but no I don't believe anyone has specifically written a recovery for this model. Hoping to be able to use some that were compatible with the other Nabi models.
Corbow6 said:
Ah, I thought that might be the case, but I was a little unsure of how to go about that. I believe it truly is in fastboot, but no I don't believe anyone has specifically written a recovery for this model. Hoping to be able to use some that were compatible with the other Nabi models.
Click to expand...
Click to collapse
If you haven't already overwritten the stock recovery. You can get some stuff off the tablet if you have root and we could try and make a TWRP.
adb shell
su
dd if=/dev/block/platform/sdhci-tegra.3/by-name/SOS of=/sdcard/recovery.img
It's also good to do a
cat /proc/partitions
and save partitions info. Upload the recovery.img(it should be on your internal storage and not always visible depending on with what you are viewing the contents) and partition info.
aicjofs said:
If you haven't already overwritten the stock recovery. You can get some stuff off the tablet if you have root and we could try and make a TWRP.
adb shell
su
dd if=/dev/block/platform/sdhci-tegra.3/by-name/SOS of=/sdcard/recovery.img
It's also good to do a
cat /proc/partitions
and save partitions info. Upload the recovery.img(it should be on your internal storage and not always visible depending on with what you are viewing the contents) and partition info.
Click to expand...
Click to collapse
since there are few posts about this model of nabi jr, please checkit out this guide i made to install gapps : http://forum.xda-developers.com/android/development/guide-manually-install-play-store-fuhu-t3435200
help to improve and test would be apreciated.
You will manually have to force the Windows driver from ADB to fastboot,
Click to expand...
Click to collapse
can someone explain exactly how to do that?
slplsnphx said:
can someone explain exactly how to do that?
Click to expand...
Click to collapse
Most of this thread doesn't make sense, since there is no TWRP for this device. It's a Mediatek CPU and a lot of these things we have listed are for Nvidia devices.

Bootloop into twrp

Hi everyone,
i have the problem that i tried to install custom rom over twrp recovery ( root installed also ).
Installation starts and finishes.
On Reboot i always get back into recovery....
No chance anymore to install any custom rom.
What can be done to solve this ?
FranzB said:
Hi everyone,
i have the problem that i tried to install custom rom over twrp recovery ( root installed also ).
Installation starts and finishes.
On Reboot i always get back into recovery....
No chance anymore to install any custom rom.
What can be done to solve this ?
Click to expand...
Click to collapse
Just LGUP kdz bro
Sent from my LGE LG-H830 using XDA Labs
Hi
thks for answer But i get error message "no handset .... " when starting lgup
FranzB said:
Hi
thks for answer But i get error message "no handset .... " when starting lgup
Click to expand...
Click to collapse
Search for dd commands in the CM 14.1 thread on one of the last few pages. I've used these on my g3, g4 and G5 and its worked to reboot to system.
FranzB said:
Hi
thks for answer But i get error message "no handset .... " when starting lgup
Click to expand...
Click to collapse
You try flashing Twrp update? I did and started getting bootloops
Sent from my LGE LG-H830 using XDA Labs
It's been confirmed if you bootloop twrp
Connect usb then on computer run adb shell
And the 2 commands at bottom of op posts bout rooting: http://forum.xda-developers.com/tmobile-lg-g5/development/root-h830-t3384526
They're the 2 commands beginning with dd one at a time and hit enter. Also, skip running su command. No need in recovery it's already good to go just copy/paste each one in to a command prompt with adb shell and should fix just bought phone today and saw this myself.
RealPariah said:
It's been confirmed if you bootloop twrp
Connect usb then on computer run adb shell
And the 2 commands at bottom of op posts bout rooting: http://forum.xda-developers.com/tmobile-lg-g5/development/root-h830-t3384526
They're the 2 commands beginning with dd one at a time and hit enter. Also, skip running su command. No need in recovery it's already good to go just copy/paste each one in to a command prompt with adb shell and should fix just bought phone today and saw this myself.
Click to expand...
Click to collapse
Thank you very much bro. These two dd commands did it for me. But my directory was different .../platform/soc/624000.ufshc
I also have this problem after I tried to flesh H850 20A OPEN EU.
You can maybe explain to me how you overcame it ??
yossiyemin said:
I also have this problem after I tried to flesh H850 20A OPEN EU.
You can maybe explain to me how you overcame it ??
Click to expand...
Click to collapse
I installed H850 20 A too. But i always got into twrp after reboot.
I connected my lg with pc ( usb ). In TWRP "Advanced" - "Terminal" i wrote these two dd statements.
First i got error - directory was wrong !
I did these two statements one after another:
dd if=/dev/zero of=/dev/block/platform/soc/624000.ufshc/by-name/misc
dd if=/dev/zero of=/dev/block/platform/soc/624000.ufshc/by-name/fota
and afterwards
reboot
Without entering twrp my phone installed H850 20A OPEN EU
Btw: My phone was locked again after this procedure and i had to unlock again, install twrp and supersu
RealPariah said:
It's been confirmed if you bootloop twrp
Connect usb then on computer run adb shell
And the 2 commands at bottom of op posts bout rooting: http://forum.xda-developers.com/tmobile-lg-g5/development/root-h830-t3384526
They're the 2 commands beginning with dd one at a time and hit enter. Also, skip running su command. No need in recovery it's already good to go just copy/paste each one in to a command prompt with adb shell and should fix just bought phone today and saw this myself.
Click to expand...
Click to collapse
Absolutely awesome advice/info - THANKS Pariah! :good:
I did the exact command on a h850 with linage and twrp and now I get a phone is corrupt and will not boot message. I hate this phone so much.
FranzB said:
Hi
thks for answer But i get error message "no handset .... " when starting lgup
Click to expand...
Click to collapse
Use UpperCut for flashing by LGUP
FranzB said:
I installed H850 20 A too. But i always got into twrp after reboot.
I connected my lg with pc ( usb ). In TWRP "Advanced" - "Terminal" i wrote these two dd statements.
First i got error - directory was wrong !
I did these two statements one after another:
dd if=/dev/zero of=/dev/block/platform/soc/624000.ufshc/by-name/misc
dd if=/dev/zero of=/dev/block/platform/soc/624000.ufshc/by-name/fota
and afterwards
reboot
Without entering twrp my phone installed H850 20A OPEN EU
Btw: My phone was locked again after this procedure and i had to unlock again, install twrp and supersu
Click to expand...
Click to collapse
Be careful, I completely bricked my phone attempting this.... only boot option was to go into the "Software Updating" screen. There was no working OS / Recovery / Fastboot at all.
Previously I've used LG Bridge to do full restore to LG stock image, then start again with OEM unlock, TWRP and then Lineage, but LG Bridge couldn't recover it (or detect it!) and although LGUP would detect it, it took me down a pretty long and messy path of having to download a lot of utilities to convert the stock image to something that LGUP would use and that kept failing 5-10% in to the update... so I ended up sending the phone off to be restored by somebody else (and cost myself £80).
FranzB said:
I installed H850 20 A too. But i always got into twrp after reboot.
I connected my lg with pc ( usb ). In TWRP "Advanced" - "Terminal" i wrote these two dd statements.
First i got error - directory was wrong !
I did these two statements one after another:
dd if=/dev/zero of=/dev/block/platform/soc/624000.ufshc/by-name/misc
dd if=/dev/zero of=/dev/block/platform/soc/624000.ufshc/by-name/fota
and afterwards
reboot
Without entering twrp my phone installed H850 20A OPEN EU
Btw: My phone was locked again after this procedure and i had to unlock again, install twrp and supersu
Click to expand...
Click to collapse
Hey,
i also ran into a revocery bootloop and just tried out you two commands. Both replied something like "no space left...". After rebooting the phone now i am stuck with a even worse bootloop saying
[750]
[800]
[850] Boot verfifaction fail
[900] - cause MISMATCH_SIG_LEN
[950]
[1000]
I am not even able to boot into Recovery any more.....Is it now trash?!
I was able to recover it after hours of google and several tools and combinations of it when i finally found a solution that worked. Hopefully nothing is broken in the back that will "fall on my feet" someday...
!!! Solution !!!
Hi,
Today I faced the same problem and after google-ing and reading trough the forums I found the right command that has to be used in this case scenario, which I tried and all worked like a charm!
So if anybody faces twrp bootloop enter this inside terminal window in twrp:
Code:
dd if=/dev/zero of=/dev/block/bootdevice/by-name/misc bs=256 count=1 conv=notrunc
Using the first commands staded above wipes your misc partition and then you end up with a Mac address that changes in every reboot!!! So don't use the first two commands stated above and use this one I posted here. Credits goes to jeffsga88 !!!
Thanks !
Yesterday I encountered the same bootloop after trying to perform an update from LineageOS 14.1 Nightly 20171024 to 20171031 through the system settings menu.
I had tried to wipe all partitions through TWRP and reinstalling the stock ROM, following a forum post (I don't find the link any more, sorry). This did not help.
I hesitated to use dd due to the reports that some phones were bricked after them. Then I found a description on teamsuperluminal dot org (the forum prevents me from posting the exact link) about the same issue occuring on a Xiaomi device; the commands proposed there only owerwrite the first 32 bytes of the two block devices, instead of 512 bytes / respectively everything. I tried to adapt it to the H850 case, as this was the least invasive option I found by a quick search.
Code:
dd if=/dev/zero of=/dev/block/platform/soc/624000.ufshc/by-name/misc bs=32 count=1
dd if=/dev/zero of=/dev/block/platform/soc/624000.ufshc/by-name/fota bs=32 count=1
This worked.
My setup:
- LG G5 (H850) EU
- TWRP 3.1.1-0
As this seems to be some kind of delicate issue, I would be curious about what I was actually doing with this. So I overwrote the first 32 bytes of the aforementioned two block devices with zeroes. What are these devices suppposed to contain? Where during the boot process are they read? What might be especially important not to owerwrite? I believe this can get into details quite quickly... but is there maybe any "high level" explanation how this works?
- wemi
recovery bootloop after LOS14.1 manual update (to 14.1-20171226-NIGHTLY-h850 via OTA) on G5-H850 EU with newest TWRP.
used only the first command from wemi, post #17 (on .../misc partition, with bs=32) in TWRP terminal, tried reboot and the problem seems to be solved. no idea why so no guarantee, of course.
Hi, I also got the recovery bootloop after using the dm-verity patch to decrypt the data partition. Can thus confirm that the first commands (overwriting "everything") lead to a corrupt phone and wemi's command let me restore it.
[deleted the rest, because I am obviously an idiot. If the problem proves to not be solved by being less of an idiot, I will edit the post once more and give more details]

How To Guide [TUTORIAL] ULTIMATE How to flash GSI Trebble AND ROM and root on Xiaomi device on Windows (files needed included)

Hi, first of all, I'm not a dev or else just user who had difficulties to flash GSI on my phone... Was 7 years with a samsung galaxy Note 3, with twrp....So easy to flash....
with the help of @gr0ndpa, thanks to him.....
FLASH GSI​
Now I will explain how to flash easily with files attached
1/ first of all you need a phone and drivers installed, use xiaomi pc suite, unzip and install it
2/ you need to activate USB debug in dev options.
3/ dl adb folder unzip it and put in C
4/ run command and type
Code:
cd /adb
5/ then
Code:
adb devices
to check if phone recognised
6/
Code:
adb reboot bootloader
once in fast boot
7/
Code:
fastboot flash vbmeta vbmeta.img
wait finished type to enter in fastbootD
8/
Code:
fastboot reboot fastboot
9/
Code:
fastboot flash system
LiR 313.XXX.img
you will have a system error, but wait the flash begin in few seconds
at the end wait ok then
10/
Code:
fastboot reboot recovery
on stock recover
11/ wipe data and reboot with +/- and PWR
and you're done...
In case you want to flash custom kernel or patched boot image to root with magisk, you have to
12/
Code:
adb reboot bootloader
Copy kernel boot image to C drive and rename kernel boot image to boot.img.
13/
Code:
fastboot flash boot c:\boot.img
14/
Code:
fastboot reboot
In case you want to flash twrp put the file to adb folder and type in fastboot
15/
Code:
fastboot boot twrp.img
Downloads for : Xiaomi Mi 11 Lite 5G | AndroidFileHost.com | Download GApps, Roms, Kernels, Themes, Firmware and more. Free file hosting for all Android developers.
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
androidfilehost.com
You can check what I ve done on tuto ss...
if you have some comments, don't hesitate...
I flashed LiR 18.1 rom and very happy with it.....
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++==================================================================================================================================================================================================================++
Flash ROM​
This now how to flash ROM on your device, it's convenient for all roms like LOS, corvus, awaken...
First you need all the proper drivers installed and unlocked bootloader, USB debugging all of that stuff.
Now open up a cmd/terminal , and put the files i sent and the ROM file in the folder from where you're opening the cmd/terminal and connect the phone (you may need to put ./ as an suffix for all the commands if you're on linux)
Type
Code:
adb reboot bootloader
Then type
Code:
fastboot devices
to see if everything is ok
Then type
Code:
fastboot flash boot_ab boot.img
(you can drag and drop the file instead of typing it)
After that's done type
Code:
fastboot flash vendor_boot_ab vendor_boot.img
(you can drag and drop this too if you want)
Code:
fastboot flash dtbo dtbo.img
(you can drag and drop this too if you want)
After that's done type
Code:
fastboot reboot recovery
This will boot you into a recovery and now you need to go to wipe and format data
After that go to apply update then adb sideload then
In the cmd type
Code:
adb sideload rom.zip
for example (you put the ROM zip here you can drag and drop it)
Wait for that to finish it will go to 47% and on the phone it will show step 1/2 then step 2/2
and when it's done it's gonna show an error
adb: failed to read command: No error
Then you can reboot to system
Hello thank your for the short HowTo. Unfortunately im stuck on invalid sparse error. Could you pls post a fix to solve this? Would appreciate your help.
hardshell said:
Hello thank your for the short HowTo. Unfortunately im stuck on invalid sparse error. Could you pls post a fix to solve this? Would appreciate your help.
Click to expand...
Click to collapse
You have to wait at least 30 sec after the error appear...
Are you sure you are on fastbootD???
tuto modified and completed to also root device with magisk and patch boot.img
when i restart into fastboot, it is frozen.
dy2592 said:
when i restart into fastboot, it is frozen.
Click to expand...
Click to collapse
normal, nothing happens on fastboot....when you flash, only thing is on your computer, not on screen..
cant seem to get this installed =(
rayman95 said:
8/
Code:
fastboot reboot fastboot
Click to expand...
Click to collapse
After I enter this, it just stays on waiting for any device.
Update: I was able to figure it out. My device had no drivers so I went search through updates on windows and installed a LeMobile Android driver os it shows up properly in device manager.
How does one install gapps?
dy2592 said:
After I enter this, it just stays on waiting for any device.
View attachment 5419437
Update: I was able to figure it out. My device had no drivers so I went search through updates on windows and installed a LeMobile Android driver os it shows up properly in device manager.
Click to expand...
Click to collapse
because you don't have xiaomi drivers installed...install xiaomi pc suite and you will have drivers installed...
duplicate
rayman95 said:
In step 14, I encountered the error "fastboot: error: ANDROID_PRODUCT_OUT not set" after executing the fastboot flash system command. what do I need to do?
Click to expand...
Click to collapse
Did you insert the img at the end?
Fastboot flash system LIRxxxxxxxxxxxx.img
you have to put your rom to adb folder and dont forget to add .img at the end
rayman95 said:
you have to put your rom to adb folder and dont forget to add .img at the end
Click to expand...
Click to collapse
1.img is your rom Is there anything else missing?
dy2592 said:
Did you insert the img at the end?
Fastboot flash system LIRxxxxxxxxxxxx.img
Click to expand...
Click to collapse
yaha your right thank you so much
rayman95 said:
you have to put your rom to adb folder and dont forget to add .img at the end
Click to expand...
Click to collapse
thank I solved my problem. Now I have another problem, how to install GAPPs
Patrick Star_ said:
thank I solved my problem. Now I have another problem, how to install GAPPs
Click to expand...
Click to collapse
run twrp, it's explain in 1st post or maybe try with magisk...I can install minimicroG nogoolag with it..
rayman95 said:
run twrp, it's explain in 1st post or maybe try with magisk...I can install minimicroG nogoolag with it..
Click to expand...
Click to collapse
I tried to use twrp to brush into GAPP, but the error is 70. How can I solve it? I don't know if there is a problem with my twrp. Can you send a tutorial on xiaomi11 Lite 5g installing twrp? Thank you very much
Patrick Star_ said:
I tried to use twrp to brush into GAPP, but the error is 70. How can I solve it? I don't know if there is a problem with my twrp. Can you send a tutorial on xiaomi11 Lite 5g installing twrp? Thank you very much
Click to expand...
Click to collapse
In case you want to flash twrp put the file to adb folder and type in fastboot
15/
Code:
fastboot boot twrp.img
And twrp link is in post 1..maybe you choose bad gapps variant

Stock Rom Backup before rooting

Hi there everyone, i want to know, how can i take a backup of stock rom of my device.
Do i need to root my device before taking a backup? If not then is there any other way to take backup of Stock Rom (i.e boot.img etc) with the help of PC (here Ubuntu Linux in my case) via using ADB, Fastboot and not using custom recoveries like TWRP, Orange Fox, SHRP.
Also do i have to root my device before installing any custom recovery in it?
I am very sorry for any inconveniences, as i am a newbie please accept my apologies.
as already mentioned in other thread one can't do anything on locked bootloader, therefore backup is impossible
https://forum.xda-developers.com/t/a-question-from-a-newbie.4407343
akram0010 said:
Hi there everyone, i want to know, how can i take a backup of stock rom of my device.
Do i need to root my device before taking a backup? If not then is there any other way to take backup of Stock Rom (i.e boot.img etc) with the help of PC (here Ubuntu Linux in my case) via using ADB, Fastboot and not using custom recoveries like TWRP, Orange Fox, SHRP.
Also do i have to root my device before installing any custom recovery in it?
I am very sorry for any inconveniences, as i am a newbie please accept my apologies.
Click to expand...
Click to collapse
Assuming that the bootloader is unlocked.
aIecxs said:
as already mentioned in other thread one can't do anything on locked bootloader, therefore backup is impossible
https://forum.xda-developers.com/t/a-question-from-a-newbie.4407343
Click to expand...
Click to collapse
Sorry i forgot to mention, but still unlocking bootloader doesn't root device.
I think the question is still valid
if your bootloader is unlocked just boot into TWRP and create backup, no root required
Code:
fastboot boot recovery.img
edit: or just download MIUI according to your current properties
Code:
adb shell getprop ro.build.fingerprint
the only other method would be MTK secure boot authentification exploit
https://github.com/francescotescari/XiaoMiToolV2
https://github.com/bkerler/mtkclient
https://forum.xda-developers.com/t/mod-dev-mediatek-mtk-auth-bypass-sla-daa-utility.4232377
aIecxs said:
if your bootloader is unlocked just boot into TWRP and create backup, no root required
Code:
fastboot boot recovery.img
edit: or just download MIUI according to your current properties
Code:
adb shell getprop ro.build.fingerprint
the only other method would be MTK secure boot authentification exploit
https://github.com/francescotescari/XiaoMiToolV2
https://github.com/bkerler/mtkclient
https://forum.xda-developers.com/t/mod-dev-mediatek-mtk-auth-bypass-sla-daa-utility.4232377
Click to expand...
Click to collapse
Is root needed
aIecxs said:
if your bootloader is unlocked just boot into TWRP and create backup, no root required
Code:
fastboot boot recovery.img
edit: or just download MIUI according to your current properties
Code:
adb shell getprop ro.build.fingerprint
the only other method would be MTK secure boot authentification exploit
https://github.com/francescotescari/XiaoMiToolV2
https://github.com/bkerler/mtkclient
https://forum.xda-developers.com/t/mod-dev-mediatek-mtk-auth-bypass-sla-daa-utility.4232377
Click to expand...
Click to collapse
Can you please tell me what is this recovery.img, and where would i get it (in Fastboot rom or recovery rom).
As i said earlier i am a newbie in this field and very much confused with these terms.
no root required click on the first link above and download TWRP for your device (TWRP-3.4.2.b_lancelot.zip)
I assume you are running windows?
extract zip file and place recovery.img on your PC in platform-tools directory. connect phone in fastboot mode, install android_winusb.inf "Android Bootloader Interface" drivers and from cmd.exe check fastboot devices
if you can see device serialno you are ready to boot TWRP from fastboot with above first command.
for linux just install android-tools-fastboot
As i am using Ubuntu i installed ADB, FASTBOOT using the APT :
Code:
sudo apt install android-tools-adb android-tools-fastboot
.
Therefore i don't have the platform-tools directory.
Also I am unable to quote reply, its showing error (Oops, we broke the Matrix, someone call Neo)
yes that's right. it doesn't matter which directory files are placed. that way you installed fastboot binary is already in PATH. linux is far more easier and doesn't require additional drivers. it might require additional udev rules to make fastboot work, but you can simply by-pass with sudo fastboot for now...

Categories

Resources