sonyxperiadev / device-sony-lena

10 stars 12 forks source link

EFS and NV Items Wiped After Reboot #15

Closed nekrondev closed 2 years ago

nekrondev commented 2 years ago

I'm using the AOSP-based SailfishOS (https://blog.jolla.com/xperia-10-iii/) on my unlocked device. To fix issues releated to the modems GNSS subsystem I need to set NV items and upload SuplRoot certificates to modems EFS storage.

Tool is available at https://gitlab.com/nekrondev/suplpatcher SailfishOS discussion here https://forum.sailfishos.org/t/gps-stopped-working/1181/621

This however is not working any more for Xperia 10 Mark III. After a reboot of the device to apply the changed settings the default values for NV register 6792 (SUPL version) and EFS folder (/SUPL) are restored to default settings, i.e. the expired and outdated Equinox, Thawte and Rakuten test certificates. On older SailfishOS devices like unlocked X, XA2, 10 Mark I and 10 Mark II modification of NV items and EFS certificate files was working without any problems and could fix my GNSS issues.

It's unclear to me why the embedded filesystem and NV data is whiped and restored to default settings on every reboot. EFS also contains positioning engine data like almanac and ephemeris data that is wiped and needs to be downloaded or injected once the GNSS system is initialized which is curently a problem on SailfishOS.

To sum it up:

On the flip side the NV item to enable or disable secure SUPL connections (register 3758) can be stored permanently and it not wiped after a reboot.

On the contrary the former Xperia 10 Mark II was able to store these settings permanently into EFS/NV and thus I was able to use SUPLv2 with a 4G connection on SailfishOS.

How can I permanently store SUPL version and EFS certificates in EFS without being wiped on every reboot? Or did Sony change policies and forces a restore on every reboot to prevent end user modification of modem settings?

nekrondev commented 2 years ago

I just found out that vendor blob /vendor/bin/hw/android.hardware.gnss@2.1-service-qti was parsing the gps.conf file and overwriting the NV item settings so eventually this was no issue on the SoC restoring default settings but some hidden feature inside the blob.

The EFS certificates uploaded into /SUPL directory are keept persistant and I guess I was a bit tired out when testing the upload.