[Xiaomi Mi MIX  ROMs, Kernels, Recoveries, & Other ] BitOBSessiOn:
[IMG="MultiROM"]http://i.imgur.com/vh3puLb.png[/IMG]​

MultiROM is one-of-a-kind multi-boot mod. It can boot any Android ROM as well as other systems like Ubuntu Touch, once they are ported to that device. Besides booting from device's internal memory, MultiROM can boot from USB drive connected to the device via OTG cable. The main part of MultiROM is a boot manager, which appears every time your device starts and lets you choose ROM to boot. You can see how it looks on the left image below and in gallery. ROMs are installed and managed via modified TWRP recovery. You can use standard ZIP files to install secondary Android ROMs and MultiROM even has its own installer system, which can be used to ship other Linux-based systems.

Features:

* Multiboot any number of Android ROMs

* Restore nandroid backup as secondary ROM

* Boot from USB drive attached via OTG cable

You can also watch a video which shows it in action.​

Warning!

It _is_ dangerous. This whole thing is basically one giant hack - none of these systems are made with multibooting in mind. It is no longer messing with data partition or boot sector, but it is possible that something goes wrong and you will have to flash factory images again. Make backups. Always.​

Installation

Firstly, there are videos on youtube. If you want, just search for "MultiROM installation" on youtube and watch those, big thanks to all who made them. There is also an awesome article on Linux Journal.

Note 1: Your device must NOT be encrypted (hint: if you don't know what it is, then it is encrypted).

To decrypt your device:

Backup ALL your data if you need to recover later (TWRP backup to USB or copy to your PC)

In fastboot mode:

fastboot format userdata

In TWRP: Flash Magisk (recommended) or SuperSU to avoid auto-encryption in next boot.

MultiROM has 2 parts you need to install:

Modified recovery (TWRP). Flash it as usual TWRP (fastboot flash recovery, or any flasher app if you're rooted).

MultiROM. Install it as usual zip from modded TWRP once flashed.

Go into TWRP MultiRom settings and be sure that "Enable No-KEXEC Workaround" is enabled (enabled by default)

Your current rom will not be erased by the installation.
​

Adding ROMs

1. Android

Go to recovery, select MultiROM -> Add ROM. Select the ROM's zip file and confirm. As for the space, clean installation of stock 6.x after first boot takes 900+mb of space.​

Updating/changing ROMs

1. Primary ROM (Internal)

Flash ROM's ZIP file as usual, do factory reset if needed (it won't erase secondary ROMs)

Go to MultiROM in recovery and do Inject curr. boot sector.

2. Secondary Android ROMs

If you want to change the ROM, delete it and add new one. To update ROM, follow these steps:

Go to MultiROM -> List ROMs and select the ROM you want to update.

Select "Flash ZIP" and flash ROM's ZIP file.

MIUI ROM as Secondary <---

Latest versions fix this, so you shouldn't need it anymore

Install MIUI as secondary via MultiROM settings in TWRP

Boot into your (rooted) primary

Edit fstab.qcom file in /storage/emulated/multirom/roms//boot/ and add /cache partition entries:

/dev/block/bootdevice/by-name/cache /cache f2fs nosuid,nodev,noatime,inline_xattr,flush_merge,data_flush wait,check,formattable
/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime,barrier=1 wait,check,formattable

Alternatively you can use attached file "fstab.qcom.txt" (rename to: fstab.qcom without .txt ). Be sure to set proper permissions (copy from original fstab.qcom, after renaming to fstab.qcom.bak, don't delete it...)

DON'T FORGET to flash Magisk / SuperSU after flashing to avoid re-encryption if you're flashing stock (not modded).

Known issues

You must wait a few seconds (3-5) before you get touch screen responsiveness in TWRP and MultiROM. (fixed by 2017.08.01 build) -- USUAL WHEN SWITCHING FROM MIUI

Some FCs on some secondary ROMs: Try using multiromfix.zip, thx to [MENTION=6622051]Startrek852[/MENTION] (to disable sdcardfs support in that secondary) -- USE MAGISK 13.5+

Issues with TWRP to boot on 4GB/128GB model... (Working on troubleshooting...) -- PRELIMINARY FIX HERE

Reporting issues

As you surely understand, a simply "it does NOT work" is not enough... so please, report your issue describing scenario as much as you can, try following this (as much as possible information is welcome, it's very tiring for me asking what this, what that, etc...):

Issue description (what, how, when, etc...)

Device model : 4GB or 6GB RAM

Decrypted? /cache and /data FSs ? (We assume IS decrypted becaues you're using MultiROM, and EXT4 FS for /cache and /data if you don't know or manually formatted to F2FS)

TWRP version + MultiROM version

Primary ROM (name, better with version)

Firmware version

Secondary ROM (the one with the issue, name and better version)

Custom kernel ? (name and version if so) <--- In theory, we shouldn't support scenarios with custom kernels.... (they can touch system stuff that make things more complex)

Xposed ? <--- Sorry we DON'T support MultiROM if you use Xposed

Google Apps (name, better with version)

Magisk / SuperSU (version and if you use it in Primary and/or Secondary and version)

Logs <--- This would be amazing great and helpful !!!! (you can get them via adb shell, terminal or using any tool)

*Original post and example in this post, please:
​

Download

You can download all stuff from here, where you can find latest TWRP and MultiROM. If you need to uninstall MultiROM, you can use this uninstaller.

MultiROM Manager (apk) available here.
​

Source code

MultiROM - https://github.com/MultiROM-dev/multirom

Modified TWRP - https://github.com/multirom-dev/Team-Win-Recovery-Project

MultiROM device tree - https://github.com/BitOBSessiOn/android_device_xiaomi_lithium
​

Special thanks to:

[MENTION=3418703]Tasssadar[/MENTION] for creating this awesome utility

[MENTION=2605798]nkk71[/MENTION] for the No-KEXEC workaround

[MENTION=2233641]AdrianDC[/MENTION] and all MultiROM guys involved in its development

[MENTION=5672995]jcadduono[/MENTION] for TWRP port