FORUMS
Remove All Ads from XDA

[TWRP][E5823] TWRP for Z5 Compact [10.11.15]

300 posts
Thanks Meter: 186
 
By nilezon, Senior Member on 28th October 2015, 12:19 PM
Post Reply Email Thread
TWRP for Z5 Compact E5823

Credits first
Most of the ideas and some of the code are kang'd from @dl12345 and his TWRP v2.8.7.0 for Sony Z3+
The first release of this recovery was based on Zombie b1 by @Tommy-Geenexus

Known problems
  • Colors are a bit distorted - but I think it looks good (fixed)
  • Not working with encrypted phone (unconfirmed)

How to build
Not for beginners

Please contribute to my repositories by creating pull requests if you manage to fix any bugs

First, sync omnirom sources:
Code:
repo init -u git://github.com/omnirom/android.git -b android-5.1
repo sync
Waaaaaiiiiiit.

Create a local manifest:
Code:
mkdir .repo/local_manifests/
nano .repo/local_manifests/twrp.xml
Manifest contents:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="sony" fetch="git://github.com/sonyxperiadev/" />
<remote name="jackfagner" fetch="git://github.com/jackfagner/" />
<project path="device/sony/kitakami" name="twrp-device-sony-kitakami" groups="device" remote="jackfagner" revision="TWRP" />
<project path="device/sony/suzuran" name="twrp-device-sony-suzuran" groups="device" remote="jackfagner" revision="TWRP" />
<project path="kernel/sony/kitakami" name="twrp-kernel-sony-kitkami" groups="device" remote="jackfagner" revision="TWRP" />
<project path="vendor/sony/system/dtbtool" name="twrp_vendor_sony_system_dtbtool" groups="device" remote="jackfagner" revision="TRWP-28.0.A.8.251" />
<project path="vendor/sony/system/mkivybootimg" name="twrp_vendor_sony_system_mkivybootimg" groups="device" remote="jackfagner" revision="TRWP-28.0.A.8.251" />
<project path="vendor/sony/system/thermanager" name="thermanager" groups="device" remote="sony" revision="master" />
<project path="vendor/sony/system/macaddrsetup" name="macaddrsetup" groups="device" remote="sony" revision="master" />
<project path="vendor/sony/system/timekeep" name="timekeep" groups="device" remote="sony" revision="master" />
</manifest>
Sync again.
Code:
repo sync
Download Sony binaries and unzip inside repo dir:
Code:
unzip SW_binaries_for_Xperia_AOSP_L_MR1_v12.zip
Setup your environment variables (ARCH and CROSS_COMPILE), then build as usual:
Code:
source build/envsetup.sh && lunch
make -j 4 recoveryimage

Binary download

Current (kernel and recovery):
TWRP for Z5C, based on kernel 32.0.A.6.152 (v2) (10.11.15)
GDrive mirror for all you MEGA haters

Old versions:
TWRP for Z5C, based on kernel 32.0.A.6.152 (v1) (07.11.15)
TWRP for Z5C, based on kernel 32.0.A.5.32 (29.10.15)
TWRP for Z5C, first release (28.10.15) - recovery only


Instructions

Boot using:
Code:
fastboot boot recovery.img
Or, better yet, flash to your phone (will replace your kernel):
Code:
fastboot flash recovery recovery.img
fastboot flash boot boot.img
When you see an amber LED, press volume buttons a few times to boot to TWRP.


Instructions to kernel developers (I'm looking at you @Tommy-Geenexus)

Like most Sony phones, the Z5/Z5C cannot boot from the recovery (FOTAKernel) partition.
This is "solved" by letting the kernel boot image chain load the recovery ramdisk.
I was looking around for a nice script to do this, but - no offence - they were all pretty bad.

So I wrote a less bad one:
https://github.com/jackfagner/twrp-s...ry-boot-script
The Following 28 Users Say Thank You to nilezon For This Useful Post: [ View ] Gift nilezon Ad-Free
28th October 2015, 12:21 PM |#2  
SdtBarbarossa's Avatar
Senior Member
Thanks Meter: 2,191
 
More
Quote:
Originally Posted by nilezon

Dear XDA, I present to you:
fully (...or possibly not) working TWRP for Z5 Compact E5823.

More info soon. Until then:

Download:
TWRP for Z5C

Boot using:

Code:
fastboot boot recovery.img

Im also trying to get that work ... How did you solved the sensor.te error?

Sent from my mint using XDA Free mobile app
The Following 2 Users Say Thank You to SdtBarbarossa For This Useful Post: [ View ] Gift SdtBarbarossa Ad-Free
28th October 2015, 12:31 PM |#3  
Tommy-Geenexus's Avatar
Senior Member
Flag I live on a Stone Hill.
Thanks Meter: 2,582
 
Donate to Me
More
Nice work, boots fine, most things seem fine.
However colors are inverted, i suppose it needs some pixel format tuning there.

Else, great work!

Edit: @nilezon
Add
Code:
TW_BRIGHTNESS_PATH := /sys/class/leds/wled/brightness
TW_MAX_BRIGHTNESS := 3511
to fix brightness slider.
28th October 2015, 01:53 PM |#4  
OP Senior Member
Thanks Meter: 186
 
More
Quote:
Originally Posted by Tommy-Geenexus

Add

Code:
TW_BRIGHTNESS_PATH := /sys/class/leds/wled/brightness
TW_MAX_BRIGHTNESS := 3511
to fix brightness slider.

Thank you! Will do.
I just want to get a nicer build environment up. This first build required a lot of hacking.
I'm hoping to publish a manifest file for easy building, including regular Z5.
The Following User Says Thank You to nilezon For This Useful Post: [ View ] Gift nilezon Ad-Free
28th October 2015, 02:07 PM |#5  
SdtBarbarossa's Avatar
Senior Member
Thanks Meter: 2,191
 
More
Quote:
Originally Posted by nilezon

Thank you! Will do.
I just want to get a nicer build environment up. This first build required a lot of hacking.
I'm hoping to publish a manifest file for easy building, including regular Z5.

That would be good would like to see the source ^^

And while you are testing around with pixelformat may have a look here:

https://gerrit.omnirom.org/#/c/14475/

I know this is not a mtk device but maybe thats the pixelformat?

Sent from my mint using XDA Free mobile app
The Following 2 Users Say Thank You to SdtBarbarossa For This Useful Post: [ View ] Gift SdtBarbarossa Ad-Free
28th October 2015, 03:37 PM |#6  
Senior Member
Flag Bhilwara
Thanks Meter: 381
 
More
@nilezon a mirror for your file here: link
mega sin't available in every country, so..
The Following User Says Thank You to itskapil For This Useful Post: [ View ] Gift itskapil Ad-Free
28th October 2015, 04:03 PM |#7  
Member
Thanks Meter: 11
 
More
I've got to jump in with this. Thanks for your effort! This beauty works like a charm. I just made the first back up with this twrp and the outcome looks great. Overall size of back up file suprized me but otherwise it's all good and I kinda like this color layout more than the usual blue. Great job!
29th October 2015, 06:48 AM |#8  
Member
Thanks Meter: 11
 
More
Ok, maybe I jumped thru the roof little too early. Is this meant to be launched with fastboot or is this integrated recovery after flashing it?? I couldn't get straight to twrp recovery without fastboot.
Anyway this is a great opening and one step closer to real thing 😊
Thanks alot!
29th October 2015, 09:34 AM |#9  
OP Senior Member
Thanks Meter: 186
 
More
Quote:
Originally Posted by Mmmiku

Ok, maybe I jumped thru the roof little too early. Is this meant to be launched with fastboot or is this integrated recovery after flashing it?? I couldn't get straight to twrp recovery without fastboot.
Anyway this is a great opening and one step closer to real thing
Thanks alot!

I'm working on a kernel that can boot to recovery using key-combo.
The Following User Says Thank You to nilezon For This Useful Post: [ View ] Gift nilezon Ad-Free
29th October 2015, 09:46 AM |#10  
Senior Member
Thanks Meter: 817
 
More
Quote:
Originally Posted by nilezon

I'm working on a kernel that can boot to recovery using key-combo.

This is tricky as you must use the sony copyleft sources...look at my github. You can deconstruct my Z3+ recovery image for the ramdisk for a dual recovery-boot solution. I'm guessing that you could probably apply my Z3+ config almost unchanged for the Z5. I used CM 12.1 to build for the Z3+....
The Following 2 Users Say Thank You to dl12345 For This Useful Post: [ View ] Gift dl12345 Ad-Free
29th October 2015, 10:37 AM |#11  
OP Senior Member
Thanks Meter: 186
 
More
Quote:
Originally Posted by dl12345

This is tricky as you must use the sony copyleft sources...look at my github. You can deconstruct my Z3+ recovery image for the ramdisk for a dual recovery-boot solution. I'm guessing that you could probably apply my Z3+ config almost unchanged for the Z5. I used CM 12.1 to build for the Z3+....

I've done this. Unpacked your Z3+ boot img and repacked it with my TWRP ramdisk and kernel cpio, and of course my copyleft kernel.
However, something seem wrong with the boot script, since it is always booting to the ramdisk-recovery.cpio.

I'm not fully satisfied with the ramdisk.cpio/ramdisk-recovery.cpio solution. I'm going to try writing an init.sh script that allows booting from FOTA without using any cpio's at all: regular ramdisk already in /, and recovery ramdisk is fetched from FOTA and overwriting / if recovery is requested.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes