[Xiaomi Mi A2 / 6X Questions & Answers] TheseAreNotTheDroids:
EDIT 4: It works now! I'm in stock again. Praise jebus. I flashed this https://bigota.d.miui.com/V10.0.10....0.PDIMIXM_20190611.0000.00_9.0_9e6473956a.tgz that was linked at the top of this thread: https://xdaforums.com/mi-a2/how-to/ota-v9-6-5-0-odimife-t3823445

EDIT 3: some weird stuff going on. I finally installed a the android-sdk-platform-tools package from the AUR and it had fastboot in it. It replaced the fastboot that I had installed that came from the official Arch Linux repositories and it seems to be flashing the official fastboot image without giving me any of the assertion errors I was getting before. fingers crossed.

EDIT 2: Ok. That didn't work. I finished flashing all the OTA partition images but the phone just started bootlooping. I'm still troubleshooting and will try to post an update if I figure out how to get stock working again on my device.

EDIT: I think I found a way to get it working. I'm still in the process of flashing my phone, but I haven't gotten any errors yet with the way I'm doing it now.

I downloaded the latest OTA zip file and used the payload_dumper python script to extract the partitions from the payload.bin file. Then I flashed each partition by manually entering in the fastboot commands. I got the idea from this thread: https://xdaforums.com/mi-a2/how-to/ota-v9-6-5-0-odimife-t3823445

The link to the payload_dumper python script was broken so I did a google search and the first result was this: https://www.droidmirror.com/download/download-payload_dumper-zip/

I looked thru the contents of the files to make sure they weren't malicious and then I used it to extract the payload.bin file from the OTA zip. The OTA zip file that I used was downloaded from this link: https://bigota.d.miui.com/V10.0.13....EGlobal_V10.0.13.0.PDIMIXM_b1d08ca14d_9.0.zip

---

Hi.

I've been running Havoc OS for about a month now and I want to return to stock. I downloaded the ROM from the MIUI site and uncompressed with tar zxvf. I'm running Linux on my PC. I flashed the stock ROM using the included shell script by typing ./flash_all.sh and everything seemed to flash properly except I got a few errors like this on some partitions:

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 10: 3651 Aborted (core dumped) fastboot $* flash modem_a `dirname $0`/images/modem.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 11: 3656 Aborted (core dumped) fastboot $* flash modem_b `dirname $0`/images/modem.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 12: 3667 Aborted (core dumped) fastboot $* flash xbl_a `dirname $0`/images/xbl.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 13: 3676 Aborted (core dumped) fastboot $* flash xbl_b `dirname $0`/images/xbl.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 14: 3689 Aborted (core dumped) fastboot $* flash pmic_a `dirname $0`/images/pmic.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 15: 3697 Aborted (core dumped) fastboot $* flash pmic_b `dirname $0`/images/pmic.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 16: 3708 Aborted (core dumped) fastboot $* flash rpm_a `dirname $0`/images/rpm.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 17: 3716 Aborted (core dumped) fastboot $* flash rpm_b `dirname $0`/images/rpm.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 22: 3736 Aborted (core dumped) fastboot $* flash keymaster_a `dirname $0`/images/keymaster.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 23: 3740 Aborted (core dumped) fastboot $* flash keymaster_b `dirname $0`/images/keymaster.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 24: 3755 Aborted (core dumped) fastboot $* flash cmnlib64_a `dirname $0`/images/cmnlib64.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 25: 3763 Aborted (core dumped) fastboot $* flash cmnlib64_b `dirname $0`/images/cmnlib64.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 26: 3771 Aborted (core dumped) fastboot $* flash cmnlib_a `dirname $0`/images/cmnlib.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 27: 3779 Aborted (core dumped) fastboot $* flash cmnlib_b `dirname $0`/images/cmnlib.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 30: 3798 Aborted (core dumped) fastboot $* flash boot_a `dirname $0`/images/boot.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 31: 3802 Aborted (core dumped) fastboot $* flash boot_b `dirname $0`/images/boot.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 37: 4277 Aborted (core dumped) fastboot $* flash mdtp_a `dirname $0`/images/mdtp.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 38: 4288 Aborted (core dumped) fastboot $* flash mdtp_b `dirname $0`/images/mdtp.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 39: 4297 Aborted (core dumped) fastboot $* flash splash `dirname $0`/images/splash.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 40: 4308 Aborted (core dumped) fastboot $* flash mdtpsecapp_a `dirname $0`/images/mdtpsecapp.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 41: 4317 Aborted (core dumped) fastboot $* flash mdtpsecapp_b `dirname $0`/images/mdtpsecapp.img

fastboot: core/libsparse/sparse.cpp:131: int write_all_blocks(struct sparse_file *, struct output_file *): Assertion `pad >= 0' failed.

./flash_all.sh: line 42: 4325 Aborted (core dumped) fastboot $* flash storsec `dirname $0`/images/storsec.mbn

Everything but those partitions flashed okay. I don't know why I am getting the assertion errors on those partitions. I have already updated to the latest fastboot binaries on my linux distribution(Arch Linux). I tried running fastboot -w and running ./flash_all.sh again, but I got the same result. I'm at a loss, really. I'd like to try MiFlash but I don't have Windows on this PC and I think MiFlash is Windows only. Anyone have any ideas?

The ROM I'm trying to flash came from here: http://en.miui.com/download-353.html ("Author: MIUI Official TeamVersion: V10.0.9.0.PDIMIXM (Android P) Size: 1687M")