How To Guide [Tool] Flash Custom ROMs through Fastboot [mojito / sunny]

Search This thread
After the initial run, the script wanted to delete the image folder it didn't find at the end. On subsequent runs this was no longer a problem. Why this happened I did not find out.

After running the script, the ROM was unpacked and the boot.img was loaded.
Rebooted into PixelExp. recovery, instead of TWRP.
Then came the errors of the next flash.
When I modified the script for flash boot_a/b, it worked correctly.
Are you using updated script ?
 

StaryMuz

Senior Member
Dec 27, 2012
559
185
Bit of a problem to verify. When the img files unpacked in the root folder were not automatically deleted, I deleted them manually. I accidentally deleted the bat file with them. So I had to extract it again. I then edited the a/b flash in the new one. At this point I don't have time to take the whole phone out of service again and try everything again.
 
Bit of a problem to verify. When the img files unpacked in the root folder were not automatically deleted, I deleted them manually. I accidentally deleted the bat file with them. So I had to extract it again. I then edited the a/b flash in the new one. At this point I don't have time to take the whole phone out of service again and try everything again.
I've removed deletion commands in the last update, just because the images might be useful to have even after installation.
 

Abdullah.Csit

Recognized Contributor
Feb 14, 2014
740
698
Iraq
Redmi Note 9 Pro
Redmi 9
Hello again 😀

At first I would thanks you again for well-support & updating tool every time.

But, I don't know why Some roms not working with this tool such as (Project Lighthouse, PixelPlusUi,...) it just sticking on:

"Checking Product information..."

Even I had face this issue while trying to flash Stock Indonesian MIUI recovery rom.

Thanks in advance
Regards
 
Hello again 😀

At first I would thanks you again for well-support & updating tool every time.

But, I don't know why Some roms not working with this tool such as (Project Lighthouse, PixelPlusUi,...) it just sticking on:

"Checking Product information..."

Even I had face this issue while trying to flash Stock Indonesian MIUI recovery rom.

Thanks in advance
Regards
I've removed "product info check" on last update (18th). Get it again.
Also per slot max capacity supported by our device is around 4.5gB. If any rom crosses it's total capacity above that, flash wouldn't be successful.

To use the tool right way, run the script on a ROM without connecting device. After extraction & sparsing steps, calculate the size of images inside root (system, system_ext, product, vendor). If the total is below 4.5gB, then you can continue connecting device.
If it crosses 4.5gB, then the script fails in the middle.
 

Abdullah.Csit

Recognized Contributor
Feb 14, 2014
740
698
Iraq
Redmi Note 9 Pro
Redmi 9
I've removed "product info check" on last update (18th). Get it again.
Also per slot max capacity supported by our device is around 4.5gB. If any rom crosses it's total capacity above that, flash wouldn't be successful.

To use the tool right way, run the script on a ROM without connecting device. After extraction & sparsing steps, calculate the size of images inside root (system, system_ext, product, vendor). If the total is below 4.5gB, then you can continue connecting device.
If it crosses 4.5gB, then the script fails in the middle.

Didn't use latest update because on changelog it's talking about Ubuntu, Linux and mac. so Skipped it since I'm on windows.

The roms size is below 4.5 . Anyway I will try your trick next time and will see.

Thanks 😊
 
Didn't use latest update because on changelog it's talking about Ubuntu, Linux and mac. so Skipped it since I'm on windows.

The roms size is below 4.5 . Anyway I will try your trick next time and will see.

Thanks 😊
Haha, It's just a changelog for linux script.
And ya, apologize for not including that changelog. Hope you can work out the script without issues.
 
  • Love
Reactions: Abdullah.Csit

Samir2298

Senior Member
Apr 3, 2015
223
20
I get error "boot partition is smaller than boot image" when flashing rom. Please help
 

Attachments

  • Screenshot_4.png
    Screenshot_4.png
    27.2 KB · Views: 23

Samir2298

Senior Member
Apr 3, 2015
223
20
Yes, bootloader is unlocked.

I guess slots have nothing to do with it. I already used this command "fastboot --set-active=b" and then tried to flash again but the problem still persists.

Looking at the error, it seems boot partition is messed up and needs to be resized somehow.

Edit: On the first page, you stated " After Installation, it'll be headed to recovery: You can format to start fresh (or) Just boot up, for dirty flash way". I want to know what recovery is it supposed to run, los, twrp or orangefox? Because after flashing, mine goes straight into MIUI recovery menu.
 

Attachments

  • d32f1ad4-dcad-4a4a-9ead-31b949f8e289.jpg
    d32f1ad4-dcad-4a4a-9ead-31b949f8e289.jpg
    21.7 KB · Views: 7
Last edited:
Yes, bootloader is unlocked.

I guess slots have nothing to do with it. I already used this command "fastboot --set-active=b" and then tried to flash again but the problem still persists.

Looking at the error, it seems boot partition is messed up and needs to be resized somehow.

Edit: On the first page, you stated " After Installation, it'll be headed to recovery: You can format to start fresh (or) Just boot up, for dirty flash way". I want to know what recovery is it supposed to run, los, twrp or orangefox? Because after flashing, mine goes straight into MIUI recovery menu.
You can't resize boot. It's physical & fixed. Check the downloaded rom. Also try other roms, & lmk if u have the same issue.
Also make sure get the recent tool & extract it from scratch.
 

Samir2298

Senior Member
Apr 3, 2015
223
20
You can't resize boot. It's physical & fixed. Check the downloaded rom. Also try other roms, & lmk if u have the same issue.
Also make sure get the recent tool & extract it from scratch.
I already did everything from scratch. By that I mean flashed MIUI thro MI Flashtool, locked bootloader and started all over again and also redownloaded the ROM(crdroid) but the problem is still there.

I did try other roms not through the fastboot tool but TWRP. And I get errors.
 

Attachments

  • 2d7d90f0-0800-469e-af54-c4ba7c0fbc21.jpg
    2d7d90f0-0800-469e-af54-c4ba7c0fbc21.jpg
    62.9 KB · Views: 17

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    I'm aware of that, this is mostly a general question about the payload.bin files, and if you look at black shark forum it's just a graveyard
    we can't help here because it's a completely different device ...
    maybe you should post your issue on General Questions and Answers
    1
    @storhaugey Stock recovery can't flash a custom rom/gsi as they aren't officially signed by xiaomi.
    Either use a custom recovery, or just use fastbootd to flash those images manually
    Code:
    fastboot reboot fastboot
    fastboot flash <img-type> <file.img>
    ...
    fastboot erase userdata
    fastboot reboot
  • 12
    Are you struggling to install custom roms on this device?
    Lots of recovery errors?
    Can't boot to any rom?
    Don't worry. Fastboot is a good way to avoid such nonsense...
    ota-update-using-adb-fastboot_proc.jpg

    Install any custom rom & miui recovery rom through fastboot

    Steps:
    1. Extract Fastboot OTA Tool. Put the ROM zip in it's root.
    2. Run the flash script.
    3. Wait till the script asks for device.
    4. Boot device to fastboot & connect.

    After Installation, it'll be headed to recovery:
    You can format to start fresh (or)
    Just boot up, for dirty flash way

    Windows users:
    Make sure you have usb drivers installed through manual method. This is done only once.
    Refer this on how to install them... Download USB Drivers from here.

    Linux users: Must have latest python & pip

    For Ubuntu distros:
    sudo apt install python python-pip
    And have an alias into ~/.bashrc or ~/.bash_aliases file:
    alias python=python3

    For Arch based distros:
    sudo pacman -S python python-pip

    For Fedora:
    sudo dnf install snapd python3.9 python3-pip

    For Mac users, make sure you allow img2simg tool from Privacy & Security to work. Or Disable Gatekeeper temperorily.

    Thanks to @LoV432 for his auto extraction idea.
    & @lyoko_xana to bringup Mac issues.
    If you have any trouble using this tool, please feel free to reply here...

    Happy flashing
    5
    -------------------------------------------------
    Changelog (2021-10-31):
    -------------------------------------------------
    - Fixed extraction issues
    - Updated fastbootd to 12.5.3
    - Implemented snapshot update-cancel
    - Partition size limit warning in linux/mac script
    - Logfile auto generation in linux/mac script
    3
    According to the script, it is used exclusively for pure flash.
    Can you please make an option for upgrade (dirty flash) as well?
    It does dirty flash bydefault (caz it doesn't affect data partition). It'll be clean flash only when you wipe from recovery at post install... 🙂
    I've edited post & clarified this...
    2
    Update: 18/08/21

    Changelog:
    • Switched to 12.5.2 stock fastbootd
    • Fixed fastboot issues on ubuntu
    • Separate scripts for linux & mac from now
    2
    !! Fastboot OTA Tool Update !!

    Fastboot_OTA_20210802.zip
    Usage instructions in the main post.
    There is an error in the script (probably by copying).

    echo Flashing boot partitions...
    tools\fastboot %* reboot bootloader
    tools\fastboot %* flash boot_a boot.img
    tools\fastboot %* flash boot_b boot.img
    tools\fastboot %* flash vendor_boot_b vendor_boot.img
    tools\fastboot %* flash vendor_boot_b vendor_boot.img