I have several modules in Magisk app and couple of apps having root authority after get root with Magisk (like Tasker). Now I want to update system while keeping my magisk apps and root-to-use apps working without any risk of stucking in reboot after install a new ROM.
Could I just firstly patch the boot.img of objective ROM in Magisk, replace the boot.img with magisk_pathed_XXXX.img and flash all the .img files needed? Will this way work? Or any other ways?
Are you just incrementing from let's say MIUI 12.0.4 to 12.0.5 ?
Can't you simply flash only new super.img ?
This should not affect Magisk while still updating your system.
lebigmac said:
Are you just incrementing from let's say MIUI 12.0.4 to 12.0.5 ?
Can't you simply flash only new super.img ?
This should not affect Magisk while still updating your system.
Click to expand...
Click to collapse
Flash super.img only? Will it be okay?
I'm gonna update my xiaomi.eu ROM, and the official update.bat script says it will flash not only super.img like this
@echo off
cd %~dp0
platform-tools-windows\fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *alioth"
if %ERRORLEVEL% neq 0 echo Missmatching image and device & exit /B 1
platform-tools-windows\fastboot %* flash dsp_ab images\dsp.img
platform-tools-windows\fastboot %* flash xbl_config_ab images\xbl_config.img
platform-tools-windows\fastboot %* flash boot_ab images\boot.img
platform-tools-windows\fastboot %* flash modem_ab images\modem.img
platform-tools-windows\fastboot %* flash vbmeta_system_ab images\vbmeta_system.img
platform-tools-windows\fastboot %* flash tz_ab images\tz.img
platform-tools-windows\fastboot %* flash vbmeta_ab images\vbmeta.img
platform-tools-windows\fastboot %* flash bluetooth_ab images\bluetooth.img
platform-tools-windows\fastboot %* flash abl_ab images\abl.img
platform-tools-windows\fastboot %* flash dtbo_ab images\dtbo.img
platform-tools-windows\fastboot %* flash featenabler_ab images\featenabler.img
platform-tools-windows\fastboot %* flash vendor_boot_ab images\vendor_boot.img
platform-tools-windows\fastboot %* flash keymaster_ab images\keymaster.img
platform-tools-windows\fastboot %* flash uefisecapp_ab images\uefisecapp.img
platform-tools-windows\fastboot %* flash qupfw_ab images\qupfw.img
platform-tools-windows\fastboot %* flash xbl_ab images\xbl.img
platform-tools-windows\fastboot %* flash cmnlib_ab images\cmnlib.img
platform-tools-windows\fastboot %* flash cmnlib64_ab images\cmnlib64.img
platform-tools-windows\fastboot %* flash devcfg_ab images\devcfg.img
platform-tools-windows\fastboot %* flash hyp_ab images\hyp.img
platform-tools-windows\fastboot %* flash imagefv_ab images\imagefv.img
platform-tools-windows\fastboot %* flash aop_ab images\aop.img
platform-tools-windows\fastboot %* flash cust images\cust.img
platform-tools-windows\fastboot %* flash super images\super.img
platform-tools-windows\fastboot %* set_active a
platform-tools-windows\fastboot %* reboot
How about that tutorial?
from min 02:26
I would like to ask the same question but not for Xiaomi EU, but for official global ROM
[ROM][MIUI][star/mars] Xiaomi.eu ROM for Xiaomi MI 11 Pro / Ultra
How to install Xiaomi.eu ROM for Xiaomi MI 11 Pro / Ultra We will release fastboot ROM versions until TWRP for star/mars is released TWRP RELEASED Steps to install xiaomi.eu ROM for first time from China ROM (All your data and files on...
forum.xda-developers.com
- Disable activated Magisk modules,
- Flash stock boot.img
- Update Rom
- Patch new boot.img
- Flash new patched boot.img
- Re-activated your Magisk modules
That's how I procede
I didn't get what you mean for flash stock boot.img anyway that tutorial is for Xiaomi EU, how can I update stock global ROM?
xNAPx said:
I didn't get what you mean for flash stock boot.img anyway that tutorial is for Xiaomi EU, how can I update stock global ROM?
Click to expand...
Click to collapse
I mean flash the original 'boot.img' (the one included in full fastboot's ROM of ROM you are actually on).
So :
- Disable activated Magisk modules,
- Flash stock boot.img ==> (the one included in full fastboot's ROM of ROM you are actually on)
- Update Rom
- Patch new boot.img ==> (the one included in full fastboot's ROM of new ROM)
- Flash new patched boot.img
- Re-activated your Magisk modules
I am still not sure how to update the EU Rom with root magisk access?
1) downloading the new Rom update
2) boot into twrp install the new update
3) reboot->install magisk.zip
4) boot into system
Is that the correct way? I am unsure because the mi 11 ultra has the A/B Slot thing...
Thank you...
chrissss91 said:
I mean flash the original 'boot.img' (the one included in full fastboot's ROM of ROM you are actually on).
So :
- Disable activated Magisk modules,
- Flash stock boot.img ==> (the one included in full fastboot's ROM of ROM you are actually on)
- Update Rom
- Patch new boot.img ==> (the one included in full fastboot's ROM of new ROM)
- Flash new patched boot.img
- Re-activated your Magisk modules
Click to expand...
Click to collapse
How?
Again How?
You mean reflashing magisk?
xNAPx said:
How?
Again How?
You mean reflashing magisk?
Click to expand...
Click to collapse
- Disable activated Magisk modules,
- Flash stock boot.img :
* Extract boot.img (from fastboot's ROM of ROM you are actually on) on your computer,
* Reboot your phone in fasboot
* On your computer run a cmd with :
Code:
fastboot flash boot_ab boot.img
- Update Rom
- Patch new boot.img :
* Extract boot.img from fastboot's ROM of new ROM,
* Copy this boot.img to your phone,
* In Magisk (which is still present), click on Install and search for copied file boot.img. It will create a file magisk_patched-23000_XXXXX.img
- Flash new patched boot.img :
* Copy file magisk_patched-23000_XXXXX.img on your computer,
* On your computer run a cmd with :
Code:
fastboot flash boot_ab magisk_patched-23000_XXXXX.img
- Re-activated your Magisk modules
Hope it answers to your questions.
Why made it so complicated?
- Disable all modules
- Reboot in TWRP
- Flash the updated ROM zip.
- No need to reboot
- Flash magisk zip (download from Here and change the extension from .apk to .zip)
- Reboot and re-enable all modules
- Reboot again.
Magisk A/B Retention Script
Fentadroid said:
Why made it so complicated?
- Disable all modules
- Reboot in TWRP
- Flash the updated ROM zip.
- No need to reboot
- Flash magisk zip (download from Here and change the extension from .apk to .zip)
- Reboot and re-enable all modules
- Reboot again.
Click to expand...
Click to collapse
Thank you very much !
Fentadroid said:
Why made it so complicated?
- Disable all modules
- Reboot in TWRP
- Flash the updated ROM zip.
- No need to reboot
- Flash magisk zip (download from Here and change the extension from .apk to .zip)
- Reboot and re-enable all modules
- Reboot again.
Click to expand...
Click to collapse
Yes your method is smplier but I didn't want to mess up with slot A/B with TWRP
Just use MiuiMix rom..... Comes pre-installed with Magisk....
Can you flash the stock ROM using twrp?
Ok I managed to update the official global ROM with magisk so for those interested
Download on your phone latest recovery package manually from trusted websites like mifirm
Disable magisk modules and reboot
Upon reboot go to settings->system version->Miui(top left button)-> in the updater click several times on the main icon to unlock hidden settings->once unlocked tap on the three dots on the top right and select "choose update package"->browse your folder to find the downloaded recovery package,select it and press the V button on the bottom->update will start->wait until completion and reboot
Once rebooted follow the procedure to flash magisk.zip
Reboot the phone into fastboot
Connect phone to the pc
Boot into twrp
Once in twrp flash dalvik and cache
Flash magisk.zip and rewipe dalvik and cache
Reboot system and voila
xNAPx said:
Ok I managed to update the official global ROM with magisk so for those interested
Download on your phone latest recovery package manually from trusted websites like mifirm
Disable magisk modules and reboot
Upon reboot go to settings->system version->Miui(top left button)-> in the updater click several times on the main icon to unlock hidden settings->once unlocked tap on the three dots on the top right and select "choose update package"->browse your folder to find the downloaded recovery package,select it and press the V button on the bottom->update will start->wait until completion and reboot
Once rebooted follow the procedure to flash magisk.zip
Reboot the phone into fastboot
Connect phone to the pc
Boot into twrp
Once in twrp flash dalvik and cache
Flash magisk.zip and rewipe dalvik and cache
Reboot system and voila
Click to expand...
Click to collapse
But you still had to reflash magisk?
Yes you have to because flashing the new update will recover the stock boot image, so you will need to reflash magisk again in order to reflash the boot image again
Related
Guys i have bricked MY mi3 16gb.
I was using Bitti opticancro build with extended partitiion.
as i want to go to miui v6. i flashed stock partition zip
Then i flashed miui stock recovery and tried to flash the miui latest rom
i forgot to rename the rom zip to update .zip so i couldnt insatll the miui rom.
the i tried to flash using fast fastboot mode but it is showing error as remote size too large.
now i am stuck with miui recovery and fastboot error.
pls help me to get back my phone.
If you can enter fastboot mode, then you can flash miui rom manually.
First unzip miui fastboot rom, place adb and fastboot files into the folder you just extracted. (ex. located in cancro_global_images_V6.4.3.0.KXDMICB_4.4_global\images)
And then press shift while in this folder to open terminal, type these one by one.
Code:
fastboot devices
fastboot flash tz tz.mbn
fastboot flash dbi sdi.mbn
fastboot flash sbl1 sbl1.mbn
fastboot flash rpm rpm.mbn
fastboot flash aboot emmc_appsboot.mbn
fastboot erase boot
fastboot flash misc misc.img
fastboot flash modem NON-HLOS.bin
fastboot flash modem1 NON-HLOS.bin
fastboot flash system system.img
fastboot flash system1 system.img
fastboot flash cache cache.img
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash boot1 boot.img
fastboot flash userdata userdata.img[B] (optional, need backup first, but I recommended to flash this if you want to use gapps)[/B]
fastboot reboot
You're done!
Android ADB Fastboot files is given if you don't have one.https://www.dropbox.com/s/ndud98a4ek3fvxg/Android_ADB_FASTBOOT.zip?dl=0
Or you can just fastboot flash TWRP recovery and then flash whatever you want from USB or something...
1)Install CWM recovery
2) Download restore-stock partition zip file from here http://www.htcmania.com/showpost.php?p=17750021&postcount=144
3) Flash it.
4) Now get in fastboot mode.
5) Get fasboot images from MIUI Forums
6) Flash it via MiFlash or use command line given by 2nd comment
7) Grab a coffee and you will be on miui in no time
8) use miui
Edit: http://xiaomi.eu/community/threads/5-5-8.27542/page-8#post-246332
There is modified flash_all.bat for Mi2, i beleive same works for cancro.
Code:
fastboot %* flash partition "%~dp0images\gpt_both0.bin" || @echo "Flash partition" && exit /B 1
Add this line after getvar and before flash lines in flash_all.bat and then MiFlash it like usually.
Flash cwm via fastboot, use "fastboot flash recovery recoveryname.img" and don't use this title, its not completely bricked.
Never run stock recovery until u manage to flash a stockrom.. Better remember that.. Save twrp or cwm.. In my case, on last monday, on twrp, i've accidentally wipe internal storage.. Luckily got 6 type of rom in usb-otg..
UPDATE4: New Treble guide is posted here. Ask all your questions here that aren't specific to other parts of Treble (e.g. the ROM or the TWRP). Thread lock requested. Thanks all!
UPDATE3: The new TWRP Installer with Treble Manager (for guided repartitioning) is now released. See this thread.
UDPATE2: Experimental RR builds for Treble is now released. This contains the required Vendor Pack for GSI use. See this thread.
UPDATE: We have succeed in booting a Phh-Treble GSI! See screenshot at Post #57. Stay tuned for user releases!
This thread will be kept for posterity, but I will request locking once we release stuff. Thanks you all for the support, and thanks to @ghpranav for lots of help and @phhusson for pointing me in the right direction on the last stretch.
Original post below
----------------------------------------------
Alright, here is my WIP guide for converting the Mi A1 to a Treble device and ROM.
NOT FOR NEWBIES. This is all manual stuff right now and if you do something wrong you CAN firm-brick your device! The project is incomplete and for developers/researchers only.
Please refrain from "good luck" and "can't wait for this" and "OMG you are the King of Kings ComsicDan, plz have my babies" and such posts.
Also note that you will NEED to get into EDL mode to restore stock partition table, if you need to, by flashing stock factory image with MiFlash or my Low-Level Backup Tool. MiFlash will WIPE your Userdata completely and your persist so you MUST make a low-level backup to restore original persist.img, and manually backup internal storage. But really it's perfectly fine to keep using a non-treble ROM even with partition table changes (there's no need to revert for any functional reason that I can think of, unless you somehow get a ROM that's bigger than 2.4GB). Note that the final update ZIP that will automatically repartition can also restore stock partitions, without the need for EDL stuff.
Prerequisite - Low-level backup, TWRP backup and Internal Storage backup
First make a full backup of all partitions, via EDL (low-level which gets all partitions). You can use my new Low-Level tool here. I recommend using the skip-systems-and-userdata list since it takes like an hour, and you can backup system/userdata faster in TWRP and PC manually.
Make a full TWRP backup of our current ROM. System needs to be erased during this procedure. After re-partitioning however, you can simply restore this backup (unless your system is > 2.4GB for some reason, which is very unlikely).
Make a full manual backup of your internal storage files to PC. Userdata partition needs to be completely erased if/when you restore the original stock partitions and firmware. You can postpone this process to later however, for if/when you want to actually restore to stock partition layour.
Phase 1 - Repartition device for vendor_a and vendor_b
This is relatively simple. Our device has a standard GPT table, so we can use sgdisk which is already included in our TWRP build.
Boot into recovery and fire up an adb shell
View current partition table...
Code:
sgdisk /dev/block/mmcblk0 --print
...and confirm these values...
Code:
...
25 1185792 7477247 3.0 GiB FFFF system_a
26 7477248 13768703 3.0 GiB FFFF system_b
...
49 14550032 61071326 22.2 GiB FFFF userdata
The important values are the partition numbers (25, 26 and 49), and the next two numbers for both system partitions (start/end sectors). The start/end sector of userdata isn't important, only the partition number of 49 is. If your sector start/ends are different, you will need to adjust some of the values in these steps - that's up to you to figure out. But do please let me know what your differences are, for science.
Remove system_a, and create a new system_a partition of size ~2.4GB. Don't worry, this is plenty - my current RR build with a heavy AROMA Gapps is only ~1.9GB. We're taking off ~600MB, which is 1228800 sectors (600*1024*1024/512) so the new end sector will be 6248447 (7477247 - 1228800):
Code:
sgdisk /dev/block/mmcblk0 --delete 25
sgdisk /dev/block/mmcblk0 --new=25:1185792:6248447
sgdisk /dev/block/mmcblk0 --change-name=25:system_a
Create vendor_a with the reclaimed ~600MB:
Code:
sgdisk /dev/block/mmcblk0 --new=50:6248448:7477247
sgdisk /dev/block/mmcblk0 --change-name=50:vendor_a
...notice the partition number of 50 - one after the userdata (49).
Do similarly to above, only for system_b and vendor_b:
Code:
sgdisk /dev/block/mmcblk0 --delete 26
sgdisk /dev/block/mmcblk0 --new=26:7477248:12539903
sgdisk /dev/block/mmcblk0 --change-name=26:system_b
sgdisk /dev/block/mmcblk0 --new=51:12539904:13768703
sgdisk /dev/block/mmcblk0 --change-name=51:vendor_b
Quit shell and reboot recovery...
Code:
adb reboot recovery
...and verify the new partitions exist...
Code:
adb shell ls -la /dev/block/bootdevice/by-name/
...should show this at the bottom...
Code:
...
lrwxrwxrwx 1 root root 21 Jan 5 1970 userdata -> /dev/block/mmcblk0p49
lrwxrwxrwx 1 root root 21 Jan 5 1970 vendor_a -> /dev/block/mmcblk0p50
lrwxrwxrwx 1 root root 21 Jan 5 1970 vendor_b -> /dev/block/mmcblk0p51
Repartition is done! You can now restore your TWRP backup (only system) and system works perfectly as before.
Roadblocks of Phase 1
How best to deliver this partition table change to users? The obvious answer is an update ZIP that just scripts it all (that's why I used sgdisk in this write-up). But then this requires the user to manually backup, reboot recovery, then restore backup. Is that ideal?
Another solution would be to export the new GPT, and make a MiFlash-flashable package. This could be another option for future, but would require new system and vendor images too - may as well be a whole flash package. That's big. We'll look into that once we actually get a Treble ROM working (e.g. stock).
Phase 1b revert - Restore stock partition map
If you want to go back to original partition table for some reason, you will need to flash an official fastboot ROM via EDL mode in MiFlash. After researching, I have discovered that there is no way around this. The way MiFlash works is it actually adjusts the GPT info dynamically based on *your* partition map (64GB vs 32GB have different userdata sizes) and for this to be done it needs to flash a full package. So, to restore stock partition map, you must flash a stock ROM in MiFlash via EDL mode which wipes everything. I hope you made a low-level and internal-storage backup like I warned - because after that you'll want to restore your backup to get persist and stuff back. Flashing in fastboot mode is not enough because it does not restore stock partition table.
Full steps for restoring to stock:
Boot into EDL mode
Load MiFlash, select any Oreo fastboot image (I use 8.1.10 since it's what I have) > Refresh. Should show COM30 (or whatever your QDLoader COM port is).
Reboot EDL by holding Power + VolDown and then 'fastboot oem edl' again
Run the restore in my Low-level flash tool of your backup
Reboot back into recovery by holding power + volume-up for ~10 seconds.
"Skip" on password screen
Wipe > Format Data > type "yes" to remove stock ROM encryption
Restore your TWRP backup
Done!
Phase 2 - Patch kernel DTB and TWRP
This requires Linux. I use ChaletOS in VirtualBox and have my home folder Samba shared, mapped to a network drive on my Windows host.
Probably when all this is finalized and working, we will use a custom kernel built from source. But for now lets just patch our existing kernel. I assume you already have TWRP installed.
Part 1 - Kernel DTB
Download the DTB split tool from:
https://github.com/dianlujitao/split-appended-dtb
...to your Linux machine. Just get the binary, not the .c source file.
Dump existing boot.img while in TWRP and pull from device:
Code:
adb shell dd if=/dev/block/bootdevice/by-name/boot of=/tmp/boot.img
adb pull /tmp/boot.img
Unpack this boot.img. I use AIK by @osm0sis from:
https://forum.xda-developers.com/showthread.php?t=2073775
... In this case, we need boot.img-zImage. Copy it to the Linux machine folder with DTB split.
Split DTB from zImage on Linux machine:
Code:
./split-appended-dtb boot.img-zImage
...should produce 1 DTB. Total output will be two files - "kernel" and "dtbdump_1.dtb".
Decompile DTB on Linux machine:
Code:
# if you need to install it
sudo apt install device-tree-compiler
dtc -O dts -I dtb -o dtbdump_1.dts dtbdump_1.dtb
Edit dtbdump_1.dts in whatever text editor. Search for fstab and edit the vendor entry, adding "slotselect" to fsmgr_flags (so it's the same as system):
Code:
fsmgr_flags = "wait,slotselect";
NOTE: This is on my RR kernel. I need to check any difference with stock or other kernels.
Recompile the dts to dtb and build a new zImage:
Code:
dtc -O dtb -I dts -o dtbdump_1_new.dtb dtbdump_1.dts
cat kernel dtbdump_1_new.dtb > boot.img-zImage.new
Copy the boot.img-zImage.new back to your kernel kitchen tool, replacing the old one.
That's the device tree patched to mount seamless/slot vendor. But don't repack the boot.img yet, we need to edit RAMDisk.
Part 2 - TWRP patch
This is just so we can see Vendor (and Persist, because why not) in TWRP. This is so:
Vendor can be formatted (required before use), backed up/restored and flashed to
[Bonus] Persist can be backed up/restored and flashed to (for e.g. Persist repair ZIP's that should come soon).
Only one step is needed - edit /etc/recovery.fstab to add vendor mount (and also persist because why not) with flags:
Code:
/vendor ext4 /dev/block/bootdevice/by-name/vendor flags=slotselect;backup=1;wipeingui;display="Vendor"
/persist ext4 /dev/block/bootdevice/by-name/persist flags=backup=1;display="Persist"
That's it.
For your convenience, I have attached a Treble-modded TWRP installer to this thread with these changes. Don't forget to flash Magisk after re-installing TWRP. Big thanks to @ghpranav
Phase 3 - Compile a Treble ROM (for Vendor files)
Already succeeded. We just need to cleanup and push.
Phase 4 - Treble-ize an installed ROM
Is this possible? Not sure... I'll check it out later sometime
Did I miss anything? Probably. Let me know!
I just realized we could use resize2fs to first shrink the system filesystem, and that would save a reboot step. Obviously a TWRP should be done first anyway, though.
Oh, but a reboot would still be necessary for TWRP to see the vendor partition so it can be written to. So... That seems pointless I think.
Hmm...
Just finished reading everything. You did a wonderful job explaining this and I'm eager to test this out even if my device is my daily driver. With that being said, I really hope inexperienced users would stay away from this thread and refrain asking silly questions. I especially want them to stay away from complaining that they bricked their device, etc etc. By the looks of this, it should be easy considering you got the partition sectors noted down and most if not all users have the 64GB variant. It should be fairly easy making the ROM boot as long as it caters to A/B partitioning (already available in XDA) and that the Vendor HALs wouldn't cause further trouble.
With all of that, I'm looking forward to testing Android P as soon as we got treble tested up and running.
Thanks for taking your time to explain this thoroughly and I appreciate all the efforts you've put into this, especially automating the process by making a backup tool and hopefully, a working TWRP for Treble.
Looking at the Treble threads, I see some devs have started working on Android P. Link here.
Sent from my Xiaomi Mi A1 using XDA Labs
joeyhuab said:
Just finished reading everything. You did a wonderful job explaining this and I'm eager to test this out even if my device is my daily driver. With that being said, I really hope inexperienced users would stay away from this thread and refrain asking silly questions. I especially want them to stay away from complaining that they bricked their device, etc etc. By the looks of this, it should be easy considering you got the partition sectors noted down and most if not all users have the 64GB variant. It should be fairly easy making the ROM boot as long as it caters to A/B partitioning (already available in XDA) and that the Vendor HALs wouldn't cause further trouble.
With all of that, I'm looking forward to testing Android P as soon as we got treble tested up and running.
Thanks for taking your time to explain this thoroughly and I appreciate all the efforts you've put into this, especially automating the process by making a backup tool and hopefully, a working TWRP for Treble.
Looking at the Treble threads, I see some devs have started working on Android P. Link here.
Sent from my Xiaomi Mi A1 using XDA Labs
Click to expand...
Click to collapse
Thanks mate! Yep I've seen them but based on Phh's work, at least Oreo Treble GSI depends on VTS which isn't released yet. So I'm not sure how long until we get it.
I just learned that in order to get stock GPT back you basically have to fully erase the device via flash_factory in MiFlash. Technical details added to the OP.
So, apart from low-level flash, you will also want to backup internal storage before reverting - since factory flash wipes absolutely everything and TWRP won't backup storage. Then of course you can use my low-level tool to restore partitions via EDL to get your (e.g.) persist and stuff back, then restore the associated TWRP backup.
Just a reminder ,
EDL mode uses rawprogram0 , prog_emmc_firehose_8953_ddr.mbn , patch0 or partition isn't it ? Flash_factory will erase all the partition and causes device lost of IMEI , ESN, PSN and others sensors settings . and only flash-able during Fastboot mode .
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *tissot" || @ECHO "error : Missmatching image and device" & exit /B 1
fastboot %* oem unlock || @ECHO "unlock error" & exit /B 1
fastboot %* flash partition %~dp0images\gpt_both0.bin || @ECHO "Flash gpt_both0 error" & exit /B 1
fastboot %* flash modem_a %~dp0images\NON-HLOS.bin || @ECHO "Flash modem_a error" & exit /B 1
fastboot %* flash modem_b %~dp0images\NON-HLOS.bin || @ECHO "Flash modem_b error" & exit /B 1
fastboot %* flash sbl1 %~dp0images\sbl1.mbn || @ECHO "Flash sbl1 error" & exit /B 1
fastboot %* flash sbl1bak %~dp0images\sbl1.mbn || @ECHO "Flash sbl1bak error" & exit /B 1
fastboot %* flash rpm %~dp0images\rpm.mbn || @ECHO "Flash rpm error" & exit /B 1
fastboot %* flash rpmbak %~dp0images\rpm.mbn || @ECHO "Flash rpmbak error" & exit /B 1
fastboot %* flash tz %~dp0images\tz.mbn || @ECHO "Flash tz error" & exit /B 1
fastboot %* flash tzbak %~dp0images\tz.mbn || @ECHO "Flash tzbak error" & exit /B 1
fastboot %* flash devcfg %~dp0images\devcfg.mbn || @ECHO "Flash devcfg error" & exit /B 1
fastboot %* flash devcfgbak %~dp0images\devcfg.mbn || @ECHO "Flash devcfgbak error" & exit /B 1
fastboot %* flash dsp %~dp0images\adspso.bin || @ECHO "Flash dsp error" & exit /B 1
fastboot %* flash fsg %~dp0images\fs_image.tar.gz.mbn.img || @ECHO "Flash fs_image error" & exit /B 1
fastboot %* flash sec %~dp0images\sec.dat || @ECHO "Flash sec error" & exit /B 1
fastboot %* flash splash %~dp0images\splash.img || @ECHO "Flash splash error" & exit /B 1
fastboot %* flash aboot %~dp0images\emmc_appsboot.mbn || @ECHO "Flash aboot error" & exit /B 1
fastboot %* flash abootbak %~dp0images\emmc_appsboot.mbn || @ECHO "Flash abootbak error" & exit /B 1
fastboot %* flash boot_a %~dp0images\boot.img || @ECHO "Flash boot_a error" & exit /B 1
fastboot %* flash boot_b %~dp0images\boot.img || @ECHO "Flash boot_b error" & exit /B 1
fastboot %* flash system_a %~dp0images\system.img || @ECHO "Flash system_a error" & exit /B 1
fastboot %* flash system_b %~dp0images\system.img || @ECHO "Flash system_a error" & exit /B 1
fastboot %* flash lksecapp %~dp0images\lksecapp.mbn || @ECHO "Flash lksecapp error" & exit /B 1
fastboot %* flash lksecappbak %~dp0images\lksecapp.mbn || @ECHO "Flash lksecappbak error" & exit /B 1
fastboot %* flash cmnlib %~dp0images\cmnlib.mbn || @ECHO "Flash cmnlib error" & exit /B 1
fastboot %* flash cmnlibbak %~dp0images\cmnlib.mbn || @ECHO "Flash cmnlibbak error" & exit /B 1
fastboot %* flash cmnlib64 %~dp0images\cmnlib64.mbn || @ECHO "Flash cmnlib64 error" & exit /B 1
fastboot %* flash cmnlib64bak %~dp0images\cmnlib64.mbn || @ECHO "Flash cmnlib64bak error" & exit /B 1
fastboot %* flash keymaster %~dp0images\keymaster.mbn || @ECHO "Flash keymaster error" & exit /B 1
fastboot %* flash keymasterbak %~dp0images\keymaster.mbn || @ECHO "Flash keymasterbak error" & exit /B 1
fastboot %* flash userdata %~dp0images\userdata.img || @ECHO "Flash userdata error" & exit /B 1
fastboot %* flash persist %~dp0images\persist.img || @ECHO "Flash persist error" & exit /B 1
fastboot %* erase modemst1
fastboot %* erase modemst2
fastboot %* erase config || @ECHO "Erase config error" & exit /B 1
fastboot %* reboot bootloader
ping 127.0.0.1 -n 5 -w 1000 > nul
fastboot %* set_active a
fastboot %* reboot
also , those code are NOT compatible for Mi A1 as modem uses modem.img not NON-HLOS.bin, sbl.img not sbl.mbn etc . for more information you may compare with flash_all with flash_factory .
well just curious i read whole thread but i didn't get that is
repartitioning affect A/B partition system or
we are lucky and have A/B and Treble both at same time?
also except developer if someone tries and flash this successfully then do post SS ???
p.s don't tell me to try it neither i am developer or researcher ?
Regards
JoKeRLeE said:
*snip*
Click to expand...
Click to collapse
Yes you are right, flash_factory is only for fastboot mode. It doesn't matter what is chose when in EDL mode as it will flash everything.
But I think EDL mode is still needed, since MiFlash recalculates the partition table. Maybe it does in fastboot mode too but I don't know, it just flashes to "partition" via fastboot.
YMMV. I do it in EDL and it works fine.
Don't know or care if any of the firmware files are incompatible (are you sure? That seems strange if so, why would they be in the A1 package if they're not) since we restore a backup from my tool anyway which does all partitions exactly how they were on your device. The only purpose of MiFlash in this case is to rewrite partition table.
murtaza1326 said:
well just curious i read whole thread but i didn't get that is
repartitioning affect A/B partition system or
we are lucky and have A/B and Treble both at same time?
also except developer if someone tries and flash this successfully then do post SS ??? regards
p.s don't tell me to try it neither i am developer or researcher ?
Regards
Click to expand...
Click to collapse
Yes, as you can see it's "vendor_a" and "vendor_b", one for each slot.
There are no screenshots lol, unless you want to see a screenshot of TWRP with a Vendor mount listing ? ?
CosmicDan said:
Yes, as you can see it's "vendor_a" and "vendor_b", one for each slot.
There are no screenshots lol, unless you want to see a screenshot of TWRP with a Vendor mount listing ? ?
Click to expand...
Click to collapse
well yeah i missed that
about screen shot that treble app on playstore or any other thing which state both
also i wonder if GSI images are flashable or moded treble roms should be there ?
Interesting.
As i know, we also need to work with .dts to make it possible with treble inside kernel source with A/B partition layout.
murtaza1326 said:
well yeah i missed that
about screen shot that treble app on playstore or any other thing which state both
also i wonder if GSI images are flashable or moded treble roms should be there ?
Click to expand...
Click to collapse
Not there yet mate, patience ?
khusika said:
Interesting.
As i know, we also need to work with .dts to make it possible with treble inside kernel source with A/B partition layout.
Click to expand...
Click to collapse
Really? This might be what I'm stuck on. No idea what it is though.
I just get recovery loop if I try to Treble-ize a ROM, and GSI's kick me to fastboot. I was suspecting that it could be kernel, but I am seeking help from Phh about it.
Do you have any links that might point me in the right direction? Meanwhile I'll see what I find in Google.
Great job. Just a question, if you restore by doing flash_factory.bat - it deletes your IMEI, or not?
CosmicDan said:
Really? This might be what I'm stuck on. No idea what it is though.
I just get recovery loop if I try to Treble-ize a ROM, and GSI's kick me to fastboot. I was suspecting that it could be kernel, but I am seeking help from Phh about it.
Do you have any links that might point me in the right direction? Meanwhile I'll see what I find in Google.
Click to expand...
Click to collapse
I'll try to provide treble for A/B with the kernel, in the next day
TrueMS said:
Great job. Just a question, if you restore by doing flash_factory.bat - it deletes your IMEI, or not?
Click to expand...
Click to collapse
Maybe. I don't know. It's kind of a moot point because if it does, my low-level backup tool will backup and restore it anyway.
khusika said:
I'll try to provide treble for A/B with the kernel, in the next day
Click to expand...
Click to collapse
Cool beans!
I was reading on Android source docs that it might be related to early mount (vboot or whatever our device uses) missing vendor. So there's still leads to work on. But no rush, whenever you can
Oh BTW, if it's compatible with stock blobs would be good (i.e. stock kernel/ROM). Using stock vendor seems like the ideal way to go.
We can use /b partition as vendor making phone /a system only without use of edl (this makes more easy recover this partition). Also if we have /cust we can use it as vendor without repartition only with recovery/kernel support.
I think it's not ideal
xemisxu said:
We can use /b partition as vendor making phone /a system only without use of edl (this makes more easy recover this partition). Also if we have /cust we can use it as vendor without repartition only with recovery/kernel support.
Click to expand...
Click to collapse
As no one wants to get rid of A/B in exchange of Treble! Both are important! And Google is pushing hard OEMs to implement A/B in near future! So, both are actually important! Moreover getting rid of it seems loosing integrity to me!
As far I know, A1 doesn't have a /cust partition!
BTW, as @CosmicDan has found a way to re-partiton, then there's no point of getting rid of anything!
And to me using /b as vendor is awful waste of space! 3 GB for vendor... Seriously?!?:cyclops:
He is using (or we need) 600*2=1200MB though!
I think he could shrink some spaces from /data instead of system! But it seems he got the 32 GB variant!
Just kidding LoL!:laugh::laugh::laugh:
SomratMJX said:
As no one wants to get rid of A/B in exchange of Treble! Both are important! And Google is pushing hard OEMs to implement A/B in near future! So, both are actually important! Moreover getting rid of it seems loosing integrity to me!
As far I know, A1 doesn't have a /cust partition!
BTW, as @CosmicDan has found a way to re-partiton, then there's no point of getting rid of anything!
And to me using /b as vendor is awful waste of space! 3 GB for vendor... Seriously?!?:cyclops:
He is using (or we need) 600*2=1200MB though!
I think he could shrink some spaces from /data instead of system! But it seems he got the 32 GB variant!
Just kidding LoL!:laugh::laugh::laugh:
Click to expand...
Click to collapse
LoL , Repartiton system is the best choice . i don't think user want to waste another 1.2GB for Vendor partition ... just my thought
JoKeRLeE said:
LoL , Repartiton system is the best choice . i don't think user want to waste another 1.2GB for Vendor partition ... just my thought
Click to expand...
Click to collapse
Just thinking how much space Android P and beyond will need in /system!
SomratMJX said:
As no one wants to get rid of A/B in exchange of Treble! Both are important! And Google is pushing hard OEMs to implement A/B in near future! So, both are actually important! Moreover getting rid of it seems loosing integrity to me!
As far I know, A1 doesn't have a /cust partition!
BTW, as @CosmicDan has found a way to re-partiton, then there's no point of getting rid of anything!
And to me using /b as vendor is awful waste of space! 3 GB for vendor... Seriously?!?:cyclops:
He is using (or we need) 600*2=1200MB though!
I think he could shrink some spaces from /data instead of system! But it seems he got the 32 GB variant!
Just kidding LoL!:laugh::laugh::laugh:
Click to expand...
Click to collapse
Sure,re-partition is the best option cause we dont have /cust partition.
I know that 5x have it but i didn know if A1 have it.
Ty for answer!
SomratMJX said:
Just thinking how much space Android P and beyond will need in /system!
Click to expand...
Click to collapse
Android P Dev Preview 2 for Mi Mix 2s is around 1.4GB in size.
Based it from here: http://bigota.d.miui.com/8.5.3/polaris_dp_global_images_8.5.3_20180503.0000.00_9.0_ef2f024b87.tgz
So it should be the around the same size for our treble.
Yeah guys, ROM's are not big anymore since Google themselves don't bother doing odex'ing (or ART'ing, whatever you want to call it now; you know like odex/deodex) since they know that most system apps just get updated from Play Store anyway and their odex goes on userdata. Also in modern Android apps can run fast before full odex/ART optimisation (that's why we have such fast booting)
Yeah I'm 32GB, it's fine I have plenty of space (we have microSD remember lol). But vendor_a and vendor_b is the way it should be for compatibility. It also keeps the doors open for dual boot in future
I don't want to mess around with resizing data. 2.4GB for System and 600MB for vendor is a comfortable figure.
I created this thread to serve as a "All in One" thread with all possible known solutions to repair the infamous Persist issue that some unfortunate people have experienced. Symptoms can include the EFS No Signal issue, and eventually the phone will shut down and no longer being able to boot to system, even when formatted the ever present persist error messages in TWRP seem unfixable. until now.
Option 1
The most simple and easy option
The easiest solution for resolving a persist issue is to restore your Full TWRP backup. That is if you were careful enough to make a full backup that included backing up the persist image.
Update repair file April 2020:
Option 2
Download this file and follow the steps on the link below
File: https://androidfilehost.com/?fid=4349826312261781866
See this page on this thread for the steps to use the tested and working file above: : https://forum.xda-developers.com/showpost.php?p=82346409&postcount=76
I will leave the other optional methods below posted just in case this file does not work for some people. Also If you are visiting this thread from another device and need similar help. Send me a PM and I can make a solution for your device, I also have made fixes for DBTO issues
Once your issue is resolved :
Immediately go make a full backup and save it to your desktop and you will never have to deal with the annoyance. of a persist related issue.
Note that you must use The most current Orange Fox or the LR Team version of TWRP, because it is one of the few versions that include the option of backing up and restoring persist.
Recommended Tools Needed for preventative measure and for the additional options below
A Recovery that can backup and restore the persist partition
April 2020 version of Orange Fox or LR Team TWRP will suffice
Orange Fox: https://sourceforge.net/projects/orangefox/files/dipper/OrangeFox-R10.1-Stable-dipper.zip/download
LR Team version of TWRP
Non-Q version: https://androidfilehost.com/?fid=4349826312261636232[/url]
Q version: https://androidfilehost.com/?fid=4349826312261636230[/url]
You must use one of these versions of TWRP, because they both have the ability to write to the persist partition.
Backup your data if possible (most likely you can’t ) and you need to remove all encryption by formatting user data
If you do not have a backup and the flashable persist solution does not work, I would suggest starting clean by restoring the phone with a fastboot rom.
Fastboot Images Rom
Any Dipper images rom will work, BUT Must be the version for your device) Below is for Global devices only.
Global Stable Fastboot 11.0.3.0 : dipper_global_images_V11.0.3.0.QEAMIXM_20200118.00 00.00_10.0_global
Alternatively you can use the older 11.0.6
http://bigota.d.miui.com/V11.0.6.0....XM_20191022.0000.00_9.0_global_fe09c43d5a.tgz
OR one of these alternate Archive of Image Roms : Make sure you choose for your device ( Global or China) . Also, I will add additional official links here as I find them I have not been able to find an official link for 11.03. but I have inspected and scanned it and it is purely stock.
https://xiaomifirmware.com/roms/download-official-miui-roms-for-xiaomi-mi8-dipper/
Option 3
In the unlikely event that the flashable fix fails unpack the fastboot rom, and manually extract the persist.img and then place it into the sd folder of your phone using the TWRP recovery file manager.
1. Boot to TWRP ( Command below only works if booted to TWRP Recovery)
2. Go to advanced, then terminal
3. type: dd if=/sdcard/persist.img of=/dev/block/bootdevice/by-name/persist
4. After its finished reboot to the system, finished
5. Alternate step here
Option 4 - If using an older Oreo or Pie rom
Ensure that you have proper Recovery installed and have downloaded the images file
1. Chose wipe-> 'format data' in TWRP, type yes, reboot to recovery English and then complete the full wipe steps and flash Magisk.
2. Next, Install the TWRP that I mentioned later versions of TWRP do not have the option to flash the persist image alone.
3. This version of TWRP is in Chinese you need to change it to English.
4. Go to settings/ globe to activate the English version. > Reboot to recovery
5. Copy persist.image to your MI8 using desktop
6. The persist image file is inside the unpacked images rom folder that you should have downloaded.
7. Within In TWRP File manager: Chose to install image, and copy persist image into the partition folder “persist”
8. Format all data and the persist will be unlocked
9. Flash Magisk
10. Done, You should be back in Business.
Option 5 - Flashall.bat restore
1. Enter Fastboot mode
2. Download fastboot dipper images rom, and use flashall.bat method to restore the phone.
3. Download dipper images rom. > Important>>>>>> It must be a fastboot rom and not a Recovery rom
4. Unpack the rom twice on your desktop
5. You will be left with a folder and inside you will see batch files and an image folder.
6. Doubleclick Flashall.bat ( be careful on what you click, you want flashall.bat only) with the phone attached an in Recovery mode, fastboot or EDL
7. Flashall.bat is a batch script that will wipe your phone and restore all images and then boot to the system.
8. You should then Setup rom
9. Afterwards, install TWRP and root then create a full Twrp backup and save to your PC.
10. This way you will have a quick solution if you ever need it again in the future.
11. Enjoy a working phone
Flashall.bat : Described here : https://forum.xda-developers.com/showpost.php?p=81532611&postcount=8
Partitions backed up by LR Team listed here : https://forum.xda-developers.com/showpost.php?p=81532463&postcount=7
If I just saved your phone and a mountain of headaches, please say thanks by clicking the thanks button or better yet I would certainly welcome a small donation for Pizza or beer.
Attached Images Explanation :
The first image illustrates the location of the persist image found within the Images Rom, this is what you will use to overwrite, the persist partition.
The 2nd image : shows the backed up files perist files when you have madea backup using one of the recommended versions of recovery. if your issue is resolved, make a backup now and store it on your desktop. This way if you encounter a persist issue, it can be fixed within seconds by booting to recovery and restoring persist ( Again It must be you own persist, You cannot restore someone else persist backup to your phone or you will cause irreparable damage.
Worst case scenario: I live in the US, if you are local and you still having trouble, feel free to send me a PM. If you arrange shipping and mail your phone to me. I will attempt to repair it and if successful there will be a very small and reasonable fee.
Good luck
I have spent literally over one hundred hours researching this issue, before discovering a universal solution that should work for most people. However, I have found that it will not permanently repair phones that have either restored someone else TWRP persist back up, or that they have manually IMEI modified. DO NOT PM ME about this is issue unless you have made a donation in advance, this thread provides everything that you need to know and you are getting it for free by reading the above options.
Reserved
tsongming said:
Since I have written the persist instructions on practically every thread out there and still receive PM's daily asking for help I have created this all in One thread with all possible solutions to repair a Persist issue ( AKA, EFS No Signal issue, or Persist error messages in TWRP)
Common Courtesy on XDA is Clicking Thank you.
Click here to learn more
Thank you Rant
Next, I don’t mind with short quick tips. But for these extended types of solutions, it's very annoying that people in the Mi8 forum cannot be bothered to click the thank you button.
Watching my statistics improve with the thanks button being clicked is almost as good as a beer. Click it, don't say it.
Once your issue is resolved :
Immediately go make a full backup and save it to your desktop and you will never have to deal with the annoyance. of a persist related issue. Note that you must use the LR Team version of TWRP, because it is one of the few versions that include the option of backing up and restoring persist.
Back to the Matter at Hand.
So I am guessing that you flashed something incorrectly and now your persist partition is corrupt. Absolutely, I have personally had this issue myself, more than once, and the easiest and best way is to restore your Full TWRP backup if you have one.
Tools Needed
LR Team version of TWRP
Non-Q version: https://androidfilehost.com/?fid=4349826312261636232
Q version: https://androidfilehost.com/?fid=4349826312261636230
You must use this version of TWRP, because it has the ability to write to the persist partition.
Backup your data if you can, most likely you can’t and it’s gone so you need to remove all encryption by formatting user data.
Fastboot Images Rom ( Any Dipper images rom will work, BUT Must be the version for your device) Below is for Global
http://bigota.d.miui.com/V11.0.6.0....XM_20191022.0000.00_9.0_global_fe09c43d5a.tgz
Alternate Archive of Image Roms, make sure you choose for your device. Also, I will add additional official links here as I find them.
https://xiaomifirmware.com/roms/download-official-miui-roms-for-xiaomi-mi8-dipper/
Option 1
• The absolute best method is to use a Twrp restore if you have one. Did you save any Twrp backups to your PC?
FYI Trivia: the release date of the firmware doesn't matter, If you use diff or Beyond Compare to analyse file differences you will find nothing different.
Option 2
• Unpack the fastboot rom, and manually extract the persist.img and then place it into the sd folder of your phone using the TWRP recovery file manager.
1. Boot to TWRP
2. Go to advanced, then terminal
3. type: dd if = / sdcard / persist.img of = / dev / block / bootdevice / by-name / persist
4. After its finished reboot to the system, finished
Option 3
Ensure that you have proper TWRP installed and have downloaded the images file
1. Chose wipe-> 'format data' in TWRP, type yes, reboot to recovery English and then complete the full wipe steps and flash Magisk Canary.
2. Next, Install the TWRP that I mentioned later versions of TWRP do not have the option to flash the persist image alone.
3. This version of TWRP is in Chinese you need to change it to English.
4. Go to settings/ globe to activate the English version. > Reboot to recovery
5. Copy persist.image to your MI8 using desktop
6. The persist image file is inside the unpacked images rom folder that you should have downloaded.
7. Within In TWRP File manager: Chose to install image, and copy persist image into the partition folder “persist”
8. Format all data and the persist will be unlocked
9. Flash Magisk
10. Done, You should be back in Business.
Option 4
1. If you are unable to access fastboot, you will need to go into EDL mode ( absolutely use Fastboot if available)
2. Download fastboot dipper images rom, and use flashall.bat method to restore the phone.
3. Download dipper images rom. Note: It has to be a fastboot rom and not a Recovery rom
4. Unpack the rom twice on your desktop
5. You will be left with a folder and inside you will see batch files and an image folder.
6. Doubleclick Flashall.bat ( be careful on what you click, you want flashall.bat only) with the phone attached an in Recovery mode, fastboot or EDL
7. Flashall.bat is a batch script that will wipe your phone and restore all images and then boot to the system.
8. You should then Setup rom
9. Afterwards, install TWRP and root then create a full Twrp backup and save to your PC.
10. This way you will have a quick solution if you ever need it again in the future.
11. Enjoy a working phone
Errors may exist in this post, I barely proofread it so let me know if there are any errors and check back I will fine tune it over the next few days.
Finally, I just saved your phone. So go click thanks, clicking thanks is what provides motivation to help you. or better yet, buy me a beer.
Images Explanation :
The first image on the left is the persist file within the Images Rom, this is what you will use to overwrite, the persist partition.
The 2nd image is what the perists files look like if you backup persist with the LR Team versions of TWRP, if you encounter a persist issue, it can be fixed in 10 seconds by boot to recovery and restoring persist ( It must be you own persist, You cannot restore someone else persist or your phone will be much m8uch worse off, and probably unfixable.
Click to expand...
Click to collapse
Hey Thanks so much for this post. However, for Option 2 , the command is not working , Then i tried dd if=/sdcard/persist.img of=/dev/block/bootdevice/by-name/persist, it worked but the issue was not solved.
and for Option 4 . i pressed the flash_all.bat but nth came out , so i installed fastboot files into the fastboot file and when i click the flashall.bat it worked . but then after setting up , my IMEI , Wifi and simcard were still dead
Any suggestion?
Once again im soo grateful for this but my 16 thanks limit is up
Theevanz said:
Hey Thanks so much for this post. However, for Option 2 , the command is not working , Then i tried dd if=/sdcard/persist.img of=/dev/block/bootdevice/by-name/persist, it worked but the issue was not solved.
and for Option 4 . i pressed the flash_all.bat but nth came out , so i installed fastboot files into the fastboot file and when i click the flashall.bat it worked . but then after setting up , my IMEI , Wifi and simcard were still dead
Any suggestion?
Once again im soo grateful for this but my 16 thanks limit is up
Click to expand...
Click to collapse
Okay, I am getting ready to go to bed so this post will be brief. Persist issues are usually caused by encryption, or somehow the persist image gets wiped. I used a spellchecker and I think it added the space. Doh!
Try using adb command : fastboot flash persist persist .img
1. You must first put a copy of the persist image from the Images folder into the ADB folder, or open the ADB window from within the extracted folder.
2. If this works then use flashall.bat method to restore phone. if it fails with the 11.6 Rom then try an older one.
If this fails:
I assume that you do not have a backup that you can restore? if so by all means do that first. Because it will absolutely work. Next remember that you must wipe the phone completely including formatting userdata/storage. and use the TWRP that I listed above.
Please explain exactly how you arrived at this issue, and don't leave out details. How did you arrive at this issue? If you were editing the IMEI then tell me , that requires restoring a QCN file and using QPST. (That issue is not really a persist issue, not at all.) But I don't mind attempting to helping you figure it out. Did you ever flash a persist image that someone posted somewhere?
Be sure that you are using a fastboot images rom specifically for your device, is it a Global or Chinese device?
Again please provide details.
This way we dont waste time taking non relative steps.
So you tried the flashall.bat steps? What should happen is the ADB windows will open and each partition image is flashed one by one, when it's complete, you will see the Miui setup page and then you sign into Wifi then you miCloud account.
Edit
@Theevanz
I found a flashable file to restore the persist for the Oreo version of the Chinese Mi8. If you a have global device it will not work. However, I used a program called beyond compare to figure out how this file works. if all goes well, I may have a flashable fix for you tomorrow. I plan to simply make a flashable file that will flash the Global Version of the persist image to the persist partition. You will still need to be fully wiped and formatted, so you do not get a write error message. Don't worry we will get this. I have had the exact same issue happens to me and I was able to get my phone working again.
Thanks for the guide tsongming.
You have absolutely helped all of us more than once. I've been using custom roms for more than 7 years and I didn't even know what "persist" partition was.
I'm currently using the TWRP made by mauronofrio because I haven't had any issue yet. However, as you explained the only TWRP that can backup the persist partition is LR Team one. Would you suggest me to flash this version and make a backup of the partition and then swap again to my original version of TWRP?
I know the questions is quite WTF but atm asking is free.
Thanks for your help.
tsongming said:
Okay, I am getting ready to go to bed so this post will be brief. Persist issues are usually caused by encryption, or somehow the persist image gets wiped. I used a spellchecker and I think it added the space. Doh!
Try using adb command : fastboot flash persist persist .img
1. You must first put a copy of the persist image from the Images folder into the ADB folder, or open the ADB window from within the extracted folder.
2. If this works then use flashall.bat method to restore phone. if it fails with the 11.6 Rom then try an older one.
If this fails:
I assume that you do not have a backup that you can restore? if so by all means do that first. Because it will absolutely work. Next remember that you must wipe the phone completely including formatting userdata/storage. and use the TWRP that I listed above.
Please explain exactly how you arrived at this issue, and don't leave out details. How did you arrive at this issue? If you were editing the IMEI then tell me , that requires restoring a QCN file and using QPST. (That issue is not really a persist issue, not at all.) But I don't mind attempting to helping you figure it out. Did you ever flash a persist image that someone posted somewhere?
Be sure that you are using a fastboot images rom specifically for your device, is it a Global or Chinese device?
Again please provide details.
This way we dont waste time taking non relative steps.
So you tried the flashall.bat steps? What should happen is the ADB windows will open and each partition image is flashed one by one, when it's complete, you will see the Miui setup page and then you sign into Wifi then you miCloud account.
Edit
@Theevanz
I found a flashable file to restore the persist for the Oreo version of the Chinese Mi8. If you a have global device it will not work. However, I used a program called beyond compare to figure out how this file works. if all goes well, I may have a flashable fix for you tomorrow. I plan to simply make a flashable file that will flash the Global Version of the persist image to the persist partition. You will still need to be fully wiped and formatted, so you do not get a write error message. Don't worry we will get this. I have had the exact same issue happens to me and I was able to get my phone working again.
Click to expand...
Click to collapse
Hi, so i will say the whole issue i had. I will miss out some details along the way as it happened very long ago
So i started installing custom rom for my Dipper and everything was fine until one day that i try to download a app on the playstore that promises to enable camera2API to improve my phone camera quailty . after i gave it root access via magisk and started the process, my phone just went down into a bootloop.
So i reinstalled my rom and my camera was not working , after some digging finally realise my persist was missing.
i tried to use MI FLASH TOOL to try to install back my persist but to no avail.
then i flashed persist from the fastboot rom (Im not sure if it was global or china but im having a global phone) and cleaned (Format data , advance wipe everything ) and reflashed my rom(Pixel experience rom - it was actually quite stable as no one was complaining the same issue) .
then after awhile , my phone start going into a bad state where it would go into a boot loop every 2 weeks or smth like that and then it would say "mount /data/..../..../.../..... (structure needs cleaning)" or sometimes persist. and i will do a clean install (Formatt , advance wipe everything, reboot back into recovery ,flash my rom ) over and over again ever few weeks . until like a few days ago , my phone died at 0 percent and when i plugged in the power bank it said 7 percent (Something wrong with the battery?? ) and i immediately powered it on and that happened .
Now the symptoms of my phone is that it cannot connect to the wifi , neither detect the sim card , no imei , apps will sometimes hang for awhile before responding , while starting it up , it will enter a black screen for ard 1 min before it shows the lock screen .
Thats about all i can think of ....
Update :
I tried the method u suggested on the fastboot flash persist persist.img . but it says partition is write protected , ima go sleep . thanks for the effort . ill send thanks when my 12 per day wears off
Boiisxu said:
Thanks for the guide tsongming.
You have absolutely helped all of us more than once. I've been using custom roms for more than 7 years and I didn't even know what "persist" partition was.
I'm currently using the TWRP made by mauronofrio because I haven't had any issue yet. However, as you explained the only TWRP that can backup the persist partition is LR Team one. Would you suggest me to flash this version and make a backup of the partition and then swap again to my original version of TWRP?
I know the questions is quite WTF but atm asking is free.
Thanks for your help.
Click to expand...
Click to collapse
Absolutely because although that version that you use works, it does not backup the persist partition and DTBO partition individually and it doesn't restore it. ( The problem with restoring persist is that it has to be your persist no else's will work) I would strongly recommend using the LR Team Version simply to make the backup and then store it to your Desktop, then if you ever need it. You will need to use the LR Team version to restore.
You need to backup everything except for:
Data
System
System Image
The partitions I backup are:
Cache
Boot
DTBO
Recovery
Vendor
Vendor Image
Firmware
Persist
Bluetooth
DSP
Cust
Splash
Logo
VBMata
DEVinfo
fsg
EFS
MSADP
APDP
XBL
CMNLIB
keymaster
hyp
TZ
DEVCFG
@ Theevanz
What you describe sounds like a combination of encryption and the persist, it also sounds like you did not flash DM verity on a Rom that called for it. The only version of DM verity that I know to work is the August version, later versions do not work. ( I don't know why)
Yes, when you come back. and click thanks . Remember that the phone must be fully wiped and Formatted.
IT Must be absolutely Formatted, ( type yes, reboot to recovery) wiping alone is not good enough..
The description that you gave, sounds alot like what i was dealing with. but in my case the phone would not even boot after a couple of days.
I have helped quite a few people with this exact issue and flashall.bat alone should work.
Flashall. Bat Steps
Boot to Fastboot
Download fastboot dipper images rom, and use flashall.bat method to restore the phone.
Download dipper_global_images_rom / It has to be a fastboot rom and not a Recovery rom
Unpack the rom twice on your desktop
You will be left with a folder and inside you will see batch files and a image folder.
Doubleclick Flashall.bat ( be careful on what you click, you want flashall.bat only) with the phone attached an in Recovery mode, fastboot or EDL
Flashall.bat is a batch script that will wipe your phone and restore all images, and then boot to system.
You should then Setup rom
Afterwards install TWRP and root then create a full Twrp backup and save to your PC.
tsongming said:
Absolutely because although that version that you use works, it does not backup the persist partition and DTBO partition individually and it doesn't restore it. ( The problem with restoring persist is that it has to be your persist no else's will work) I would strongly recommend using the LR Team Version simply to make the backup and then store it to your Desktop, then if you ever need it. You will need to use the LR Team version to restore.
You need to backup everything except for:
Data
System
System Image
The partitions I backup are:
Cache
Boot
DTBO
Recovery
Vendor
Vendor Image
Firmware
Persist
Bluetooth
DSP
Cust
Splash
Logo
VBMata
DEVinfo
fsg
EFS
MSADP
APDP
XBL
CMNLIB
keymaster
hyp
TZ
DEVCFG
Click to expand...
Click to collapse
Thanks for your reply.
I've downloaded the twrp for android 9 (currently using los16) but it seems that it's a .zip. Can I flash it via TWRP or shall I flash it using fastboot mode?
Moreover, I don't know what actually are those all partitions you backup for.
Boiisxu said:
Thanks for your reply.
I've downloaded the twrp for android 9 (currently using los16) but it seems that it's a .zip. Can I flash it via TWRP or shall I flash it using fastboot mode?
Moreover, I don't know what actually are those all partitions you backup for.
Click to expand...
Click to collapse
Yes its a zip, it will write to the Recovery. if you are nervous you can unpack it and you will see the image, that you can flash instead.
The partitions are selected by default, double check to make sure. These partitions are the one that you need if your partitions are damaged. personally, I have found persist and DBO to be exceptionally useful. However, be sure to back them all up, I have seen issues on other phones where these partition backups are lifesavers.
tsongming said:
Absolutely because although that version that you use works, it does not backup the persist partition and DTBO partition individually and it doesn't restore it. ( The problem with restoring persist is that it has to be your persist no else's will work) I would strongly recommend using the LR Team Version simply to make the backup and then store it to your Desktop, then if you ever need it. You will need to use the LR Team version to restore.
You need to backup everything except for:
Data
System
System Image
The partitions I backup are:
Cache
Boot
DTBO
Recovery
Vendor
Vendor Image
Firmware
Persist
Bluetooth
DSP
Cust
Splash
Logo
VBMata
DEVinfo
fsg
EFS
MSADP
APDP
XBL
CMNLIB
keymaster
hyp
TZ
DEVCFG
Click to expand...
Click to collapse
Sorry, may be i don't understand english so good. I tryed to instal persist (taking .img file from a fastboot ROM Global) partition with your twrp, the process is completed but wifi, signal still not work.
I don't have my backup of that partition because mine doesn't exist any more.
After flashing it i still can't see any file in /persist folder (via twrp) is it normal? Or just cant see folder contenent via twrp?
tsongming said:
@ Theevanz
What you describe sounds like a combination of encryption and the persist, it also sounds like you did not flash DM verity on a Rom that called for it. The only version of DM verity that I know to work is the August version, later versions do not work. ( I don't know why)
Yes, when you come back. and click thanks . Remember that the phone must be fully wiped and Formatted.
IT Must be absolutely Formatted, ( type yes, reboot to recovery) wiping alone is not good enough..
The description that you gave, sounds alot like what i was dealing with. but in my case the phone would not even boot after a couple of days.
I have helped quite a few people with this exact issue and flashall.bat alone should work.
Flashall. Bat Steps
Boot to Fastboot
Download fastboot dipper images rom, and use flashall.bat method to restore the phone.
Download dipper_global_images_rom / It has to be a fastboot rom and not a Recovery rom
Unpack the rom twice on your desktop
You will be left with a folder and inside you will see batch files and a image folder.
Doubleclick Flashall.bat ( be careful on what you click, you want flashall.bat only) with the phone attached an in Recovery mode, fastboot or EDL
Flashall.bat is a batch script that will wipe your phone and restore all images, and then boot to system.
You should then Setup rom
Afterwards install TWRP and root then create a full Twrp backup and save to your PC.
Click to expand...
Click to collapse
I tried again but to no avail. Do i need to do anything before the fastboot?
So heres what i did :
Did not wipe anything or format device (Device was already in MIUI 11)
Power off
Went to fastboot
Got a global fastboot Rom (dipper_global_images_V11.0.6.0.PEAMIXM_20191022.0000.00_9.0_global)
extracted 2 times with 7zip
Put the adb/fastboot files into the extracted rom
Clicked on flash_all.bat
Device rebooted but the issue was no solved
Heres what i realise :
i opened the flash_all file and tried to find the sentence to flash persist but i cant find anything tat says flashing persist . heres my flash_all file from the extracted folder. Should i add a line that says to flash persist?
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *dipper" || echo Missmatching image and device
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *dipper" || exit /B 1
::set CURRENT_ANTI_VER=1
::for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
::if [%version%] EQU [] set version=0
::if %version% GTR %CURRENT_ANTI_VER% (
:: echo current device antirollback version is greater than this pakcage
:: exit /B 1
:
fastboot %* erase boot || @ECHO "Erase boot error" && exit /B 1
fastboot %* flash crclist %~dp0images\crclist.txt || @ECHO "Flash crclist error" && exit /B 1
fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @ECHO "Flash sparsecrclist error" && exit /B 1
fastboot %* flash xbl_ab %~dp0images\xbl.img || @ECHO "Flash xbl_ab error" && exit /B 1
fastboot %* flash xbl_config_ab %~dp0images\xbl_config.img || @ECHO "Flash xbl_config_ab error" && exit /B 1
fastboot %* flash abl_ab %~dp0images\abl.img || @ECHO "Flash abl_ab error" && exit /B 1
fastboot %* flash tz_ab %~dp0images\tz.img || @ECHO "Flash tz_ab error" && exit /B 1
fastboot %* flash hyp_ab %~dp0images\hyp.img || @ECHO "Flash hyp_ab error" && exit /B 1
fastboot %* flash devcfg_ab %~dp0images\devcfg.img || @ECHO "Flash devcfg_ab error" && exit /B 1
fastboot %* flash storsec_ab %~dp0images\storsec.img || @ECHO "Flash storsec_ab error" && exit /B 1
fastboot %* flash bluetooth %~dp0images\bluetooth.img || @ECHO "Flash bluetooth error" && exit /B 1
fastboot %* flash cmnlib_ab %~dp0images\cmnlib.img || @ECHO "Flash cmnlib_ab error" && exit /B 1
fastboot %* flash cmnlib64_ab %~dp0images\cmnlib64.img || @ECHO "Flash cmnlib64_ab error" && exit /B 1
fastboot %* flash modem %~dp0images\modem.img || @ECHO "Flash modem error" && exit /B 1
fastboot %* flash dsp %~dp0images\dsp.img || @ECHO "Flash dsp error" && exit /B 1
fastboot %* flash keymaster_ab %~dp0images\keymaster.img || @ECHO "Flash keymaster_ab error" && exit /B 1
fastboot %* flash logo %~dp0images\logo.img || @ECHO "Flash logo_ab error" && exit /B 1
fastboot %* flash misc %~dp0images\misc.img || @ECHO "Flash misc error" && exit /B 1
fastboot %* flash aop_ab %~dp0images\aop.img || @ECHO "Flash aop_ab error" && exit /B 1
fastboot %* flash qupfw_ab %~dp0images\qupfw.img || @ECHO "Flash qupfw_ab error" && exit /B 1
fastboot %* flash ImageFv %~dp0images\imagefv.elf || @ECHO "Flash imagefv error" && exit /B 1
fastboot %* flash vendor %~dp0images\vendor.img || @ECHO "Flash vendor_ab error" && exit /B 1
fastboot %* flash system %~dp0images\system.img || @ECHO "Flash system_ab error" && exit /B 1
fastboot %* flash userdata %~dp0images\userdata.img || @ECHO "Flash userdata error" && exit /B 1
fastboot %* flash recovery %~dp0images\recovery.img || @ECHO "Flash recovery error" && exit /B 1
fastboot %* flash cache %~dp0images\cache.img || @ECHO "Flash cache error" && exit /B 1
fastboot %* erase sec || @ECHO "Erase sec error" && exit /B 1
fastboot %* flash cust %~dp0images\cust.img || @ECHO "Flash cust error" && exit /B 1
fastboot %* flash boot %~dp0images\boot.img || @ECHO "Flash boot error" && exit /B 1
fastboot %* reboot || @ECHO "Reboot error" && exit /B 1
tsongming said:
Yes its a zip, it will write to the Recovery. if you are nervous you can unpack it and you will see the image, that you can flash instead.
The partitions are selected by default, double check to make sure. These partitions are the one that you need if your partitions are damaged. personally, I have found persist and DBO to be exceptionally useful. However, be sure to back them all up, I have seen issues on other phones where these partition backups are lifesavers.
Click to expand...
Click to collapse
So the other file that comes in the .zip is not important?
Boiisxu said:
So the other file that comes in the .zip is not important?
Click to expand...
Click to collapse
No, You just flash the zip, there is a code that tells it to flash to recovery.
I was just letting you know that the image was inside the unpacked zip, and it can be flashed traditionally. Personally, I always flash the zip.
Leoleo96 said:
Sorry, may be i don't understand english so good. I tryed to instal persist (taking .img file from a fastboot ROM Global) partition with your twrp, the process is completed but wifi, signal still not work.
I don't have my backup of that partition because mine doesn't exist any more.
After flashing it i still can't see any file in /persist folder (via twrp) is it normal? Or just cant see folder contenent via twrp?
Click to expand...
Click to collapse
Okay , if your formatted and typed yes ( this is the most important step)
Then you double clicked flash all.bat, you should have seen ADB restore every partition and then from there, install TWRP Recovery, and boot to TWRP. After booting into twrp you can use dd command from adb shell to access persist partition.
@Leoleo96
Edit
Your case is more difficult, I just added Option 5 , try it. This should work.
Theevanz said:
I tried again but to no avail. Do i need to do anything before the fastboot?
So heres what i did :
Did not wipe anything or format device (Device was already in MIUI 11)
Power off
Went to fastboot
Got a global fastboot Rom (dipper_global_images_V11.0.6.0.PEAMIXM_20191022.0000.00_9.0_global)
extracted 2 times with 7zip
Put the adb/fastboot files into the extracted rom
Clicked on flash_all.bat
Device rebooted but the issue was no solved
Heres what i realise :
i opened the flash_all file and tried to find the sentence to flash persist but i cant find anything tat says flashing persist . heres my flash_all file from the extracted folder. Should i add a line that says to flash persist?
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *dipper" || echo Missmatching image and device
fastboot %* getvar product 2>&1 | findstr /r /c:"^product: *dipper" || exit /B 1
::set CURRENT_ANTI_VER=1
::for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
::if [%version%] EQU [] set version=0
::if %version% GTR %CURRENT_ANTI_VER% (
:: echo current device antirollback version is greater than this pakcage
:: exit /B 1
:
fastboot %* erase boot || @ECHO "Erase boot error" && exit /B 1
fastboot %* flash crclist %~dp0images\crclist.txt || @ECHO "Flash crclist error" && exit /B 1
fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @ECHO "Flash sparsecrclist error" && exit /B 1
fastboot %* flash xbl_ab %~dp0images\xbl.img || @ECHO "Flash xbl_ab error" && exit /B 1
fastboot %* flash xbl_config_ab %~dp0images\xbl_config.img || @ECHO "Flash xbl_config_ab error" && exit /B 1
fastboot %* flash abl_ab %~dp0images\abl.img || @ECHO "Flash abl_ab error" && exit /B 1
fastboot %* flash tz_ab %~dp0images\tz.img || @ECHO "Flash tz_ab error" && exit /B 1
fastboot %* flash hyp_ab %~dp0images\hyp.img || @ECHO "Flash hyp_ab error" && exit /B 1
fastboot %* flash devcfg_ab %~dp0images\devcfg.img || @ECHO "Flash devcfg_ab error" && exit /B 1
fastboot %* flash storsec_ab %~dp0images\storsec.img || @ECHO "Flash storsec_ab error" && exit /B 1
fastboot %* flash bluetooth %~dp0images\bluetooth.img || @ECHO "Flash bluetooth error" && exit /B 1
fastboot %* flash cmnlib_ab %~dp0images\cmnlib.img || @ECHO "Flash cmnlib_ab error" && exit /B 1
fastboot %* flash cmnlib64_ab %~dp0images\cmnlib64.img || @ECHO "Flash cmnlib64_ab error" && exit /B 1
fastboot %* flash modem %~dp0images\modem.img || @ECHO "Flash modem error" && exit /B 1
fastboot %* flash dsp %~dp0images\dsp.img || @ECHO "Flash dsp error" && exit /B 1
fastboot %* flash keymaster_ab %~dp0images\keymaster.img || @ECHO "Flash keymaster_ab error" && exit /B 1
fastboot %* flash logo %~dp0images\logo.img || @ECHO "Flash logo_ab error" && exit /B 1
fastboot %* flash misc %~dp0images\misc.img || @ECHO "Flash misc error" && exit /B 1
fastboot %* flash aop_ab %~dp0images\aop.img || @ECHO "Flash aop_ab error" && exit /B 1
fastboot %* flash qupfw_ab %~dp0images\qupfw.img || @ECHO "Flash qupfw_ab error" && exit /B 1
fastboot %* flash ImageFv %~dp0images\imagefv.elf || @ECHO "Flash imagefv error" && exit /B 1
fastboot %* flash vendor %~dp0images\vendor.img || @ECHO "Flash vendor_ab error" && exit /B 1
fastboot %* flash system %~dp0images\system.img || @ECHO "Flash system_ab error" && exit /B 1
fastboot %* flash userdata %~dp0images\userdata.img || @ECHO "Flash userdata error" && exit /B 1
fastboot %* flash recovery %~dp0images\recovery.img || @ECHO "Flash recovery error" && exit /B 1
fastboot %* flash cache %~dp0images\cache.img || @ECHO "Flash cache error" && exit /B 1
fastboot %* erase sec || @ECHO "Erase sec error" && exit /B 1
fastboot %* flash cust %~dp0images\cust.img || @ECHO "Flash cust error" && exit /B 1
fastboot %* flash boot %~dp0images\boot.img || @ECHO "Flash boot error" && exit /B 1
fastboot %* reboot || @ECHO "Reboot error" && exit /B 1
Click to expand...
Click to collapse
The persist image is inside the folder, you take it out, and try the DD command. I just added Option 5 , try it.
next regarding your error log, You clicked flashall. bat? Remember that the phone must be in fastboot mode and connected to the PC. if you have usb3 ports you will need to use a hub, that converts down to usb 2. You can buy an extender hub practically anywhere for $5
tsongming said:
Okay , if your formatted and typed yes ( this is the most important step)
Then you double clicked flash all.bat, you should have seen ADB restore every partition and then from there, install TWRP Recovery, and boot to TWRP. After booting into twrp you can use dd command from adb shell to access persist partition.
@Leoleo96
Edit
Your case is more difficult, I just added Option 5 , try it. This should work.
Click to expand...
Click to collapse
When type the first code line (option 5) it says
'Invalid sparse file format at header magic
Failed to read sparse file'
Leoleo96 said:
When type the first code line (option 5) it says
'Invalid sparse file format at header magic
Failed to read sparse file'
Click to expand...
Click to collapse
Read the instruction on option 5
You place the image in the user storage /sd card, and use TWRP terminal, it works for countless people on all Xiaomi phones.
@Leoleo96
Try editing the file as indicated here: http://4pda.ru/forum/index.php?s=&showtopic=906971&view=findpost&p=77405784
tsongming said:
The persist image is inside the folder, you take it out, and try the DD command. I just added Option 5 , try it.
next regarding your error log, You clicked flashall. bat? Remember that the phone must be in fastboot mode and connected to the PC. if you have usb3 ports you will need to use a hub, that converts down to usb 2. You can buy an extender hub practically anywhere for $5
Click to expand...
Click to collapse
Option 5 does not work with the error of 'Invalid sparse file format at header magic Failed to read sparse file' (Its in the correct file , /sdcard)
should i try the persist on older version of global miui roms??
i also Tried editing the file as indicated here: http://4pda.ru/forum/index.php?s=&sh...ost&p=77405784 , I ran the file with the added info stated in the forum . when i ran the file through a USB 2.0 , the command prompt stops at the persist command. (I have attached the files that i edited. the batch file has been converted to a txt file cause XDA dont support)
Do you need any other info? Thanks so much !!
tsongming said:
Absolutely because although that version that you use works, it does not backup the persist partition and DTBO partition individually and it doesn't restore it. ( The problem with restoring persist is that it has to be your persist no else's will work) I would strongly recommend using the LR Team Version simply to make the backup and then store it to your Desktop, then if you ever need it. You will need to use the LR Team version to restore.
Click to expand...
Click to collapse
If backup is taken before the persist problem with this TWRP, only restoring the backup will solve the problem when problem occurs? Or have to wipe/format phone again? And you are using this TWRP for quite a long time. Have you faced persist/any problem till now?
Thanks
Ah yes, Oneplus released that new update. Now I must download 2+ GB off my capped data plan, then flash it to recovery, carefully switch back my slot then flash my custom ROM again to the slot I just flashed OOS to and then flash OOS again to the other slot and then I must repeat everything above. After that I must delete the 2 fake partitions the updater created on data because they are useless. Oh wait it doesn't let me delete them who'd have thought?
Seriously? What on earth happened there
A better solution is required, especially something that grants more control. Well here it is
The boring stuff:
I am not responsible for anything you do to your device
These zips contain the following files:
Code:
The firmware (duh)
flashall - flashes both a and b
flash_a - only flashes slot a
flash_b - only flashes slot b
The following partitions found in the official oxygenos zip have been removed:
Code:
vbmeta
boot
dtbo
odm
system
vendor
reserve
india
Because for custom ROM users these partitions are either unused or used by the currently running custom ROM
How to flash?
From TWRP (it doesn't even need to support decryption):
Code:
adb push abl.img aop.img bluetooth.img cmnlib64.img cmnlib.img devcfg.img dsp.img flash_a flashall flash_b hyp.img keymaster.img LOGO.img modem.img oem_stanvbk.img qupfw.img storsec.img tz.img xbl_config.img xbl.img /tmp/
adb shell
cd /tmp
chmod 777 flashall # or flash_a/b
./flashall # or sh flashall or use flash_a/b
I suggest you use one of the flash_a/b scripts to only flash your current slot and test the changes out before running flashall
From termux:
You might need to set selinux to permissive while flashing. Only try to flash your current slot, reboot and if there are no errors flash the other slot
unzip the zip file to a directory and cd to it. If you use termux you should already know this
Just run one of the flashing scripts as root
Note that the flashing takes some time. Do not abort it
From adb root:
Sadly I don't have adb root so if someone has it they can let me know how it goes and how they flashed it
Do NOT believe in myths. You do NOT need to wipe cache/dalvik/any other nonsense while upgrading firmware. Stop wasting your time
Downloads:
Open beta 9: https://glassrom.pw/guacamole-ob9fw.zip
More will be added when I have time
Yes I personally tested this on my device and it was fine. Except that the popup camera pops out sometimes but I just suspect big brother. Nothing abnormal
Happy flashing. Or whatever
Anybody caught the latest OOS release link yet? All I found was an incremental OTA
Is this project discontinued? If yes, I'd like to see a revival of this.
hellcat50 said:
Is this project discontinued? If yes, I'd like to see a revival of this.
Click to expand...
Click to collapse
He doesn't care about support
The link is dead.
Does anyone have this zip?
I need these files
flashall
flash_a
flash_b
in order to make an up to date zip.
alessio89g said:
The link is dead.
Does anyone have this zip?
I need these files
flashall
flash_a
flash_b
in order to make an up to date zip.
Click to expand...
Click to collapse
you can get the file list and the firmware collection from the glassrom device tree
i stopped maintaining this as now i just ship firmware into my roms
Bitbucket
bitbucket.org
flash_a, flash_b and flashall really were just script generated scripts
something like
```
for i in $(ls *img | sed 's/.img$//g')
do
echo dd if="$i".img of=/dev/block/bootdevice/by-name/"$i"_a;
done
```
same for slot b:
```
for i in $(ls *img | sed 's/.img$//g')
do
echo dd if="$i".img of=/dev/block/bootdevice/by-name/"$i"_b;
done
```
concetenate flash_a and flash_b as follows:
```
cat flash_a flash_b > flashall
```
PS: you need to remove the oem_stanvbk_{a,b} entries as that is not an A/B partition. also i have just shown you roughly what i use to generate the flash scripts. there is no guarantee these work. example you might need to remove the $ from the regex
How to unlock the Realme 8 Pro bootloader?
1. you'd better write in english, to get a broader range of people who understand you question ;-).
2. Also waiting for that ... it's a shame.
Greetz
Kurt
How to unlock bootloader realme 8 5G
Answer from [email protected] from today :
Unlock Bootloader tutorial for Realme 8 Pro RMX3081 is not available as of now.Further, keep following our social media handles and official community portal for the latest updates,
Yeah, we can achieve the bootloader unlock of realme 8 pro. Mine is unlocked. The build number and security patch must be (RMX3081_11_A.44) (November 5,2021)
This is Export rom not the GDPR rom (EU)
Have flashed it and can unlock and flash files via fastboot.
OFP - Original Firmware Project :
Code:
Model Project Project ID Download link
RMX3081 20711 (Project ID-20711)_INDIA,MM,BD,PK RMX3081export_11_A.44 https://fileload.coloros.com/504197RMX3081export_11_A.44_2021110921030235.zip
RMX3081 20712 (Project ID-20712)_PH,VN,KH,-EG,IQ,MY RMX3081export_11_A.44 https://fileload.coloros.com/504198RMX3081export_11_A.44_2021110921100000.zip
RMX3081 20713 (Project ID-20713)_LUX,CH,ES,UK,FR,IT,DE,NL,BE,NO,PT,FIN,CY RMX3081GDPR_11_A.44 https://fileload.coloros.com/504200RMX3081GDPR_11_A.44_2021110921090000.zip
RMX3081 20713 (????) RMX3081export_11_A.44 https://fileload.coloros.com/504199RMX3081export_11_A.44_2021110921060000.zip
RMX3081 20714 (????) RMX3081export_11_A.44 https://fileload.coloros.com/504201RMX3081export_11_A.44_2021110921110000.zip
@Shibu Shaji share us the
getprop ro.build.display.full_id
Yeah, we can achieve the bootloader unlock of realme 8 pro. Mine is unlocked. The build number and security patch must be (RMX3081_11_A.44) (November 5,2021)
StratOS_HTC said:
This is Export rom not the GDPR rom (EU)
Have flashed it and can unlock and flash files via fastboot.
OFP - Original Firmware Project :
Code:
Model Project Project ID Download link
RMX3081 20711 (Project ID-20711)_INDIA,MM,BD,PK RMX3081export_11_A.44 https://fileload.coloros.com/504197RMX3081export_11_A.44_2021110921030235.zip
RMX3081 20712 (Project ID-20712)_PH,VN,KH,-EG,IQ,MY RMX3081export_11_A.44 https://fileload.coloros.com/504198RMX3081export_11_A.44_2021110921100000.zip
RMX3081 20713 (Project ID-20713)_LUX,CH,ES,UK,FR,IT,DE,NL,BE,NO,PT,FIN,CY RMX3081GDPR_11_A.44 https://fileload.coloros.com/504200RMX3081GDPR_11_A.44_2021110921090000.zip
RMX3081 20713 (????) RMX3081export_11_A.44 https://fileload.coloros.com/504199RMX3081export_11_A.44_2021110921060000.zip
RMX3081 20714 (????) RMX3081export_11_A.44 https://fileload.coloros.com/504201RMX3081export_11_A.44_2021110921110000.zip
@Shibu Shaji share us the
getprop ro.build.display.full_id
Click to expand...
Click to collapse
Here is my id : RMX3081export_11_A.44_2021110921030235
Yeah, see it's exported Project ID-20711 and don't have a bootloader locked.
Have flashed it previously and know that.
The GDPR versions of ROM you cannot do almost nothing 4 now.
Oh bro, this is not GDPR version.. After I unlocked my bootloader, i tried to root realme 8 pro with patched boot image from OFP Rom but it's doesn't work for me..
Any thing to say about this?
StratOS_HTC said:
Yeah, see it's exported Project ID-20711 and don't have a bootloader locked.
Have flashed it previously and know that.
The GDPR versions of ROM you cannot do almost nothing 4 now.
Click to expand...
Click to collapse
Well let me guide you throught it :
Get the firmware in zip
Extract the boot.img and vbmeta files from the opf file.
adb reboot bootloader
fastboot flashing unlock (Unlock bootloader)
*fastboot flashing unlock_critical
Use magisk to patch the boot.img use patched image as boot.img
fastboot –disable-verity –disable-verification flash vbmeta vbmeta.img
fastboot flash boot boot.img
fastboot reboot
or use it with --force additional option
after finish it give feedback, please.
If successfull go back fo fastbootd mode and provide me with two files fetched from the system
fetch could be limited in fastboot
fastboot fetch vbmeta vbmeta.xxx
fastboot fetch vbmeta_system vbmeta_system.xxx
U can get it via adb (I guess)
adb pull /dev/block/sde18 vbmeta
adb pull /dev/block/sde16 vbmeta_system
Since jour project id is 20711
Guess your PCB shows 0020711*
dial : *#899#
press the PCB num
StratOS_HTC said:
Well let me guide you throught it :
adb reboot bootloader
fastboot flashing unlock (Unlock bootloader)
Get the firmware in zip
Extract the boot.img and vbmeta files from the opf file.
Use magisk to patch the boot.img use patched image as boot.img
fastboot –disable-verity –disable-verification flash vbmeta vbmeta.img
fastboot flash boot boot.img
fastboot reboot
Click to expand...
Click to collapse
StratOS_HTC said:
Well let me guide you throught it :
Get the firmware in zip
Extract the boot.img and vbmeta files from the opf file.
adb reboot bootloader
fastboot flashing unlock (Unlock bootloader)
*fastboot flashing unlock_critical
Use magisk to patch the boot.img use patched image as boot.img
fastboot –disable-verity –disable-verification flash vbmeta vbmeta.img
fastboot flash boot boot.img
fastboot reboot
or use it with --force additional option
after finish it give feedback, please.
If successfull go back fo fastbootd mode and provide me with two files fetched from the system
fetch could be limited in fastboot
fastboot fetch vbmeta vbmeta.xxx
fastboot fetch vbmeta_system vbmeta_system.xxx
U can get it via adb (I guess)
adb pull /dev/block/sde18 vbmeta
adb pull /dev/block/sde16 vbmeta_system
Click to expand...
Click to collapse
Yeah , tried but nothing seems to be work.
StratOS_HTC said:
Well let me guide you throught it :
Get the firmware in zip
Extract the boot.img and vbmeta files from the opf file.
adb reboot bootloader
fastboot flashing unlock (Unlock bootloader)
*fastboot flashing unlock_critical
Use magisk to patch the boot.img use patched image as boot.img
fastboot –disable-verity –disable-verification flash vbmeta vbmeta.img
fastboot flash boot boot.img
fastboot reboot
or use it with --force additional option
after finish it give feedback, please.
If successfull go back fo fastbootd mode and provide me with two files fetched from the system
fetch could be limited in fastboot
fastboot fetch vbmeta vbmeta.xxx
fastboot fetch vbmeta_system vbmeta_system.xxx
U can get it via adb (I guess)
adb pull /dev/block/sde18 vbmeta
adb
Click to expand...
Click to collapse
StratOS_HTC said:
Well let me guide you throught it :
Get the firmware in zip
Extract the boot.img and vbmeta files from the opf file.
adb reboot bootloader
fastboot flashing unlock (Unlock bootloader)
*fastboot flashing unlock_critical
Use magisk to patch the boot.img use patched image as boot.img
fastboot –disable-verity –disable-verification flash vbmeta vbmeta.img
fastboot flash boot boot.img
fastboot reboot
or use it with --force additional option
after finish it give feedback, please.
If successfull go back fo fastbootd mode and provide me with two files fetched from the system
fetch could be limited in fastboot
fastboot fetch vbmeta vbmeta.xxx
fastboot fetch vbmeta_system vbmeta_system.xxx
U can get it via adb (I guess)
adb pull /dev/block/sde18 vbmeta
adb pull /dev/block/sde16 vbmeta_sys
Click to expand...
Click to collapse
StratOS_HTC said:
Well let me guide you throught it :
Get the firmware in zip
Extract the boot.img and vbmeta files from the opf file.
adb reboot bootloader
fastboot flashing unlock (Unlock bootloader)
*fastboot flashing unlock_critical
Use magisk to patch the boot.img use patched image as boot.img
fastboot –disable-verity –disable-verification flash vbmeta vbmeta.img
fastboot flash boot boot.img
fastboot reboot
or use it with --force additional option
after finish it give feedback, please.
If successfull go back fo fastbootd mode and provide me with two files fetched from the system
fetch could be limited in fastboot
fastboot fetch vbmeta vbmeta.xxx
fastboot fetch vbmeta_system vbmeta_system.xxx
U can get it via adb (I guess)
adb pull /dev/block/sde18 vbmeta
adb pull /dev/block/sde16 vbmeta_system
Click to expand...
Click to collapse
Yeah i tried the steps that u said above to ROOT realme 8 pro, but it doesn't work for me... here are the steps that i did.
Fastboot mode
*Fastboot flashing unlock
*Fastboot --disable-verity --disable-verification
flash vbmeta vbmeta.img
*Fastboot flash boot (magisk patched) boot.img
Result : Device went to bootloop. Retrieved from
bootloop by flashing stock boot image that previously extracted from OFP file and now the device is fine.
Also tried this step
Fastboot mode
*Fastboot flashing unlock
*Fastboot --disable-verity --disable-verification
flash vbmeta vbmeta.img
* Fastboot --disable-verity --disable-verification
flash vbmeta_system vbmeta_system.img
*Fastboot --disable-verity --disable-verification
flash vbmeta_vendor vbmeta_vendor.img
*Fastboot flash boot (magisk patched) boot.img
Result : Bootlooped. Retrieved by flashing stock boot image..
And also, i tried to BOOT patched boot image... and it shows
FAILED <remote: unknown command>
ABV is still active.
THX @Shibu Shaji
For showing us the 20711 EXPORT .44 ROM fastboot getvar all infos.
I have also the 20713 GDPR .44 ROM fastboot getvar all infos.
The bootloader in EXPORT is unlocked and is not userspaced.
From green to orange state ... some progress after all ...
It seems your bootloader unlocked? actually how? I think ur AVB is now disabled
StratOS_HTC said:
View attachment 5505451
From green to orange state ... some progress after all ...
Click to expand...
Click to collapse
Wow, how did you do it?
currently via isp ufs access and help of a reversing from a friend.
On bootloop also ...
Oh bro, So what to do next? Is there any other problems with ur partitions after this?
Since EDL is not configured correctly (No kernel driver supported: Operation not supported or unimplemented on this platform) after the firehose programmer sucessfully boot ...
Also QFIL and unimplemented <CONFIGURE> or <SIG> and signed and certed things the only thing to do is via ISP UFS control.
OR possible USB port communication debug via MSM flash.
For EXPORT version have prepared seen action on the screen for this ROM
Code:
Project 20711
RMX3081
Version Flash MSM download tool v.2.0.51 for eMMC/UFS
Rom ofp : RMX3081export_11_A.28_202104090210
Server : India
Use default NV=yes
Reboot on finish=yes
Download Firehose protocol file
Sahara communication succeeded
Boot via firehose
Trying to handshake
Get sign data
Verify data
Getting NV code from server
Failed to get NV code. Default NV code would be used
Firehose GetUfsInfo
Erasing the partition Primarly GPT
Erasing the partition BackupGPT
Erasing the partition userdata
Downloading cdt_engineering_release.img
Erasing partition keystore
Downloading cache.img
Downloading recovery.img
Downloading metadata.img
Downloading userdata.img
Downloading gpt_main0.bin
Downloading xbl.elf
Downloading gpt_main1.bin
Downloading gpt_main2.bin
Downloading aop.mbn
Downloading tz.mbn
Downloading NON-HLOS.bin
Erasing the partition mdtpsecapp
Erasing the partition mdtp
Downloading abl.elf
Downloading dspso.bin
Downloading boot.img
Downloading devcfg.mbn
Downloading vbmeta_vendor.img
Downloading dtbo.img
Downloading imagefv.elf
Downloading oppo_sec.mbn
Downloading dpAP.mbn
Erasing the partition spunvm
Downloading splash.img
Downloading logfs_ufs_8mb.bin
Erasing the partition cateloader
Erasing the partition rawdump
Erasing the partition logdump
Download multi_image.mbn
Erasing the partition catefv
Downloading gpt_main4.bin
Download static_nvbk.bin
Erasing the partition opporeserve1
Downloading emmc_fw.bin
Downloading DRIVER.ISO
Downloading gpt_main5.bin
Restarting
Downloading Firehose protocol file
Sahara communication succeeded
Trying to handshake via Firehose
Configure the settings of Firehose
Get sign data
Verify data
Downloading super partsuper.0
Downloading super partsuper.1
Downloading super partsuper.2
Get basic data
Write patch image to user partition
Restarting
Download succeeded
Get sign data
Verify data
Currently non-implemented/documented also by MSM7125 ?