• If you are experiencing issues logging in, we moved to a new and more secure software and older account passwords were not able to be migrated. We recommend trying to reset your password, then contacting us if there are issues.
  • Nearly done! Migration cleanup is mostly done. There are a small number of issues left that we continue to work on, but all the heavy lifting is done. We still would love to hear feedback over at this thread and also check out the new XDA app! Thanks and we hope you enjoy the new forums, and thanks for your support of XDA <3

Project Treble for Xperia XZs [G8321/2] [Pie 9.0] [no repartitioning]

Status
Not open for further replies.

local__hero

Senior Member
Oct 13, 2018
116
262
0
Project Treble for Xperia XZs

With this project, you can run (almost) any Generic System Image(GSI) on your Xperia XZs. This means you can test LineageOS, Havoc, Pixel Experience...

No repartitioning necessary! This method is re-using the oem partition.

What is Project Treble?
Understanding Project Treble and Android updates
Talkin’ Treble: How Android engineers are winning the war on fragmentation
What are GSIs?
Android Source: Generic System Image (GSI)

Downloads:

How to install:
  • Back up your stuff
  • Wipe data and caches
  • Install the zip via TWRP (or unzip and install just the /boot and /vendor images via fastboot)
  • Install any GSI via "fastboot flash system your-gsi-image.img"
  • To use Magisk: Flash twrp-kagura-oem-to-vendor.img as recovery. Reboot into recovery and install Magisk like you usually would. If you want to go back to another ROM, you need to re-flash your old TWRP recovery as well.

Bugs: See post #2

DO NOT POST HERE FOR FLASHING HELP OR YOU WILL BE REPORTED. Read everything before posting.​

If you have questions, ask them in this thread: AOSP 9.0 Pie builds for F8331/F8332

List of GSIs: phhusson's treble Generic System Image
Important: You need an A-Only, ARM64 GSI!
GSIs based on phhusson's work offer the best compatibility.

Magisk: For Magisk to work, you need to tweak your TWRP installation, since it doesn't know that we have shuffled /vendor to the oem partition. You need to change /oem to /vendor in TWRP's fstab file.
See above for a tweaked TWRP.


If you want to go back to any other AOSP-based ROM that is not a GSI, simply re-flash the regular oem image and install like you usually would.

For developers:
This method is repurposing the oem partition to hold /vendor and odm(blobs). There's 400mb of space on that partition and we are only using ~260mb for blobs, while vendor is only about 20-30mb.
Re-partitioning can be quite dangerous if you do not know what you are doing. This method should be safe for everyone.

Sources are up now.

You need to tweak the following:
  • Kernel dtsi to disable "odm" and load /vendor from "bootdevice/by-name/oem"
  • PlatformConfig on tone
  • device-sony-common:
    adreno-symlinks branch
    symlink from /vendor/odm/lib to /vendor/lib instead of from /odm/lib: Extra symlinks for build.prop and radio (aosp already symlinks /odm to /vendor/odm, but it omits build.prop and our radio folder)
    Misc fixes
    PRODUCT_FULL_TREBLE_OVERRIDE needs to be "true"
  • device-sony-tone: treble fixes:
    Mount oem as /vendor in fstab
    "TARGET_COPY_OUT_VENDOR := vendor" needs to be set
    Set VNDK versions, and override properties that get set because the build system is made to believe our XZ shipped with Oreo
  • device/sony/odm with odm files
    Unpack the oem blobs under device/sony/odm/odm and follow the README in device/sony/odm/README.
  • We need to put the odm files("blobs") somewhere. They get symlinked from /vendor/odm to /odm; both locations need to be accessible.
  • sepolicy: Use the broad-updates branch (it's kinda hack-ish now because /odm/pm-service is using /dev/binder, which messes with sepolicy). Sepolicy is on permissive for these builds because of that issue.

Tested:
  • AOSP Extended (calling works, bluetooth may crash)
  • Havoc (no calling, bluetooth may crash)
  • Camera should work everywhere

Bugs are the same as the regular AOSP builds, plus some more if the GSI is not built well or doesn't have tweaks for Sony devices.

Happy holidays, I hope you have fun with this!

XDA:DevDB Information
Project Treble for Xperia XZ F8331/2, ROM for the Sony Xperia XZ

Contributors
local__hero
ROM OS Version: 9.x Pie
ROM Kernel: Linux 4.x
ROM Firmware Required: .184 or later stock firmware
Based On: AOSP

Version Information
Status: Nightly

Created 2018-12-30
Last Updated 2018-12-30

XDA:DevDB Information
Project Treble for Xperia XZs [Pie 9.0], ROM for the Sony Xperia XZs

Contributors
local__hero
Source Code: https://git.ix5.org/felix/local-manifests-ix5

ROM OS Version: 9.x Pie
ROM Kernel: Linux 4.x
ROM Firmware Required: Stock Oreo firmware, best .184
Based On: AOSP

Version Information
Status: Nightly

Created 2019-01-28
Last Updated 2019-06-10
 
Last edited:
Status
Not open for further replies.