How to install the kernel through Fastboot on Xiaomi: step-by-step instructions

Modifying the Android operating system on Xiaomi devices often starts with trying to install a custom kernel, allowing you to root, overclock the processor or significantly extend battery life. However, standard methods of updating through recovery are not always suitable, especially if you change the partition structure or restore the system after a failed experiment.

Using Fastboot mode is the most reliable way to directly record a kernel image in a device’s memory, a method that requires careful attention because it works at a low level and bypasses many software protections, but when executed correctly, it guarantees results even when the phone is not booting into the system. You’ll need a computer, an original cable, and a little patience.

Before you start taking action, make sure you understand the risks. Fastboot is a fast-paced process. If the cable goes off at a critical moment or the laptop loses power, the device can turn into a brick. However, for power users, this is a standard procedure that allows you to have full control of your smartphone.

Environment preparation and necessary tools

The first step is to build the software on your computer. Without a properly configured environment, communication with Xiaomi is impossible. You will need to install ADB and Fastboot drivers, which are part of the Android SDK Platform Tools. This is the basic set of ulites for any modder.

It is also critical to have original USB-Cheap charging cables often don't have data lines, which will cause connection errors.The computer needs to see the device as Android Bootloader Interface in Windows Device Manager.

  • πŸ“¦ Download the Platform Tools archive from Google’s official website.
  • πŸ”Œ Use only the original cable or quality analogue with support.
  • πŸ’» Install universal Google drivers USB Driver or specific to Xiaomi.
  • πŸ“‚ Create a folder on the disk C:\, Where to put all the files for ease of work.

⚠️ Warning: Make sure the battery charge of the device is at least 60%.Sudden power outage during memory partition writing can cause permanent damage to the bootloader.

β˜‘οΈ Firmware readiness check

Done: 0 / 5

Unlock the bootloader and log into Fastboot mode

Without an unlocked Bootloader, recording any images other than the official ones is impossible. On Xiaomi and Redmi devices, this procedure is officially supported, but requires a wait of 7 to 168 hours after the Mi Account is linked to the device.

To enter fastboot mode, you need to turn off your smartphone and press the button combination. This is usually a Volume Down button when you connect the cable to your computer, and an image of a rabbit repairing an android will appear on the screen, signaling that the device is ready for commands.

If the bootloader is already unlocked, you can immediately go to the firmware. Otherwise, use the Mi Unlock Tool utility. The unlocking process will completely remove all data from the device, so backup is mandatory.

What if Mi Unlock can’t see the phone?
If the utility doesn't respond, try reinstalling the drivers in Device Manager. Find the device with the exclamation mark, select "Update driver" ->"Select from the list" ->"MTP USB Device or Android Bootloader Interface. USB-port, preferably USB 2.0, located on the motherboard behind the system unit.

Search and Prepare a Kernel Image (boot.img)

The centerpiece of the procedure is the boot.img file. This is a binary image containing the Linux kernel and the initial file system (ramdisk), which you take strictly from firmware that matches your current version of MIUI or HyperOS, or from the assembly of a custom kernel designed specifically for your model.

If you're taking an image from stock firmware for the Magisk patch, make sure the firmware version matches the one installed on the phone. Version mismatch can lead to bootloop (cyclical reboot). The file is usually extracted from the Fastboot firmware archive.

Place boot.img in the same directory as adb.exe and fastboot.exe executables, which will make it easier to enter commands, as you don’t have to specify full paths to the files.

File typeDescriptionRisk of use
boot.imgThe main core and ramdiskMedium (main modification file)
recovery.imgSection of the reconstruction sectionHigh (may lose access to the reset)
vbmeta.imgChecking the integrity of the loaderCritical (disables system protection)
dtbo.imgDevice description tableHigh (may not earn screen/touch)

πŸ’‘

If you use a custom core (such as KCSTSU or XANMOD), read the description on the 4PDA or XDA forum carefully. Authors often specify specific requirements, such as the mandatory presence of a certain Recovery or Android version.

The process of installing the kernel through the command line

Now, let's get to the practical part: Open the command line (cmd) or PowerShell in the tool folder. First, check the connection to the device. Type in the command fastboot devices. If you see the serial number of the device, then the connection is established correctly.

To record an image, use flash. The syntax is simple: first the partition name, then the path to the file. In this case, the partition is called boot.

fastboot flash boot boot.img

Once the recording is successful, the terminal will issue a message Finished successfully. Now you need to restart the device, this can be done by turning off the cable and holding the power button, or programmatically using the command fastboot reboot. The first start after a kernel change can last longer than usual - up to 5-7 minutes.

  • πŸš€ Enter fastboot flash boot boot.img start-up.
  • ⏳ Wait for the report of the successful completion of the operation.
  • πŸ”„ Enter fastboot reboot to reboot your smartphone.

πŸ’‘

Successful writing of a boot.img file via Fastboot is an irreversible action. The old kernel will be overwritten with new data, so the original file must be guaranteed to the workers.

Solving errors and problems in firmware

There may be errors in the process. One of the most common is FAILED (remote: device is locked), which means that the bootloader is locked, and this can only be solved through the official unlock procedure through Mi Unlock, because without it, you can not bypass the protection.

Another common problem β€” FAILED (remote: flash write failure or timeouts. USB-Try connecting the cable directly to the motherboard, avoiding USB-Hubs, you may also need to put the device in mode. EDL (Emergency Download, if the standard Fastboot does not respond.

⚠️ Warning: If you run your phone into an endless reboot, don't panic. 15-20 seconds to force reboot in Fastboot and try flashing the original (stock) boot.img, which you have kept in advance.

πŸ“Š What problem have you encountered most often?
Error "device is locked"
Phone is not defined by PC
Bootloop after firmware
It was a success for the first time.

Checking the operation of the new core and rolling back changes

Once you boot the system, you should make sure that the new kernel is actually working, and you can use applications like CpuInfo or AIDA64 to do this. The Kernel section should show the version that matches the installed file. Also check for Wi-Fi, Bluetooth and cameras, as custom cores sometimes have driver problems.

If you don't like the result or the system is unstable, you need to roll back. boot.img. The procedure is identical to installation: connect to Fastboot and flash the original command fastboot flash boot original_boot.img.

Regularly creating backups of the current configuration is the golden rule of modding: Keep copies of working kernel images on a cloud disk or computer, which will save you hours of firmware search in case of critical failures.

Can I update the kernel without unlocking the bootloader?
No, Fastboot's standard methods are not to write a modified kernel to a locked bootloader; Verified Boot does not allow untested code to run; the only option is to exploit vulnerabilities, but they are rare, depend on the specific model and version of the software, and are not stable.
What if the fastboot device team can’t see the phone?
Check Windows Device Manager if the device is defined as "Unknown Device" or"QUSB_BULK", If it shows up as Android without sub-items, try installing the drivers manually, pointing the path to the driver folder. ADB/Fastboot. Try another one. USB-port.
Is it dangerous to stitch the core from another Xiaomi model?
Absolutely, yes, the kernel contains hardware-specific drivers (screen, touchscreen, camera, modem), and the kernel from another model is guaranteed to render the device inoperable (black screen, no connection) and require recovery through EDL with account authorization.