[Solved] Phone sensors stopped working after installing experimental image [Ubuntu]

If I remember correctly what has changed is that atleast one file was mislabeled in a previous android version (sensors_persist_file ← → persist_sensors_file). That is one thing I found while skimming through some commits.

As far as I’m aware some partitions are automatically relabeled, but the persist partition only gets relabeled under certain specific conditions which are not triggered by a reboot/flash but only by some specific changes.

1 Like

Hello, Florian from UBports here. This happens, unexpectedly for us to say, for the following reasons:

  • Ubuntu Touch does not use SELinux but Apparmor to secure processes, files, isolate Apps etc.
  • When doing a port for Ubuntu TOuch therefore SELinux is turned off in kernel, and so any SELinux context information that was stored with files may be tampered/removed if the file gets written.
  • Sensors probably store calibration, metadata whatever on /persist in this case
  • When Android is reinstalled, its not supposed to reset anything on persist
  • But also, Android refuses access to those files since they fail SELinux checks now
  • At the end, sensors do not work anymore

We will work with Fairphone to see if this can be fixed in a better way. Until then, please use the manual workaround psoted a few comments above.

4 Likes

Are there plans to use SELinux? I only have advanced experience with SELinux (Fedora/RHEL user) and some regular experience with AppArmor (OpenSUSE/Debian). But from what I can tell is that SELinux is, when enabled, really strict. While AppArmor, when enabled, it could only be just protecting a CUPS service. That sort of gives me the impression that SELinux is more like a firewall where you have the default rule to drop traffic, and then allow selective traffic. While AppArmor feels more like a firewall where the default is to allow everything, and you specify some behavior you don’t want.

This may be a topic of it’s own though. But just wondering if Ubuntu Touch is considering SELinux. Fedora Silverblue shows how a Linux environment can be quite locked down in terms of security at the level of iOS/Android, by using SELinux (and some other stuff).

I had the same exact problem and it worked for me too. Thanks :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

I’m having the same issues and have now successfully installed Magisk. Probably missing something and it’s late so gonna go bed! Root is now working and tries to get restorecon -FR /mnt/vendor/persist to work via termux

I suspect reading further I need to use the command via adb in windows

Hey. this solution worked for me thank you!. i want to note that i couldnt find the magisk app on the appstore so you have to google it and got it myself from magiskmanager.com and installed the apk.

For other people you can find the fairphone 4 rom on the official website which contains the boot.img also when patched it will look a little like this “magisk_patched-26100_qXhxI.img”

If someone is technical enough to do this but is strugging to get it working ill offer my assistance for a short while.

1 Like

Never download Magisk from some random 3rd party site, this is software that can do everything on your phone, you can’t be sure that it hasn’t been tampered with!
The only safe place to get it is from Magisk’s GitHub releases, the official instructions are here.

Oh and welcome to the community BTW :wave:

2 Likes

argh ok i have exactly the same problem and now i know how to fix it if i dare try it :frowning:

1 Like