[recovery][fota] Z3 TWRP 2.8.5.0 (with F2FS)

Verbato

Senior Member
Jan 1, 2007
323
172
63
Hallingdal
Simply put, this is (as of now) the latest TWRP (with F2FS, without multirom - sorry).

https://www.mediafire.com/?mj5885q1x5lamzv

Either install it normally or by using fastboot:
Code:
fastboot flash recovery fota.img
If you head over to AndroPlus' thread and download his latest kernel (as of writing, that is Z3_AndroPlusKernel_F2FS_v26a.zip) you could format /system and /cache as F2FS and it will boot and run fine, /data will however, sadly, not format or work as F2FS. But so far, /system and /cache does.

* Goal: get /data to work with F2FS as well
 
Last edited:

panzerscope

Senior Member
Jul 9, 2009
384
44
0
Sure I think there would be a good amount of interest considering it would mean that no matter what happened to the Kernel/recovery we would still be able to fall back on Fota for Multirom. :)

Sure take your time, would be great if possible.

Sent from my Xperia Z3 using XDA Free mobile app
 

Verbato

Senior Member
Jan 1, 2007
323
172
63
Hallingdal
Sorry if i should know this, but do we need a supported kernel or something to boot into FOTA recoveries?
You need something that, in the init, at boot, waits to check and see if you hit a set key.
"If set key is pushed - load "kernel" (or really ramdisk) from FOTA-partition"

Or more correctly, as @AndroPlus has coded it:

Code:
if [ -n "$POWRKEYCHECK" ]
                        then
                                #load FOTA ramdisk
                                busybox mknod -m 600 ${BOOTREC_FOTA_NODE}
                                busybox mount -o remount,rw /
                                busybox ln -sf /sbin/busybox /sbin/sh
                                extract_elf_ramdisk -i ${BOOTREC_FOTA} -o /sbin/ramdisk-recovery-fota.cpio -t / -c
                                busybox rm /sbin/sh
                                load_image=/sbin/ramdisk-recovery-fota.cpio
                                busybox echo 'Selected FOTA recovery' >>boot.txt
                        fi
If you want to do that yourself I can attach the original Sony LP kernel, dt.img and ramdisk for you.
 

Attachments

  • Like
Reactions: know.i.dee

da900

Senior Member
Mar 20, 2009
823
189
0
Saint-Petersburg
Stock ROM

Hi. Just flashed your TWRP on my Z3, but I can't boot into it. What could be a problem? I am using latest CM12. Everytime I press vol + button during boot and lila light I get into CM recovery. :(
 
Last edited:

Verbato

Senior Member
Jan 1, 2007
323
172
63
Hallingdal
Hi. Just flashed your TWRP on my Z3, but I can't boot into it. What could be a problem? I am using latest CM12. Everytime I press vol + button during boot and lila light I get into CM recovery. :(
Well, to put it easy:
On boot the phone has a script that tells it to look for certain keys to be pushed.
1. If volume up is pushed then go to CM Recovery
2. If volume down is pushed then go to TWRP Recovery
3. If camera button is pushed then go to...
And so on. If there is no script telling the phone to do so (original Sony kernel/ramdisk) then the phone will just simply boot in to android. Nothing tells it to do otherwise.
If there is a script that only tells the phone to boot in to CM recovery or what ever, then that's the only options the phone has.

The kernel (or rather, the ramdisk with the kernel) you use has to have support for booting from the FOTAKernel-partition. If there is no support for it in the kernel then the installed FOTAKernel will just exist there. Not hurting anything, but not doing any good either.

TL;DR - ask the creator/developer of your kernel to add booting from the FOTAKernel as a feature.
 
  • Like
Reactions: da900

cmeeren

Member
Mar 24, 2015
37
7
0
Is there any automated or hassle-free way of replacing the nightly CM12 installer script with the script required for this recovery? Or do I have to download the zip manually, unzip, replace the sript manually, rezip, transfer the zip to my Z3, and then flash - every day?
 

Entropy512

Senior Recognized Developer
Aug 31, 2007
14,095
25,085
0
Owego, NY
No, Fota Recovery is independent from the Kernel

Sent from my Xperia Z3 using XDA Free mobile app
Wrong. On Sony devices, once the bootloader is locked, the device will NOT boot the contents of the FOTAKernel partition.

This is similar to older Samsung devices.

The problem with this, of course, is that you normally can't change recovery without changing the kernel.

The workaround developed (IIRC by Dees_Troy of TWRP) was to have the boot kernel extract its recovery ramdisk from the FOTAKernel partition if present, allowing a person to switch recoveries without switching kernels - but they still need a kernel that will read the ramdisk. Also, the recovery ramdisk present needs to "play nice" with the kernel itself, which can lead to problems when Qualcomm or Sony do things that break display compatibility. For example, I'm fairly certain most current Z3 FOTAKernel builds use RGBX_8888, which Qualcomm dropped support for in vanilla framebuffers (like what recovery uses) in newer kernels. So any FOTAKernel ramdisk that tries to use RGBX_8888 will fail, for example, with Sony AOSP (due to it using a newer 3.10 kernel)
 
  • Like
Reactions: Arju