Sony Xperia 1 II (sony-pdx203)

Contributors

 * tath1nhhdk

How to enter flash mode
Before you can flash PostmarketOS, you'll need to unlock your bootloader as described on Sony's open devices portal. This may potentially void your warranty, be warned, and read the warnings that Sony provide also.

Once you've finished these steps, your device will have been wiped. Set up android if you want, you won't have any reason to get rid of it because UFS doesn't work at the moment (see below). Then, either:
 * Power off the device. Holding up on the volume rocker, plug the device into a computer.
 * (or, on android) get an adb shell and run.

Installation
For more info on UFS see below

Because UFS doesn't work, you'll want to flash the rootfs to an sdcard. Use. Take a look at partitioning to understand what's going on here.

You'll need to flash some empty bytes to the dtbo due to a bootloader bug. Create a file with two empty bytes with  and then flash it with

Then flash the kernel as usual, by putting the device into flash mode (fastboot) and then running.

Status
This device belongs to the Sony Edo platform, which is the Xperia 1 II (this one, pdx203), Xperia 5 II (pdx206) and the 2020 Xperia PRO (pdx204). This might warrant a common platform page if anyone gets their hands on another Edo.

Work has been done on the device trees in the mainline kernel by the folks over at somainline. The device does boot, but I can't get SSH to work, telnet works fine, also for some reason the initramfs cannot find my sdcard

UFS
The phone's internal storage is UFS. Sony's past devices have had a bug that will erase the phone's entire internal storage if you try to start up UFS on mainline, because one of the UFS commands is misimplemented. This includes wiping the bootloader, bricking the device FOR EVER.

We currently have UFS disabled in the device tree, which renders the device's internal storage unusable but means there is no chance of anything getting bricked. It should be possible to patch out this command and reenable UFS in dts on a device-specific kernel eventually.