How to upgrade your Poco F1 without losing custom ROM or encrypting data

meltbanana

Senior Member
Feb 13, 2018
263
119
53
Hi,

I noticed the same question today at the miui forum, so I decided to help and share my experience with you.

To upgrade a Poco F1 running a custom ROM all you need first are two things: a fastboot ROM provided by Xiaomi

http://en.miui.com/a-234.html

and @CosmicDan's encryption disabler (twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip) > https://github.com/cosmicdan/MIUI_Kitchen/releases

Having the latest fastboot ROM downloaded - no matter if dev oder stable - extract the .tgz and edit this file with your favorite editor:

flash_all_except_storage.sh (Linux/Unix/Mac)

or

flash_all_except_storage.cmd (Windows)

and comment out these 6 lines:
Code:
#fastboot $* -S 200M flash system `dirname $0`/images/system.img
#if [ $? -ne 0 ] ; then echo "Flash system error"; exit 1; fi
#fastboot $* flash recovery `dirname $0`/images/recovery.img
#if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
....
#fastboot $* reboot
#if [ $? -ne 0 ] ; then echo "Reboot error"; exit 1; fi
so system.img and recovery.img won't get flashed and there's no reboot after flashing all partitions to prevent encryption.

save and close your edited script and execute it with your poco rebooted in fastboot mode. as soon as all new partitions are flashed you'll get a message:

for example finished. total time: 43.419s

then long press and hold power + vol up until you're back in twrp, or if you didn't install it before you'd have to reboot to fastboot (vol down + power) and boot it with

fastboot boot twrp-3.2.3-beryllium-cosmic-20180915.img

then flash CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip to keep encryption disabled.
optionally flash magisk to patch your kernel if you had installed it before or otherwise your custom ROM probably won't boot.

thanks a lot to @CosmicDan who did the community great jobs with his work, so many times!! :D

hope it helps + best regards
 
Last edited:

meltbanana

Senior Member
Feb 13, 2018
263
119
53
Essentially, by doing this you flash everything else (vendor, modem, dsp, cust, boot...) *except* system and recovery. Any chance that the updated partitions break something with the custom ROM? What if the custom ROM is Pie based?
I'm on pixel pie now and went back from dev to stable, no issues at all, vice versa, gcam works in 16:9 again.
 

meltbanana

Senior Member
Feb 13, 2018
263
119
53
thanks sir.. i hope this will solve my problem,, FAILED TO BOOT on LOS 16 .
coming from miui 10 v8.9.20 global beta..
ahm,, if i understand it correctly, i still need to flash my phone with a fastboot rom???
Yes, flash a stable fastboot image like explained above and LOS16 should boot but my guide is primary for upgrading or downgrading vendor ROM without a need to wipe an already installed custom ROM or encrypting the data partition. It seems v8.9.20 vendor (unsurprisingly) doesn't play nice with LOS16 kernel.
 
  • Like
Reactions: santiagoruel13

simorangkir_dcs

Senior Member
Oct 9, 2012
448
140
0
Jakarta
OK, I need to get this straight

I am now still bone stock without TWRP or anything, not even unlocked (still need to wait 40 hours)
This guide is for anyone who wants to upgrade to MIUI 10 but still can flash custom ROM (LOS or AOSP based) without error, right?

So, what I need to do is unlocked my poco f1, then flash MIUI 10 eu for example via fastboot step by step according to this guide:
flash_all_except_storage.cmd (Windows)
and:
Code:
#fastboot $* -S 200M flash system `dirname $0`/images/system.img
#if [ $? -ne 0 ] ; then echo "Flash system error"; exit 1; fi
#fastboot $* flash recovery `dirname $0`/images/recovery.img
#if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
....
#fastboot $* reboot
#if [ $? -ne 0 ] ; then echo "Reboot error"; exit 1; fi
and then, flash/boot with TWRP
fastboot boot twrp-3.2.3-beryllium-cosmic-20180915.img
then flash CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip to keep encryption disabled.

Are these steps correct?
Thanks for your answer.
 

meltbanana

Senior Member
Feb 13, 2018
263
119
53
OK, I need to get this straight

I am now still bone stock without TWRP or anything, not even unlocked (still need to wait 40 hours)
This guide is for anyone who wants to upgrade to MIUI 10 but still can flash custom ROM (LOS or AOSP based) without error, right?

So, what I need to do is unlocked my poco f1, then flash MIUI 10 eu for example via fastboot step by step according to this guide:
flash_all_except_storage.cmd (Windows)
and:
Code:
#fastboot $* -S 200M flash system `dirname $0`/images/system.img
#if [ $? -ne 0 ] ; then echo "Flash system error"; exit 1; fi
#fastboot $* flash recovery `dirname $0`/images/recovery.img
#if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
....
#fastboot $* reboot
#if [ $? -ne 0 ] ; then echo "Reboot error"; exit 1; fi
and then, flash/boot with TWRP
fastboot boot twrp-3.2.3-beryllium-cosmic-20180915.img
then flash CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip to keep encryption disabled.

Are these steps correct?
Thanks for your answer.
yep, commenting out these lines with a hash (#) just prevents to overwrite or erase system, recovery and userdata ( < flash_all_except_storage) while all other partitions are upgraded.
thus it's crucial to flash @CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip afterwards to prevent encryption.

however, from my experience MIUI (10) developer ROM and custom ROMs (due to new vendor) don't interact nice.
on stock ROM your data is already encrypted, so it's better make sure to create a full backup of your important data before cause you'll have to format from twrp.
 
Last edited:

CosmicDan

Senior Member
Jun 19, 2009
5,845
7,677
263
34
Sydney
OK, I need to get this straight

I am now still bone stock without TWRP or anything, not even unlocked (still need to wait 40 hours)
This guide is for anyone who wants to upgrade to MIUI 10 but still can flash custom ROM (LOS or AOSP based) without error, right?

So, what I need to do is unlocked my poco f1, then flash MIUI 10 eu for example via fastboot step by step according to this guide:
flash_all_except_storage.cmd (Windows)
and:


yep, commenting out these lines with a hash (#) just prevents to overwrite or erase system, recovery and userdata ( < flash_all_except_storage) while all other partitions are upgraded.
thus it's crucial to flash @CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip afterwards to prevent encryption.

however, from my experience MIUI (10) developer ROM and custom ROMs (due to new vendor) don't interact nice.
on stock ROM your data is already encrypted, so it's better make sure to create a full backup of your important data before cause you'll have to format from twrp.
On Windows, use :: or REM as comment character. :: is neater but REM is required in loops.
 
  • Like
Reactions: meltbanana

meltbanana

Senior Member
Feb 13, 2018
263
119
53
OK, I need to get this straight

I am now still bone stock without TWRP or anything, not even unlocked (still need to wait 40 hours)
This guide is for anyone who wants to upgrade to MIUI 10 but still can flash custom ROM (LOS or AOSP based) without error, right?

So, what I need to do is unlocked my poco f1, then flash MIUI 10 eu for example via fastboot step by step according to this guide:
flash_all_except_storage.cmd (Windows)
and:
Code:
#fastboot $* -S 200M flash system `dirname $0`/images/system.img
#if [ $? -ne 0 ] ; then echo "Flash system error"; exit 1; fi
#fastboot $* flash recovery `dirname $0`/images/recovery.img
#if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
....
#fastboot $* reboot
#if [ $? -ne 0 ] ; then echo "Reboot error"; exit 1; fi
and then, flash/boot with TWRP
fastboot boot twrp-3.2.3-beryllium-cosmic-20180915.img
then flash CosmicDan's twrp-3.2.3-beryllium-cosmic_FBE-Disable.zip to keep encryption disabled.

Are these steps correct?
Thanks for your answer.
not sure if you can boot twrp straight after flashing the ROM, due to CRC checks, so better reboot straight into fastboot mode and then boot twrp
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone