Day 17, Season 2
jolla-camera-hw.txt
[apps/jolla-camera]
backCameraLabels=['1x', '0.5']
maxVideoResolution='2048x1080'
Fingerprint…
device/asus/sake/fod/FingerprintInscreen.cpp
says
Return<int32_t> FingerprintInscreen::getPositionX() {
return 435;
}
Return<int32_t> FingerprintInscreen::getPositionY() {
return 1631;
}
Following instructions from GitHub - sailfishos-open/sailfish-fpd-community: Sailfish OS fingerprint support
This is my previous fork from sailfish-open that had some hacks to work with the Mi Note 10.
git clone https://github.com/b100dian/sailfish-fpd-community.git hybris/mw/sailfish-fpd-community
[HABUILD_SDK]$ make libbiometry_fp_api
Then
git clone https://github.com/erfanoabdi/fake_crypt.git external/fake_crypt
[HABUILD_SDK]$ make fake_crypt
Which fails:
external/fake_crypt/Keymaster4.h:27:10: fatal error: ‘keymasterV4_0/Keymaster.h’ file not found
#include <keymasterV4_0/Keymaster.h>
A quick find shows hardware/interfaces/keymaster/4.1/support/include/keymasterV4_1/Keymaster.h
So 4.0 becomes → 4.1
That could be a quick change…
However, the build still fails (not finding keymasterV4_1/Keymaster.h
). And it still contains this include -Ihardware/interfaces/keymaster/4.0/support/include
line.
Hmm… Let’s proceed without it since I have a keymaster service, maybe fake_keymaster is not needed.
[PlatformSDK]$ hybris/mw/sailfish-fpd-community/rpm/copy-hal.sh
droid-biometry-fp-0.0.0/out/target/product/sake/system/lib64/libbiometry_fp_api.so
[PlatformSDK]$ rpm/dhd/helpers/build_packages.sh --build=hybris/mw/sailfish-fpd-community --spec=rpm/droid-biometry-fp.spec --do-not-install
The ‘–do-not-install’ option is not needed anymore and is currently ignored
- Building rpm/droid-biometry-fp.spec
Setting version: 1.1.2+lineage.18.1.20230510180255.25842be
error: Unable to open /mnt/datas/sake/hadk/hybris/mw/sailfish-fpd-community/.mb2/spec: No such file or directory
error: query of specfile /mnt/datas/sake/hadk/hybris/mw/sailfish-fpd-community/.mb2/spec failed, can’t parse - Check /mnt/datas/sake/hadk/hybris/mw/sailfish-fpd-community.log for full log.
That log has the same contents. That .mb2/spec
file exists though.
Hmm… that error goes away by just exiting and re-entering sfossdk
. Stale something…?
The package goes directly to OBS’s droid-hal-device
, as do all packages of Android bits:
[PlatformSDK]$ cp droid-local-repo/sake/droid-biometry-fp-1.1.2+lineage.18.1.20230510180255.25842be-202305101841.aarch64.rpm ~/osc/nemo\:devel\:hw\:asus\:sake/droid-hal-sake/
[PlatformSDK]$ cd ~/osc
[PlatformSDK]$ osc add droid-biometry-fp-1.1.2+lineage.18.1.20230510180255.25842be-202305101841.aarch64.rpm
[PlatformSDK]$ osc commit
The other two packages I copy their definitions from my previous port:
[PlatformSDK]$ osc copypac nemo\:devel\:hw\:xiaomi\:tucana/sailfish-fpd-community-test nemo\:devel\:hw\:asus\:sake/
[PlatformSDK]$ osc copypac nemo\:devel\:hw\:xiaomi\:tucana/sailfish-fpd-community nemo\:devel\:hw\:asus\:sake/
Ok, now zypper them in.
sailfish-fpd-community[25580]: library "android.hardware.biometrics.fingerprint@2.1.so" not found
Hmm… that was available at compile time and now it is not?
Detour:
Testing zip install
Let’s take a break and test a zip file. Reboot, hold power-up.
$ sudo fastboot boot twrp-3.7.0_12-0-I006D.img
Sending 'boot.img' (98304 KB)
Seems locked. “Restart bootloader”
Same “result” the 2nd and 3rd time.
Changing cable… (to the original one) and it works. Maybe just luck.
Actually it does not, it is stuck at ASUS logo.
Hold Power + Vol Dn, on logo dissapearence - hold Vol Up. Again. Stuck at logo.
Let’s try previous TWRP.
$ sudo fastboot boot twrp-3.6.1_11-0-I006D.img
This one is stuck at another logo:) The charging one.
Let’s try a second time. Asus logo. Stuck.
Third cable, the Xiaomi one I flashed A11 with.
$ sudo fastboot boot twrp-3.7.0_12-0-I006D.img
Stuck at Asus logo.
$ sudo fastboot boot twrp-3.6.1_11-0-I006D.img
Stuck at the charging logo
This might not be a cable issue only, after all.
Booting normally actually ends up in battery charging mode of sailfishos too:)
I use the “occasion” to issue /usr/libexec/droid-hybris/system/bin/bootctl
commands to mark boot successful and switch slots, from 1 to 0
I expect a ramdump on reboot since in this state I think the modem driver will be upset.
And ramdump it is. Unfortunately no logs, as I was using journalctl and that was probably cut off earlier than dmesg is.
Darn. Let’s flash twrp
$ sudo fastboot flash boot twrp-3.7.0_12-0-I006D.img
Sending 'boot_a' (98304 KB) OKAY [ 3.359s]
Writing 'boot_a' OKAY [ 0.196s]
No it doesn’t start. Not even by selecting “Recovery mode”
There must be something about the device that I changed… some other thing.
Let’s flash Lineage boot. (Danger! I remember if I don’t get this right it may while my /data)
Using “Recovery mode” AND holding VolDn just to be shure - it boots. Whew
Pusing “adb shell push sailfishos-sake-release-4.5.0.19-alpha2.zip /data”
But I can’t find what to do with it.
As much as I grep sources from lineage recovery, I don’t understand how to use the zip file which has an “udpater-script.sh”
(android_bootable_recovery/updater.h at lineage-18.1 · LineageOS/android_bootable_recovery · GitHub)
Actually, it does look as it is used in an updater_main.cpp that is in a an executable module named ‘updater’, but that binary is not in path, so maybe it was not compiled in.
So the only thing I can test if it can unzip and untar. And that works, thankfully, so if I boot twrp…
Manual installation instruction written Sailfish on Zenfone 8 · GitHub
/end detour
Back to that fpd error. “android.hardware.biometrics.fingerprint@2.1.so” not found.
Let’s grep the filenames on device:
# find / -type f -iname android.hardware.biometrics\*
/apex/com.android.vndk.v30/lib64/android.hardware.biometrics.face@1.0.so
/apex/com.android.vndk.v30/lib64/android.hardware.biometrics.fingerprint@2.1.so
/apex/com.android.vndk.v30/lib64/android.hardware.biometrics.fingerprint@2.2.so
/apex/com.android.vndk.v30/lib/android.hardware.biometrics.face@1.0.so
/apex/com.android.vndk.v30/lib/android.hardware.biometrics.fingerprint@2.1.so
/apex/com.android.vndk.v30/lib/android.hardware.biometrics.fingerprint@2.2.so
/apex/com.android.vndk.v30@1/lib64/android.hardware.biometrics.face@1.0.so
/apex/com.android.vndk.v30@1/lib64/android.hardware.biometrics.fingerprint@2.1.so
/apex/com.android.vndk.v30@1/lib64/android.hardware.biometrics.fingerprint@2.2.so
/apex/com.android.vndk.v30@1/lib/android.hardware.biometrics.face@1.0.so
/apex/com.android.vndk.v30@1/lib/android.hardware.biometrics.fingerprint@2.1.so
/apex/com.android.vndk.v30@1/lib/android.hardware.biometrics.fingerprint@2.2.so
/vendor/etc/init/android.hardware.biometrics.fingerprint@2.1-service.rc
/vendor/etc/vintf/manifest/android.hardware.biometrics.fingerprint@2.1-service.xml
/vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service
So it seems it uses 2.1 version services, but also has 2.1 and 2.2 libraries.
Let’s link one of the 2.1 ones to /odm/lib64:
# ln -s /apex/com.android.vndk.v30/lib64/android.hardware.biometrics.fingerprint@2.1.so /odm/lib64/
# systemctl restart sailfish-fpd-community
library “android.hardware.biometrics.fingerprint@2.1.so” needed or dlopened by “/usr/libexec/droid-hybris/system/lib64/libbiometry_fp_api.so” is not accessible for the namespace [name="(default)", ld_library_paths="/usr/libexec/droid-hybris/system/lib64:/vendor/lib64:/system/lib64:/odm/lib64", default_library_paths="/system/lib64:/system_ext/lib64", permitted_paths="/system/lib64/drm:/system/lib64/extractors:/system/lib64/hw:/system_ext/lib64:/system/framework:/system/app:/system/priv-app:/system_ext/framework:/system_ext/app:/system_ext/priv-app:/vendor/framework:/vendor/app:/vendor/priv-app:/system/vendor/framework:/system/vendor/app:/system/vendor/priv-app:/odm/framework:/odm/app:/odm/priv-app:/oem/app:/product/framework:/product/app:/product/priv-app:/data:/mnt/expand:/apex/com.android.runtime/lib64/bionic:/system/lib64/bootstrap"]
Ok, soft link doesn’t cut it.
# touch /odm/lib64/android.hardware.biometrics.fingerprint@2.1.so
# mount -o ro,bind /apex/com.android.vndk.v30/lib64/android.hardware.biometrics.fingerprint@2.1.so /odm/lib64/android.hardware.biometrics.fingerprint@2.1.so
# systemctl restart sailfish-fpd-community
Adding the sake 435 and 1631 coordinates to /usr/share/sailfish-fpd-community-test/qml/pages/EnrollPage.qml
Rectangle {
x: 435
y: 1631
width: 220
height: 220
radius: 220
(previous values were from Mi Note 10)
Then starting the test app with the white circle rectangle to give inscreen fingerprint a chance…
Error while starting to enroll: -1
05-11 21:44:39.185 5512 5517 E rpmb_ufs: Unable to open /dev/0:0:0:49476 (error no: 2)
05-11 21:44:39.186 5555 5555 E KeymasterUtils: rsp_header->status: -30
Maybe I need that fake_crypt
package though.
I look at the compile error and at the Android.mk still had a reference to 4.0 by listing libkeymaster4support
, instead of libkeymaster4_1support
(as I’ve found out looking in hardware/interfaces/keymaster/4.1/support/Android.bp
)
All in all, both were needed, plus some changes that were not needed actually… Comparing erfanoabdi:master...b100dian:keymaster41 · erfanoabdi/fake_crypt · GitHub
Built droid-fake-crypt, commit to OBS, zypper in…
Still fails to enroll, -1
.
Journal:
May 12 02:29:48 Zenfone8 sailfish-fpd-community[12109]: void AndroidFP::enroll(uid_t) 100000
May 12 02:29:48 Zenfone8 systemd[1]: sailfish-fpd-community.service: Main process exited, code=killed, status=11/SEGV
Logcat continues to have
rpmb_ufs: Unable to open /dev/0:0:0:49476 # process is /vendor/bin/qseecomd
KeymasterUtils: rsp_header->status: -30 # process is /vendor/bin/hw/android.hardware.gatekeeper@1.0-service-qti
Great. Vendor services for which I don’t have sources.
qseecomd
is one that I made dev/ufs-bsg
available to, for rpmb-something errors, on day 29, before-GUI…