Install unofficial firmware on Xiaomi via Fastboot: from unlock to final setup

Installing custom firmware on Xiaomi devices via Fastboot mode is a process that requires careful and understanding of each step. Unlike standard updates via MIUI Updater, this method allows you to install alternative versions of Android (for example, LineageOS, Pixel Experience or ArrowOS), gain root access or restore a brick after unsuccessful experiments, but it comes with risks ranging from loss of warranty to complete failure of the device if you disrupt the sequence of actions.

In this article, we’ll take a look at the entire process, from preparing and unlocking the bootloader to direct firmware and post-installation settings. We’ll focus on the critical points that 90% of users miss: checking the firmware’s compatibility with the codename of the device (codenames like raphael for the Redmi K20 Pro) and using the MiFlash tool correctly to avoid anti-rollback errors. If you’re a beginner, we recommend reading the sections on risk and backup first, and they will save you from errors.

1.Preparation: What to do before the firmware

Before you start installing unofficial software, you need to follow a few critical steps, and ignoring them can lead to data loss, device locking, or even physical damage to the hardware (for example, when interrupting the firmware process).

First, back up all your data completely. Use Mi PC Suite (the official software from Xiaomi) or third-party utilities like TWRP (if you already have one installed). Note that backups through Google Account won't save SMS, call logs, or some application settings. For security, copy important files to an external drive or cloud.

  • πŸ“± Check the model and code name of the device: go to Settings β†’ The phone. β†’ Version. MIUI And then you tap Kernel Version a few times, and you can find a Device line in the menu that appears (like cepheus for Xiaomi Mi 9), which you need to use to select the right firmware.
  • πŸ”‹ Charge the battery to at least 70%. Fastboot firmware can take up to 30 minutes, and discharging in the process will cause a failure.
  • πŸ–₯️ Prepare your PC: install the latest versions of Xiaomi drivers (you can download it on the official website), ADB/Fastboot tools and archives (e.g, 7-Zip firmware-unpacking).
  • πŸ”— Download the firmware only from verified sources: XDA Developers, SourceForge (open source projects) or thematic telegram channels. Avoid files with.exe extensions - they may contain malware.

⚠️ Note: If your device was purchased in China (suffix version) CN In the model, the firmware of the global version (Global) can lead to problems with the modem (no network). EFS.

πŸ“Š What kind of firmware do you plan to install?
LineageOS
Pixel Experience
ArrowOS
MIUI caste (e.g. xiaomi.eu)
Another.

2 Unlocking the bootloader: official and informal ways

The bootloader on Xiaomi devices is locked by default, and unlocking it is a must before installing any unofficial firmware. The official method requires linking the Mi Account to the device and waiting for confirmation (usually 7-14 days). Unofficial methods (for example, through vulnerabilities in EDL) can work faster, but can risk blocking IMEI.

For official unlocking:

  1. Activate Developer Mode: Go to Settings β†’ About Phone and tap the MIUI version 7 times.
  2. Include OEM Unlock and USB Debugging in the Developer Menu.
  3. Link your Mi Account to your device in Settings β†’ Xiaomi Account.
  4. Download the Mi Unlock Tool utility from the official website and follow the instructions of the program.

If you don’t like the waiting period (720 hours), you can try to get around it. EDL-mode, but it requires a special cable (Deep Flash Cable) or soldering contacts on the board. This method is not recommended for beginners, as improper actions can lead to failure of the device.

Unlocking methodWaiting timeRisks.Tools required
Official (Mi Unlock)7-14 daysMinimum (the guarantee is lost)PC, Mi Unlock Tool, Mi Account
EDL (through vulnerability)5-10 minutesHigh (risk of blocking IMEI)Deep Flash Cable, Mi Flash Pro
TWRP (if already installed)1-2 minutesMedium (possible errors in firmware)Established TWRP, file disable_miui_anti_rollback.zip

⚠️ Warning: Once the bootloader is unlocked, all data on the device will be erased! This includes photos, contacts and installed apps. Don't rely on backups made through Mi Cloud - it's often impossible to restore them after custom software firmware is installed.

3. Selection and verification of firmware: how not to go wrong with the version

Firmware selection is the most common reason Xiaomi devices get β€œbricked”; even if the model name matches, firmware may not be compatible because of:

  • πŸ”„ Different code names (e.g. Redmi Note 8 has Ginkgo and Willow variants).
  • πŸ“‘ Regional modifications (firmware for Global is not suitable for China without patches).
  • πŸ”™ Anti-Rollback protection (installation of the old version of the software on the new device will block it).

To avoid problems:

  1. Check your device’s code name (see Section 1) and check it against supported models on the firmware page.
  2. Learn a topic with XDA Developers or 4PDA – there are usually known bugs and ways to get around them.
  3. If you install MIUI-based firmware (e.g. xiaomi.eu), make sure that the version is no older than the current official version.

Example: Poco F3 (codename alioth) will be suitable for Pixel Experience firmware marked alioth-13.0-20231010. Installing a version for aliothin (Indian modification) can lead to a broken modem.

What is Anti-Rollback and why is it dangerous?
Anti-Rollback is a protection mechanism in Xiaomi devices that prevents rollbacks to an older firmware version. If you try to install software with a lower build number than the current one, the device will be locked at the boot stage (this will appear β€œThis” MIUI version cannot be downgraded”). This can only be corrected by EDL-mode with full flashing of all sections, which requires special equipment.

4. Fastboot Firmware Process: Step-by-step instruction

When all the preparations are complete, you can start firmware. We will use the MiFlash utility (for official firmware) or fastboot commands (for custom ones).

Battery charge >70% | Xiaomi drivers installed on PC| Firmware unpacked in folder without Cyrillic | Fastboot (black screen with rabbit) | Antiviruses disabled (they can block MiFlash)

-->

Step 1: Transfer the device to Fastboot mode

Turn off your smartphone. Press the Volume down button. + Power for 10-15 seconds until you see a screen with a rabbit in a hat, connect the device to the PC through the USB-cable (preferably original).

Step 2. Check the connection

Open the command line (Win + R β†’ cmd) and type:

fastboot devices

If the device is determined (the serial number will appear), you can continue. If not, check the drivers or try another one. USB-port.

Step 3: Firmware via MiFlash (for official firmware)

  1. Unpack the downloaded firmware (.tgz or.zip format) into a folder without spaces and Cyrillic.
  2. Open MiFlash, press Select and point the way to the firmware folder.
  3. At the bottom, select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader).
  4. Press Refresh – your device should appear in the list.
  5. Click Flash and wait until it is completed (usually 5-15 minutes).

Step 4: Firmware custom software through fastboot commands

For informal firmware (like LineageOS), you usually need to manually flash each partition. Example commands for the Redmi Note 10 Pro (sweet):

fastboot flash boot boot.img


fastboot flash dtbo dtbo.img




fastboot flash recovery recovery.img




fastboot flash system system.img




fastboot flash vendor vendor.img




fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img




fastboot reboot

⚠️ Warning: If the device has been stuck on the logo for more than 10 minutes after the fastboot reboot command, don’t try to turn it off with the power button! plug it in and wait another 20 to 30 minutes – sometimes the first download takes a long time due to app optimization.

πŸ’‘

If MiFlash gives you a "Couldn't find partition" error, try manually specifying the path to the file. flash_all.bat Open the command line in this folder and execute the command. flash_all.bat.

5. Typical errors and their solutions

Even with the correct following of the instructions, there can be problems, and the following are the most common mistakes and ways to fix them.

Mistake.Reason.Decision
This package is for"xxx" devices; this is a"yyy"The firmware is not suitable for your model.Check the code name of the device and download the correct version.
Anti-rollback check failReverse to the old version of MIUISwipe through a newer official firmware, then try again
Device is lockedThe bootloader is not unlockedReturn to Section 2 and unlock the
The device does not turn on after firmwareNo critical sections are stitched (e.g. vbmeta)Repeat the flag firmware --disable-verity

If the device boots after firmware, but there are problems (for example, the camera or mobile network is not working), most likely, the firmware is incompatible with your region.

  • πŸ” Check the error log via adb logcat (required to be enabled) USB Debugging).
  • πŸ”„ Install a patch for the modem (look for the 4PDA device-model).
  • πŸ“₯ Try a different firmware build (for example, go from Global to EEA).

πŸ’‘

If the device doesn't turn on or respond to buttons after the firmware is done, don't panic. In 90% of cases, it can be restored via EDL mode, but it will require a special cable or soldering of test points on the board.

6. Post-installation setting: what to do after firmware

Once the firmware is successful, the device requires additional customization. Here's what you need to do first:

  1. Check the basic functions: calls, mobile internet, Wi-Fi, Bluetooth, camera and sensors (gyroscope, compass). If something doesn't work, go back to section 5.
  2. Update your firmware to the latest version: Many custom software (for example, LineageOS) support OTA-Update through the built-in Settings menu β†’ System system β†’ Update.
  3. Install GApps (if required): Most custom firmware does not include Google services. Download the appropriate Open GApps package (choose arm64 for modern devices) and run it through TWRP.
  4. Set up root access (optional): If you need superuser rights, install Magisk via TWRP or boot.img patch.

To improve productivity and battery life:

  • πŸ”„ Turn off unnecessary background processes in Settings β†’ Annexes.
  • πŸ“΅ Set up Battery Saver mode to save charge.
  • πŸ›‘οΈ Install an alternative launcher (like Nova Launcher) to speed up the interface.

If you have installed MIUI-based firmware (e.g. xiaomi.eu), pay attention to additional settings:

  • 🌐 Include Second Space to separate work and personal space.
  • πŸ”’ Set up App Lock to protect confidential applications.
  • 🎨 Activate Super Wallpapers for dynamic wallpapers (not available on all devices).

7 Risks and how to minimize them

Installing unofficial software always involves risks, but they can be reduced by following several rules:

1. Loss of guarantee

Unlocking the bootloader automatically voids the Xiaomi warranty, and if you need maintenance, you can return the device to its original state:

  • πŸ”„ Sweep through the official firmware through MiFlash in clean all and lock mode.
  • πŸ“± Perform reset to factory settings in Settings β†’ Additionally. β†’ Recovery and discharge.

However, some service centers may detect traces of unlocking even after these actions.

2. IMEI or modem lock

This problem is more common when you run firmware through EDL or use incompatible firmware, to avoid it:

  • πŸ“‘ Always check firmware compatibility with your model and region.
  • πŸ”§ If the modem has stopped working, run the modem sections separately and EFS firmware.

3. Data loss

As mentioned earlier, the firmware erases all data to minimize the loss:

  • ☁️ Use cloud services to back up photos and contacts (Google Photos, Mi Cloud).
  • πŸ’Ύ Create a local copy through TWRP (if fitted, or ADB Backup.

⚠️ Note: Some banking applications (e.g. Sberbank Online or Tinkoff) may block work on devices with unlocked bootloader or root access. If these services are critical to you, consider using a second phone for experiments.

FAQ: Frequent questions about Xiaomi’s firmware through Fastboot

Can I flash Xiaomi through Fastboot without unlocking the bootloader?
No, unlocking the bootloader is mandatory for any unofficial firmware installation, without which the device simply will not allow data to be written to system partitions, except for the firmware of official updates via MiFlash in save user data mode, but this is not the case with custom software.
What if MiFlash can’t see the device?
Try the following steps: Make sure Xiaomi drivers are installed (check in Device Manager). USB-cable USB 2.0 (sometimes USB 3.0 Run MiFlash on behalf of the administrator. Try another PC or virtual machine with Windows. 10/11. If nothing helps, check if your device is detected in fastboot mode via the command line (fastboot devices).
How to return the official firmware after custom?
To return to stock MIUI: Download the official firmware for your model from Xiaomi. Unpack it and run it through MiFlash in clean all mode. If you want to lock the bootloader, select clean all and lock mode. After that, the device will return to factory condition, but the warranty will not recover.
Why is the mobile network not working after the firmware?
This problem is usually related to: Incompatibility of the firmware with the region of the device (for example, Global firmware on the Chinese model), lack of modem files or EFS In the custom firmware, incorrect settings. APN (Check in the settings β†’ SIM-maps and mobile networks β†’ Access points (APN)). Solution: Sweeve the official firmware, then re-install the custom room with a modem patch.
Can I flash Xiaomi via Fastboot on Mac or Linux?
Yes, but with some caveats: macOS requires fastboot to be installed via Homebrew (brew install android-platform-tools). On Linux, use a fastboot package from repositories (sudo apt install fastboot for Debian/Ubuntu). MiFlash only runs on Windows, so the official firmware will require a virtual machine. fastboot commands are the same for all OSes, but file paths may differ (e.g../fastboot instead of just fastboot).