Sony Xperia XA2
Manufacturer

Sony

Name

Xperia XA2

Identifier

sony-pioneer

System Type

android

SoC

qualcomm-sdm660

Architecture

aarch64-linux

Source

Mobile NixOS repository

Builds

Hydra (default build)

Building

This will build the default output for your Sony Xperia XA2.

$ nix-build --argstr device sony-pioneer -A build.default

Installation

The device will need to be booted in its bootloader, or fastboot, mode. The boot image can be installed using the following command, assuming it was built using the previous command.

$ result/flash-critical.sh

If you have a system image (system.img) built, you can use fastboot to flash it to the device. Note that it might be too big to fit over the system partition. In such case, it can be flashed on the userdata partition.

Warning
This will erase everything on the partition. Additionally, the common backups methods, e.g. TWRP, will not backup the userdata partition.
$ fastboot flash userdata system.img

Device-specific notes

Fastboot

This device has a quirky way to get to fastboot.

  • You have to have the device connected to a computer, or else it will not activate fastboot mode.

  • Fastboot shows nothing on the display

With the phone connected to a computer, hold volume up and somehow cause a reboot (from the system, or by holding power to force reset).

Alternatively, from a powered-off state, hold volume up and connect to your computer.

Finally, you can always trigger a reboot to bootloader via software. From within Mobile NixOS, sudo reboot bootloader, or from an Android-based system using adb reboot bootloader or equivalent methods.

Note that the LED will light up blue when in fastboot mode.