SODP General Treble ROM Build Guidance
I'm so sorry, I don‘t have enough time to build a treble ROM every week, I decide to write this guide.
Support devices:
Xperia X, Xperia X Performance, Xperia X Compact
Xperia XZ, Xperia XZs. Xpeira XZ Premium
Xperia XZ, Xperia XZs. Xpeira XZ Premium
Principle
SODP team has done everything to Go treble on AOSP Pie. So if you want to go treble, you need only to do a little work.The key is to enable VNDK and provide a Vendor partition. As is known to us, there are many partitions exist in our devices. But not all of them are necessary for AOSP. 300KB disk space is enough for our AOSP cache partiton, but sony give us more than 300MB. It's a waste of disk space. Besides, all of these devices I mentioned support Qnovo charging technology, there is a partition in our phone named Qnovo for this stock function. It about 10~30MB. But we don't need it on AOSP. So we can use these two partition to Go Treble.
How to go treble
We need to use cache partition as vendor partition and Qnovo partition as cache partition.
I'll take Maple as an example. How to modify devices tree to support treble.
I'll take Maple as an example. How to modify devices tree to support treble.
Enable VNDK
Maple's Devices tree: Link
We need to add vndk modules config in device.mk. See picture.Add new partition table config
Yoshino's Devices tree: Link
First Step:For maple, we need to add partition table config in BoardConfig.mk..
Notice: Because Yoshino platform has 3 devices. XZ1 and XZ1C has a vendor partition. The partition table config is in devices's BoardConfig.mk. For tone and loire platform, all of their devices has the same partition table. Their partition table config is in platform devices tree's PlatformConfig.mk.
The cache and vendor partitions' size shoud depend on phone's actual size. You can use my config. I had set it smaller than actual size.
See picture:
Second Step:
For maple, we need to modified fstab in Yoshino platform device tree, the path is: rootdir/vendor/etc/fstab_legacy.yoshino.
See picture:
Third Step:
We need to modified selinux policy in Yoshino platform device tree, the path is: sepolicy_platform/file_contexts.
See picture:
Fifth Step:
To avoid SELinux policy errors and fail to boot, we'd better to set selinux=permissive in BoardConfig.mk or PlatformConfig.mk.
Modify kernel fstab config
For maple the path is arch/arm64/boot/dts/qcom/msm8998-yoshino-maple_common.dtsiNotice: For tone and loire platform, you need to find the platform common config in the same floder, like msm8996-tone-common.dtsi, msm8952-loire-common.dtsi
You need to set right vendor path and status, just like configs of system and oem partition
After doing this, you can build a treble ROM
By Sjll
2019.2.15
Last edited: