OnePlus OnePlus 6T
Manufacturer

OnePlus

Name

OnePlus 6T

Identifier

oneplus-fajita

System Type

android

SoC

qualcomm-sdm845

Architecture

aarch64-linux

Supports Stage-0

no

Source

Mobile NixOS repository

Builds

Building and installing

There are multiple installation methods for your OnePlus OnePlus 6T. They all rely on flashing one or more partitions on your device.

Warning

All installation methods can lead to data loss.

Flashing a partition will erase everything on the partition. Additionally, the common backups methods, e.g. TWRP, will not backup the userdata partition, which may be the installation target.

Make backups.

Using Fastboot

This will produce a folder with a flashing script, and the partition images for your OnePlus OnePlus 6T.

$ nix-build --argstr device oneplus-fajita -A outputs.android-fastboot-images

Alternatively, you can build a specific partition image:

$ nix-build --argstr device oneplus-fajita -A outputs.android-bootimg
$ nix-build --argstr device oneplus-fajita -A outputs.rootfs

The device will need to be booted in its bootloader, or fastboot, mode.

The boot images can be installed using the following command, assuming the android-fastboot-images output was used.

$ 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.

$ fastboot flash userdata system.img

Using a flashable zip

An alternative installation method is to use a flashable zip. The flashable zip can be built for your OnePlus OnePlus 6T using one of the following commands:

$ nix-build --argstr device oneplus-fajita -A outputs.android-flashable-bootimg
$ nix-build --argstr device oneplus-fajita -A outputs.android-flashable-system
$ nix-build --argstr device oneplus-fajita -A outputs.android-flashable-zip

The first two will flash only a specific partition. The last one contains the partitions of the two previous one.

The zip can either be copied to the device and selected in a compatible Android recovery, or sent to the device through adb sideload.

$ adb sideload /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-flashable-oneplus-fajita-boot.zip

By default it will flash to the system partition. Some configurations may change this to flash to the userdata partition. In that case, no warning is given before flashing.

Device-specific notes

First time setup notes

Update firmware

Make sure your device was updated to the latest OxygenOS 11. It may not be required, but this will reduce disparities.

Make sure the firmware partitions are consistent by using a recovery to flash copy-partitions-*.zip as described in the installation instructions of LineageOS

Again, it may not be strictly required, but this ensures a coherent single set of firmwares are present on-device where relevant. This is important as it is possible to have different versions flashed to different slots. This is why so many persons online have “only one slot that works”.

Prepare for mainline

Note

This assumes the phone will only run SDM845 mainline images.

You will need to erase the dtbo partitions for either slots.

 $ fastboot erase dtbo_a
 $ fastboot erase dtbo_b

Dual booting

This is not supported. Refer to other non-Android Linux instructions and adapt as needed. Here be snapdragons.