Xiaomi Redmi Note 8 Pro
Manufacturer

Xiaomi

Name

Redmi Note 8 Pro

Identifier

xiaomi-begonia

System Type

android

SoC

mediatek-mt6785

Architecture

aarch64-linux

Supports Stage-0

no

Source

Mobile NixOS repository

Builds

Hydra (default build)

Building and installing

There are multiple installation methods for your Xiaomi Redmi Note 8 Pro. 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 Xiaomi Redmi Note 8 Pro.

$ nix-build --argstr device xiaomi-begonia -A build.android-fastboot-images

Alternatively, you can build a specific partition image:

$ nix-build --argstr device xiaomi-begonia -A build.android-bootimg
$ nix-build --argstr device xiaomi-begonia -A build.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 Xiaomi Redmi Note 8 Pro using one of the following commands:

$ nix-build --argstr device xiaomi-begonia -A build.android-flashable-bootimg
$ nix-build --argstr device xiaomi-begonia -A build.android-flashable-system
$ nix-build --argstr device xiaomi-begonia -A build.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-xiaomi-begonia-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

Note

Do not acquire a Xiaomi Redmi Note 8 Pro with the intent to run Mobile NixOS on it.

This is not a recommended device.

It is of utmost importance that you read and familiarize yourself with the CFW megathread. Not doing so will result in a brick.

Again, you will almost assuredly brick your phone unless you read, understand and follow instructions pertaining to the community CFW and the Redmi Note 8 Pro.

Finally, as a last warning, you will need the community CFW for the Redmi Note 8 Pro. Otherwise irrecoverably bricking is almost guaranteed.

Recovering from a brick, quick notes

If you’re told “Please select a valid authentication file or ask for help.” it may be a red herring as long as you were mindful of not flashing a stock Xiaomi preloader and lk, and sticking to CFW. Make sure you are not holding power or a volume key when you plug the device in.

It is unknown what is necessary to be flashed using SP Flash Tool when recovering a bricked device. For some bricks it seems that flashing only boot is required. For other bricks it seems more is needed.

Fastboot commands

With the engineering preloader and aboot (lk), unknown for the stock Xiaomi one, it is not possible to fastboot boot a boot image.