Livecasting porting notes for Zenfone 8

Day 14, Season 2

Got it. I was missing the group for the devices.ini, see this looping over groups.
That “[home_in_file]” was missing when I pasted in vi on the device.
Moving back /home to /home-bak, rebooting…

sailfish-device-encryption-community-wizard[5643]: library “/vendor/lib64/egl/libEGL_adreno.so” (“/vendor/lib64/egl/libEGL_adreno.so”) needed or dlopened by “/usr/libexec/droid-hybris/system/lib64/libvndksupport.so” is not accessible for the namespace

This sounds like needing the linkerconfig-user.service wait & sleep 5, that I introduced in Day 3 Season 2.
But that is a user systemd service, and the wizard is a system systemd service.
I will just make a copy “linkerconfig-system” for now and add it to its .wants/
I also change linkerconfig-user to sleep 0
If this works I need to update the files in my repo too…

Manually running it works though!

EGL_PLATFORM=hwcomposer QT_QPA_PLATFORM=hwcomposer /usr/bin/sailfish-device-encryption-community-wizard -plugin evdevtouch -plugin evdevmouse -plugin evdevkeyboard:keymap=/usr/share/qt5/keymaps/droid.qmap

I think the line in droid-hal that I need to wait for is
droid-hal-init: linkerconfig generated /linkerconfig with mounted APEX modules info

Find in files shows that’s in /system/core/init/builtins.cpp
That runs /system/bin/linkerconfig --target /linkerconfig
Which probably creates the com.android* subfolders from /linkerconfig

Let’s change it to /bin/bash -c "while [ ! -f /linkerconfig/com.android.runtime/ld.config.txt ]; do sleep 1; done; sleep 5"

This seems to work for the new “linkerconfig-system” service, but the wizard does not wait for it.
Maybe the services, as opposed to the targets, need to also list the Wants= inside the service file.
I could add a conf file in (…).service.d/ folder

Adding

# cat sailfish-device-encryption-community-wizard.service.d/20-droid.conf 
[Unit]
After=linkerconfig-system.service
Requires=linkerconfig-system.service

This time it works. I let it create and encrypt a home file
Then reboot

systemd-ask-password-gui[5647]: couldn’t find an OpenGL ES implementation, make sure you set ro.hardware.egl or ro.board.platform

Same error.

# mkdir systemd-ask-password-gui.service.d
# cp sailfish-device-encryption-community-wizard.service.d/20-droid.conf systemd-ask-password-gui.service.d/

Reboot
Ramdump?
Reboot again.
Works.

Unfortunately no dmesg was running at that ramdump.

Now it asks for password and boots.
Then cp -ar /home-bak/* /home/ and reboot

And again

systemd-ask-password-gui[5637]: couldn’t find an OpenGL ES implementation, make sure you set ro.hardware.egl or ro.board.platform
I don’t understand why. It seems “Linkerconfig generated /linkerconfig with mounted APEX modules info” message is twice output.

Ultimate plan: wait for both /linkerconfig/default to disappear then /linkerconfig/com/android/runtime to appear.
while [ -f /linkerconfig/default/ld.config.txt ]; do sleep 1; done; while [ ! -f /linkerconfig/com.android.runtime/ld.config.txt ]; do sleep 1; done; sleep 1

Ramdump again at reboot.

[  703.260744] [  703.260744] (CPU:5-pid:183:irq/335-smp2p) [23:45:50.374376193] Fatal error on modem!
[  703.260761] [  703.260761] (CPU:5-pid:183:irq/335-smp2p) [23:45:50.374393797] modem subsystem failure reason: rmts_api.c:2304:[2, 3145728, -919099608] EFS:rmts_get_buffer failed while writing.
[  703.260769] [  703.260769] (CPU:5-pid:183:irq/335-smp2p) [23:45:50.374400932] (703)2023-05-05 23:45:50 :[SSR]:modem rmts_api.c:2304:[2, 3145728, -919099608] EFS:rmts_get_buffer failed while writing
[  703.260781] [  703.260781] (CPU:5-pid:183:irq/335-smp2p) [23:45:50.374413172] subsys-restart: subsystem_restart_dev(): Restart sequence requested for modem, restart_level = SYSTEM.
[  703.260791] [  703.260791] (CPU:7-pid:10317:wk:do_write_su) [23:45:50.374423068] (703)2023-05-05 23:45:50 :[SSR-Info] Save SubSys Medical Table Error: [0xfffffffe]
[  703.260811] [  703.260811] (CPU:5-pid:11284:wk:device_rest) [23:45:50.374443380] Ramdump(ramdump_microdump_modem): No consumers. Aborting..
[  703.260816] [  703.260816] (CPU:5-pid:11284:wk:device_rest) [23:45:50.374447963] microdump_modem_notifier_nb: do_ramdump() failed

So there is something about modem not initialized when it ramdumps. Hopefully this happens only in my experiments, not in real life.

Let’s make that wait script into its own, say /usr/bin/droid/wait_for_linkerconfig.sh
Here is the result:
Now to the logs: the “with mounted APEX modules info” is 5 seconds apart. This might add 5 seconds to the entire boot process (passphrase entry is around 25s).
An idea would be to remove a previous patch that enabled mount of linkerconfig change…

These are the changes that enable community encryption for this device. You still have to install sailfish-device-encryption-community-droid manually for now, I need to test them at initial installation

2 Likes