Hi, earlier, I wanted to change the rom of my mi 5s. I've got an error 7 follow by "Failed to update system image" on twrp during the flash. I tried many things: edit the installation script, format all the data, update and downgrade TWRP, lock and unlock bootlander and finally perform a fastboot flash using mi flash and the last one worked. But I am not longer able to flash a custom rom without getting error 7 after the "Patching system image unconditionally" message. I've tested lineage, pixel experience, miui, even 8.1 rom but same result. I'm stuck with fastboot global miui 10 (oreo )
Btw, I think that after the error the partition are corrupted since I can't repair them with TWRP.
I don't know what I can do more.I think that i figured out that I am able to flash system.img file using fastboot but I can't flash zip rom using recovery.
As anyone encounter this ?
bob_bricoleur said:
Hi, earlier, I wanted to change the rom of my mi 5s. I've got an error 7 follow by "Failed to update system image" on twrp during the flash. I tried many things: edit the installation script, format all the data, update and downgrade TWRP, lock and unlock bootlander and finally perform a fastboot flash using mi flash and the last one worked. But I am not longer able to flash a custom rom without getting error 7 after the "Patching system image unconditionally" message. I've tested lineage, pixel experience, miui, even 8.1 rom but same result. I'm stuck with fastboot global miui 10 (oreo )
Btw, I think that after the error the partition are corrupted since I can't repair them with TWRP.
I don't know what I can do more.I think that i figured out that I am able to flash system.img file using fastboot but I can't flash zip rom using recovery.
As anyone encounter this ?
Click to expand...
Click to collapse
This usually happens when a partition is missed the way that TWRP doesn´t recognice the exact model and this error 7 is a kind of protection to avoid further mistake.
Some TWRP has in-built the option to fix system issue in advanced settings or then of try to flash a system image this option could appear.
Can you upload from any of the roms the updater script that is inside?
Also sometime you did a repartition? Or flashed some GSI?
SubwayChamp said:
This usually happens when a partition is missed the way that TWRP doesn´t recognice the exact model and this error 7 is a kind of protection to avoid further mistake.
Some TWRP has in-built the option to fix system issue in advanced settings or then of try to flash a system image this option could appear.
Can you upload from any of the roms the updater script that is inside?
Also sometime you did a repartition? Or flashed some GSI?
Click to expand...
Click to collapse
Here is a script from pixel experience:
https://pastebin.com/DXgKrB8Z
I have the error "E1001: Failed to update system image" or "E2001: Failed to update vendor image" or just error 7 if I remove all the abort and assert.
I never did a repartition or flashed a GSI.
bob_bricoleur said:
Here is a script from pixel experience:
https://pastebin.com/DXgKrB8Z
I have the error "E1001: Failed to update system image" or "E2001: Failed to update vendor image" or just error 7 if I remove all the abort and assert.
I never did a repartition or flashed a GSI.
Click to expand...
Click to collapse
Just to be sure I guess you removed all the lines with getprop and not only the words.
Try first flashing persist image through fastboot.
If not flash the rom not through fastboot but using EDL mode and MiFlash tool, if you have unlocked bootloader you can send device through adb with: adb reboot edl or through fastboot with: fastboot oem edl
SubwayChamp said:
Just to be sure I guess you removed all the lines with getprop and not only the words.
Try first flashing persist image through fastboot.
If not flash the rom not through fastboot but using EDL mode and MiFlash tool, if you have unlocked bootloader you can send device through adb with: adb reboot edl or through fastboot with: fastboot oem edl
Click to expand...
Click to collapse
Yep I removed all the line
I managed to flash a full fastboot rom with mi flash and I think that during the process, a persist image was flashed. So i'm runing a stock miui. I even managed to flash Twrp and magisk. But I can't flash a rom through TWRP even after that :crying:
bob_bricoleur said:
Yep I removed all the line
I managed to flash a full fastboot rom with mi flash and I think that during the process, a persist image was flashed. So i'm runing a stock miui. I even managed to flash Twrp and magisk. But I can't flash a rom through TWRP even after that :crying:
Click to expand...
Click to collapse
Some times causes different results flashing the fastboot full image through EDL mode (download mode) instead of through fastboot mode.
It could be the issue the TWRP version if there is other available.
And you could try deleting the recovery partition with fastboot erase recovery, then boot (don´t flash yet) to recovery using fastboot boot whateveriscalled.img, then in TWRP flash the TWRP image or the installer zip, then reboot for first time to TWRP and try again.
I followed a tutorial and it gave a single vbmeta.img file that it can be used for all Android devices. Is this true or does each device have its own vbmeta.img file? If Each device has its own then where can I get that of my phone (Tecno Spark 4 KC8 Android 10)? Can I get it from the Stock Firmware? If yes how do I go about it? If no then how can I get it
Please I need help.
Sakodie King TI said:
I followed a tutorial and it gave a single vbmeta.img file that it can be used for all Android devices. Is this true or does each device have its own vbmeta.img file? If Each device has its own then where can I get that of my phone (Tecno Spark 4 KC8 Android 10)? Can I get it from the Stock Firmware? If yes how do I go about it? If no then how can I get it
Please I need help.
Click to expand...
Click to collapse
vbmeta.img is unique for the phone model.
you can get it be extracting your stock firmware.
Kenora_I said:
vbmeta.img is unique for the phone model.
you can get it be extracting your stock firmware.
Click to expand...
Click to collapse
Hi #[email protected] thanks very much. So you mean if I extract the stock firmware of my model I should be able to see a file named vbmeta right (or do I need to go an extra mile to get the vbmeta file)? Now what of a blank (empty) vbmeta.img file. How do I get it because I need to flash it before flashing custom recovery? Also can I use a universal empty vbmeta.img as I saw on a tutorial or my model also has its specific empty vbmeta.img file?
The one in the tutorial.is fine.
Kenora_I said:
The one in the tutorial.is fine.
Click to expand...
Click to collapse
Um, So, To install TWRP, I need -dm-verity-opt-encrypt.zip and vbmeta.img. Should the Vbmeta, be specific for each device, only to install a custom rom? or also specific to install a recovery like TWRP, If I install TWRP, I still need the Vbmeta, to install custom roms, or I only need it when using ADB, Um, Also, Do I need no-verity-opt-encrypt, I saw a post, that I need to flash it in order to install the TWRP, If I dont need the dm-verity to install the TWRP, Can I directly flash vbmeta?
I saw this code to install TWRP on my device:
Code:
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot flash recovery TWRP.img
I need to ask 2 more things:
1) how to check if my device is compatible with No-verity-opt-Encrypt?
2) Differences between DM Verity, OPT Encrypt, and Force Encryption Disabler?
Why would I need to disable verity? What is No verity, and what is vbmeta?
Is there any FULL Comprehensive Tutorial on this mobile Custom Rom Cooking lecture, So that I could know about treble, recoveries, kernels, and etc. Please.
Thanks
Hi TechySkills see my answer in the next comment below for a clear explanation.
TechySkills said:
Um, So, To install TWRP, I need -dm-verity-opt-encrypt.zip and vbmeta.img. Should the Vbmeta, be specific for each device, only to install a custom rom? or also specific to install a recovery like TWRP, If I install TWRP, I still need the Vbmeta, to install custom roms, or I only need it when using ADB, Um, Also, Do I need no-verity-opt-encrypt, I saw a post, that I need to flash it in order to install the TWRP, If I dont need the dm-verity to install the TWRP, Can I directly flash vbmeta?
I saw this code to install TWRP on my device:
Code:
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot flash recovery TWRP.img
I need to ask 2 more things:
1) how to check if my device is compatible with No-verity-opt-Encrypt?
2) Differences between DM Verity, OPT Encrypt, and Force Encryption Disabler?
Why would I need to disable verity? What is No verity, and what is vbmeta?
Is there any FULL Comprehensive Tutorial on this mobile Custom Rom Cooking lecture, So that I could know about treble, recoveries, kernels, and etc. Please.
Thanks
Click to expand...
Click to collapse
[Links have been attached at the end of the explanation]...
I started this thread sometime ago and after following up, I have now documented everything.
-- DM-Verity (or Verified Boot), Forceencryption and SafetyNet are some basic Android security features. For security reasons, Android should boot with what the OEM has provided (modifications to partitions or modified/custom partitions are not trusted; the reason your phone won't boot or boots with a warning if you make changes to the OS).
-- DM-Verity checks for alterations when your phone is booting and if detected, Forceencryption encrypts the data partition to prevent a data breach. Meanwhile Safetynet is also triggered when you alter the OS and apps that depend on the strict Android security won't work well if SafetyNet fails.
-- TWRP (which can be flashed using: fastboot flash recovery TWRP.img)
is a custom recovery partition (not provided or approved by the OEM), GSI is a custom system partition (not approved by the OEM) and to install any custom partition, it is wise to disable the security barriers (Forceencryption, DM-Verity). As you are taking over control of your phone, whatever issue you fall into afterwards should be addressed to yourself.
-- In older Android versions, DM-verity sits in the boot partition. But in recent Android versions (9, 10, etc), it sits in the dedicated vbmeta partition and that is why you have to flash an empty/signed vbmeta image (using:
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img) to bypass DM-Verity. Google has a universal vbmeta image that works for all devices. For Forceencryption, you need to flash a disabler zip like dm-verity-and-forceencrypt-disabler zip (also disables DM-verity) or no-verity-opt-encrypt zip. Or you can also edit the vendor fstab file to remove encryption.
-- See What Is Verified Boot (DM-Verity) In Android And How To Disable It https://sakophone.wordpress.com/202...ce=728bab228a&preview=true&_thumbnail_id=4446
-- See Encryption, Decryption And Forceencryptin https://sakophone.wordpress.com/2022/01/03/encryption-decryption-and-forceencryptin/#forceencryption
Hello,
1. In the first link you gave, It says, that, after flashing a custom recovery, flash forceencryption, I don't know how to flash forceencryption through adb, cuz, If i just flash the TWRP, and boot, In my guess, It will not open, unless you flash the forceencrytption.
2. As you said in your reply, "fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img" So this removes the need to flash the zip file as mentioned in the first step?? But right after you said that, You also need to flash the dm-verity zip file. I am very very confused.
3. Also, What is exactly vbmeta, I understood about dm-verity etc, But I am still confused about vbmeta, can you please comprehend it to me?
4. What is the need of rooting the phone, after unlocking the bootloader, like, why root phone, when the phone is already unlocked? Please remove these stupid confusions of mine.
Thanks
TechySkills said:
Hello,
1. In the first link you gave, It says, that, after flashing a custom recovery, flash forceencryption, I don't know how to flash forceencryption through adb, cuz, If i just flash the TWRP, and boot, In my guess, It will not open, unless you flash the forceencrytption.
2. As you said in your reply, "fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img" So this removes the need to flash the zip file as mentioned in the first step?? But right after you said that, You also need to flash the dm-verity zip file. I am very very confused.
3. Also, What is exactly vbmeta, I understood about dm-verity etc, But I am still confused about vbmeta, can you please comprehend it to me?
4. What is the need of rooting the phone, after unlocking the bootloader, like, why root phone, when the phone is already unlocked? Please remove these stupid confusions of mine.
Thanks
Click to expand...
Click to collapse
If you went through the guides I sent, you should have all your answers there.
1. The key used by DM-Verity is signed and kept in the vbmeta partition (from Android 8 onwards). Therefore you have to flash a vbmeta that has been signed or an empty vbmeta (that holds no key to do a check) to disable DM-VERITY.
2. vbmeta disables DM-verity and not Forceencryption. The disabler zips disable Forceencryption (and some disable DM-VERITY too). For zips that disable both Forceencryption and DM-Verity, you can use just it and not use the signed/empty vbmeta.
3. Your phone is protected out of the box for your own safety. If you want to take total control over it, you must alert the system by unlocking it (unlocking the bootloader). If you want to give back all the control to your phone, relock bootloader. Note that unlocking/locking bootloader wipes all your data so do backups first.
4. Bootloader is the first step and must be done, if not, the phone won't boot. After bootloader then comes turning off security barriers (DM-Verity, Forceencryption).
5. Though the steps might vary, they usually follow this manner:
• Unlock bootloader. Turn on the toggle in Developer options and then use fastboot to complete the unlocking
• Flash vbmeta to disable DM-VERITY
• Flash TWRP. Though Forceencryption has not been removed yet, TWRP will boot. Now format data in TWRP to temporarily make the phone decrypted. With a temporarily decrypted state, you can access your internal storage to select Forceencryption disabler zip. Flashing the zip makes decryption Permanent.
• You can now reboot or continue flashing other stuff like other recovery, GSI, custom ROM, magisk, etc. Most of them can be done from TWRP itself (the reason you need TWRP in the first place)
• Rooting is optional. You can decide not to root even if you have TWRP, custom ROM, etc. Some apps need superuser privileges to work and you can only use them in a rooted phone (the reason people root their phone). These apps are mostly those that modify the OS. Flashing magisk roots your phone.
Any doubts again?
Sakodie King TI said:
If you went through the guides I sent, you should have all your answers there.
1. The key used by DM-Verity is signed and kept in the vbmeta partition (from Android 8 onwards). Therefore you have to flash a vbmeta that has been signed or an empty vbmeta (that holds no key to do a check) to disable DM-VERITY.
2. vbmeta disables DM-verity and not Forceencryption. The disabler zips disable Forceencryption (and some disable DM-VERITY too). For zips that disable both Forceencryption and DM-Verity, you can use just it and not use the signed/empty vbmeta.
3. Your phone is protected out of the box for your own safety. If you want to take total control over it, you must alert the system by unlocking it (unlocking the bootloader). If you want to give back all the control to your phone, relock bootloader. Note that unlocking/locking bootloader wipes all your data so do backups first.
4. Bootloader is the first step and must be done, if not, the phone won't boot. After bootloader then comes turning off security barriers (DM-Verity, Forceencryption).
5. Though the steps might vary, they usually follow this manner:
• Unlock bootloader. Turn on the toggle in Developer options and then use fastboot to complete the unlocking
• Flash vbmeta to disable DM-VERITY
• Flash TWRP. Though Forceencryption has not been removed yet, TWRP will boot. Now format data in TWRP to temporarily make the phone decrypted. With a temporarily decrypted state, you can access your internal storage to select Forceencryption disabler zip. Flashing the zip makes decryption Permanent.
• You can now reboot or continue flashing other stuff like other recovery, GSI, custom ROM, magisk, etc. Most of them can be done from TWRP itself (the reason you need TWRP in the first place)
• Rooting is optional. You can decide not to root even if you have TWRP, custom ROM, etc. Some apps need superuser privileges to work and you can only use them in a rooted phone (the reason people root their phone). These apps are mostly those that modify the OS. Flashing magisk roots your phone.
Any doubts again?
Click to expand...
Click to collapse
Um, No, Thank you very very very much, You literally fixed all my confusions, I actually bricked my phone and had to go to support office previous month, and pay 2$ (500PKR) to fix it. That is why, I was asking and clearing my confusions. Thank you, Now I am very confident, That, I can now flash my device. Thank you!
TechySkills said:
Um, No, Thank you very very very much, You literally fixed all my confusions, I actually bricked my phone and had to go to support office previous month, and pay 2$ (500PKR) to fix it. That is why, I was asking and clearing my confusions. Thank you, Now I am very confident, That, I can now flash my device. Thank you!
Click to expand...
Click to collapse
Good to hear
{Mod edit: Quotation fixed - Oswald Boelcke, Moderator}
Sakodie King TI said:
[Links have been attached at the end of the explanation]...
I started this thread sometime ago and after following up, I have now documented everything.
-- DM-Verity (or Verified Boot), Forceencryption and SafetyNet are some basic Android security features. For security reasons, Android should boot with what the OEM has provided (modifications to partitions or modified/custom partitions are not trusted; the reason your phone won't boot or boots with a warning if you make changes to the OS).
-- DM-Verity checks for alterations when your phone is booting and if detected, Forceencryption encrypts the data partition to prevent a data breach. Meanwhile Safetynet is also triggered when you alter the OS and apps that depend on the strict Android security won't work well if SafetyNet fails.
-- TWRP (which can be flashed using: fastboot flash recovery TWRP.img)
is a custom recovery partition (not provided or approved by the OEM), GSI is a custom system partition (not approved by the OEM) and to install any custom partition, it is wise to disable the security barriers (Forceencryption, DM-Verity). As you are taking over control of your phone, whatever issue you fall into afterwards should be addressed to yourself.
-- In older Android versions, DM-verity sits in the boot partition. But in recent Android versions (9, 10, etc), it sits in the dedicated vbmeta partition and that is why you have to flash an empty/signed vbmeta image (using:
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img) to bypass DM-Verity. Google has a universal vbmeta image that works for all devices. For Forceencryption, you need to flash a disabler zip like dm-verity-and-forceencrypt-disabler zip (also disables DM-verity) or no-verity-opt-encrypt zip. Or you can also edit the vendor fstab file to remove encryption.
-- See What Is Verified Boot (DM-Verity) In Android And How To Disable It https://sakophone.wordpress.com/202...ce=728bab228a&preview=true&_thumbnail_id=4446
-- See Encryption, Decryption And Forceencryptin https://sakophone.wordpress.com/2022/01/03/encryption-decryption-and-forceencryptin/#forceencryption
Click to expand...
Click to collapse
So, I want to install twrp to install a custom rom, but you said if I want to change from miui to a custom rom, it needs a file called "vbmeta" but after I did a search, the vbmeta file is only needed if the device is running Android 8 and above, whereas my device is on Android 7 | MIUI 10 | Santoni, and it says it only needs DM-verity? What should I do to be able to install a custom ROM?
kjisoo said:
So, I want to install twrp to install a custom rom, but you said if I want to change from miui to a custom rom, it needs a file called "vbmeta" but after I did a search, the vbmeta file is only needed if the device is running Android 8 and above, whereas my device is on Android 7 | MIUI 10 | Santoni, and it says it only needs DM-verity? What should I do to be able to install a custom ROM?
Click to expand...
Click to collapse
vbmeta was introduced starting Android 8, so no need looking for a vbmeta if you are on Android 7. Starting Android 7, dm-verity had to be strictly enforcing (optional). If this is your case, then you can disable it in Android 7 by using flasher zips. Everything is in this guide.
What Is Verified Boot (DM-Verity) In Android And How To Disable It
Last Updated: February/21/2023 Contents Getting Started What Actually Is Verified Boot And Dm-Verity In Android How Verified Boot And DM-Verity Work In Older Devices (Android 7 And Below) How Verif…
sakophone.wordpress.com
@Kenora_I hi, maybe you know. I have Redmi 9 with soft upgraded to android 12.1 and i wanted boot temporary to SHRP. I tried fasboot flash recovery shrp.img and fasboot reboot recovery after but my device did not boot to recovery but started normally into system. May it be problem with vbmeta? My device ia A partition only.
Slawek_ said:
@Kenora_I hi, maybe you know. I have Redmi 9 with soft upgraded to android 12.1 and i wanted boot temporary to SHRP. I tried fasboot flash recovery shrp.img and fasboot reboot recovery after but my device did not boot to recovery but started normally into system. May it be problem with vbmeta? My device ia A partition only.
Click to expand...
Click to collapse
PART 1:
Maybe your device lacks recovery partition (common with new and AB slot devices). If this is so, "fastboot flash recovery shrp.img" won't work because there's no recovery partition (recovery now sits in boot partition as boot-ramdisk).
Such devices need two recovery files: img and zip. If you have the two, the ZIP should be in your phone and the img in your PC then first boot the SHRP:
fastboot boot shrp.img
When recovery boots up, locate and flash the ZIP then from SHRP, reboot recovery and enjoy.
NB: I am assuming the name of your img file is shrp.img which might differ.
PART 2:
However, if you are sure your device is A-only, then here you go (make sure the shrp.img is the one for your device and you have the universal vbmeta disable):
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot flash recovery shrp.img
## For AB devices with recovery partition, you can specify slot
fastboot flash recovery_a shrp.img
fastboot flash recovery_b shrp.img
Fastboot reboot
NB: You can choose to boot shrp (instead of permanently install) if you want to use it just now:
fastboot boot shrp.img
Hi @Sakodie King TI ,
I tried fastboot boot command but im getting "too many links error."
Treble check saying my phone is A partition only.
I also checked
fastboot flash recovery shrp.img
then rebooting manualy by volume up + pwr but then im getting bootloop while holding these keys.
That is why i asked is this can be caused by vbmeta.
Sakodie King TI said:
Maybe your device lacks recovery partition (common with new and AB slot devices). If this is so, "fastboot flash recovery shrp.img" won't work because there's no recovery partition (recovery now sits in boot partition as boot-ramdisk).
Such devices need two recovery files: img and zip. If you have the two, the ZIP should be in your phone and the img in your PC then first boot the SHRP:
fastboot boot shrp.img
When recovery boots up, locate and flash the ZIP then from SHRP, reboot recovery and enjoy.
NB: I am assuming the name of your img file is shrp.img which might diffe
Click to expand...
Click to collapse
Slawek_ said:
Hi @Sakodie King TI ,
I tried fastboot boot command but im getting "too many links error."
Treble check saying my phone is A partition only.
I also checked
fastboot flash recovery shrp.img
then rebooting manualy by volume up + pwr but then im getting bootloop while holding these keys.
That is why i asked is this can be caused by vbmeta.
Click to expand...
Click to collapse
Did you flash vbmeta first?
And try "fastboot reboot recovery" after flashing instead of using volume keys
I did not flash vbmeta at all. I'm afraid i will brick device.
Shouldn't shrp boot temporary without flashing vbmeta?
Slawek_ said:
I did not flash vbmeta at all. I'm afraid i will brick device.
Shouldn't shrp boot temporary without flashing vbmeta?
Click to expand...
Click to collapse
You have to flash vbmeta first. instead, doing it without flashing vbmeta means you are looking for ways to brick your device.
Hey @Sakodie King TI
So i did this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
After reboot recovery i got rebooted to system not recovery.
Also when i'm rebooting to recovery manually, i'm still on old muiu recovery nothing changed.
I took vbmeta from my firmware lancelot_eea_global_images_V13.0.3.0.SJCEUXM_20230111.0000.00_12.0_eea.
In that firmware there are also vbmeta_system.img and vbmeta_vendor.img maybe need to flash them also with --disable-verity --disable-verification parameters?