[Recovery][FOTA]CWM and TWRP recoveries for custom ROMs - Sony Xperia M

Now we have official TWRP support, so this thread will not be updated anymore. For more info about official TWRP visit this thread.
Tired waiting for someone to repack kernel with your favorite version of recovery? Or tired to run recovery script every time you update your ROM or kernel? Now you don't need any repacked kernels or recovery-scripts. Use your FOTAKernel as recovery partition!
It works on any kernel with extract_elf_ramdisk utility (it's built in mostly all kernels for custom ROMs, but I am not sure) by @Dees_Troy. And don't forget, that you are doing on your own risk, I am not responsible for bricked devices, acid rains or thermonuclear war.
Installation:
Download zip and flash it via your current recovery. If your current recovery is unusable, you can flash it via terminal emulator:
- Extract FOTAKernel.img and place it to the root of your external SD-card
- Type su and grant root access
- Type
Code:
dd if=/ext_card/FOTAKernel.img of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel
- Reboot to recovery to test if it works (if not, try again and check if you are doing it correctly).
Download:
TWRP 2.8.7.0
TWRP 2.8.6.0 (this and next versions are compiled for Xperia M by me)
Older versions and CWM:
TWRP 2.8.5.0 (port from Xperia L)
TWRP 2.8.4.0 (thanks to @Rohan purohit for bringimg it for Xperia L, I just ported and modded it)
TWRP 2.8.0.0/CWM (or scroll down, it's right below this post)
You can restore original FOTAKernel image by following instructions in this post (or just scroll down, it is 3rd post, lol).
Some info:
Sony Xperia devices don't have recovery partition. Instead of this in custom kernels is used recovery-in-boot conception with two-stage boot (ramdisk-recovery is packed inside main ramdisk). And there is partition called FOTAKernel that is used for installing official FOTA (firmware-over-the-air) updates. After unlocking your bootloader this partition becomes redundant, because you cannot use OTA function anymore. So it may be used for storing recovery ramdisk. And this very useful future was implemented by recognized developer @Dees_Troy (lead TWRP developer), he developed utility extract_elf_ramdisk (it is merged to almost all kernels for Sony devices), it extracts recovery ramdisk from FOTA partition instead of using regular one from boot image. So even after updating or changing your kernel or ROM you don't lose your current recovery! Here is some info from Dees_Troy.

Download
TWRP 2.8.6.0>>>
TWRP 2.8.5.0>>>
TWRP 2.8.4.0>>>

Restoring original image
- You can restore original FOTAKernel flashing it via Flashtool by flashing any firmware (just uncheck everything in "wipe" section and uncheck everything in "exclude" section excluding "FOTA" like in attached screenshot).
- Or install attached zip via recovery or flash FOTAKernel.img from archive as it is written in OP.

cucumber09 said:
TWRP version is 2.8.0.0, because I could not boot 2.8.3.0 this way (maybe due to ramdisk size limitations), I'll look for this later and will try to fix it
Click to expand...
Click to collapse
Excuse me sir,
is this recovery work with cm11 which I have now??
Can I flash it now,
so when I decided to flashing cm12 being ready[emoji4]
I hope I explained my idea

kh34d said:
Excuse me sir,
is this recovery work with cm11 which I have now??
Can I flash it now,
so when I decided to flashing cm12 being ready[emoji4]
I hope I explained my idea
Click to expand...
Click to collapse
I don't know for sure. Download both recoveries, try to flash one that differs from yours and reboot recovery. If it changes, that means it works on CM11 kernel. BTW, even if it doesn't work on CM11, it will work when you will flash CM12 kernel. So you can flash it to be prepared.

Some one please uploade original fota kernel, i'm forgot to backup them .. thanks

itsnie said:
Some one please uploade original fota kernel, i'm forgot to backup them .. thanks
Click to expand...
Click to collapse
Okay, I will upload original FOTAKernel.

itsnie said:
Some one please uploade original fota kernel, i'm forgot to backup them .. thanks
Click to expand...
Click to collapse
Everything about restoring is in 3rd post.

cucumber09 said:
Everything about restoring is in 3rd post.
Click to expand...
Click to collapse
Thangs, now all problem will be fixed ..

@cucumber09 Will it work for stock 4.3, i know you mentioned for custom rom but just curious about it, what do u think?

KHM90 said:
@cucumber09 Will it work for stock 4.3, i know you mentioned for custom rom but just curious about it, what do u think?
Click to expand...
Click to collapse
No, it needs custom kernel, that includes extract_elf_ramdisk, stock kernel doesn't. BTW, there are CWM-included kernels for all stock ROMs. And TWRP is not available for stock. I can try repacking stock kernel with TWRP, but I doubt it will work.

cucumber09 said:
No, it needs custom kernel, that includes extract_elf_ramdisk, stock kernel doesn't. BTW, there are CWM-included kernels for all stock ROMs. And TWRP is not available for stock. I can try repacking stock kernel with TWRP, but I doubt it will work.
Click to expand...
Click to collapse
Ok thx, Not needed just wanna know whether it will work or not
btw, FOTA kernel awesome idea:good:

I try to repack my custom kernel with justarchi twrp version. I can Confirm it doesn't boot to fota recovery. Main boot.img is cm12 first nightly. It always boot to CyanogenMod recovery. Still search for solution...

ndrancs said:
I try to repack my custom kernel with justarchi twrp version. I can Confirm it doesn't boot to fota recovery. Main boot.img is cm12 first nightly. It always boot to CyanogenMod recovery. Still search for solution...
Click to expand...
Click to collapse
I read sources of extract_elf_ramdisk utility. And found there something about uncompressed ramdisk size, there is limitation to 8 Mb by default. So, I think, we should reduce ramdisk size by removing unnecessary or redundant files and binaries (must be done very carefully) or to commit change in our kernel.

I'm confused, does it work for locked bootloader?

pincheraro said:
I'm confused, does it work for locked bootloader?
Click to expand...
Click to collapse
No way. It even won't work on stock kernel with unlocked BL.

@cucumber09 Which build is the attached FOTA restore zip from? .9?

elmkzgirxp said:
@cucumber09 Which build is the attached FOTA restore zip from? .9?
Click to expand...
Click to collapse
No, it is from earlier build, but also from 4.3. From first 4.3 build, as I remember.

cucumber09 said:
I read sources of extract_elf_ramdisk utility. And found there something about uncompressed ramdisk size, there is limitation to 8 Mb by default. So, I think, we should reduce ramdisk size by removing unnecessary or redundant files and binaries (must be done very carefully) or to commit change in our kernel.
Click to expand...
Click to collapse
You mean this source code: Dees-Troy
I inspect the twrp, but no found the file that save to be removed. Btw, what commit needed to apply to kernel?

ndrancs said:
You mean this source code: Dees-Troy
I inspect the twrp, but no found the file that save to be removed. Btw, what commit needed to apply to kernel?
Click to expand...
Click to collapse
I read these sources. And 49th line defines size of uncompressed ramdisk. But now I am not sure, which one is used in our kernel. I suppose, that newer one.

Related

[Kernel][Recovery][CM12]TWRP and CWM recoveries for Lollipop (CM12) [discontinued]

CM12 now comes with CyanogenMod recovery, which is unusable for now. So here are repacked kernels with TWRP and CWM.
For now, use Recovery-in-FOTA images! This thread probably will not be updated anymore. Also you can use this script.
Download TWRP (for PecanCM's Beta 3, not flashable)
Older versions (CWM included):
for FXP-2015-0115:
1. TWRP
2. CWM
For FXP-2015-0110 build:
1. TWRP (with fixed app2sd)
2. CWM
For PecanCM's 01.03 build:
1. CWM
2. TWRP
3. TWRP 2.8.3.0 (new)
For PecanCM's Beta 2:
1. CWM
2. TWRP
Thanks to:
@osm0sis for Android Image kitchen for Windows (and to @FindYanot and @Bonoboo for discovering it for me).
@JustArchi for compiling TWRP 2.8.3.0 for our device in ArchiDroid 3.0.1.1
Installation:
1. Extract archive to the root of external sdcard and run in terminal emulator su then /ext_card/flash_kernel.sh
or in adb adb shell /ext_card/flash_kernel.sh
2. Flash boot.img drom archive via fastboot (fastboot flash boot boot.img) or fastbootmode in Flashtool
These are obsolete, but will work though
3. Via adb:
- Place boot.img to the root of internal sd (adb push *path*\boot.img /sdcard/ (replace *path* with path to file on your PC))
- adb shell dd if=/sdcard/boot.img of=/dev/block/platform/msm_sdcc.1/by-name/boot
4. Via Terminal emulator (you can download it on Play Store):
- Place boot.img to the root of internal sd
- Enter su and allow superuser access
- Type dd if=/sdcard/boot.img of=/dev/block/platform/msm_sdcc.1/by-name/boot
I want warn, that at least CWM (probably and TWRP) not backup apps moved to sdcard.
Because it "don't know" that they on external sdcard1, not on sdcard0
So manually copy folder .android_secure only on PC via cardreader.
Or using RootExplorer copy all from /mnt/asec/
But restoring will be hard because it must performed before boot.
Hi @cucumber09 , I just wanted to know what are the changes in this kernel and original kernel except the recovery change...
Please tell..!
abhatia1435 said:
Hi @cucumber09 , I just wanted to know what are the changes in this kernel and original kernel except the recovery change...
Please tell..!
Click to expand...
Click to collapse
There are no other changes, I didn't rebuild the kernel, I just repacked it with replacing recovery ramdisk using very simple script.
Bonoboo said:
Or using RootExplorer copy all from /mnt/asec/
But restoring will be hard because it must performed before boot.
Click to expand...
Click to collapse
Is it possible to restore them using AromaFM, or is this folder unmounting when the phone is not booted in system?
A little question
Err @cucumber09 Is this the same overclocked kernel from FindYanot or is this the stock kernel that's not oc? Cuz when i flashed this just now the performance is slower than FindYanot's kernel.
XtremeWave said:
Is this the same overclocked kernel
Click to expand...
Click to collapse
There no any word about overclock in first post.
So it's without overclock = nothing surprising that it's slower than with.
Yeah. You're right. Please don' t think of me as an idiot nor undestimate. I'm 11, but I rooted and unlocked the BL of my C1904 just to get Cm11 in 2012, I was just wondering as he said repacked etc. So i guess i have to TRY other things. Well the kernel's fine. Just that I wanted an oc cwm kernel.
Thanks @ Bonoboo
XtremeWave said:
Yeah. You're right. Please don' t think of me as an idiot nor undestimate. I'm 11, but I rooted and unlocked the BL of my C1904 just to get Cm11 in 2012, I was just wondering as he said repacked etc. So i guess i have to TRY other things. Well the kernel's fine. Just that I wanted an oc cwm kernel.
Thanks @ Bonoboo
Click to expand...
Click to collapse
should i flash both cwm and twrp
You need to flash one. Choose what u want.
Here's one over clocked kernel (Cwm 6.05.1) for Beta 2 of the CM12 ROM by Senior Member PecanCM for the Xperia M:http://www60.zippyshare.com/v/11764560/file.html
---------- Post added at 05:06 PM ---------- Previous post was at 05:03 PM ----------
Well TWRP is great. But I prefer CWM
UPDATED!
Recoveries are updated for new build (press thanks to Bonoboo). Dload links are in the OP.
New TWRP version
Kernel with new version of TWRP (2.8.3.0), wich should be more compatible with Lollipop. Compiled by sir @JustArchi. I didn't test it on LP yet. If someone will test it, let me know is it working as it should. Changelog is here (our previous version is 2.8.0.0).
UPD: I already tested it: recovery works, but I don't know, is there any bugs.
Will this recovery work on 5.0.2 as well??
manoj36 said:
Will this recovery work on 5.0.2 as well??
Click to expand...
Click to collapse
One post above:
Recoveries are updated for new build
Click to expand...
Click to collapse
cucumber09 said:
Kernel with new version of TWRP (2.8.3.0), wich should be more compatible with Lollipop. Compiled by sir @JustArchi. I didn't test it on LP yet. If someone will test it, let me know is it working as it should. Changelog is here (our previous version is 2.8.0.0).
UPD: I already tested it: recovery works, but I don't know, is there any bugs.
Click to expand...
Click to collapse
I have test the 2.8.3.0 TWRP, and so far its work as expected
Sent from my C1905
madper said:
I have test the 2.8.3.0 TWRP, and so far its work as expected
Sent from my C1905
Click to expand...
Click to collapse
Okay, if there is no bugs, I will repack kernels for next builds with this version of recovery.
it's working for me as well & very stable so far checked..thank you! :thumbup:
Thanks for update sir
Update TWRP for FXP build
TWRP updated for FXP-20150110
TWRP version: 2.8.3.0
CWM update for FXP
CWM updated for FXP-20150110.
Happy flashing!

[Q&A] [Recovery][FOTA]CWM and TWRP recoveries for custom ROMs

Q&A for [Recovery][FOTA]CWM and TWRP recoveries for custom ROMs
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.
Before posting, please use the forum search and read through the discussion thread for [Recovery][FOTA]CWM and TWRP recoveries for custom ROMs. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.
Thanks for understanding and for helping to keep XDA neat and tidy!
cucumber09 said:
Tired waiting for someone to repack kernel with your favorite version of recovery? Or tired to run recovery script every time you update your ROM or kernel? Now you don't need any repacked kernels or recovery-scripts. Use your FOTAKernel as recovery partition!
It works on any kernel with extract_elf_ramdisk utility (it's built in mostly all kernels for custom ROMs, but I am not sure) by @Dees_Troy. And don't forget, that you are doing on your own risk, I am not responsible for bricked devices, acid rains or thermonuclear war.
Installation:
Download zip and flash it via your current recovery. If your current recovery is unusable, you can flash it via terminal emulator:
- Extract FOTAKernel.img and place it to the root of your external SD-card
- Type su and grant root access
- Type
Code:
dd if=/ext_card/FOTAKernel.img of=/dev/block/mmcblk0p23
- Reboot to recovery to test if it works (if not, try again and check if you are doing it correctly).
Download:
TWRP 2.8.4.0 (thanks to @Rohan purohit for compiling it for Xperia L, I just ported and modded it)
TWRP 2.8.0.0/CWM (or scroll down, it's right below this post)
You can restore original FOTAKernel image by following instructions in this post (or just scroll down, it is 3rd post, lol).
Some info:
Sony Xperia devices don't have recovery partition. Instead of this in custom kernels is used recovery-in-boot conception with two-stage boot (ramdisk-recovery is packed inside main ramdisk). And there is partition called FOTAKernel that is used for installing official FOTA (firmware-over-the-air) updates. After unlocking your bootloader it partition becomes redundant, because you cannot use OTA function anymore. So it may be used for storing recovery ramdisk. And this very useful future was implemented by recognized developer @Dees_Troy (lead TWRP developer), he developed utility extract_elf_ramdisk (it is merged to almost all kernels for Sony devices), it extracts recovery ramdisk from FOTA partition instead of using regular one from boot image. So even after updating or changing your kernel or ROM you don't lose your current recovery! Here is some info from Dees_Troy.
BTW, I don't own any of this work, I just adapted recovery images for using them from FOTA partition. And recoveries are not compiled by me.
Click to expand...
Click to collapse
Hey, i use your recovery but when i write reboot recovery in terminal, my phone boots normally. But i can acess it by volume up button. How can i fix it?
Vp10 said:
Hey, i use your recovery but when i write reboot recovery in terminal, my phone boots normally. But i can acess it by volume up button. How can i fix it?
Click to expand...
Click to collapse
It is CM bug, it will be fixed in next nightlies.
Hi bro, i see new twrp update in xperia l thread ..
I hope you to update them ..
Thangs
cucumber09 said:
It is CM bug, it will be fixed in next nightlies.
Click to expand...
Click to collapse
And how we can flash new nightlies without recovery?
Hi, can I install twrp 2.8.4.0 from my FOTA recovery 2.4.0.0?
digt said:
Hi, can I install twrp 2.8.4.0 from my FOTA recovery 2.4.0.0?
Click to expand...
Click to collapse
[emoji782]
AggelosGR said:
And how we can flash new nightlies without recovery?
Click to expand...
Click to collapse
Recovery is accessible, just press many times vol rocker 'till you will enter the recovery.
---------- Post added at 20:59 ---------- Previous post was at 20:55 ----------
2ALL
I'm reading Q&A section not often, better write to main thread or tag me (if you are not quoting me), so I will see the notification.
How to solve image unstability in FOTA TWRP?
Hello @cucumber09. I've been trying your FOTA recovery, which I consider a great solution for our device, but I'm facing image unstability while in recovery: the screen flips and flicks horizontally making it very hard to tap correctly any option, and could lead to fatal errors. Could you please tell me a solution? I've tried flashing several kernels/traditional recoveries, but when I make it work satable in recovery, then the OS does'nt boot (bootloop). I'm using stock 4.3 15.4.A.1.9 ROM, unlocked bootloader, rooted, with Xposed Framework and Gravitybox module.
Also I've tried many KK and LP ROMs but I always return to stock 'cause I can't stand glitches and gaps while listening to my favourite tunes.
Thanks in advance,
e-bert.
e-bert said:
Hello @cucumber09. I've been trying your FOTA recovery, which I consider a great solution for our device, but I'm facing image unstability while in recovery: the screen flips and flicks horizontally making it very hard to tap correctly any option, and could lead to fatal errors. Could you please tell me a solution? I've tried flashing several kernels/traditional recoveries, but when I make it work satable in recovery, then the OS does'nt boot (bootloop). I'm using stock 4.3 15.4.A.1.9 ROM, unlocked bootloader, rooted, with Xposed Framework and Gravitybox module.
Also I've tried many KK and LP ROMs but I always return to stock 'cause I can't stand glitches and gaps while listening to my favourite tunes.
Thanks in advance,
e-bert.
Click to expand...
Click to collapse
Your problem is using the stock sony rom, it doesn't support FOTA recoveries properly, as soon as you switch to any other rom the FOTA recovery will work.
Thanks & new question.
Remorcer said:
Your problem is using the stock sony rom, it doesn't support FOTA recoveries properly, as soon as you switch to any other rom the FOTA recovery will work.
Click to expand...
Click to collapse
OK. Thank you for your quick response. Now, could you suggest to me any custom ROM that has no glitches or gaps in music playing? In yor opinion, which is the best ROM you've tried for our device (Xperia M SS c1904)?
Thanks again.
e-bert said:
OK. Thank you for your quick response. Now, could you suggest to me any custom ROM that has no glitches or gaps in music playing? In yor opinion, which is the best ROM you've tried for our device (Xperia M SS c1904).
Thanks again.
Click to expand...
Click to collapse
Everyone has its own taste in roms, I like stable and clean roms and would suggest cm11 or PA, try some of the roms and I'm sure you'll find your favourite.
Bliss pop is good.try it ,the battery is good.smooth performance and id say not much sound glitch .
Sent from my nicki using XDA Premium 4 mobile app
All hail to all cucumber..
its so frustrated to install kernel only for recovery..
and its more frustrating when your phone not responsive because incompatible kernel.
i recommended to install this trough recovery..
more reliable and low risk..
if you cant install from recovery (signature verification failed), first install another kernel to get unsigned recovery (niu kernel example)..
its a long way, but i'm prefer this than risking my phone because wrong command..
tested in resurrection remix rom 5.1..
Installed fota twrp with terminal, it freezes
So I did just as it was written. Installed it with command thru terminal on a CM 12 rom on Xperia z2.
It did work, for approx 10 seconds. I reboot in recovery, got first the screen for
CM recovery, before it changed to twrp. When I got there, I couldn't press anything
And suddenly it reboot into normal again. Dunno what it can be?!
Stuck on cyanogenmod boot
Flashed it and now i'm stuck on the cyanogenmod boot screen
is TWRP better or CWM...?
i flashed the twrp version 2.8.3.0 stuck on boot animation and when flashed 2.8.5.0 loop of recovery...m on xenon hd 5.1.1 rom...can anyone help???/ i want to flash twrp recovery
Neemac said:
So I did just as it was written. Installed it with command thru terminal on a CM 12 rom on Xperia z2.
It did work, for approx 10 seconds. I reboot in recovery, got first the screen for
CM recovery, before it changed to twrp. When I got there, I couldn't press anything
And suddenly it reboot into normal again. Dunno what it can be?!
Click to expand...
Click to collapse
It is for Xperia M, not Z2. So it won't work on it.
@Neemac i think z2 have official fota twrp, so why you not use them?
Sent from my C1905 using Tapatalk

Flashable TWRP v2.8.7.0 for Sony Z3+ E6553 Ivy_Kitakami

Introduction
Disclaimer: While this TWRP has been tested by myself on my own device to flash, wipe and backup, I make no warranties as to it's performance. Use at your own risk.
WARNING: flashable version contains a kernel boot image which will be flashed to your device along with the recovery image.
Click to expand...
Click to collapse
Installation instructions
This recovery image is for the E6553 single SIM Z3+. Do not use it on another model.
This recovery image requires an unlocked bootloader. You will lose some functionality on your phone if you unlock your bootloader
Do your research and make sure you're using the latest version of the relevant tools if you do decide to unlock.
DO NOT enable MyXperia functionality if you've unlocked your bootloader. You will brick your device.
This first download of this recovery image CANNOT be flashed to your phone and must be used in fastboot mode only
The second download is a flashable recovery
Use the first version to flash the second dual-boot.zip version
Unzip the recovery.zip file to extract the recovery.img file to use in fastboot mode
Code:
C:\>adb reboot bootloader
C:\>fastboot boot recovery.img
C:\>adb push dual-boot.zip /sdcard/dual-boot.zip
C:\>adb push dual-boot.zip.md5 /sdcard/dual-boot.zip.md5
Click to expand...
Click to collapse
Now use the TWRP install feature to install dual-boot.zip. Follow the prompts of the Aroma graphical installer.
CAVEAT: this extends the boot time by about 5 - 10 seconds as ramdisk images need to be unpacked and there's a wait on a keypress to determine whether to enter recovery mode. In order to boot into recovery, press power on. When you see the yellow LED come on then press the down volume button once or twice. You will then boot into TWRP.
NOTE: the dual-boot.zip installs a new 28.0.A.8.251 kernel. If you're using the autoroot kernel from Devries you will need to flash SuperSU to re-root your device
This dual boot/recovery works by flashing the recovery image to the FOTAkernel partition. A custom ramdisk image contains the normal boot image. If the down volume keypress is detected, then the recovery ramdisk is automatically extracted from the FOTAKernel partition and flow of control switches to recovery. If no keypress is detected then the normal ramdisk is extracted and normal android boot ensues.
Those of you who installed version 1.0 please download and install this version 1.1 to fix the error with the startup of the trim area daemon
Download
Binary
Fastboot TWRP Recovery Image v2.8.7.0-e6553-1.0 for Z3+ E6553
Flashable TWRP Recovery Image v2.8.7.0-e6553-1.1 for Z3+ E6553 (MD5: 52d4b7d406308dbd457e8b94210b7c87)
Flashable TWRP Recovery Image v2.8.7.0-e6553-1.1 for Z3+ E6553 - MD5
Sources @ github
device_sony_kitakami
device_sony_ivy
Click to expand...
Click to collapse
Changelog
Code:
Current changelog: -- 29 September 2015
[new] v1.1 fix up problem in combined ramdisk preventing trim area daemon from starting correctly
[new] Flashable recovery - 28 September 2015
[new] Fixed various sys/class issues so that CPU temperature and LED / backlight control work correctly
[new] Updated to use 28.0.A.8.251 kernel (as opposed to the AOSP kernel)
[old] Initial release - 10 September 2015
Click to expand...
Click to collapse
Thanks To
The regular contributors to the Z3+ forum, among others @[NUT], @ChrisJ951, @DHGE, @Devries, @zxz0O0, @Venkat Kamesh, @AndroPlus, @Sacktreter who pass on knowledge and who make the forum a lively and cooperative place
Click to expand...
Click to collapse
People who installed version 1.0 of the Flashable TWRP must please update to version 1.1 to correct a bug.
Awesome work.
Glad you were able to get the screen working for it! Boots up fine w/o issue for me
This is fantastic. Is there any way of getting this to work with a locked bootloader?
Sent from my Xperia Z3+
AMoosa said:
This is fantastic. Is there any way of getting this to work with a locked bootloader?
Sent from my Xperia Z3+
Click to expand...
Click to collapse
I'd venture to suggest that it's highly unlikely that locked bootloader recovery could work. The DM_VERITY is almost a guarantor of that. Just search for CONFIG_DM_VERITY or Verity in the Z3+ forums for more info.
Even if an exploit works, the second it modifies the system partition, the kernel panics and refuses to boot. The only way of preventing that is to flash a new kernel or edit the ramdisk to remove the verity key. And the only way to flash a new kernel / edit the ramdisk is to unlock the bootloader.
Thank you first for development... maazing!
I have unlocked the bootloader via Sony and then used an boot.img from Devries to root as root was my primary goal. I have flashbooted as per instructions the TWRP recovery.img that is provided here by the awesome dl12345 .
However the issue is that I am unable to boot to recovery after rebooting from TWRP. In other words the flashboot works and I am able to make a backup and use TWRP well but it doesn't seem to stick.
Am I doing something wrong. Should I have flashed a ROM first from xperfirm, Flashtools, and/or can I flash a kernel without it effecting the recovery. My knowledge is sketchy but I am totally up for testing if I can help.
elladroid said:
Thank you first for development... maazing!
I have unlocked the bootloader via Sony and then used an boot.img from Devries to root as root was my primary goal. I have flashbooted as per instructions the TWRP recovery.img that is provided here by the awesome dl12345 .
However the issue is that I am unable to boot to recovery after rebooting from TWRP. In other words the flashboot works and I am able to make a backup and use TWRP well but it doesn't seem to stick.
Am I doing something wrong. Should I have flashed a ROM first from xperfirm, Flashtools, and/or can I flash a kernel without it effecting the recovery. My knowledge is sketchy but I am totally up for testing if I can help.
Click to expand...
Click to collapse
This is correct behaviour. You're not actually flashing the recovery image, just temporarily booting a recovery kernel and associated ramdisk. Sony Xperia devices don't have a recovery partition, or more accurately, they don't have a bootloader than can check and load a boot image from a recovery partition.
Technically it's possible to make the boot image check for a ramdisk on another partition and use this instead of the normal ramdisk, but this is step two. Sony should be releasing an open recovery bootloader fairly soon for the Z3+ which will allow this recovery image to be flashed. It's already been released for other devices.
Until Sony releases open recovery for Z3+ or I spend the time trying to implement a feature that probably only has days or weeks of utility (until Sony releases the open recovery for Z3+) , you're stuck with a TWRP that you need to launch every time in fastboot mode.
On the first screen immediately after the TWRP logo comes up, the battery is always being reported at being 50%. Sometimes the correct number is displayed when in the flashing screen. Otherwise works great!
Also, link to Sony Z3+ windows drivers
How to install unsigned drivers in Windows 8.1/10 with secure boot
elladroid said:
Thank you first for development... maazing!
I have unlocked the bootloader via Sony and then used an boot.img from Devries to root as root was my primary goal. I have flashbooted as per instructions the TWRP recovery.img that is provided here by the awesome dl12345 .
However the issue is that I am unable to boot to recovery after rebooting from TWRP. In other words the flashboot works and I am able to make a backup and use TWRP well but it doesn't seem to stick.
Am I doing something wrong. Should I have flashed a ROM first from xperfirm, Flashtools, and/or can I flash a kernel without it effecting the recovery. My knowledge is sketchy but I am totally up for testing if I can help.
Click to expand...
Click to collapse
New version now flashable so that you can boot into recovery...read top post carefully before using.
serrin85 said:
On the first screen immediately after the TWRP logo comes up, the battery is always being reported at being 50%. Sometimes the correct number is displayed when in the flashing screen. Otherwise works great!
Also, link to Sony Z3+ windows drivers
How to install unsigned drivers in Windows 8.1/10 with secure boot
Click to expand...
Click to collapse
Fixed in latest version
http://www.kz3.eu:18998/dual-boot.zip link gives 404 ..
deecept said:
http://www.kz3.eu:18998/dual-boot.zip link gives 404 ..
Click to expand...
Click to collapse
Yes, I've temporarily disabled the link while I resolve a problem relating to the trim area daemon not starting up due to some peculiarity of the dual boot ramdisk. I'll reinstate it as soon as I fix the problem.
dl12345 said:
Yes, I've temporarily disabled the link while I resolve a problem relating to the trim area daemon not starting up due to some peculiarity of the dual boot ramdisk. I'll reinstate it as soon as I fix the problem.
Click to expand...
Click to collapse
Oh, ok, sweet! Looking to flash this to my Z3+. More than happy to test if needed =) Great work on these!!
deecept said:
Oh, ok, sweet! Looking to flash this to my Z3+. More than happy to test if needed =) Great work on these!!
Click to expand...
Click to collapse
Download back online and problem fixed
Those who downloaded the 1.0 please download this 1.1 version and install to correct the problem with trim area daemon startup. Thanks
dl12345 said:
Download back online and problem fixed
Those who downloaded the 1.0 please download this 1.1 version and install to correct the problem with trim area daemon startup. Thanks
Click to expand...
Click to collapse
HI dl12345,
this recovery support Dual model? E6533
hi.question...i get remote: dtb not found error when trying to boot the recovery..any ideas?
didnt get a thing... how do i install?
please, release TWRP for 6533 too
we need custom recovery so bad
Dathrex said:
please, release TWRP for 6533 too
we need custom recovery so bad
Click to expand...
Click to collapse
Pleaseee ????
Brother, please, help us with twrp to E6533, please.
Enviado de meu E6533 usando Tapatalk

Custom kernel Z3+ E6553 - Nuke Verity / Sony RIC and allow SELinux permissive

Introduction
The stock Sony kernels use SONY RIC, SELinux and CONFIG_DM_VERITY that together make it exceptionally hard to root. With the stock kernel, it's impossible to run a modified ROM of any form (incorporating changes to the system partition). Attempting to boot with the stock kernel off a modified system partition results in a kernel stop or panic, manifested either by getting stuck on the Sony screen or a bootloop.
This kernel removes the Sony RIC and CONFIG_DM_VERITY and sets boot and runtime parameters that allow SELinux to be disabled or to be set into permissive mode. Once this kernel is flashed, you can download SuperSU flashable zip and flash it to your phone using the TWRP recovery image I posted in this forum in order to get root on your stock ROM.
This kernel contains no source patches. It's a completely stock kernel from the Sony github repository.
Click to expand...
Click to collapse
Features
SELinux configurable at boot and runtime
Sony RIC disabled
CONFIG_DM_VERITY disabled
Click to expand...
Click to collapse
Installation instructions
This boot image requires an unlocked bootloader. You will lose some functionality on your phone if you unlock your bootloader
Do your research and make sure you're using the latest version of the relevant tools if you do decide to unlock.
Unzip the boot.zip file to extract the boot.img file
Code:
C:\>adb reboot bootloader
C:\>fastboot flash boot boot.img
C:\>fastboot boot recovery.img
C:\>adb push UPDATE-SuperSU-v2.46.zip /sdcard/supersu.zip
Then switch to the TWRP interface, go to the Install menu and flash /sdcard/supersu.zip. Reboot and you're rooted. You can then modify your system partition as you please.
Click to expand...
Click to collapse
NOTE: if you install Xposed you MUST wipe cache/dalvik after installation otherwise you will get an error message telling you that you are running out of storage space and any apps you install with Play store will fail the installation with a 504 error. This is NOT related to the kernel, but is caused by failing to wipe cache after installing Xposed.
Download
Binary
28.0.A.8.251 custom kernel for Z3+ E6553
TWRP Recovery Image V0.1 for Z3+ E6553
Sources @ github
Kernel config
Sony kernel-copyleft repository
Click to expand...
Click to collapse
Changelog
Code:
[B]Changelog[/B]
[new] 12 September 2015- Update to 28.0.A.8.251
[old] 10 September 2015 - Initial release
Thanks To
Code:
[url="http://forum.xda-developers.com/member.php?u=631273"]@Chainfire[/url]. What would we do without SuperSU.....
Click to expand...
Click to collapse
Awesome work, works without any issues.
I must be being really stupid....
Unable to boot into recovery without reflashing recovery.img. I must be missing something!
Otherwise no other issues to speak of. Amazing Thanks!
elladroid said:
I must be being really stupid....
Unable to boot into recovery without reflashing recovery.img. I must be missing something!
Otherwise no other issues to speak of. Amazing Thanks!
Click to expand...
Click to collapse
"Until Sony releases an open bootloader you need to use this image via fastboot boot mode."
really 28.0.A.8.251?
@dl12345
searching for 28.0.A on GitHub gave me:
28.0.A.7.xxx Updated 2 months ago by jerpelea
28.0.A.6.xxx Updated 3 months ago by jerpelea
28.0.A.4.xxx Updated 4 months ago by jerpelea
Did you try the source posted on SONY Developer?
http://developer.sonymobile.com/dow...rchives/open-source-archive-for-28-0-a-8-251/
Does your boot.img work as a replacement for the boot.img flashed with 28.0.A.8.251 FTF?
I ask because I failed booting a boot image compiled from the SONY Developer source and an older kernel from 28.0A.7.24/31 as replacement for the image in the latest 8.251 FTF for my SGP712/karin_windy
DHGE said:
@dl12345
searching for 28.0.A on GitHub gave me:
28.0.A.7.xxx Updated 2 months ago by jerpelea
28.0.A.6.xxx Updated 3 months ago by jerpelea
28.0.A.4.xxx Updated 4 months ago by jerpelea
Did you try the source posted on SONY Developer?
http://developer.sonymobile.com/dow...rchives/open-source-archive-for-28-0-a-8-251/
Does your boot.img work as a replacement for the boot.img flashed with 28.0.A.8.251 FTF?
I ask because I failed booting a boot image compiled from the SONY Developer source and an older kernel from 28.0A.7.24/31 as replacement for the image in the latest 8.251 FTF for my SGP712/karin_windy
Click to expand...
Click to collapse
Correct. The sources on github are old. I dowloaded the archive from the Sony website and compiled it. Yes the boot.img I compiled works perfectly as a replacement. I'm currently running it on my phone.
How to modify system partition
Hi all,
Nob question but need help urgently. After installing the kernel I'm now getting storage space almost full and error 504 due I think to some modifications to the kernel to get root. I'm aware OP did say to modify system partition but don't have a clue how to do so in order to get storage space back and also install apps. Urgent help needed pls.
Cheers and thanks for your assistance.
yawo76 said:
Hi all,
Nob question but need help urgently. After installing the kernel I'm now getting storage space almost full and error 504 due I think to some modifications to the kernel to get root. I'm aware OP did say to modify system partition but don't have a clue how to do so in order to get storage space back and also install apps. Urgent help needed pls.
Cheers and thanks for your assistance.
Click to expand...
Click to collapse
The kernel makes no modifications to the system partition and is unrooted. You need to flash SuperSU to get root.
This error you're getting is caused by the Xposed framework. You've installed the Xposed framework but you forgot to do a wipe dalvik and cache after installing. This is exactly what happens when you forget to wipe cache after installing xposed.
You can try to use the xposed uninstaller which may fix it. If not, you need to do a full wipe and reflash a ROM.
dl12345 said:
The kernel makes no modifications to the system partition and is unrooted. You need to flash SuperSU to get root.
This error you're getting is caused by the Xposed framework. You've installed the Xposed framework but you forgot to do a wipe dalvik and cache after installing. This is exactly what happens when you forget to wipe cache after installing xposed.
You can try to use the xposed uninstaller which may fix it. If not, you need to do a full wipe and reflash a ROM.
Click to expand...
Click to collapse
Thanks very much. It's true I installed Xposed Framework and didn't wipe cache. I have already reinstalled the Rom so will remember this time not to repeat the same mistake.
dl12345 said:
Introduction
NOTE: if you install Xposed you MUST wipe cache/dalvik after installation otherwise you will get an error message telling you that you are running out of storage space and any apps you install with Play store will fail the installation with a 504 error. This is NOT related to the kernel, but is caused by failing to wipe cache after installing Xposed.
Download
[B
Click to expand...
Click to collapse
I'm on .251 (modified system partition) without XPOSED installed. Using the kernel just causes boot loops (Sony Logo then 3 red flashes from the LED) the same way the stock kernel does. Is there something special I need to get SONY RIC / Verity to not run at boot?
This looks like a bad flash. Can you fastboot this kernel?
dl12345 said:
This looks like a bad flash. Can you fastboot this kernel?
Click to expand...
Click to collapse
No luck doing fastboot boot, or fastboot flash boot (both have the same issue of red led 3x then rebooting)
I re-downloaded it and the md5sum matched between the downloads:
768eac3ba2ebcbdaf67e12d8bd11450b /home/chris/Downloads/boot-251.img
768eac3ba2ebcbdaf67e12d8bd11450b /home/chris/Downloads/boot-251.img (2)
EDIT:
Also just in case it matters, the exact build I'm on is
28.0.A.8.251
Edit2: Went back to complete stock from FTF flash and the kernel boots. Need to modify system partition and recheck
Edit3: Flashes SuperSU.zip and it is booting with SU installed. Unsure why my old rom was incompatible with it
ChrisJ951 said:
No luck doing fastboot boot, or fastboot flash boot (both have the same issue of red led 3x then rebooting)
I re-downloaded it and the md5sum matched between the downloads:
768eac3ba2ebcbdaf67e12d8bd11450b /home/chris/Downloads/boot-251.img
768eac3ba2ebcbdaf67e12d8bd11450b /home/chris/Downloads/boot-251.img (2)
EDIT:
Also just in case it matters, the exact build I'm on is
28.0.A.8.251
Edit2: Went back to complete stock from FTF flash and the kernel boots. Need to modify system partition and recheck
Edit3: Flashes SuperSU.zip and it is booting with SU installed. Unsure why my old rom was incompatible with it
Click to expand...
Click to collapse
Me neither - this bootimage has very few modifications: only CONFIG_DM_VERITY and RIC removed, some options for runtime control of SELinux added and the verity keys removed from the ramdisk. It boots fine on a stock 251 ROM for me. The kernel source is .251 source too...
I have noticed that I occasionally get bad flashes and odd behaviour when flashing ROMs (with everything from fastboot to flashtool to TWRP). I think the platform itself isn't totally stable and bug free. Usually I fix it by just wiping and reflashing
Hi @dl12345, can you make the same kernel for Z3 (D6603) or at least point me in direction to know what I need to change by compiling own kernel from sources? Or modifying the original ramdisk..
The issue is that the new Concept M firmware from Sony uses the same security features. Guys (@Gustavo RD78) made successfully kernel for previous Concept L (5.1.1) based firmware, however the same approach seems to fail in case of Marshmallow. Your help will be very appreciated.
EDIT - removed full OP quoted by mistake.
ondrejvaroscak said:
Hi, can you make the same kernel for Z3 (D6603) or at least point me in direction to know what I need to change by compiling own kernel from sources? Or modifying the original ramdisk..
The issue is that the new Concept M firmware from Sony uses the same security features. Guys (@Gustavo RD78) made successfully kernel for previous Concept L (5.1.1) based firmware, however the same approach seems to fail in case of Marshmallow. Your help will be very appreciated.
Click to expand...
Click to collapse
You need kernel source (Sony won't upload it since it's closed beta test).
Also do not quote full OP.
[UPDATE]
AOSP and copyleft source are different things. You need kernel source for concept rom's kernel, and it won't be published so it's impossible to build custom kernel for concept rom.
AndroPlus said:
You need kernel source (Sony won't upload it since it's closed beta test).
Also do not quote full OP.
Click to expand...
Click to collapse
Do I get it right, that I can't justo compile kernel for use with this firmware from AOSP / Sony Copy-left sources?

Another TWRP 2.8.7 for Fota Partition with working brightness

TWRP updated to 2.8.7.2 including latest commits. Download at the bottom (see Dec25 file). Selinux permissive is set, so, should work on all roms. Remember, unzip and flash in fastboot.
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
I know there is a bunch of different TWRP recoveries for our Z1, including the official one. Well. This one is for Fota. It was compiled in Z1 build environment with all the appropriate flags. And brightness is working fine. Why brightness is important? Because at maximum brightness your phone will overheat to over 65 degrees during flashing. And thanks to previously wrong value, the brightness level in other TWRPs is 15 times the maximum one.
You can flash this one in fastboot like this: fastboot flash recovery recovery.img. Just make sure that your kernel does not have inbuilt TWRP, because 2 identical recoveries will conflict with each other. Unzip first...
For those who would like to know what's new, look here: https://gerrit.omnirom.org/#/q/project:android_bootable_recovery
In this build, I have also reduced default vibration to 28/28/28, but you can set in Settings to whatever you want.
can you publish your settings to get brightness working ? would be nice to complete official sources from twrp !
hawkeyexp said:
can you publish your settings to get brightness working ? would be nice to complete official sources from twrp !
Click to expand...
Click to collapse
My commit was merged about 2 months ago by Slimroms. See their /device/sony/rhine-common. There is a flag for brightness that should be 255 instead of 4095. So, the changes are not in TWRP sources, but in the rhine tree...
Edit: Here is the commit: https://github.com/SlimRoms/device_sony_rhine-common/commit/7d64159d87d948926ebd40485deb18f9c292abbe
ok will try it out if it works with my tree
Thanks for posting.
I guess since this is FOTA it will not work with roms with recovery in boot like Jaguar?
Sent from my Z1 using Tapatalk
Gawis said:
Thanks for posting.
I guess since this is FOTA it will not work with roms with recovery in boot like Jaguar?
Sent from my Z1 using Tapatalk
Click to expand...
Click to collapse
That's right, but I am planning to update Jaguar's kernel. So, when it is done, I will
post it without recovery, so this one can work.
But it really makes no difference...
optimumpro said:
My commit was merged about 2 months ago by Slimroms. See their /device/sony/rhine-common. There is a flag for brightness that should be 255 instead of 4095. So, the changes are not in TWRP sources, but in the rhine tree...
Edit: Here is the commit: https://github.com/SlimRoms/device_sony_rhine-common/commit/7d64159d87d948926ebd40485deb18f9c292abbe
Click to expand...
Click to collapse
Is working fine - thx !
Does this one work with the aosp android 6.0 rom that's around here?
Sent from my C6903 using Tapatalk
swa100 said:
Does this one work with the aosp android 6.0 rom that's around here?
Sent from my C6903 using Tapatalk
Click to expand...
Click to collapse
Try, but there is a separate branch for TWRP for M. And anyway, M is not usable yet and won't be for a long time...
Thanks for this one!
I do however seem to experience an issue when trying another ROM like CM.
With your ROM I can reboot into this recovery but with CM I get a black screen. When using another older TWRP recovery I used when rooting both ROMS boot fine into recovery.
Sent from my Z1 using Tapatalk
@optimumpro is there any chance to make a flashable zip with it? Thanks
matcho13579 said:
@optimumpro is there any chance to make a flashable zip with it? Thanks
Click to expand...
Click to collapse
Use Rashr app to install this...
Hey there~
For some reason this recovery is not working for me at all. It won't start after flashing it, just a black screen.
The original twrp 2.8.7.0 from twrp.me is working, though. But I'd rather get your version to work because of the brightness control.
Could you help me please? >.<
Snowblond said:
Hey there~
For some reason this recovery is not working for me at all. It won't start after flashing it, just a black screen.
The original twrp 2.8.7.0 from twrp.me is working, though. But I'd rather get your version to work because of the brightness control.
Could you help me please? >.<
Click to expand...
Click to collapse
Are you sure you are doing everything right? Does your kernel have a builtin recovery? If that's the case, you will have problems. Have you updated your bootloader with Emma? Before flashing (in fastboot), do this: fastboot erase recovery; and then fastboot flash recovery recovery.img. Make sure you are not mistyping: the command means fastboot has to flash recovery.img to recovery partition. If you have FOTA, then there is a chance flash recovery may not work.
optimumpro said:
Are you sure you are doing everything right? Does your kernel have a builtin recovery? If that's the case, you will have problems. Have you updated your bootloader with Emma? Before flashing (in fastboot), do this: fastboot erase recovery; and then fastboot flash recovery recovery.img. Make sure you are not mistyping: the command means fastboot has to flash recovery.img to recovery partition. If you have FOTA, then there is a chance flash recovery may not work.
Click to expand...
Click to collapse
Thanks for your answer. I tried flashing it exactly like you suggested, but the result was the same - black screen. My kernel does not have an inbuilt recovery and no, I didn't update my bootloader with Emma. That means I can only use FOTA, right? But I thought this recovery IS indeed for FOTA?
It's strange that the original TWRP is working, but yours doesn't.. even though they're both for FOTA..
Snowblond said:
Thanks for your answer. I tried flashing it exactly like you suggested, but the result was the same - black screen. My kernel does not have an inbuilt recovery and no, I didn't update my bootloader with Emma. That means I can only use FOTA, right? But I thought this recovery IS indeed for FOTA?
It's strange that the original TWRP is working, but yours doesn't.. even though they're both for FOTA..
Click to expand...
Click to collapse
I don't know why it is not working for you. If you post your boot.img, I can put recovery in it..
Snowblond said:
Thanks for your answer. I tried flashing it exactly like you suggested, but the result was the same - black screen. My kernel does not have an inbuilt recovery and no, I didn't update my bootloader with Emma. That means I can only use FOTA, right? But I thought this recovery IS indeed for FOTA?
It's strange that the original TWRP is working, but yours doesn't.. even though they're both for FOTA..
Click to expand...
Click to collapse
Happened to me once.
Try wiping FOTAKernel partition first, with:
Code:
fastboot erase FOTAKernel
and then flash the recovery with
Code:
fastboot flash FOTAKernel recovery.img
where recovery.img is your recovery.
drakonizer said:
Happened to me once.
Try wiping FOTAKernel partition first, with:
Code:
fastboot erase FOTAKernel
and then flash the recovery with
Code:
fastboot flash FOTAKernel recovery.img
where recovery.img is your recovery.
Click to expand...
Click to collapse
Thank you, but it's still a black screen when I try to boot in recovery. :/ I just don't understand why this version won't work with my device but the one from twrp.me without brightness control does .. -.-
Snowblond said:
Thank you, but it's still a black screen when I try to boot in recovery. :/ I just don't understand why this version won't work with my device but the one from twrp.me without brightness control does .. -.-
Click to expand...
Click to collapse
Did you try with another kernel? If it worked then, you can trace the problem to the kernel itself, and not the device or your flashing methodology.
Recovery updated to 2.8.7.2. See OP for download...

Categories

Resources