Install LineageOS on Xiaomi POCO F4
Flashing additional partitions
- Download the following files from here .boot.img
- Power off the device, and boot it into bootloader mode:With the device powered off, hold Volume Down + Power. Keep holding both buttons until the word “FASTBOOT” appears on the screen, then release.
Flash the downloaded image files to your device by typing:fastboot flash boot boot.img
Installing Lineage Recovery using fastboot
- Download Lineage Recovery. Simply download the latest recovery file, named
vendor_boot.img.warning - IMPORTANT: Other recoveries may not work for installation or updates. We strongly recommend to use the one linked above!
- Connect your device to your PC via USB if it isn’t already.
If your device isn’t already in fastboot mode, on the computer, open a command prompt (on Windows) or terminal (on Linux or macOS) window, and type:adb -d reboot bootloader
- You can also boot into fastboot mode via a key combination:
- With the device powered off, hold Volume Down + Power. Keep holding both buttons until the word “FASTBOOT” appears on the screen, then release.
Once the device is in fastboot mode, verify your PC finds it by typing:fastboot devices
- If you don’t get any output or an error:
- on Windows: make sure the device appears in the device manager without a triangle. Try other drivers until the command above works!
- on Linux or macOS: If you see
no permissions fastboottry runningfastbootas root. When the output is empty, check your USB cable (preferably use a USB Type-A 2.0 one or a USB hub) and port! - check
- TIP: Some devices have buggy USB support while in bootloader mode, if you see
fastboothanging with no output when using commands such asfastboot getvar ...,fastboot boot ...,fastboot flash ...you may want to try a different USB port (preferably a USB Type-A 2.0 one) or a USB hub.
Flash recovery onto your device:fastboot flash vendor_boot vendor_boot.img Now reboot into recovery to verify the installation.Type the command:fastboot reboot-recovery
Installing LineageOS from recovery
- Download the LineageOS.zip file that you would like to install or build the package yourself.
- If you are not in recovery, reboot into recovery:With the device powered off, hold Volume Up + Power. Keep holding both buttons until the “MI” logo appears on the screen, then release.
- Now tap Factory Reset, then Format data / factory reset and continue with the formatting process. This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one).
- Return to the main menu.
- Sideload the LineageOS
.zippackage but do not reboot before you read/followed the rest of the instructions!On the device, select “Apply Update”, then “Apply from ADB” to begin sideload. - On the host machine, sideload the package using:
adb -d sideload filename.zip.check - TIP: After the package is installed, recovery will inform you that reboot to recovery is required to install add-ons. In case you want to do that, please select “Yes,” otherwise “No”.
- check
- TIP: Normally, adb will report
Total xfer: 1.00x, but in some cases, even if the process succeeds the output will stop at 47% and reportadb: failed to read command: Success. In some cases it will reportadb: failed to read command: No errororadb: failed to read command: Undefined error: 0which is also fine.
Installing Add-Ons
WARNING: If you want to install Google Apps add-on package (use the arm64 architecture), you can download it from here. This add-on needs to be installed before booting into LineageOS for the first time!
- Click
Apply Update, thenApply from ADB, thenadb -d sideload filename.zipfor all desired packages in sequence. - When presented with a screen that says
Signature verification failed, clickContinue. It is expected as add-ons aren’t signed with LineageOS’s official key!
Once you have installed everything successfully, you can now reboot your device into the OS for the first time!
- Click the back arrow in the top left of the screen, then “Reboot system now”.