FORUMS

General Treble Build Guidance Based SODP

288 posts
Thanks Meter: 336
 
By Sjll, Senior Member on 16th February 2019, 02:55 AM
Post Reply Email Thread
General Treble Build Guidance Based SODP

Support devices:

Xperia X, Xperia X Performance, Xperia X Compact
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.

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 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.dtsi
Notice: 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.16
The Following 8 Users Say Thank You to Sjll For This Useful Post: [ View ] Gift Sjll Ad-Free
7th February 2020, 05:19 AM |#2  
mirhl's Avatar
Senior Member
Thanks Meter: 1,134
 
More
Quote:
Originally Posted by Sjll

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.

Quote:
Originally Posted by Sjll

We need to use cache partition as vendor partition and Qnovo partition as cache partition.

Two wrongs things here.
First, it's not true that Qnovo cannot work with AOSP.
Secondly, you aren't really forced to nuke a partition. You can just do like ix5, with oem repurposed to hold both odm and vendor.
The Following User Says Thank You to mirhl For This Useful Post: [ View ] Gift mirhl Ad-Free
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes