Day 27
After droid-hal-init started, I test wlan again:
# echo 1 > /sys/devices/platform/soc/b0000000.qcom,cnss-qca6490/fs_ready
# modprobe modprobe qca_cld3_wlan
# ifconfig -a
wlan0 Link encap:Ethernet HWaddr 3C:7C:3F:8E:E5:8A
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
wlp1s0 Link encap:Ethernet HWaddr 3E:7C:3F:8E:E5:8A
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Cool.
Hmmm. forgot to # cp /odm_root/etc/selinux/precompiled_sepolicy /etc/selinux/minimum/policy/policy.30
yesterday?
Btw, I can now safely flash instead of boot the hybris-boot.img. I should do so next.
Done. Bye bye Lineage recovery, see you soon.
About yesterdays’ logcat: Check failed: selinux_status_open(true ) >= 0
.
I thought I set up selinux files, but maybe more is needed.
For example, my kernel doesnt display “SELinux: Initializing” on the 0th second on boot, but “AppArmor: AppArmor initialized”.
The function selinux_status_open(int fallback)
is in libselinux/src/sestatus.c.
The comment says something about “/selinux/status”.
I do have /selinux
but there’s nothing in there.
Checking mount
on the device, there is no selinuxfs
mount, but there is one securityfs
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
In that folder I do find AppArmor
references - but no “status”.
Reading a comparison1 of SELinux and AppArmor it is clear to me that those are not related at all, and are parallell developments.
I was “hoping” that ASUS used some rebranded thing that would turn out to be SELinux, but it is not.
It may be older… Also, wikipedia hints at “Yama” and “Tomoyo”.
So the question is, then: how come those same services work on Lineage without SELinux and the fail in hybris?
:facepalm: they were from halium check-kernel-config
.
Let’s remove most of that.
Next boot my heart skipped a beat because telnet got disconnected and wouldn’t connect again.
Oh, no not some sfos or android service again.
But when pulling out the USB cable and connecting it back I got back access :whew:
I get a large logcat - of which I save the first 60 seconds since that would be enough for a phone to ‘boot’ - and it doesn’t show that selinux error. Also, /sys/fs/selinux
is now mounted as selinuxfs
.
Lots of “avc: denied” lines there that end up in “permissive=1”, so it’s just noise (would have been denied, but isn’t)
Some notable errors:
vendor.qti.vibrator: open /dev/input/by-path failed, errno = 21
Altough I see it is world readable.
When CamX enters the stage, logs start to become unreadable:)
Then there’s
--------- beginning of crash
03-17 17:24:47.367 6400 6400 F linker : CANNOT LINK EXECUTABLE “/usr/libexec/droid-hybris/system/bin/minisfservice”: library “libandroidicu.so” not found: needed by /system/lib/libmedia.so in namespace (default)
That I should know how to fix.
From previous debugging experience, confirmed in porter’s channel, the usual path to look for libraries contains /odb/lib[64], and since I control that, I should be able to link these kind of libraries.
Then there’s also
03-17 17:24:47.665 6480 6615 E audioadsprpcd: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:921:Error 0x2: fileExists failed for path /vendor/dsp/adsp/audioadsprpcd.farf, errno is No such file or directory
But /vendor/dsp/adsp/
exists and it is filled with other files.
Good news is that I got one “ACDB-LOADER: ACDB → init done!” which is audio related.
Next, I grep for “Waiting for service” lines. I get
Waiting for service ‘package_native’
Waiting for service ‘statscompanion’
That ‘statscompanion’ is so often waited upon I look for it on the whole device
find / -iname *.rc -exec grep statscompanion {} ; -print
I don’t find anything though. The same for package_native.
Hmm. Let’s:
- boot an audit=0 cmdline kernel
- fix the libandroidicu.so requirement by linking it from /odm/lib
- See the new logcat. Maybe share it on porter’s channel…
For 2. I do # ln -s /apex/com.android.art/lib/libandroidicu.so /odm/lib/libandroidicu.so
Wait, no such file or directory - /odm
does not exist unfortunately.
I thought I already created it and linkd /odm/etc to /odm_root/etc… it is not on the rootfs?
Again:
# mkdir /odm
# ln -s /odm_root/etc /odm/etc
# mkdir /odm/lib
# ln -s /apex/com.android.art/lib/libandroidicu.so /odm/lib/libandroidicu.so
Reboot. Boot new hybris-boot with audit=0
Minimedia this time complains about missing libicuuc.so
# ln -s /apex/com.android.art/lib/libicuuc.so /odm/lib/libicuuc.so
Let’s link all libs from my previous port then.
# ln -s /apex/com.android.vndk.v30/lib/libaudioroute.so /odm/lib/libaudioroute.so
# ln -s /apex/com.android.art/lib/libicui18n.so /odm/lib/libicui18n.so
Reboot.
linker : CANNOT LINK EXECUTABLE “/usr/libexec/droid-hybris/system/bin/minimediaservice”: library “libnativehelper.so” not found: needed by /system/lib/libmediandk.so in namespace (default)
Ok, # ln -s /apex/com.android.art/lib/libnativehelper.so /odm/lib/libnativehelper.so
Reboot.
This time I don’t find CANNOT LINK messages in logcat. Let’s see about those services.
# vi /usr/libexec/droid-hybris/system/etc/init/disabled_services.rc
I add them as
service package_native /system/vendor/bin/DISABLED
service statscompanion /system/vendor/bin/DISABLED
and remove the vendor.ipacm
disablement line from previous day when I thought that was making me reboot.
And reboot again.
(Btw, each reboot needs cable re-connect to continue telnet. Some service is re-setting something)
02-25 23:16:36.211 985 985 I SurfaceFlinger: Using HWComposer service: ‘default’
02-25 23:16:38.466 985 985 I HWComposer: Switching to generalized multi-display mode
02-25 23:16:38.466 985 985 W DisplayIdentification: Invalid EDID: falling back to serial number due to missing display name.
02-25 23:16:38.466 985 985 W DisplayIdentification: Invalid EDID: falling back to ASCII text due to missing serial number.
02-25 23:16:38.466 985 985 E HWComposer: isConnected failed for display 19261202339590786: Invalid display
Hmm…
I would like to have wlan to test minimer.
But then again…
# echo 1 > /sys/devices/platform/soc/b0000000.qcom,cnss-qca6490/fs_ready
# modprobe qca_cld3_wlan
modprobe: FATAL: Module qca_cld3_wlan not found in directory /lib/modules/5.4.61-qgki-perf-gc8a3515be514
# uname -r
5.4.61-qgki-perf-gc8a3515be514
This means that my latest kernel changes changed the magic version too. I need to re-build the mic image… and I was hoping that I will first make screen and wlan work then scp into to transfer the changes.
Maybe I can just copy the /lib/modules though, by booting lineage recovery…
But how to boot it? fastboot boot will not go into recovery…
Maybe it’s safer to flash it.
Hmm Lineage recovery says that my /data needs wiping/reset. I get away by “using” the back button and do enable “Adb shell”
However I cannot mount /data as before. So I may have broken it somehow:(
I try to boot a previous “AppArmor” kernel.
Nope.
So no, I again have borked my /data probably by booting Lineage.
So. To end in a high note. Tomorrow I will have to do all the changes I did in the previous days (/dev/ipa, links to /odm, selinux) properly, offline, in a way they will get picked up by the next --mic build.
Good think I made a note of them all
Also, I need to fix this “accidentally rebooting without holding vol-up starts lineage that wipes /data” somehow. Either by formatting and mounting data some other way, or by including the recover ramdisk in the hybris-boot image (or vendor boot?)