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

Search This thread

Samir2298

Senior Member
Apr 3, 2015
223
20
Do you think the phone got encrypted in someway? Because when I was doing the flashing stuff I got lots of folders with weird names on the internal storage like the picture below(this is not mine but just the example of what I'm saying). They got deleted tho after I formatted data partition.
 

Attachments

  • encrypted_files_via_twrp.jpg
    encrypted_files_via_twrp.jpg
    272.4 KB · Views: 31

slickw

Senior Member
Jun 4, 2013
193
90
I got same error partition is too small but after flashing wit errors rom booted and works without problems.
Device is sunny rom is xiaomi eu.
I tought it was normal error since 8t didnt cause any problems
 
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.
2021/10/05 is not my build, but the new maintainer's. Try my previous builds or other roms & let me know.
 

Samir2298

Senior Member
Apr 3, 2015
223
20
I got same error partition is too small but after flashing wit errors rom booted and works without problems.
Device is sunny rom is xiaomi eu.
I tought it was normal error since 8t didnt cause any problems
Mine does boot also but I get errors like "SystemUI has stopped" and also wifi doesnt work. Plus I can't flash/sideload gapps thro TWRP or other recoveries.
 

Samir2298

Senior Member
Apr 3, 2015
223
20

Attachments

  • f718f47e-dfed-4f84-a77d-2c71c9524710.jpg
    f718f47e-dfed-4f84-a77d-2c71c9524710.jpg
    74.6 KB · Views: 37
  • Screenshot_6.png
    Screenshot_6.png
    10.4 KB · Views: 37
Last edited:

akoaypinoy

Senior Member
Aug 1, 2021
276
60
Well I flashed MIUI again and followed the Pixel Experience guide from here: https://telegra.ph/Pixel-Experience-MojitoSunny-04-17 But still I got errors. Take a look at screenshot.

Edit: I just tired PE with fastboot tool, got same error "Boot partition is smaller than boot image"
Did you try clean flash by mi flash tool? I've encounter that when I install lineageOS. Maybe similar on crdroid. I think you need clean flash by mi flash tool. In order to do that you must flash with Lock. Then unlock again bootloader . In mi flash I'm surely encounter you this on mi flash tool "metadata is not allowed on snapshot state" to fix that go to cmd and type this command

fastboot devices

Then

fastboot snapshot-update cancel


After that go back to mi flash tool and start the process to clean flash and lock.

Once you install rom like crdroid or lineageOS

Surely it happen for that... I don't know why it happen but I'll experience on that matter.
 

munimjaffer

Senior Member
Jul 3, 2015
241
34
22
Karachi
Because of this tool my Wifi and sound isn't working. I can't even flash any other ROM in recovery. Unable to flash fastboot ROM in mi flash tool as well. Please help !
 

sahbimath

Member
Oct 11, 2015
39
7
Because of this tool my Wifi and sound isn't working. I can't even flash any other ROM in recovery. Unable to flash fastboot ROM in mi flash tool as well. Please help !
I didn't check yet whether i'm able to go back to stock through mi flash, but i can't install anything through twrp or orange fox, not even adb sideloading works i guess, i'll try flashing a fastboot rom n ill go back again
 

munimjaffer

Senior Member
Jul 3, 2015
241
34
22
Karachi
I didn't check yet whether i'm able to go back to stock through mi flash, but i can't install anything through twrp or orange fox, not even adb sideloading works i guess, i'll try flashing a fastboot rom n ill go back again
and how would u flash a fastboot rom? I'm using mi flashtool and it gives me this error
1641402700484.png
 

DTFuser

Senior Member
Jul 1, 2014
118
4
With two different ROMs (PE 1.2 and official 12.5.4) i got the same error:"FAILED (remote:"Could not open super partition"). Then I tried with official MiFlash tool and I also got error while writing super partition "error: write_sparse_skip_chunk: don't care size 4254...) then I tried the third way. I tried to flash ROM from TWRP and that also failed because TWRP are unresponsive (like touchscreen is not working) and I cannot chose anything from opening menu.
Any suggestion on how to fix super partition or how to install any ROM, either from fastboot or from working recovery will be appreciated.
 

nierewa

Senior Member
Jan 22, 2018
141
1
11
I use cDroid 7.12 Version 2021117.
I want to update with TWRP (3.6.0_11-0) but get an error:

Error applying update: 7 /ErrorCode:: kInstallDeviceOpenError)
Device on super may not mount until rebooting recovery.

A help was this answer:
If you have flashed with OTA script before then go back to miui and come back bcoz partition layout of your device is messed up
Is there a fix for it?
 

StaryMuz

Senior Member
Dec 27, 2012
559
185
You quoted what you're supposed to do.:"... before then go back to miui ..."
Thus MiFlash, the "clear all" option.
 

nierewa

Senior Member
Jan 22, 2018
141
1
11
That would mean that I would have to flash Miui every time I update cDroid to be able to do this with TWRP.

A flash memory can not be rewritten forever again and again.
The last time I flashed MIUI for cDroid 8 ROM I got the message: " Gerätespeicherbeschädigung festgestellt. Das Gerät ist jetzt unsicher."

Is there no other way?
 

StaryMuz

Senior Member
Dec 27, 2012
559
185
You worry about memory wear unnecessarily. It is electronic memory and writing to it wears it out just as much as reading.
Trying to use TWRP all the time is wrong. Each ROM lists its own optimal upload and it is not always TWRP. For now, there is no perfect custom recovery and therefore a MiFlash cleanup may be necessary after some steps.
Plus, moving from a lower to a higher version of Android needs a clean new foundation.
 

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