answered
2019-04-29 22:49:20 +0200
LOGS
Please pay attention that Jolla's Sailfish OS is systemd-based, and (unlike most of your usuall GNU/Linux desktop distributions) has no logger deamon enabled.
Thus you'll find the /var/log
directory mostly empty.
Instead, you'll need to use journalctl
. journalctl --follow
in an SSH terminal is a great way to get information about what's currently happening in the system, journalctl --since '20 min ago'
is another example of something useful to quickly investigate what just happened.
Note again that (also unlike most of your usuall GNU/Linux desktops) journald persistence is completely turned off. So not only do you need to create a /var/log/journal
directory, but you'll also need to edit /etc/systemd/journald.conf
and change Storage=volatile
to Storage=auto
(or Storage=persist
) to have your log survive accross reboots.
Android
The android application compatibility layer Alien-Dalvik has changed a bit on the XA2 compared to older hardware.
Because Android 8.1 Oreo doesn't use a JVM-like dalvik JIT like the previous Android 4.4 Kitkat used before, Android application aren't isolated from the rest of Sailfish at the level of the Java VM. Instead, the whole AOSP userland runs inside an LXC container.
The container is aliendalvik, see in /var/lib/lxc/
(the AOSP system itself is stored in the read-only SqaushFS compressed image /opt/alien/system.img
).
To enter inside the (already running) container :
lxc-attach -n aliendalvik -- /system/bin/sh
The various deamons that make the translation between the Sailfish OS host and the AlienDalvik should already output some useful information in the system-wide journald logs. (Mostly about missing APIs)
To get the Android's own specific logs, use the (libhybris specific) log from outside the container:
/system/bin/logcat
or
/usr/libexec/droid-hybris/system/bin/logcat
But this only display the Android kernel logs.
To get alien-dalvik's logs, you need to run logcat
in the context of the (already running) LXC container:
lxc-attach -n aliendalvik -- /system/bin/logcat
or
lxc-attach -n aliendalvik -- /system/bin/sh
/system/bin/logcat
WARNING Unpacking system.img file with unsquashfs
and then repacking it (as happens when either installing signature spoofing for microG or installing Google's official proprietary Play Services) does break some attributes inside system.img, and you'll get this error message:
logcat read failure
and journalctl
log entries such as:
May 02 15:01:24 Sailfish init: starting service 'logd'...
May 02 15:01:24 Sailfish init: Created socket '/dev/socket/logd', mode 666, user 1036, group 1036
May 02 15:01:24 Sailfish init: Created socket '/dev/socket/logdr', mode 666, user 1036, group 1036
May 02 15:01:24 Sailfish init: property_set("ro.boottime.logd", "17627153292115") failed: property already set
May 02 15:01:24 Sailfish init: Created socket '/dev/socket/logdw', mode 222, user 1036, group 1036
May 02 15:01:24 Sailfish init: Opened file '/proc/kmsg', flags 0
May 02 15:01:24 Sailfish init: Opened file '/dev/kmsg', flags 1
May 02 15:01:24 Sailfish logd: failed to set CAP_SETGID, CAP_SYSLOG or CAP_AUDIT_CONTROL (1)
May 02 15:01:24 Sailfish init: Sending signal 9 to service 'logd' (pid 6141) process group...
May 02 15:01:24 Sailfish init: Successfully killed process cgroup uid 1036 pid 6141 in 0ms
Google Play Services
Lots of Android apps (anything more fancy than WhatsApp) will require Google's proprietary services to work successfully.
Basically, you have two ways:
Use a tool like opengapps to fetch and install Google's own proprietary service, the Play Store, etc.
There should be some tutorials floating somewhere on this forum for XA2's 8.1 Pie
Use FDroid (a repository of opensource software), MicroG (an open source re-implementation of the proprietary server), Yalp (a client that can fetch APKs from the official Play Store) and FakeStore (for the few android APPs that will show error message when they don't see the official Play Store).
See this thread and more specifically the docker tool mentionned in that answer.
That's what I use (but I still can't manage to get GPS working inside the Android Apps running on aliendalvik. :-( Though I use the Sailfish native "Pure Maps" app, so it isn't critical for me).
Warning modifying system.img this way causes breakage on the logging daemon (logd). The workaround I've found is to use loop-mount and rsync -avPSHAX
instead of unsquashfs
.