Ask / Submit

Provide option to mount the system partition / rootfs for Aliendalvik rewritable [Xperia XA2] [XA2 Plus] [Android 8.1]

asked 2019-03-31 23:28:07 +0300

micuintus gravatar image

From /var/lib/lxc/aliendalvik/configand I can tell that the new Android 8.1 runtime is based on Linux containers and its root filesystem is a squashfs image (with lz4 compression that the squashfs-tools I can install on SailfishOS via pkcon install squashfs-tools do not support...).

squashfs by its nature is a read-only file system. For several use cases mounting ´/system´ rw in the Android container would be really helpful: putting an su binary for rooting, moving apps to the system folder etc.

Would it be possible to either pack the system partition with an image format that can be mounted RW or provide an overlayfs based solution for the user to use the Android runtime in a more flexible manner?

edit retag flag offensive close delete


Note that currently, the system.img requires both extented attibutes (for SELinux-related security stuff, otherwise logcat break) and compression (because space on the /opt/alien partition is limited).

Very few filesystems fulfills the requirement. One obvious choice would be BTRFS but it comes with its own bag of caveat, specially on such small space.

EXT4 could be usable (xattr) but it has no built-in compression, which could grow to be problematic on the limited space.

DrYak ( 2019-06-03 16:35:34 +0300 )edit

1 Answer

Sort by » oldest newest most voted

answered 2019-04-10 23:20:07 +0300

micuintus gravatar image

Most certainly the very best way of achieving this would be using overlayFS, because then, whenever the Aliendalvik runtime is getting updated, simply the whole system.img would be replaced W/O replacing the changes the user has made (since they are being kept separately). Unfortunately, overlayFS is not available in the kernel :( ->

I was able to achieve some results by converting the system.img to ext4. But after doing so, logcat doesn't work any longer (see my answer to On top of that, I still struggle with a lot of problems: no location in any Android app, a lot of them do not have internet access (neither with mobile data, nor with WiFi),...

edit flag offensive delete publish link more



Regarding the location:

  • same problem here. Which provider are you using? The official Google Play Services? I'm using MicroG with several plug-ins and I was wondering if it is limited to MicroG or for all android environment.

Regarding Internet access :

  • forwarding conneciton information between Sailfish and Android is spotty. Some applications don't give a damn and try going online anyway (WhatsApp). Other application could miss a "going on-line event" and still think the connection is down.

    Usually, stop and starting again Alien Dalvik seems to solve that issue (like alwaysmost Android-related issues :-P ) and apps are again aware that there's a connection.

Regarding OverlayFS (and in a completely unrelated subject regarding Bluetooth HID) :

  • Modules aren't disabled on XA2, so somebody with some time could recompile the necessary kernel module, until Jolla adds it in some future versions (apparenty after 3.0.3)
DrYak ( 2019-04-11 16:14:16 +0300 )edit

Which provider are you using? The official Google Play Services? I'm using MicroG

I tried it with both of them. It could be though that (in both of the cases) I put to many of the Google / MicroG things there, of which one overwrote / shadowed the location abstraction / virtualization by Jolla. But I actually doubt that. Yet, W/O my changes to the system.img the location at least worked a little bit with HERE Maps (it was also very clunky there).

Usually, stop and starting again Alien Dalvik seems to solve that issue (like alwaysmost Android-related issues :-P ) and apps are again aware that there's a connection.

Good tip, thanks! I am gonna try that.

micuintus ( 2019-04-12 12:10:17 +0300 )edit

@DrYak: BTW, did you manage to get a proper rooted system setup running W/ AlienDalvik? I tried, but failed so far, I downloaded several su-binary/superuser.apk combos, put the su-binary in /system/bin but all of them said they cannot find a proper su-binary. :shrug:

micuintus ( 2019-04-12 12:14:11 +0300 )edit

Currently, it's going to be hard/pointless as system.img can only be mounted as read-only due to the limitations of SquashFS.

Also, most of the things I use Android for (Banks that insist on using Android apps for 2FA, chats like WhatsApp that don't tolerate 3rd party and require the Android official client that my friends insist on using, etc.) don't require root.

For split-apk, I simply use SAI, no root required.

And nearly all the situations that would have had required root can be handled "from the outside", i.e.: by being root on the outter Sailfish OS itself, or on the plugged-in laptop (e.g.: for patching system.img). On the other hand I'm way much more fluent in GNU/Linux than in Android (due among other things for professionnal reasons) so there's probably a lot of problems that are more natural for me to handle on a Linux shell that would be more natural to handle "the proper Android way" for others.

Out of curiosity, what are you needing root for from within Android?

DrYak ( 2019-04-12 12:22:15 +0300 )edit

For the EXT4 image and logd and logcat failing:

I turns out that using unsquashfs to extract the system.img junks some of the extended attributes (it's a bug of squashfs-tools, it affects other GNU/Linux distribution beside Sailfish), and without those attributes (relating to selinux) logd doesn't have the necessary privileges to run and is stuck in a restart loop.

The current alternative route (e.g.: for installing Google Play Services or MicroG) is to loop-mount the image and use rsync -avPSHAX to copy all attributes.

DrYak ( 2019-06-03 16:32:28 +0300 )edit
Login/Signup to Answer

Question tools



Asked: 2019-03-31 23:28:07 +0300

Seen: 246 times

Last updated: Apr 10