Ubuntu Touch for Redmi 4X (santoni )



  • Hi Ubports comunity

    Danct12 and Asriel have make and excellent job on porting Ubuntu touch (Ubports) on Xiaomi Redmi 4x (Santoni).
    Unfortunately, they can no longer do anything at the moment.
    A big thank to both of them. Their work are available at https://github.com/ubports-santoni.

    The features available are:

    • Kernel 3.18.140 with apparmor v3 patch applied.
    • Mobile Data (4G)
    • SMS (send and receive) with notification in the menu
    • Incoming and Outgoing call process normally, but no audio at all and no ringtone (only vibration on incoming call)
    • Bluethooth
    • GPS
    • Front and rear camera take pictures, but hang on recording video.
    • Led charging indicator

    Not working:

    • Fingerprint
    • Automatic screen rotation. (maybe I broke it)
    • Playing video file with the "Media Player"

    What I've done so far (I haven't committed the changes yet):

    • Fix the audio issues during call. So Incoming and Outgoing call now work properly.
    • Change API of the camera to 64 bit. This reduce latency time when taking picture.

    The next thing an want to fix is ringtone on incoming call, but I am blocked on following issues:
    The kernel is compiled with CONFIG_SECURITY_APPARMOR=y and CONFIG_DEFAULT_SECURITY_APPARMOR=y

    a) If apparmor=0 is set in the kernel boot parameter, all the above listed features work including all apps.
    Ringtone on incoming call will not work.

    b) If apparmor=1 is set or simply removed, all the above listed features work including ringtone.
    But but but, only a few apps will start run properly: System Settings, Phone, Contacts, Openstore, Terminal and File Manager.
    The most apps like Morph Browser, Camera, Messaging, Gallery etc... will not start. They are all killed by Apparmor with the following error messages such as (example of Morph Browser):

    Dec 29 17:03:11 ubuntu-phablet kernel: [  666.130118] audit_printk_skb: 438 callbacks suppressed
    Dec 29 17:03:11 ubuntu-phablet kernel: [  666.130135] audit: type=1400 audit(1577635391.080:22874): apparmor="DENIED" operation="sendmsg" profile="morph-browser" name="/socket/logdw" pid=7491 comm="morph-browser" requested_mask="w" denied_mask="w" fsuid=32011 ouid=1036
    Dec 29 17:03:11 ubuntu-phablet kernel: [  666.130286] audit: type=1400 audit(1577635391.080:22875): apparmor="DENIED" operation="open" profile="morph-browser" name="/dev/pmsg0" pid=7491 comm="morph-browser" requested_mask="w" denied_mask="w" fsuid=32011 ouid=0
    Dec 29 17:03:11 ubuntu-phablet kernel: [  666.130897] audit: type=1400 audit(1577635391.080:22876): apparmor="DENIED" operation="sendmsg" profile="morph-browser" name="/socket/logdw" pid=7491 comm="morph-browser" requested_mask="w" denied_mask="w" fsuid=32011 ouid=1036
    Dec 29 17:03:11 ubuntu-phablet kernel: [  666.130987] audit: type=1400 audit(1577635391.080:22877): apparmor="DENIED" operation="open" profile="morph-browser" name="/dev/pmsg0" pid=7491 comm="morph-browser" requested_mask="w" denied_mask="w" fsuid=32011 ouid=0
    Dec 29 17:03:11 ubuntu-phablet kernel: [  666.153658] audit: type=1400 audit(1577635391.100:22878): apparmor="DENIED" operation="sendmsg" profile="morph-browser" name="/socket/logdw" pid=7491 comm="morph-browser" requested_mask="w" denied_mask="w" fsuid=32011 ouid=1036
    Dec 29 17:03:11 ubuntu-phablet kernel: [  666.153767] audit: type=1400 audit(1577635391.100:22879): apparmor="DENIED" operation="open" profile="morph-browser" name="/dev/pmsg0" pid=7491 comm="morph-browser" requested_mask="w" denied_mask="w" fsuid=32011 ouid=0
    Dec 29 17:03:11 ubuntu-phablet kernel: [  666.154006] audit: type=1400 audit(1577635391.100:22880): apparmor="DENIED" operation="open" profile="morph-browser" name="/sys/devices/soc0/soc_id" pid=7491 comm="morph-browser" requested_mask="r" denied_mask="r" fsuid=32011 ouid=0
    Dec 29 17:03:11 ubuntu-phablet kernel: [  666.169794] audit: type=1400 audit(1577635391.110:22882): apparmor="DENIED" operation="open" profile="morph-browser" name="/sys/devices/soc0/soc_id" pid=7491 comm="morph-browser" requested_mask="r" denied_mask="r" fsuid=32011 ouid=0
    Dec 29 17:03:11 ubuntu-phablet kernel: [  666.178765] audit: type=1400 audit(1577635391.120:22883): apparmor="DENIED" operation="sendmsg" profile="morph-browser" name="/socket/logdw" pid=7491 comm="morph-browser" requested_mask="w" denied_mask="w" fsuid=32011 ouid=1036
    Dec 29 17:03:12 ubuntu-phablet dbus[2505]: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/com/canonical/libertine/Service/Operations" interface="com.canonical.libertine.Service.Operations" member="list" mask="send" name="com.canonical.libertine.Service" pid=7491 label="morph-browser" peer_pid=4506 peer_label="unconfined"
    Dec 29 17:03:12 ubuntu-phablet dbus[2505]: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/com/canonical/libertine/Service/OperationsMonitor" interface="com.canonical.libertine.Service.OperationsMonitor" member="running" mask="send" name="com.canonical.libertine.Service" pid=7491 label="morph-browser" peer_pid=4506 peer_label="unconfined"
    Dec 29 17:03:12 ubuntu-phablet dbus[2505]: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/com/canonical/libertine/Service/OperationsMonitor" interface="com.canonical.libertine.Service.OperationsMonitor" member="last_error" mask="send" name="com.canonical.libertine.Service" pid=7491 label="morph-browser" peer_pid=4506 peer_label="unconfined"
    Dec 29 17:03:12 ubuntu-phablet dbus[2505]: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/com/canonical/libertine/Service/OperationsMonitor" interface="com.canonical.libertine.Service.OperationsMonitor" member="result" mask="send" name="com.canonical.libertine.Service" pid=7491 label="morph-browser" peer_pid=4506 peer_label="unconfined"
    Dec 29 17:03:13 ubuntu-phablet kernel: [  668.111851] ether_ioctl: [rndis0] error: ioctl called for unsupported cmd[35585]
    
    

    My questions:

    1. Is Apparmor still working properly if apparmor=0 is set in the kernel boot parameter ?
    2. In case of b) Do I need additional configuration in order for apparmor to work properly?

Log in to reply