• 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 XZ [F8331/2] [Pie 9.0] [no repartitioning]

local__hero

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

Hey everyone,
before the year ends, I have something quite neat for you. With this project, you can run (almost) any Generic System Image(GSI) on your Xperia XZ. 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"
  • Fix /dsp labels: See DSP file relabeling for SODP
  • 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: Xperia XZ Pie ROMs Questions and Answers Thread

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.

I'll put up the sources shortly. They're based on the regular AOSP builds but need a few tweaks for compatibility.
Update: 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
 
Last edited:

local__hero

Senior Member
Oct 13, 2018
116
262
0
Reserved

Reporting bugs

Important: Read the bug list before posting. Anyone can add bugs to the list, just follow the rules.

DO NOT REPORT ISSUES WITH GSIs! Ask the GSI maintainer to fix them!

I will repeat the rules again here:

Rules:
  • New bugs must include version where error popped up and which oem version you are using
  • Only reproducible errors
  • Should include adb logcat (linked in a pastebin service like https://del.dog)
  • Must include clear description what is wrong
  • If it is a visual/SystemUI bug, only report it here
  • If it is an internal bug(e.g. fingerprint crashes device), report it to the Sony bugtracker as well!
  • Always try to fix the bug yourself first! Then submit a pull request to Sony
  • Must search if error has already been reported (bug tracker, this document, dev buglist)
  • If you've reported the issue somewhere else already and just want to track it here as well, add a link
  • Before reporting a bug, always make sure to isolate it. That means, wipe everything, install only the ROM without GApps and Magisk and see if the problem still exists. Only then report the bug!
 
Last edited:

DarkPrinciple

Member
Jul 3, 2014
33
7
0
I want to say for the community out there curious as to what Project Treble is:

TL;DR
More ROMS for Xperia XZ ( as development just isn't what it used to be )


Long story:

PT is a new way for alternative ROM developers to make ROMS for a wider range of phones that support PT

PT acts like a middle man for the ROM and the Xperia allowing ( where developed) other phones to have the same ROM on it .

I'd seriously recommend giving this a try, instructions aren't hard if YOU READ THEM CORRECTLY

And it also gives Xperia users a bigger range of ROMS to experiment with, that's weren't specifically built for the XZ

It is to be noted, it's not perfect. And is in development and some featured aren't stable
 

Slawek1995

Member
Feb 2, 2018
33
11
0
WWA
how can I move ld.config.28 into system/etc if my phone standing on SONY logo and wont boot up? I installed Havoc OS and dont't know how to move this file.
 

piotr7543

Senior Member
Oct 27, 2016
93
10
0
Augustów
Za pomocą TWRP w menedżerze plików (zakładka zaawansowane) zamontuj partycję system i skopiuj plik z karty SD do /system/etc :)

Mod Edit by @gregbradley English translation added
Using TWRP in the File Manager (Advanced tab) mount the system partition and copy the file from SD card to/system/etc

Rule 4
4. Use the English language.

We understand that with all the different nationalities, not everyone speaks English well, but please try. If you're really unable to post in English, use an online translator. You're free to include your original message in your own language, below the English translation. (This rule covers your posts, profile entries and signature). You could try :- https://translate.google.com/ or https://www.babelfish.com/ or use one of your choice.
 
Last edited by a moderator:
  • Like
Reactions: DarkPrinciple

Slawek1995

Member
Feb 2, 2018
33
11
0
WWA
Za pomocą TWRP w menedżerze plików (zakładka zaawansowane) zamontuj partycję system i skopiuj plik z karty SD do /system/etc :)
Dzięki właśnie to odkrylem. Wszystko niby spoko ale nie mogłem zainstalować magiska i zdjęcia wychodza bardzo ciemne, flash też działa źle, świeci jak łapie ostrość ale przy robieniu zdjęcia się wyłącza, może naprawią to kiedyś :)

Everything work fine but i cant install magisk and Photos are very dark. Flash working bad too...

ModEdit by @gregbradley, English translation added
This is why I discovered it. All kind of cool but I could not install Magiska and pictures go out very dark, the flash works too bad, it shines as it grabs sharpness but when you take the picture off, maybe repair it sometime

Rule 4
4. Use the English language.

We understand that with all the different nationalities, not everyone speaks English well, but please try. If you're really unable to post in English, use an online translator. You're free to include your original message in your own language, below the English translation. (This rule covers your posts, profile entries and signature). You could try :- https://translate.google.com/ or https://www.babelfish.com/ or use one of your choice.
 
Last edited by a moderator: