[Sony Xperia Z Ultra] astronfestmon:
http://d-h.st/NxCF

I hope it's working :)

PS:

If my new boot.img does not work try my oldest or minato bootimg to flash.

Bring-up of Sony Xperia line of devices based on CM 12.1 tree.

Tested on Z1, Z Ultra, Nexus 5

== Useful key combinations ==

Before you attempt flashing an Ubuntu image to your device, these key combinations should help you switch between phone modes.

* Vol UP pressed + insert USB cable -> fastboot mode

* Vol DOWN pressed + insert USB cable -> flash mode (used by Sony tools)

* Vol UP + POWER, both pressed during 30 seconds -> hard reboot

* Vol DOWN + POWER, no USB cable, stop pressing POWER after vibration -> recovery mode when it has been enabled and has a proper image (see below)

* Small red button next to SIM, press it for a few seconds (you need a clip) until you get 3 vibrations -> power off

=== Useful packages ===

sudo add-apt-repository ppa:phablet-team/tools
sudo apt-get update
sudo apt-get install phablet-tools

sudo apt-get install git gnupg flex bison gperf build-essential \
zip bzr curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool \
g++-4.8-multilib

== Current images ==

Built images are ready to flash on a device. Ensure you download the boot.img and ubuntu.img files and then follow the flashing instructions below.

== Flashing Ubuntu ==

1. Unlock the boot loader [[http://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader|following Sony's instructions]]

2. Make sure that you have Android 5.1.1 in your Z1. Otherwise, flash it using the [[http://developer.sonymobile.com/services/flash-tool/how-to-download-and-install-the-flash-tool/|Sony official tools]] or [[http://www.flashtool.net/index.php|unofficial tools]] that run in Ubuntu.

3. After that you can use {{{fastboot}}} to flash the images, by running these commands on the terminal:

sudo fastboot -S 256M flash boot boot.img
sudo fastboot -S 256M flash system system.img

== Compiling from scratch ==

Alternatively, in addition to the ready-made images, if you want to contribute to development or modify those images, you can build them yourself following these instructions.

These assume you've got knowledge of building software and you are familiar with the Ubuntu and Android source code.

Current source tree is compatible with Sony’s binary blobs version 19a

mkdir phablet && cd phablet

repo init -u https://github.com/ubports/android -b ubp-5.1

repo sync

git clone https://github.com/vic3t3chn0/device_sony_togari_ubuntu.git

. build/envsetup.sh

lunch -> Select desired target e.g Z Ultra cm_togari-userdebug
make -j8

this is optional step, if you want to use specific channel to build ubuntu root from, for example . ubuntu/prebuilts/prepare-ubuntu-packages-for-build -d generic -c rc-proposed/ubuntu-pd

make ubunturootfsimage -j8 -> build will downloads ubuntu rootfs and custom packages for default channel rc-proposed/ubuntu channel

Additional steps:
Get the TheMuppets sony vendor, copy the rhine vendor folder to a new anme called rhine-togari and name it inside rhine-togari vendor you will see it.
make this important step:
mkdir -p out/target/product/togari/dtbs
cp device/sony/togari/dtbs/* out/target/product/togari/dtbs

build it.

Optional steps:

Use custom channel to build Ubuntu rootfs from:
after step 6 run: . ubuntu/prebuilts/prepare-ubuntu-packages-for-build -d generic -c rc-proposed/ubuntu-pd

For 64bit devices (Z5, Z5c, Z4 tablet) custom build of libhyrbis needs to be used, to fix GPU crash
Run following after step 6

git clone https://code-review.phablet.ubuntu.com/ubuntu/libhybris-prebuilt ubuntu/libhybris-prebuilt -b personal/w-ondra/phabket-5.x-kitakami
mmm ubuntu/libhybris-prebuilt/
make snod

== Port status ==

The port is in its early steps and feature set differs between devices, there are many things that do not work. Some of the stuff that does work is:

|| '''Device''' || '''what is working''' || '''known issues''' ||

|| Z1 (honami) || Unity8/wifi/SMS/data/audio || Power handling/BT/camera/MHL/phone calls ||

|| Z Ultra (togari) || Unity8/wifi/SMS/data/audio || Power handling/BT/camera/MHL/phone calls ||

|| Z5 (sumire) || Unity8/wifi/SMS/data/audio || Power handling/BT/camera/MHL/phone calls ||

|| Z5 compact (suzuran) || Unity8/wifi/SMS/data/audio || Power handling/BT/camera/MHL/phone calls ||

== Generic known issues ==

* Power handling.

* Device does not power off completely. When usb cable is plugged and unplugged, power button fails to switch off screen.

* suspend does not works properly

* MHL does not work

* Camera does not work and eventually crashes device

* phone calls do not work

* generic stability

Do not forget to donate me. Press the link in my profile.