Fastboot boot twrp.img not working in mediatek chipset - General Questions and Answers

Hello there.
I have a Redmi pad running on mediatek helio g99(Treble A/B partition)
I have recently compiled orangefox recovery for my device and trying to boot from the image so that i can make my recovery permanent. But i get the following error:
Code:
fastboot boot OrangeFox-Unofficial-yunluo.img
Sending 'boot.img' (65536 KB) OKAY [ 1.826s]
Booting FAILED (remote: 'unknown command')
fastboot: error: Command failed
Any solutions?

Obviously the Fastboot command "boot" isn't supported on your
XIAOMI REDMI PAD ​( Android 12, MIUI 13.1 ).

ghostranger047 said:
Hello there.
I have a Redmi pad running on mediatek helio g99(Treble A/B partition)
I have recently compiled orangefox recovery for my device and trying to boot from the image so that i can make my recovery permanent. But i get the following error:
Code:
fastboot boot OrangeFox-Unofficial-yunluo.img
Sending 'boot.img' (65536 KB) OKAY [ 1.826s]
Booting FAILED (remote: 'unknown command')
fastboot: error: Command failed
Any solutions?
Click to expand...
Click to collapse
Try
fastboot boot recovery OrangeFox-Unofficial-yunluo.img

ghostranger047 said:
Hello there.
I have a Redmi pad running on mediatek helio g99(Treble A/B partition)
I have recently compiled orangefox recovery for my device and trying to boot from the image so that i can make my recovery permanent. But i get the following error:
Code:
fastboot boot OrangeFox-Unofficial-yunluo.img
Sending 'boot.img' (65536 KB) OKAY [ 1.826s]
Booting FAILED (remote: 'unknown command')
fastboot: error: Command failed
Any solutions?
Click to expand...
Click to collapse
Also on devices that have a neutered version of fastboot (or none at all) you can use mtkclient which can also unlock bootloader, etc on the pesky ones.
You can find mtkclient on github.com :
GitHub - bkerler/mtkclient: MTK reverse engineering and flash tool
MTK reverse engineering and flash tool. Contribute to bkerler/mtkclient development by creating an account on GitHub.
github.com
If you're not really familiar with Linux, there's a gui for windows they were nice enough to include so it's not all terminal command line.

Droidriven said:
Try
fastboot boot recovery OrangeFox-Unofficial-yunluo.img
Click to expand...
Click to collapse
Didn't work.
Code:
fastboot: error: cannot load 'recovery': No such file or directory

ghostranger047 said:
Didn't work.
Code:
fastboot: error: cannot load 'recovery': No such file or directory
Click to expand...
Click to collapse
Do you have the recovery .img in the folder where fastboot.exe is located on your PC? If not, you will have to include a <path to flie> in your command line.

Droidriven said:
Do you have the recovery .img in the folder where fastboot.exe is located on your PC? If not, you will have to include a <path to flie> in your command line.
Click to expand...
Click to collapse
I dont have a recovery image for my device, its A/B partition with only boot image. And yes OrangeFox-Unofficial-yunluo.img is inside the same folder as fastboot.exe.

ghostranger047 said:
I dont have a recovery image for my device, its A/B partition with only boot image. And yes OrangeFox-Unofficial-yunluo.img is inside the same folder as fastboot.exe.
Click to expand...
Click to collapse
If you are trying to fastboot boot a TWRP or Orangefox recovery, you need a TWRP or Orangefox recovery.img to do it. There is a difference between a boot.img and a recovery.img.
Your posts are confusing and contradicting each other. To clarify, what exactly are you trying to boot? A boot.img or a recovery.img? The Orangefox .img you have is a boot.img or a recovery.img? Are you trying to boot a temporary TWRP session in order to install Orangefox recovery, or what? If you are using a boot.img, you should be trying to flash that boot.img instead of fastboot booting a TWRP or Orangefox recovery session. Typically, "fastboot boot" command is used to boot a temporary recovery session(usually on devices that have locked bootloader) and then use that temporary recovery session to flash a custom file or modify something on the device. Is your bootloader locked or unlocked? If it is unlocked, you should be able to flash your modified boot.img instead of having to fastboot boot TWRP or Orangefox.
Either you don't understand what you are doing or you are not wording yourself correctly and I'm misunderstanding your intent. Help me make sense of what you are trying to do and what you want your end result to be.

@Droidriven you are the noob here..

aIecxs said:
@Droidriven you are the noob here..
Click to expand...
Click to collapse
No. 10+ years is far from noob. I'm just trying to make sense of what they are after. In their first post, they said they had just compiled Orangefox recovery and the title says ("fastboot boot TWRP.img failed", this command is used to boot a recovery.img, not a boot.img) of which, both are recoveries but then they say they don't have a recovery.img and their original failed command says "boot.img". In my experience, to "fastboot boot TWRP.img" means to boot a temporary TWRP recovery session and then flashing/modifying from within that temporary recovery session, fastboot booting a boot.img is something completely different. I'm just trying to establish which of these is their actual goal. Now, do you see the convolutedness of what the title says and what their posts say and how the wording conflicts?
I've personally used fastboot boot TWRP.img command to boot a temporary TWRP recovery session, not a "boot.img". What they are describing is something different from that process but they are trying to use the same command that boots a temporary TWRP recovery session.
If they are trying to boot a "boot.img" then they should be using a "fastboot boot boot.img" command, not a "fastboot boot TWRP.img" command, correct? Again, conflicting information. Do you understand why I'm trying to clarify now?

see post #1 ghostranger047 for right usage.
the phone answered with FAILED (remote: 'unknown command')
the correct answer is in post #2. on SAR devices, init is in / rootdir of system partition. in case boot.img/recovery.img itself contains no kernel/ramdisk, booting straight from fastboot no longer works (might be the reason why Xiaomi disabled that cmd, or he's simply in fastbootd).
fastboot boot accepts 1 argument (file). you are giving advise to pass 2 arguments. 1st argument 'recovery': No such file or directory, 2nd argument is ignored.
you with 10+ years experience for sure know that fastboot boot cmd always state Sending 'boot.img' (65536 KB) regardless of the file name provided, be it recovery.img or boot.img
OP is very clear in what he said. He wants to boot in his own compiled (orangefox, based on twrp) recovery.img, nothing else.
you are confusing yourself.
edit: btw fastboot boot is forbidden on locked bootloader, otherwise anyone could just boot into magisk patched boot.img

found another possible reason why fastboot boot won't work when it should.
Exelios said:
Even worse than that "fastboot boot" works only if current slot is not marked as not bootable, so any try to launch TWRP fails once your in this mode.
Click to expand...
Click to collapse
Worth a try checking which slot is flagged bootable and set as active (the one with yes)
Code:
fastboot getvar current-slot
fastboot getvar slot-bootable
fastboot getvar slot-successful
fastboot --set-active=other

aIecxs said:
see post #1 ghostranger047 for right usage.
the phone answered with FAILED (remote: 'unknown command')
the correct answer is in post #2. on SAR devices, init is in / rootdir of system partition. in case boot.img/recovery.img itself contains no kernel/ramdisk, booting straight from fastboot no longer works (might be the reason why Xiaomi disabled that cmd, or he's simply in fastbootd).
fastboot boot accepts 1 argument (file). you are giving advise to pass 2 arguments. 1st argument 'recovery': No such file or directory, 2nd argument is ignored.
you with 10+ years experience for sure know that fastboot boot cmd always state Sending 'boot.img' (65536 KB) regardless of the file name provided, be it recovery.img or boot.img
OP is very clear in what he said. He wants to boot in his own compiled (orangefox, based on twrp) recovery.img, nothing else.
you are confusing yourself.
edit: btw fastboot boot is forbidden on locked bootloader, otherwise anyone could just boot into magisk patched boot.img
Click to expand...
Click to collapse
I used a tool that used a script with the fastboot boot command to boot a temporary TWRP img while in fastboot mode on a locked bootloader Intel Atom device. With A/B devices, partitions and where everything is at changed but the basic function of the commands changed very little.
As for the part you said about I should know that the command returns "sending boot.img", that has nothing to do with I said or why I said it, it has to do with the fact that the OP themselves stated that they didn't have a recovery .img, that they had a A/B device, that they were using a boot.img(not a recovery .img). See the confusion? You are confused by what I'm saying about being confused about what they are saying.

I think you got it

ghostranger047 said:
Hello there.
I have a Redmi pad running on mediatek helio g99(Treble A/B partition)
I have recently compiled orangefox recovery for my device and trying to boot from the image so that i can make my recovery permanent. But i get the following error:
Code:
fastboot boot OrangeFox-Unofficial-yunluo.img
Sending 'boot.img' (65536 KB) OKAY [ 1.826s]
Booting FAILED (remote: 'unknown command')
fastboot: error: Command failed
Any solutions?
Click to expand...
Click to collapse
did you manage to run this on your device?

Related

How to backup stock recovery before flashing TWRP?

Hi. How can I backup the stock recovery on my Xiaomi Poco X3 NFC before flashing the TWRP?
I tried executing following code while the phone is in fastboot mode but it never actually boots the custom recovery. It get's stuck at the poco boot logo. Yes my phone has unlocked bootloader.
Code:
fastboot boot TWRP.img
In terminal I get this output:
Code:
[email protected]:/# fastboot boot twrp_3.4.0-15_mauronofrio.img
downloading 'boot.img'...
OKAY [ 3.080s]
booting...
OKAY [ 5.088s]
finished. total time: 8.168s
Does anybody know why this command is not working? Thanks.
lebigmac said:
Hi. How can I backup the stock recovery on my Xiaomi Poco X3 NFC before flashing the TWRP?
I tried executing following code while the phone is in fastboot mode but it never actually boots the custom recovery. It get's stuck at the poco boot logo. Yes my phone has unlocked bootloader.
Code:
fastboot boot TWRP.img
In terminal I get this output:
Code:
[email protected]:/# fastboot boot twrp_3.4.0-15_mauronofrio.img
downloading 'boot.img'...
OKAY [ 3.080s]
booting...
OKAY [ 5.088s]
finished. total time: 8.168s
Does anybody know why this command is not working? Thanks.
Click to expand...
Click to collapse
I have had the same issues with that TWRP from mauronofrio and our stock ramdisk image. However, using Orangefox or the latest 3.5.0 TWRP which can be found in the Index for our device (everything can be found there lol) solved that issue, also, you don't need to backup the recovery partition, because the stock can be easily found and flashed the same.
Thanks but that still doesn't explain why the command fastboot boot twrp.img doesn't work on the Xiaomi Poco X3 NFC with unlocked bootloader.
EDIT:
Ok good news. I've actually managed to boot into the TWRP before flashing it.
As soon as it's done uploading the recovery to the phone you must unplug the USB cable. The timing is very important.
Good luck!
lebigmac said:
This appears to be a more widespread issue than I had originally thought:
Fastboot boot <boot.img> doesn't work but flash does
Hi there ! I compiled a kernel for my DB410. I am trying to boot it using $ fastboot boot boot.img Following the instructions that can be found here: https://builds.96boards.org/releases/dragonboard410c/linaro/debian/17.06.1/ Unfortunately, the device doesn’t boot. It starts the booting...
discuss.96boards.org
fastboot boot TWRP.img Not working
I'm trying to just boot the TWRP image for my OnePlus 5t to then install a custom ROM. So I typed fastboot boot "C:\Users\Elias\Downloads\twrp-3.3.1-0-dumpling.img" and it seemed to work and I got ...
android.stackexchange.com
https://www.reddit.com/r/LineageOS/comments/arakiy
After Android Q upgrade fastboot boot doesn't work on guacamole · Issue #1530 · TeamWin/Team-Win-Recovery-Project
I am running an official build of TWRP, downloaded from https://twrp.me/Devices/ I am running the latest version of TWRP I have read the FAQ (https://twrp.me/FAQ/) I have searched for my issue and ...
github.com
Can't boot TWRP image using fastboot boot
I'm trying to root my Moto Z3 Play. I'm on Windows 10, I have already unlocked the bootloader, however, I can't boot the twrp.img. I got the twrp.img from here https://twrp.me/motorola/motorolamoto...
stackoverflow.com
Click to expand...
Click to collapse
try latest OFOX or TWRP (OFOX image needs to be extracted from zip file), I'm really interested if some of these will boot via "fastboot boot recovery.img", thanks
lebigmac said:
Hi. How can I backup the stock recovery on my Xiaomi Poco X3 NFC before flashing the TWRP?
I tried executing following code while the phone is in fastboot mode but it never actually boots the custom recovery. It get's stuck at the poco boot logo. Yes my phone has unlocked bootloader.
Code:
fastboot boot TWRP.img
In terminal I get this output:
Code:
[email protected]:/# fastboot boot twrp_3.4.0-15_mauronofrio.img
downloading 'boot.img'...
OKAY [ 3.080s]
booting...
OKAY [ 5.088s]
finished. total time: 8.168s
Does anybody know why this command is not working? Thanks.
Click to expand...
Click to collapse
You don't need to backup the sock recovery.
Everything you need to do is download the stock rom and extract recovery.
@jeryll thanks for chiming in. All of these TWRP images will boot via "fastboot boot recovery.img" on our device.
It's important to unplug the USB cable at the right moment as soon as it's done uploading. Good luck!

Unable to reinstall Oxygen OS from custom ROM. FAILED (remote: Flashing is not allowed for Critical Partitions ). Need assistance, details below.

Hello, friends. So I am here following this exact tutorial :
How to Restore OnePlus Nord Back to Stock OxygenOS Software - A Complete Guide
In this guide, we will show you how to restore the stock OxygenOS software on the OnePlus Nord by flashing the factory image/Fastboot ROM. Things like custom ROMs, TWRP, and Magisk root are pretty…
www.thecustomdroid.com
I currently am stuck there
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot flash abl abl.img
target reported max download size of 805306368 bytes
sending 'abl' (1996 KB)...
OKAY [ 0.055s]
writing 'abl'...
FAILED (remote: Flashing is not allowed for Critical Partitions
)
finished. total time: 0.057s
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot flashing unlock_critical
...
FAILED (remote: Device already : unlocked!)
finished. total time: 0.000s
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot flashing unlock
...
FAILED (remote: Device already : unlocked!)
finished. total time: 0.000s
Click to expand...
Click to collapse
I just simply do not understand what could be wrong here.
In fastoot mode I get "device - State unlocked"
As you already saw, it seems the device is completely unlocked. What could be wrong ?
Also, some steps before, I get that :
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot reboot fastboot
fastboot: usage: unknown reboot target fastboot
Click to expand...
Click to collapse
I suspect switching to the automated in Windows won't change much.
It is strange because I am able to perform these steps without problems, ones the ones after seem to not work :
./fastboot flash boot boot.img
./fastboot flash dtbo dtbo.img
./fastboot flash modem modem.img
./fastboot flash recovery recovery.img
./fastboot --disable-verity flash vbmeta vbmeta.img
./fastboot --disable-verity flash vbmeta_system vbmeta_system.img
Click to expand...
Click to collapse
I might be doing something wrong ? Be located in the wrong folder or something ? For instance, when I type these commands it does not work if I write the "./" before fastboot, it tells me
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ ./fastboot flash boot boot.img
bash: ./fastboot: No such file or directory
Click to expand...
Click to collapse
My phone is a Oneplus Nord and I am using the advised Oxygen OS ROM provided in the tutorial I linked at the beginning of my message.
I hope you'll be able to get me out of this as I unfortunately can't figure out how to solve this problem on my own.
Best regards
krakard said:
I might be doing something wrong ? Be located in the wrong folder or something ? For instance, when I type these commands it does not work if I write the "./" before fastboot, it tells me
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ ./fastboot flash boot boot.img
bash: ./fastboot: No such file or directory
Click to expand...
Click to collapse
Yes, that makes sense.
Fastboot should be located at /usr/bin/fastboot. Since you're not in that directory, ./fastboot won't work. (This ./ means: "Look at the current working directory for the command fastboot." If it cannot find fastboot there or it isn't a shell command, it will throw an error.)
However, since you didn't install fastboot globaly, you have to address its exact path inside your platform-tools folder. If fastboot is not in Partition-image folder, ./ won't work.
Can't help you with your main issue though.
Edit: You seem to have fastboot installed globally though:
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot reboot fastboot
fastboot: usage: unknown reboot target fastboot
Click to expand...
Click to collapse
So my first explaination is valid.
Thank you for clarifying that. I understand the issue there. Which is a non-issue indeed since I already installed it globally. But well, it at least teaches me how Linux work.
Of course however, the main issue remains that's for sure.
krakard said:
Thank you for clarifying that. I understand the issue there. Which is a non-issue indeed since I already installed it globally. But well, it at least teaches me how Linux work.
Of course however, the main issue remains that's for sure.
Click to expand...
Click to collapse
You're welcome.
BTW:
krakard said:
@pop-os:~/Desktop/platform-tools_r31.0.2-linux/platform-tools/Partition-image$ fastboot reboot fastboot
fastboot: usage: unknown reboot target fastboot
Click to expand...
Click to collapse
There is no "fastboot" to boot into. Instead, type
Code:
fastboot reboot bootloader
I didn't mention that yesterday for some reason.
Guys, here is where I am at now. Still struggling but I feel I am very near ! Some help maybe ?
https://forum.xda-developers.com/t/...your-device-to-oxygenos.4148415/post-85022511
best regards
SOLVED
krakard said:
SOLVED
Click to expand...
Click to collapse
How did you fixed this? I'm currently stuck at the same point as you with a oneplus 8
Same here, how did you managed to solve the "Flashing is not allowed for Critical Partitions: error with the fastboot ROM batch file?
mbootsman1 said:
Same here, how did you managed to solve the "Flashing is not allowed for Critical Partitions: error with the fastboot ROM batch file?
Click to expand...
Click to collapse
I found the solution, you have to do fastboot reboot fastboot which reboots you to fastbootd instead of fastboot. There you can flash critical partitions without issue.
Hi,
As the command recommanded everywhere :
Code:
fastboot flashing unlock_critical
had never worked for me in the bootloader environment,
I have to reboot i my rom embedded recovery in order to flash the file (apply update menu) through the :
fastbootD
To sum up :
#From Android (while having all prerequisite done ie bootloader unlocked...)
Code:
adb reboot bootloader
#From the bootloader I choose to boot to recovery and I get to the rom custom recovery
#In the custom recovery, I choose the menu "apply update" that will lead me to the fastbootD mode
#I type the appropriate command to flash the persist partition
Code:
fastboot flash persist "c:\your_path_to_your_persist_file\persist.img"
#Then I simply reboot the phone
Code:
fastboot reboot
PS : Initially flash the OxygenOS (OOS) 11, then apply the CRdroid Android v8 custom rom (based on Android 12)
I did it similar like solid-snake:
In my case I also had no access to fastbootD
The solution came randomly when I flashed back the first part from my lineageOS package:dtbo.img, vbmeta.img and the recovery.img --> after that my phone naturally booted in a fastbootD mode from the lineageOS package.
I modified the flash-all.bat from the stock ROM fastboot flash package:
I removed the line with the reboot command, because I'm already in the fastbootD mode.
Then I ran the modified flash-all.bat and everything went well.
If anyone else struggles (like I did) to get the phone in EDL mode, or the "Flashing is not allowed for Critical Partitions" error ,even if the "fastboot flashing unlock_critical" cmd was executed, here are some hints that might help.
I tried forever on a Linux computer without any luck, so I ended up installing Windows 10 on actual hardware to finally unbrick my One Plus Nord (Avicii). Here are the most important steps, YMMV, execute at own risk:
bcdedit.exe /set nointegritychecks off run this cmd as admin in terminal, toggle to "on"
then install edl drivers as admin, This is where I struggled the most, I finally found an .exe file(QDLoader HS-USB Driver_64bit_Setup.exe) that I just installed and then phone showed up as it should in device manager. ("Qualcomm HS-USB QDLoader 9008," not "QUSB_BULK")
install adb and fastboot. (platform-tools)
install MSM-Download-Tool
download stock OS for use in MSM-Download-Tool program
open msm tool, if phone is not recognised try turning on and holding power pluss both volume, or just one of the volumes.
uncheck the "sha hash check" box
flash
if you get the "Sahara Communication Failed", just try again, it worked for me.
wipe
erase Windows 10 and replace with any Linux distro, tell your PC it will never happen again.
enjoy
Here are link to the EDL-drivers that worked for me. Or just do a web-search for "QDLoader HS-USB Driver_64bit_Setup.exe"
The flashing process will take over 300 seconds, be patient.

Why use no-verity-opt-encrypt zip file?

I rooted my Chinese phone without a custom recovery (haven't bothered for last few phones).
However, I am considering putting TWRP on and when I had a quick look on the Internet to see if one was around for my phone (being a Chinese phone) I naturally came across rooting guides and I noticed they seem to talk about flashing a no-verity-opt-encrypt zip file.
I do not understand why this file is needed?
To cut a long story short...
I extracted what I needed from the stock rom, patched with Magisk as normal and flashed using fastboot.
Then to bypass a bootloop from a signature mismatch because of Android verified boot, I flashed vbmeta using the following options:
--disable-verity --disable-verification
Android boots fine and my device is rooted (verified by Magisk and root checker app).
So why is there the need to flash the additional file no-verity-opt-encrypt zip?
People seem to be using it on many devices so there must be a reason I am missing.
Point is: your Chinese phone is not the only phone China produced. In my Chinese phone you cannot flash neither modified boot.img nor modified recovery.img. If you try, phone swithes to red state
And my Chinese phohe has empty vbmeta partition (ROM is based on android 8.1), so, evidently, it is not vbmeta but some other mechanism that prevents me from rooting my phone or from flashing TWRP/boot. And for those who are proud owners of such ****ty Chinese phones like mine, using verity disabler script might be the last resourt.
I'll tell you even more: with your Chinese phone you still could flash vbmeta using fastboot. Ho-ho-ho-ho.... Not true Chinese phone. Look at mine! It does NOT allow you to use fastboot for flashing. That is real Chinese phone!!
/However, I have no idea how am I supposed to flash verity disabler script if I don't have TWRP... If someone could help me with that.../
I am not sure you understand what I mean (sorry I probably was not clear).
Red State is absolutely correct for what you have done AND more importantly for you, if you copy the way I have done it you should remove the verification.
Your phone should return to Orange State and your device will be rooted without the need to flash/use TWRP or the no-verity-opt-encrypt zip file.
However, I do not understand what you mean when you say you can't flash using fastboot?
If I remember correctly, when my phone was in Red State it was difficult to enter Fastboot because it was in a Bootloop, but once you do you can flash as normal?
I can only give you advice flashing by Fastboot. So assuming you can (as above) then forget what the guides tell you and simply do this...
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot reboot
Your phone should reboot, show Orange state and boot into Android. If you patched with Magisk correctly it should be rooted. You can verify this in the Magisk app and any root checker app.
Note: I am using Android 10 not 8
Bondyuk said:
However, I do not understand what you mean when you say you can't flash using fastboot?
Click to expand...
Click to collapse
Better to see it once than to hear many times. This is how true Chinese phone (mine) behaves:
Code:
Z:\android\adb>adb reboot bootloader
Z:\android\adb>fastboot flash vbmeta vbmeta.img
Sending 'vbmeta' (4 KB) OKAY [ 0.006s]
Writing 'vbmeta' FAILED (remote: 'unknown command')
fastboot: error: Command failed
Z:\android\adb>fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
Rewriting vbmeta struct at offset: 0
Sending 'vbmeta' (4 KB) OKAY [ 0.009s]
Writing 'vbmeta' FAILED (remote: 'unknown command')
fastboot: error: Command failed
Z:\android\adb>
Apart from this ugly fastboot implementation I should stress once again that vbmeta partition on my device is blank meaning the partition has all zeroes. Also, this partition is NOT supposed to be flashed when I flash stock ROM. Here's what is there in rawprogram0.xml:
Code:
<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="" label="vbmeta" ...
<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="" label="vbmetabak" ...
To sum up: I do not believe any vbmeta juggling would help me.
Bondyuk said:
Red State is absolutely correct for what you have done
Click to expand...
Click to collapse
Are you saying any boot.img properly patched by Magisk and flashed to the phone should cause red state?
vp1117 said:
Better to see it once than to hear many times. This is how true Chinese phone (mine) behaves:
Code:
Z:\android\adb>adb reboot bootloader
Z:\android\adb>fastboot flash vbmeta vbmeta.img
Sending 'vbmeta' (4 KB) OKAY [ 0.006s]
Writing 'vbmeta' FAILED (remote: 'unknown command')
fastboot: error: Command failed
Z:\android\adb>fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
Rewriting vbmeta struct at offset: 0
Sending 'vbmeta' (4 KB) OKAY [ 0.009s]
Writing 'vbmeta' FAILED (remote: 'unknown command')
fastboot: error: Command failed
Z:\android\adb>
Apart from this ugly fastboot implementation I should stress once again that vbmeta partition on my device is blank meaning the partition has all zeroes. Also, this partition is NOT supposed to be flashed when I flash stock ROM. Here's what is there in rawprogram0.xml:
Code:
<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="" label="vbmeta" ...
<program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="" label="vbmetabak" ...
To sum up: I do not believe any vbmeta juggling would help me.
Click to expand...
Click to collapse
What happens when you try this:
adb reboot bootloader
fastboot unlock flash
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
There should actually be two implementations of Fastboot. The main one you reboot into and another called Fastboot.d within the recovery.
vp1117 said:
Are you saying any boot.img properly patched by Magisk and flashed to the phone should cause red state?
Click to expand...
Click to collapse
I am not sure, it does on mine.
The device verifies the boot.img checksum to make sure it is original/stock. Because Magisk modifies the boot.img it will no longer pass verification and puts the device into Red state.
As far as I am aware this is part of AVB so it only affects devices using it. I am not sure when it was implemented (Android 8, 9 or 10)
Bondyuk said:
What happens when you try this:
fastboot unlock flash
Click to expand...
Click to collapse
This command does not exist. Probably what you meant me to try is this:
Z:\android\adb>fastboot flashing unlock
FAILED (remote: ' Device already : unlocked!')
fastboot: error: Command failed
Z:\android\adb>
Bondyuk said:
There should actually be two implementations of Fastboot. The main one you reboot into and another called Fastboot.d within the recovery.
Click to expand...
Click to collapse
Fastboot.d is something which was introduced in A10. I'm on A8.
Bondyuk said:
Because Magisk modifies the boot.img it will no longer pass verification and puts the device into Red state.
Click to expand...
Click to collapse
Then every phone owner would shout "It does not work!" and magisk project would be closed soon. However, it does not happen. It means that only selected models are built in such a nasty way that they expect modified partition to be signed by vendor's key.
I do not have knowledge enough to continue this discussion. I just wanted to respond to your initial question as to why people might need verity-disabler script. There are different phones with different android versions, with different security implementation and not always you can achieve your goal following standard fastboot flashing commands.
@vp1117
To keep you updated:
The vbmeta image is cryptographically signed and contains verification data (e.g. cryptographic digests) for verifying boot.img, system.img, and other partitions/images.
Contents of vbmeta image is parsed by bootloader as 1st thing of all things unless parsing got disabled.
The vbmeta's signing basically must not be of interest to you, the vbmeta's signature key must never get changed by anyone.
To prepare modding phone's Android OS one run ADB / Fastboot commands as follows
Code:
adb devices
adb reboot fastboot
fastboot reboot fastboot 2>nul
fastboot flashing unlock
fastboot reboot
adb reboot fastboot
fastboot reboot fastboot 2>nul
fastboot --disable-verification --disable-verity flash vbmeta vbmeta.img
fastboot reboot
where the vbmeta.img what gets passed to Fastboot should get pulled out from phone before thus it's size is matching.
jwoegerbauer said:
@vp1117
To keep you updated:
The vbmeta image is cryptographically signed and contains verification data (e.g. cryptographic digests) for verifying boot.img, system.img, and other partitions/images.
Contents of vbmeta image is parsed by bootloader as 1st thing of all things unless parsing got disabled.
The vbmeta's signing basically must not be of interest to you, the vbmeta's signature key must never get changed by anyone.
where the vbmeta.img what gets passed to Fastboot should get pulled out from phone before thus it's size is matching.
Click to expand...
Click to collapse
Thank you Jwoegerbauer.
This is a clear and well written explanation.
Do you know if the no-verity-opt-encrypt zip file actually needs to be flashed in TWRP, rather than simply flashing vbmeta with the --disable-verification --disable-verity options?
vp1117 said:
Z:\android\adb>fastboot flashing unlock
FAILED (remote: ' Device already : unlocked!')
fastboot: error: Command failed
Z:\android\adb>
Click to expand...
Click to collapse
I find it really hard to believe they modified fastboot so drastically.
What I don't understand is that the flash command obviously does work, because you say that when you flash boot or recovery your phone enters Red state?!
Do you have another Thread about your problem?
If so post a link here, I would be interested to see what you have tried and see if I can help
Bondyuk said:
Thank you Jwoegerbauer.
This is a clear and well written explanation.
Do you know if the no-verity-opt-encrypt zip file actually needs to be flashed in TWRP, rather than simply flashing vbmeta with the --disable-verification --disable-verity options?
Click to expand...
Click to collapse
The no-verity-opt-encrypt.zip must only be applied on Android OS versions that don't come with vbmeta.img, means where dm-verity is incorporated in Android's boot.img.
Bondyuk said:
What I don't understand is that the flash command obviously does work, because you say that when you flash boot or recovery your phone enters Red state?!
Click to expand...
Click to collapse
Comon! Luckily, fastboot is not the only flashing tool on earth. I use QFIL for that.
I created 2 threads recently.
One was regarding custom recovery: https://forum.xda-developers.com/t/360-n6-lite-qiku-in-desperate-need-of-twrp-recovery.4273965/
Another - how to root the phone: https://forum.xda-developers.com/t/360-n6-lite-qiku-help-is-needed-to-root-the-device.4277407/
I'm planning to add questions on AVB to the 2nd thread.
jwoegerbauer said:
The no-verity-opt-encrypt.zip must only be applied on Android OS versions that don't come with vbmeta.img, means where dm-verity is incorporated in Android's boot.img.
Click to expand...
Click to collapse
That makes sense.
Could you manually do it by opening the boot.img in a hex editor, finding the verification or dm-verify string and zeroing it out?
Surely Magisk would do this as part of its patching process?
I must be wrong because otherwise the zip file would not be needed again
Bondyuk said:
Could you manually do it by opening the boot.img in a hex editor, finding the verification or dm-verify string and zeroing it out?
Click to expand...
Click to collapse
Look inside file boot-patcher.sh that comes with the no-verity-opt-encrypt.zip to see how patching boot.img is done.
jwoegerbauer said:
Look inside file boot-patcher.sh that comes with the no-verity-opt-encrypt.zip to see how patching boot.img is done.
Click to expand...
Click to collapse
I downloaded and had a looked at the zip file.
From what I can tell the actual patching is done by altering the fstab to pass dm-verify options to the kernel during boot?
vp1117 said:
Point is: your Chinese phone is not the only phone China produced. In my Chinese phone you cannot flash neither modified boot.img nor modified recovery.img. If you try, phone swithes to red state
And my Chinese phohe has empty vbmeta partition (ROM is based on android 8.1), so, evidently, it is not vbmeta but some other mechanism that prevents me from rooting my phone or from flashing TWRP/boot. And for those who are proud owners of such ****ty Chinese phones like mine, using verity disabler script might be the last resourt.
I'll tell you even more: with your Chinese phone you still could flash vbmeta using fastboot. Ho-ho-ho-ho.... Not true Chinese phone. Look at mine! It does NOT allow you to use fastboot for flashing. That is real Chinese phone!!
/However, I have no idea how am I supposed to flash verity disabler script if I don't have TWRP... If someone could help me with that.../
Click to expand...
Click to collapse
you are right i am also facing this problem on my vivo y20 phone if you find any solution tell me

[SOLVED] Unable to flash boot image - Pixel 4a

I have been using this method to flash new stock update every month to my rooted pixel 4a.
Steps I follow:
- Download the factory image of the last month
- Extract the boot.img. And patch it using magisk canary build
- Move the boot.img to the computer and flash it in fastboot mode
- flash the complete image
- Reroot the phone using magisk
This time with January update, I am getting stuck on step 3. Everytime I try to flash the bootloader image using the command:
C:\platform-tools>fastboot flash bootloader "C:\platform-tools\magisk_boot.img.img"
I get the following error:
Sending 'bootloader' (65536 KB) OKAY [ 1.609s]
Writing 'bootloader' FAILED (remote: 'No such file or directory')
fastboot: error: Command failed
No, It isn't booted in fastbootd mode. I am using correct Fastboot mode using the hotkeys
Kindly assist. Thank you
Your fastboot may be old... Upgrading it might help.
Or you might be able to use fastboot boot patched.img to get temporary root and use Magisk manager to install (direct) to make it permanent. That's what I do, and it's always worked.
Absarock said:
I have been using this method to flash new stock update every month to my rooted pixel 4a.
Steps I follow:
- Download the factory image of the last month
- Extract the boot.img. And patch it using magisk canary build
- Move the boot.img to the computer and flash it in fastboot mode
- flash the complete image
- Reroot the phone using magisk
This time with January update, I am getting stuck on step 3. Everytime I try to flash the bootloader image using the command:
C:\platform-tools>fastboot flash bootloader "C:\platform-tools\magisk_boot.img.img"
I get the following error:
Sending 'bootloader' (65536 KB) OKAY [ 1.609s]
Writing 'bootloader' FAILED (remote: 'No such file or directory')
fastboot: error: Command failed
No, It isn't booted in fastbootd mode. I am using correct Fastboot mode using the hotkeys
Kindly assist. Thank you
Click to expand...
Click to collapse
fastboot flash boot
And not
fastboot flash bootloader
Cheers!
Typhus_ said:
fastboot flash boot
And not
fastboot flash bootloader
Cheers!
Click to expand...
Click to collapse
Thank you, sir. It helped
a1291762 said:
Your fastboot may be old... Upgrading it might help.
Or you might be able to use fastboot boot patched.img to get temporary root and use Magisk manager to install (direct) to make it permanent. That's what I do, and it's always worked.
Click to expand...
Click to collapse
I tried updating fastboot. Didn't work.
Either way I was able to solve by using the command boot_b instead of bootloader. B being the partition

No System Partition? FAILED (remote: 'partition table doesn't exist')

We're trying to install a GSI ROM. We get the error FAILED (remote: 'partition table doesn't exist')
We ran
Code:
fastboot getvar all
and see all of the partition tables listed or at least most of them. We do not see a system partition listed.
Why would this be? If I create one, how would I do that? How would I get the correct size? I'm assuming
Code:
fastboot create-logical-partition [NAME SIZE]
?
Does anyone know if I cannot boot into fastbootd and only boot into fastboot, am I still able to create a partition? It seems this device is boot looped. I haven't been able to boot into recovery. I can only get fastboot and EDL modes. Stock firmware is not available.
Starting with Android 10 fastboot got moved to Android's user-space, what requires this pair of commands
Code:
adb reboot fastboot
fastboot reboot fastboot
to get fastboot working.
xXx yYy said:
Starting with Android 10 fastboot got moved to Android's user-space, what requires this pair of commands
Code:
adb reboot fastboot
fastboot reboot fastboot
to get fastboot working.
Click to expand...
Click to collapse
Thank you for the reply. I do understand that part, however I cannot get into adb. If it is stuck in a bootloop, how can I access adb?
The bootloader is unlocked and oem debugging is on. It is a Moxee M2160 MH-T6000 Qualcomm QM215. We cannot find any stock firmware for it.

Categories

Resources