Contributor Moderators

Private

Can moderate the New Contributors section

Posts

  • Installing Android after Ubuntu Touch: Fix sensors issue

    Hi there,

    if you ever want to install an Android-based distro after Ubuntu Touch was installed, you will notice that no sensors work anymore. The root cause was already identified by guys on the Fairphone forum some time ago description is more to the end of the thread, so be patient and read it in full - but here in UT side nobody of course noticed that, as sensors keep working correctly in UT 🙂

    What happens is that the necessary Android selinux contexts are being somehow removed from the sensor folder in the persist partition. We would need to analyze why this happens, but probably the files are being rewritten from the Android container in UT and as UT does not use selinux, they are set to unlabeled, like so:

    ./sensors/registry/registry:
    total 668
    drwxr-xr-x 2 system system u:object_r:vendor_persist_sensors_file:s0  12288 2023-11-21 22:10 .
    drwxr-xr-x 3 system system u:object_r:vendor_persist_sensors_file:s0   4096 2023-11-21 22:10 ..
    -rw------- 1 system system u:object_r:unlabeled:s0                       78 2023-11-21 22:10 ak0991x_0
    -rw------- 1 system system u:object_r:unlabeled:s0                      131 2023-11-21 22:10 ak0991x_0.mag
    -rw------- 1 system system u:object_r:unlabeled:s0                      233 2023-11-21 22:10 ak0991x_0.mag.config
    -rw------- 1 system system u:object_r:unlabeled:s0                      181 2023-11-21 22:10 ak0991x_0.mag.config_2
    -rw------- 1 system system u:object_r:unlabeled:s0                      222 2023-11-21 22:10 ak0991x_0_platform
    -rw------- 1 system system u:object_r:unlabeled:s0                      866 2023-11-21 22:10 ak0991x_0_platform.config
    -rw------- 1 system system u:object_r:unlabeled:s0                      142 2023-11-21 22:10 ak0991x_0_platform.mag
    -rw------- 1 system system u:object_r:unlabeled:s0                      146 2023-11-21 22:10 ak0991x_0_platform.mag.fac_cal
    -rw------- 1 system system u:object_r:unlabeled:s0                      204 2023-11-21 22:10 ak0991x_0_platform.mag.fac_cal.bias
    -rw------- 1 system system u:object_r:unlabeled:s0                      508 2023-11-21 22:10 ak0991x_0_platform.mag.fac_cal.corr_mat
    -rw------- 1 system system u:object_r:unlabeled:s0                      148 2023-11-21 22:10 ak0991x_0_platform.mag.fac_cal_2
    -rw------- 1 system system u:object_r:unlabeled:s0                      206 2023-11-21 22:10 ak0991x_0_platform.mag.fac_cal_2.bias
    -rw------- 1 system system u:object_r:unlabeled:s0                      510 2023-11-21 22:10 ak0991x_0_platform.mag.fac_cal_2.corr_mat
    -rw------- 1 system system u:object_r:unlabeled:s0                      176 2023-11-21 22:10 ak0991x_0_platform.orient
    -rw------- 1 system system u:object_r:unlabeled:s0                      622 2023-11-21 22:10 ak0991x_0_platform.placement
    

    Unfortunately the solution to this is, as described in the Fairphone forum thread, a bit cumbersome:

    • The bootloader needs to be unlocked. If you happen to have all your data already in this Android installation and you have locked the bootloader again, you will loose all your data during this process.
    • You have to install Magisk. Depending on the Android version this involves patching the boot.img file or creating a custom recovery
    • With Magisk you can obtain a root shell and the execute the necessary restorecon command

    It would be awesome to find out if we can avoid this situation somehow. Unfortunately I just dont have the time for the moment, but I can confirm the fix worked as described over there.

    BR Florian

  • RE: Warning About a Sneaky Spamming Method in This Forum and How to Detect and Counter It

    @grenudi Obviously not.

  • RE: Warning About a Sneaky Spamming Method in This Forum and How to Detect and Counter It

    @grenudi I think your reference point and association in this case is so far off the mark I find it hard to believe the comparison could even be made. I suggest you stop now and leave it well alone. It is offensive on so many levels and factually inaccurate do not repeat it.
    Also I have no inclination to stop the discussion you started in your original post as some points are worth discussion. However we ask that repeating the same point across numerous threads is not done as confusing, distracting and frankly annoying.
    Please if you wish refer back to the original post with a link in other threads if you must but stop starting new ones or repeating at length in others the same point. Thank you.

Member List