[Xperia Z General] Carceri:
This is the ROM i use myself, but I post it here in case other people also want a clean (almost) stock ROM with root and recovery. It works for me, but I provide no guarantee that it will work for you. That said, these ZIP files and procedures have been tested by myself and a few others and seem to work quite well.

FLASH THIS AT YOUR OWN RISK.

Requirements:

Sony Xperia Z.

Only tested on LB, but should also work on UB.

Ability to flash ZIP files via recovery.

Features:

Based on Xperia Z_10.1.1.A.1.307_Unbranded BE.ftf (file uploaded by Psicao).

Removed bloat and other apps you can download from Google Play.

Installed CWM recovery 6.0.2.8 for locked bootloaders v4.

Odexed and zipaligned.

No reboots when mounting system r/w.

Pre-rooted with Koush's Superuser App.

Busybox v1.20.2 installed.

Call recording.

18 Toggles.

36 dpi softkeys.

Changelog:

v8

Added 18 Toggles.

Switched to 36 dpi softkeys.

v7

Added WeatherWidget back due to popular demand.

More robust and less intrusive way to ensure that mounting system r/w doesn't cause a reboot.

v6

Based on 10.1.1.A.1.307

Removed 18 Toggles since it is not compatible with 1.307 yet.

Delete the ric daemon early in the boot process.

v5

Added 18 Toggles.

Applied a few WiFi tweaks to get a (hopefully) more stable WiFi connection.

v4

Removed duplicate notification sound 'vega' (bug in original ROM).

Increased volume a bit.

v3

Created all symlinks found in the original FTF file.

Changed all file and directory permissions to match those in the original FTF file.

Added a more robust script to stop ric.

v2

Fixed reboot issue when mounting system r/w.

Added Notes and NoteWidget back.

Reodexed and zipaligned.

v1

Initial release.

Installation:

Enter recovery.

Flash C6603_10.1.1.A.1.307_DEBLOAT.zip.

Clear user data OPTIONAL STEP - SEE BELOW.

Reboot.

Reboot again once NFC firmware has been upgraded (only needed if upgrading from 1.434 or earlier).

Note regarding unlocked bootloaders: This ROM is designed for LB. If using this on UB flash the following ZIP after installation to remove the CWM recovery for LB: C6603_10.1.1.A.1.307_UBPATCH.zip

Clear data?

If NFC is not working and you're upgrading from a 1.434 ROM, I recommend that you clear your userdata by flashing C6603_10.1.1.A.1.307_ClearData.zip.

You do NOT need to clear user data if you are already running a ROM based on 1.253 or 1.307 and everything is working fine.

MD5 hashes:

2f8fe013da90987447a04c0e5f405998 (C6603_10.1.1.A.1.253_DEBLOAT.zip)

3bba6ffb3cd9bdf7535c5e4b722223d5 (C6603_10.1.1.A.1.253_ClearData.zip)

b889d474290d9b924acbf011277d58e3 (C6603_10.1.1.A.1.307_UBPATCH.zip)

Upgrade kernel and baseband:

Once the ROM is working you might want to flash kernel and baseband from the original FTF via Flashtool in order to get the full 1.307 experience.

Preventing reboots when mounting /system read-write

This ROM uses my own little utility called RICHunter to prevent reboots when mounting /system read-write. If you want to use it yourself in your own ROM you can download it here:

0c766dc58cc909693f5d669264d78f4a (richunter.zip)

Included in the ZIP file is a README.txt that explains how to use it, but you can also read it here:

RICHunter by Carceri @ XDA

1. What is this?

On the Xperia Z Sony have added a small program called ric which

monitors mount options on filesystems and reboots the system if

they deviate from their default values. This causes the system

to reboot e.g. when the /system partition is mounted read-write.

In short, this programs stops this daemon and replaces it with a

dummy version that doesn't do anything, thereby disabling ric.

2. How do I use it?

Just put the file richunter somewhere on your system, for example

/system/bin/richunter, make it executable (chmod 755) and run it

as the root user. This needs to be done every time the system is

restarted.

This can be achieved by putting the following lines in a file

called /system/etc/install-recovery.sh:

#!/system/bin/sh

exec /system/bin/richunter

Another way is to make a wrapper to /system/bin/ctrlaltdel and

call richunter from there:

#!/system/bin/sh

exec /system/bin/richunter

exec /system/bin/toolbox ctrlaltdel "${1}" "${2}" "${3}" "${4}"

Choose either one, or a 3rd solution to automatically run it.

Remember to make the files executable.

3. How does it work?

On the latest kernel, the ric daemon is restarted whenever it

is killed. Therefore the following steps are taken by this

program to stop it without giving it time to reboot the system:

1) The programs runs as a daemon waiting for up to 60 seconds

for ric to start.

2) It detects which CPU ric was last scheduled on, and forces

ric to always run on that CPU in the future.

3) It forces itself to run on the same CPU as ric and sets its

scheduling priority to real-time. This prevents anything

in that CPU from running, including ric.

4) It mounts the rootfs read-write and replaces ric with a

dummy version that just sleeps forever. Finally it kills

the ric process and remounts rootfs read-only.

5) The daemon now exits. When ric is restarted the dummy

version is started instead.

4. What about unlocked bootloaders and custom kernels?

On custom kernels ric has either been removed or not installed

at all. Therefore this is only needed on locked bootloaders.

5. Can I use it in my own ROM?

Sure. Use it as you want.

6. How do I compile it?

You need to have the Android NDK installed. Then set the

correct paths in the included Makefile and run:

1) make prep

2) make

That's it. When you want to recompile you can skip step 1).

7. What license is this released under?

It is UNLICENSED software. See http://unlicense.org/