Hello! I've been trying to port ubports/halium to my device for almost a month. It's a custom device based on https://www.quectel.com/product/lte-sc200l-smart-module-series. I have build environment from the manufacturer along with the sources and I can build android 10.(single aosp+vendor modifications git repository).
Now I want to use halium with custom rootfs.
Thanks to everyone who helped me from the ubports and droidian porting chats, but discussions are dissolving in the stream there, so I decided to start this topic.
My device supports treble/gsi. I have a /vendor partition etc. I found out that in this case, I can just build boot.img with a patched kernel config and write rootfs.img to the data partition and get a working system! This is what I'm goal for now, for the first step, then I want to fully the system partition as well.
What I did:
- I found a device from the same manufacturer https://gitlab.com/ubports/porting/community-ports/android10/jingpad-a1/jingpad-a1 and based on this repository, I made my own https://gitlab.com/amednyy/sharke_ubports
- I also had to change the build scripts: https://gitlab.com/amednyy/halium-generic-adaptation-build-tools, because I have a 32-bit platform, and for some reason the original scripts often explicitly refer to 64-bit images, tools etc.
- I updated the kernel config and my first success was that I got into the initramfs shell via telnet!
- After that, I tried to put rootfs.img to the data section, and even it loaded! I was able to get into the ubports shell via ssh!
- Next, I see that the screen is empty, the original partitions, with the exception of / data, are not mounted, the android container of course has not started, journalctl does not write anything and in general the system is in a barely alive state(systemctl status gives me strange message that services list is not supported) etc...
- I thought the problem was in mounting partitions, I looked at the partitions in the original image and saw /dev/mapper... in the chat, I was prompted that there is an initramfs variant with dynparts - this is really my case, I received several new partition files in /dev/disk/by-label, but this did not help rootfs itself, it still does not mount anything and the android container does not start.
- Then I tried to fix the script /usr/sbin/mount-android.sh and manually mount the vendor partition in /android/system/vendor right before the line "if ! mountpoint -q -- /vendor; then", but nothing changed after the reboot. The partition is mounted, but this does not help halium to start in any way.
And that's where I'm stuck. I do not know where to go next, please help me understand what is wrong with my system.
My questions: - I noticed that there are big problems with the armhf architecture in the scripts, even though I have a 64bit processor, I can't switch to 64bit because I only have 32bit libraries/blobs.
- The program "Treble info", running on the original android, tells me that I have a 32-bit OS and a 64-bit binder, please explain how the bitness of the binder affects, can It be thereason of my troubles?
- how do I debug ubports init scripts? I see that initramf writes its logs to dmesg, but since the start of rootfs, I don't see anything from the init scripts of ubuntu itself.
4.below is original android mount output, as you see there are two vendor partitions one mounted to /vendor, second to /mnt/vendor, also two more strange partitions: socko and odmko, socko has some *.ko modules and odmko is empty. What are those partitions? What is my next step?
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=972132k,nr_inodes=131123,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600,ptmxmode=000)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /mnt type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=972132k,nr_inodes=131123,mode=755,gid=1000)
tmpfs on /apex type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=972132k,nr_inodes=131123,mode=755)
/dev/block/dm-3 on / type ext4 (ro,seclabel,nodev,relatime)
/dev/block/dm-4 on /vendor type ext4 (ro,seclabel,relatime)
/dev/block/dm-5 on /product type ext4 (ro,seclabel,relatime)
none on /dev/cg2_bpf type cgroup2 (rw,nosuid,nodev,noexec,relatime)
none on /dev/cpuctl type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
none on /acct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
none on /dev/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent)
none on /dev/memcg type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
/dev/block/dm-3 on /apex/com.android.tzdata@290000000 type ext4 (ro,seclabel,relatime)
/dev/block/dm-3 on /apex/com.android.tzdata type ext4 (ro,seclabel,relatime)
/dev/block/dm-3 on /apex/com.android.runtime@1 type ext4 (ro,seclabel,relatime)
/dev/block/dm-3 on /apex/com.android.runtime type ext4 (ro,seclabel,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)
none on /config type configfs (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,seclabel,nosuid,nodev,noexec,relatime)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,seclabel,relatime)
/dev/block/mmcblk0p39 on /data type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=50370,resuid=0,resgid=0,alloc_mode=reuse,fsync_mode=nobarrier)
/dev/block/mmcblk0p36 on /metadata type ext4 (rw,seclabel,nosuid,nodev,noatime,errors=panic,data=ordered)
/dev/block/mmcblk0p1 on /mnt/vendor type ext4 (rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,data=ordered)
/dev/block/mmcblk0p30 on /cache type ext4 (rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,data=ordered)
/dev/block/dm-6 on /mnt/vendor/socko type ext4 (ro,seclabel,nosuid,nodev,noatime,noauto_da_alloc)
/dev/block/dm-7 on /mnt/vendor/odmko type ext4 (ro,seclabel,nosuid,nodev,noatime,noauto_da_alloc)
tmpfs on /storage type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,size=972132k,nr_inodes=131123,mode=755,gid=1000)
/dev/block/dm-3 on /apex/com.android.media.swcodec@290000000 type ext4 (ro,seclabel,nodev,relatime)
/dev/block/dm-3 on /apex/com.android.media.swcodec type ext4 (ro,seclabel,nodev,relatime)
/dev/block/dm-3 on /apex/com.android.resolv@290000000 type ext4 (ro,seclabel,nodev,relatime)
/dev/block/dm-3 on /apex/com.android.resolv type ext4 (ro,seclabel,nodev,relatime)
/dev/block/dm-3 on /apex/com.android.conscrypt@290000000 type ext4 (ro,seclabel,nodev,relatime)
/dev/block/dm-3 on /apex/com.android.conscrypt type ext4 (ro,seclabel,nodev,relatime)
/dev/block/dm-3 on /apex/com.android.media@290000000 type ext4 (ro,seclabel,nodev,relatime)
/dev/block/dm-3 on /apex/com.android.media type ext4 (ro,seclabel,nodev,relatime)
cgroup_root on /sys/fs/cgroup type tmpfs (rw,seclabel,relatime,size=972132k,nr_inodes=131123)
/data/media on /mnt/runtime/default/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,unshared_obb)
/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal,unshared_obb)
/data/media on /mnt/runtime/read/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid,default_normal,unshared_obb)
/data/media on /mnt/runtime/write/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal,unshared_obb)
/data/media on /mnt/runtime/full/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal,unshared_obb)