[Xperia Z1 Compact Original Android Development] 115ek:
This one is deprecated! Please use this one instead.

Some words about...

This recovery is for amami - Sony Z1 compact.

I'm opening this thread because I was looking for an up-to-date version of TWRP recovery. After a long search i found this one: https://xdaforums.com/sony-xperia-z1-compact/orig-development/lineageos-12-1-z1c-current-sec-patches-t3614936.

Why am I opening this thread then?

Well,

I want to built TWRP from newest android sources (not like cm12.1 that is used in the link above )

and I want to get a deeper understanding of sony's partition layout (especially concerning recovery).

I just read a comment about the possibilities to store a recovery on our device, but unfortunately I couldn't find it again. It was something like that:

fastboot flash boot boot.img (recovery uses same kernel but different ramdisk, common sony approach, after kernel boot-up hardware keys decide which ramdisk to load)

fastboot flash FOTAKernel recovery.img (recovery is stored on extra partition with own kernel and own ramdisk)

fastboot flash recovery recovery.img (recovery is stored on extra partition with own kernel and own ramdisk)

So I stumbled over https://xdaforums.com/showpost.php?p=73575131&postcount=130 and followed the instruction. But an inspection of the partitions leads me to the following assumption: either the thing doesn't worked - or fastboot flash FOTAKernel recovery.img and fastboot flash recovery recovery.img are doing the same thing.

The partitions afterwards:

major minor #blocks name #label

254 0 524288 zram0
179 0 15267840 mmcblk0
179 1 2048 mmcblk0p1 TA
179 2 512 mmcblk0p2 sbl1
179 3 256 mmcblk0p3 s1sbl
179 4 64 mmcblk0p4 dbi
179 5 512 mmcblk0p5 aboot
179 6 512 mmcblk0p6 rpm
179 7 512 mmcblk0p7 tz
179 8 512 mmcblk0p8 alt_sbl1
179 9 256 mmcblk0p9 alt_s1sbl
179 10 64 mmcblk0p10 alt_dbi
179 11 512 mmcblk0p11 alt_aboot
179 12 512 mmcblk0p12 alt_rpm
179 13 512 mmcblk0p13 alt_tz
179 14 20480 mmcblk0p14 boot
179 15 10240 mmcblk0p15 ramdump
179 16 16384 mmcblk0p16 FOTAKernel
179 17 32 mmcblk0p17 DDR
179 18 16384 mmcblk0p18 lta-label
179 19 1536 mmcblk0p19 modemst1
179 20 1536 mmcblk0p20 modemst2
179 21 1536 mmcblk0p21 fsg
179 22 8192 mmcblk0p22 apps_log
179 23 2379776 mmcblk0p23 system
179 24 204800 mmcblk0p24 cache
179 25 12589039 mmcblk0p25 userdata
179 32 4096 mmcblk0rpmb

1 block == 1 kByte == 1024 Bytes

--> get actual size in Byte: #blocks*1024 Bytes

How to install

unlock bootloader

fastboot flash FOTAKernel recovery.img (this should work in any case)

OR

fastboot flash recovery recovery.img (if my findings are correct, this should only work with new bootloader from here: https://xdaforums.com/showpost.php?p=73575131&postcount=130 )

remove USB cable

press and hold Vol. down and power, if device vibrates release power and keep Vol. down holding. That's it.

Feel free to test and give comments on my thougts. :silly:

Credits:

SpritCroc (and AICP team)

munjeni (new bootloader)

Micha-Btz

charles1018

Sources:

my manifest: https://github.com/115ek/manifest

forked device tree: https://github.com/115ek/device_sony_amami

original device tree and kernel sources: https://github.com/aicp

TWRP: https://github.com/omnirom/android_bootable_recovery