[GUIDE] [Mi 4] Fix sensors not working!

Lennoard

Recognized Developer
May 5, 2015
583
713
0
22
Teresina
hebfoptimizer.androidvip.com.br

userprince

Senior Member
Mar 12, 2012
732
181
0
mmcblk0p25
Here's the partition
https://drive.google.com/file/d/0BxSyFhLEi8whVGRQSU1WYnZVWEk/view?usp=docslist_api

Usually we use get partition by name not dev/block/....
But I have no sure.
No what was written right side of Persist on the app. Something like this mmcbl9kp2
 

satvikvg

Senior Member
Aug 11, 2012
192
142
0
PERSIST in Mi 4 after repartition

Kindly Note this:
After repatriation the PERSIST partition changes to mmcblk0p21 in Miui 7 6.1.14 Beta Marshmelow

EDIT: mmcblk0p22 no longer works if you guys have Re partitioned for Marshmelow
 

rxl.noir

Senior Member
Nov 2, 2014
241
123
63
Bandung
Actually guys, if you still have a fastboot ROM for your device, you can flash the persist.img from the fastboot ROM folder directly using fastboot to fix this problem.
Code:
fastboot flash persist persist.img
Haven't tested it using different OS source, but just to be sure though, always use the same persist.img for same OS gen (from KK fastboot to all KK ROMs, from LP fastboot to all LP ROMs, you guys get the point).
 

kennethkee93

Member
Feb 16, 2014
25
5
0
Actually guys, if you still have a fastboot ROM for your device, you can flash the persist.img from the fastboot ROM folder directly using fastboot to fix this problem.
Code:
fastboot flash persist persist.img
Haven't tested it using different OS source, but just to be sure though, always use the same persist.img for same OS gen (from KK fastboot to all KK ROMs, from LP fastboot to all LP ROMs, you guys get the point).
It works with different OS source, the persist file is from android LP and it works with my phone on android MM.
 

rxl.noir

Senior Member
Nov 2, 2014
241
123
63
Bandung
It works with different OS source, the persist file is from android LP and it works with my phone on android MM.
Phew, then it shouldn't be a problem... But try using the latest persist.img from MIUI MM.
IDK what had been changed, but for Mi3, the persist.img from KK fastboot and MM fastboot has different md5 hash. Maybe some updated sensor driver, IDK.
 

rajumack07

Senior Member
Aug 5, 2011
157
64
0
Bhubaneswar
Phew, then it shouldn't be a problem... But try using the latest persist.img from MIUI MM.
IDK what had been changed, but for Mi3, the persist.img from KK fastboot and MM fastboot has different md5 hash. Maybe some updated sensor driver, IDK.
Yes, that's true. I found there is difference in size of files based on Android version. Previously, I tried the MM version on CM12.1 and it went to bootloop. But the one shared by @kennethkee93 worked.

Edit: As I am on merged partition with CM12.1, I had to use "mmcblk0p21" partition.
 
Last edited:

rxl.noir

Senior Member
Nov 2, 2014
241
123
63
Bandung
Yes, that's true. I found there is difference in size of files based on Android version. Previously, I tried the MM version on CM12.1 and it went to bootloop. But the one shared by @kennethkee93 worked.

Edit: As I am on merged partition with CM12.1, I had to use "mmcblk0p21" partition.
So the MM's persist got LP ROMs to bootloop?
Hmmm... Seems like the persist.img from KK is probably still used for LP ROMs (since there's no MIUI LP for Mi3).

I think it's better to have persist from KK for KK and LP ROMs, while MM for MM ROMs only. Just in case against any bootloops.
Here's both of them, extracted from v6.5.3.0 Global Stable (KK) and v6.2.4 China Dev (MM). Only flash them through fastboot, since it was from fastboot ROM.

On the matter of the partition layout, it doesn't really matter though, since the difference is only where the persist partition is located.
 
Last edited:

kennethkee93

Member
Feb 16, 2014
25
5
0
So the MM's persist got LP ROMs to bootloop?
Hmmm... Seems like the persist.img from KK is probably still used for LP ROMs (since there's no MIUI LP for Mi3).

I think it's better to have persist from KK for KK and LP ROMs, while MM for MM ROMs only. Just in case against any bootloops.
Here's both of them, extracted from v6.5.3.0 Global Stable (KK) and v6.2.4 China Dev (MM). Only flash them through fastboot, since it was from fastboot ROM.

On the matter of the partition layout, it doesn't really matter though, since the difference is only where the persist partition is located.
The link given needs access permission.