[HowTo] Flash Fastboot ROM with Linux


Muhamed

Members
Jun 24, 2014
342
67
Tutorial for flashing/install xiaomi.eu Fastboot ROM's (Android 12 - MIUI 13) over Linux-Terminal.
First of all we need adb and fastboot. We will get all what we need over android-tools:

0.png

Arch Based distros (Manjaro, EndeavourOS, etc.)
sudo pacman -S android-tools

Debian based distros (Ubuntu, Linux Mint, PopOS, etc.)
sudo apt install android-tools

RPM based distros (Fedora, RedHat, Opensuse, etc.)

sudo dnf install android-tools

1.png


Download the ROM -> extract -> right click (empty space in folder) -> open in Terminal

2.png


1. Connect the phone with USB cable
2. run -> adb devices
3. a windows will pop up on your Xiaomi smartphone -> press yes/ok and "never forget"
4. run -> adb reboot bootloader -> wait few seconds, your phone will reboot in fastboot mode
5. run -> fastboot devices -> you need to see a number (if not switch USB port/cable)
6. with -> ls -> check if u see the firmware files (if not you are in wrong folder)
7. now u got 2 options:
fresh install -> ./linux_fastboot_first_install_with_data_format.sh -> will wipe all data and only for first install
update rom -> ./linux_fastboot_update_rom.sh -> will update without wipe

3.png


You need to wait untill you see this:

4.png


Finished and Rebooting. This will not happen immediately, just wait untill your phone reboot, than u can close the terminal and disconnect USB cable.

- you can use USB 3.0/3.1 but it's useless, because all Xiaomi's only got USB 2.0
- use the original cable, some cable will not work, I use deleyCON USB 3.0 cable and its working with any phone
- some Debian distros need a "sudo", so not "adb devices" but "sudo adb devices", just before any command here sudo ...
- don't touch it, don't disconnect, just wait untill it reboots
- first boot after flash/install can be 5-10 min. -> just wait and don't panic
- generally it works on Linux without any issue, any USB port but some cable doesn't, the original one from the box works always
 
Quick update, I also try it on Fedora 35 (36 still not available)
1.png

2.png

It's working with USB 3.0 port and even on Type C USB 3.2 Gen 2 port but you need the sudo before any command.
3.png

4.png

This is just to take away the fear...
 
  • Like
Reactions: katerpanne
HI Muhamed, thank you this is really useful. I just want to check that this is going to be doable on my xiaomi.

1 I have lineageos 18.1 installed and need to upgrade to lineageos 19.1
2. The lineageos instructions say that I first need to upgrade android 11 to android 12: https://wiki.lineageos.org/devices/vayu/upgrade
3. The original xda guide I consulted suggested I would need windows to flash the fastboot, unless I was using a binary. What does this mean, and how is this different from a fastboot rom with a tgz extension, and where do I get it? https://www.xda-developers.com/how-...i-android-update-xiaomi-mi-redmi-smartphones/
4. Also, potentially relevant info: my phone reports that I have adroid 12 rather than miui. I don't know how this change happened - perhaps when I flashed lineageos. But now I can't do things like tap on the miui icon to access developer settings
 
@airmonkey as I know you don't need that if the ROM is official. In unofficial threads you will read "need to flash 12.x.xx.y than..."

For which device you looking for?
 
@Muhamed I'm looking to upgrade a Xiaomi Poco X3 Pro. I just want to confirm the process for upgrading Miui so that I can then go and upgrade LineageOS on the phone.
 
Hi Muhamed, so I've cleared up some questions in the interim. I think I can restate the basic problem as this:
1. I have pure android 11 on my phone, not miui
2. I want to upgrade to lineageos 19.1
3. To do that I need to get android 12 first
4. So: can I just flash muiu onto my phone following your instructions, and then upgrade to lineageos 19.1? And if so, anything to watch out for?
5. Or: do I need to find pure android and upgrade that? And if so, where do I do so?

Hope to hear from you soon!
 
I really don't know. I know in some cases they say flash 13.0.7.0 firmware first but don't know about Android upgrade if you need full flash like that or even if you can flash firmware like that on AOSP based ROM
 
Thanks very much Muhamed, I'll check this out elsewhere and let you know if I manage to find out a bit more.
 
Hi Muhamed,
Thank you very much for describing this method! It saved me a lot of time. It turns out that flashing a Fastboot ROM is much easier on Linux than on Windows (I had have many problems installing drivers for my Redmi Note 10s). And I use Manjaro too! Regards :)
 
Dear,

Few questions:
If I want to jump from Android 11 to Android 12 (Xiaomi Redmi Note 11 pro 5G), are the steps the same?
Is no secret, that in EU region Android 12 is stucked to upgrade at Redmi Note 11 pro 5G.
For this, bootloader has to be opened?
 
Dear,

Few questions:
If I want to jump from Android 11 to Android 12 (Xiaomi Redmi Note 11 pro 5G), are the steps the same?
Is no secret, that in EU region Android 12 is stucked to upgrade at Redmi Note 11 pro 5G.
For this, bootloader has to be opened?
the steps are the same for a fastboot rom. and the bootloader must be unlocked if you want to use a custom rom like xiaomi.eu
 
the steps are the same for a fastboot rom. and the bootloader must be unlocked if you want to use a custom rom like xiaomi.eu
Thanks for answer.
One more: if I want to put the official Fastboot ROM, still needs to be bootloader unlocked?
 
I'll try one more time before posting my question... sorry, I don't know how to remove it.
 
I have this error:
sudo: ./linux_fastboot_update_rom.sh: command not found
If I use sudo sh {comand} I have the next error:
bin/linux/fastboot cannot be executed.
Can someone help me please?
 
I have this error:
sudo: ./linux_fastboot_update_rom.sh: command not found
If I use sudo sh {comand} I have the next error:
bin/linux/fastboot cannot be executed.
Can someone help me please?
Why are you using sudo? fastboot doesn't need elevation of privilege.
 
Why are you using sudo? fastboot doesn't need elevation of privilege.
Maybe bc of this...
"- some Debian distros need a "sudo", so not "adb devices" but "sudo adb devices", just before any command here sudo ..."
I'll try one more time before posting my question... sorry, I don't know how to remove it.
Ask if you have some issue
I have this error:
sudo: ./linux_fastboot_update_rom.sh: command not found
If I use sudo sh {comand} I have the next error:
bin/linux/fastboot cannot be executed.
Can someone help me please?
For thos command you don't need sudo and never type sudo:

Like you see in the screenshot you don't need nothing before ./linux_fastbo...
 
Same error using Linux Mint LMDE
 

Attachments

  • Captura de pantalla de 2023-02-26 14-27-00.png
    Captura de pantalla de 2023-02-26 14-27-00.png
    847.9 KB · Views: 415