Flashing CalyxOS on the Xiaomi Mi A2
Using Debian 10 (may function as well with all other GNU/Linux-operating systems.) Based on this install: https://gitlab.com/calyxos/calyxos/-/wikis/mi-a2 I couldn‘t flash CalyxOS on my Xiaomi Mi A2 following exactly the above guidance. After many tries and help from different sides, I managed it using this steps: (The grey highlighted parts are commands for the bash in GNU/Linux.) First of all you should not use the newest version of the SDK Platform Tools as it‘s demanded (writing this, it‘s 30.0.4), but 30.0.2 or 30.0.3. You can find 30.0.2 e.g. here: https://androidsdkmanager.azurewebsites.net/Platformtools Then you should follow the steps obtaining fastboot mentioned here: https://www.calyxos.org/installation, because the version in Debian 10 (and maybe in other debian-based systems) is to old. Extract the downloaded zipped folder, open a bash from where the unzipped folder is and run `export PATH="$PWD/platform-tools:$PATH"`. This is for onetime usage only. For the next try you have to repeat the steps. **1. Boot into fastboot mode:** Turn device off. Hold Volume Down button and Power button until fastboot logo appears. Connect to USB and type fastboot devices to verify that it worked. **2. Unlock bootloader:** `fastboot flashing unlock` and to also unlock critical partitions `fastboot flashing unlock_critical` **3. Download this old Stock Oreo ROM:** https://bigota.d.miui.com/V9.6.17.0.ODIMIFE/jasmine_global_images_V9.6.17.0.ODIMIFE_20181108.0000.00_8.1_1c60295d1c.tgz **4. Flashing old Stock Oreo ROM:** Extract archive (`tar -xvzf jasmine_*.tgz`), change into extracted folder and run `./flash_all.sh` to flash it on the device. In the original install says „./flash-all.sh“ but it has to be a „_“, because the file ./flash-all.sh does not exist in the many folders, I downloaded, but ./flash_all.sh does. **5. Booting once** Boot stock Oreo once, complete the Setup Wizard quickly and get to the Home Screen just to make sure things are working. Shut the device down. **6. Downloading CalyxOS** Download the current CalyxOS build here: https://www.calyxos.org/get. Please check the sha256sum: Open a bash from where the build is downloaded and run `sha256sum [put here the name of the zipped folder e.g. jasmine_sprout-factory-2020.09.22.12.zip]`. A long column of numbers appears, which you compare with the one under the download link. They should be the same, otherwise the file is corrupted. **7. Fastboot mode again** Boot to fastboot mode again, extract the zip file (`unzip jasmine_sprout-*.zip`), change into extracted folder and run `./flash-all.sh` there (this time it‘s the right command with the „-“). If you get an error with „No space left on device“, set the TMPDIR variable to a location with sufficient free disk space (I did not get this error.). **8. Booting CalyxOS first time** The device should boot into CalyxOS. Don't set it up yet, but shut it down. **9. Locking the bootloader (or not)** Reboot to fastboot mode again and then run `fastboot flashing lock` to lock the bootloader. Then confirm that the "unlocked" warning is gone. This is still a big problem as you can see here: https://gitlab.com/calyxos/calyxos/-/issues/88. It seems to be impossible to relock the bootloader, which scotches one big aim of CalyxOS. The starting device shows the special ID, but than the unlocked bootloader-warning appears. **10. Setting it up** Now boot normally and set up your device. **11. PIN!** Be sure to set a PIN in the setup wizard since it is required for data encryption. **12. Encrypt your device!** Once the setup wizard is complete, setup the data encryption in Settings -> Security & location -> Encryption & credentials -> Encrypt phone **Conclusion:** As just a user of free software it was really hard for me to reach the goal of installing CalyxOS on the Xiaomi Mi A2. For me free software is an essential part of a free society. But if we want more people using privacyfriendly and free operating systems on their devices, we need really better documented installation guidances (I hope, that the new device flasher will work properly). This is my try for one device… The Xiaomi Mi A2 runs really smooth and fast with CalyxOS and I do not miss anything as I am coming from LineageOS and never was using googled devices. So I am satisfied with my setup and waiting til I can relock the bootloader. Attached you'll find a PDF of this manual: [flashing-calyxos-on-xiaomi-mi-a2.pdf](/uploads/695d998a552df519b444705036d74d0a/flashing-calyxos-on-xiaomi-mi-a2.pdf)
issue