[MOD][ NOV 15 ][Redmi 2] MultiROM v33 [No Kexec Workaround]

premaca

Inactive Recognized Developer
Jan 22, 2012
1,029
3,623
0
Bangalore
Introduction

MultiROM is one-of-a-kind multi-boot mod for Redmi2. It can boot any Android ROM as well as other systems like Ubuntu Touch, Plasma Active, Bohdi Linux or WebOS port, once they are ported to our 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, daily prebuilt image files to install Ubuntu Touch 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
* Use for example Ubuntu Touch or Desktop alongside with Android, without the need of device formatting, once they are ported to Redmi2
* Boot from USB drive attached via OTG cable

Check this video with CM13.0 base and Tesla Secondary on our device.
You can also watch a video which shows it in action in general.


Warning!

It _is_ dangerous. This whole thing is basically one giant hack - none of these systems are made with multibooting in mind. It is messing with boot sector and data partition. 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
1. Via MultiROM Manager app (We do not have Official Support, so this is not an option for us yet)
This is the easiest way to install everything MultiROM needs. Install the app and select MultiROM and recovery on the Install/Update card. If the Status card says Kernel: doesn't have kexec-hardboot patch! in red letters, you have to install also patched kernel - either select one on the Install/Update card or get some 3rd-party kernel here on XDA. You are chosing kernel for your primary ROM, not any of your (future) secondary ROMs, so select the version accordingly.
Press "Install" on the Install/Update card to start the installation.

2. Manual 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.


MultiROM has 3 parts you need to install:

  • Modified recovery (TWRP_multirom_wt88047_YYYYMMDD.img) - download the IMG file from second post and use fastboot or Flashify app to flash it.
  • Patched kernel *OPTIONAL* - you can find it in the second post. Download the ZIP file and flash it in recovery. You can use any 3rd-party kernel which include the patch. (You do not need install patched kernel if you continue to use multirom with no-kexec-workaround only)
  • MultiROM (multirom-YYYYMMDD-vXX-wt88047-signed.zip) - download the ZIP file from second post and flash it in recovery.
You current rom will not be erased by the installation.
Download links are in the second post.



Adding ROMs

1. Android
Go to recovery, select Advanced -> MultiROM -> Add ROM. Select the ROM's zip file and confirm.​


Using USB drive (not tested yet)
During installation, recovery lets you select install location. Plug in the USB drive, wait a while and press "refresh" so that it shows partitions on the USB drive. You just select the location (extX, NTFS and FAT32 partitions are supported) and proceed with the installation.
If you wanna use other than default FAT32 partition, just format it in PC. If you don't know how/don't know where to find out how, you probably should not try installing MultiROM.
If you are installing to NTFS or FAT32 partition, recovery asks you to set image size for all the partitions - this cannot be easilly changed afterward, so choose carefully. FAT32 is limited to maximum of 4095MB per image - it is limitation of the filesystem, I can do nothing about that.
Installation to USB drives takes a bit longer, because the flash drive is (usually) slower and it needs to create the images, so installation of Ubuntu to 4Gb image on my pretty fast USB drive takes about 20 minutes.
Enumerating USB drive can take a while in MultiROM menu, so when you press the "USB" button in MultiROM, wait a while (max. 30-45s) until it searches the USB drive. It does it by itself, no need to press something, just wait.​



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 Advanced -> 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 Advanced -> MultiROM -> List ROMs and select the ROM you want to update.
  • Select "Flash ZIP" and flash ROM's ZIP file.
  • In some cases, you might need to flash patched kernel - get coresponding patched kernel version from second post and flash it to the secondary ROM sama way you flashed ROM's ZIP file.



Explanation of recovery menus

Main menu
- Add ROM - add ROM to boot
- List ROMs - list installed ROMs and manage them
- Inject boot.img file - When you download for example kernel, which is distrubuted as whole boot.img (eg. franco kernel), you have to use this option on it, otherwise you would lose MultiROM.
- Inject curr. boot sector - Use this option if MultiROM does not show up on boot, for example after kernel installation.
- Settings - well, settings.

Manage ROM
- Rename, delete - I believe these are obvious
- Flash ZIP (only Android ROMs) - flash ZIP to the ROM, for example gapps
- Add/replace boot.img - replaces boot.img used by this ROM, this is more like developer option.
- Re-patch init - this is available only for ubuntu. Use it when ubuntu cannot find root partition, ie. after apt-get upgrade which changed the init script.​


Source code
MultiROM - https://github.com/multirom-redmi2/multirom (branch android-7.0-mrom)
Modified TWRP - https://github.com/multirom-redmi2/Team-Win-Recovery-Project (branch android-7.0-mrom)
Kernel w/ kexec-hardboot patch - https://github.com/premaca/Xiaomi_Kernel_OpenSource (branch cosmos)
Device Tree - https://github.com/multirom-redmi2/android_device_redmi2 (branch mrom)

Credits
Little or more, these are the people helped, motivated me to bring this to our device


@martinusbe
@Alx31
@Ashish94 (For building the kernel with my commits)
@nkk71 (For kexec workaround)

Donations (Please donate to the Creator @Tasssadar )

I'd be glad if you could spare a few bucks. You can use either paypal or Bitcoins, my address is 172RccLB2ffSnJyYwjYbUD3Nx4QX3R8Ris


XDA:DevDB Information
[MOD][MAY 18][Redmi 2] MultiROM v33, Tool/Utility for the Xiaomi Redmi 2

Contributors
premaca

Version Information
Status: Beta
Current Beta Version: v33
Beta Release Date: 2016-05-18

Created 2016-05-18
Last Updated 2016-11-15
 
Last edited:

premaca

Inactive Recognized Developer
Jan 22, 2012
1,029
3,623
0
Bangalore
Reserved

Downloads

20161115

Download the required things from this folder - https://www.androidfilehost.com/?w=files&flid=129625
The kexec patched kernel is Jerrica cosmos, which you can use for MM and N ROMs as Primary/Secondary.


20160728

Download the required things from this folder - https://www.androidfilehost.com/?w=files&flid=85630

- no-kexec-workaround is announced Stable -


20160724

Download the required things from this folder - https://www.androidfilehost.com/?w=files&flid=83809

Old Downloads

1. Main downloads
MultiROM: multirom-20160710-v33-UNOFFICIAL-wt88047.zip
MultiROM: multirom-20160520-v33-UNOFFICIAL-wt88047.zip
MultiROM: multirom-20160518-v33-UNOFFICIAL-wt88047.zip
Modified recovery (based on TWRP):
TWRP_multirom_wt88047_20160710.img
TWRP_multirom_wt88047_20160520.img
TWRP_multirom_wt88047_20160518.img

Kernel w/ kexec-hardboot patch : OPTIONAL - If you continue to use multirom with no-kexec-workaround only
bk-180516v2.zip (Berserk Kernel)

multirom.zip
You need to have kernel with kexec-hardboot patch only in your primary ROM!, if not using no-kexec-workaround

2. third-party kernels with kexec-hardboot patch (NONE YET)

3. Uninstaller

MultiROM uninstaller: multirom_uninstaller_20160520.zip
MultiROM uninstaller: multirom_uninstaller.zip

Flash this ZIP file to remove MultiROM from your device. It will erase all secondary ROMs. If you don't want MultiROM menus in recovery, re-flash clean TWRP, but it is not needed - those menus don't do anything if MultiROM is not installed.

4. Multirom manager APP

MultiROM Manager APP: MultiROMMgr-Redmi2.apk

Changelog

11.15
- Support for Nougat ROMs
- Kexec patched kernel based off Jerrica Cosmos release (Those who prefer kexec boot)
- No-exec workaround is enabled by default, you do not need enable explicitly, check it.
- You must install Recovery
[Note]: Tested with N ROM as Primary and other N and MM ROMs as secondary, both Internal and External. Have not tested any other scenarios, please let me know if you have issues in other cases.

07.28
- Back to be able to install Secondaries and Boot. (Do not know if there is temporary compatible issues, but reported that earlier version had issues)
- Multirom manager App compiled again for all variants
- The App doesn't still display the external ROMs, i will try see if we can fix it.

07.10
- Minor upstream changes
- Multirom manager App compiled and released.

05.18
- Enabled F2FS
- no-kexec-workaround (Please read post#3 for details)
- recovery updated to 3.0.0.2
- External SD Card ROMs are now shown with every reboot during Auto-boot dialogue
- External SD Card ROMs are tested, i'm running two Roms externally now

05.18
- Initial Release


FAQ and other notes
Device encryption
Since v32, MultiROM supports encryption on this device (it has to be added for each device separately). It works only with Android-based secondary ROMs and the secondary ROMs don't know the device is encrypted, so they would allow you to encrypt the device again - do not do that. If you're using password, pin or pattern for the encryption, MultiROM will ask you for the password on boot. If you're booting the primary ROM, then Android will ask you for the password _again_ - unfortunately, there is no way for me to pass the "unencrypted" status to Android. If you're booting secondary ROM, MultiROM will ask you for the password again after the reboot - that's because I have to unencrypt the /data partition after the ROM's kernel is loaded.

I could omit the second password prompt when booting secondary ROM by temporarily saving the password somewhere, but that's obviously unsafe. So is using encryption with unlocked device though, so I might add this later.​
I have not tested it yet, as i never used ENCRYPTION on my device, will try to see if there are issues and more users for this use case

About security
In order to make multi-booting possible, MultiROM has to sacrifice some security measures. Firstly, on secondary Android ROMs, /system is not mounted read-only. While there are other things preventing malicious software from messing with /system, this might potentialy make it easier for such software to attack that system.​

What do the ROMs share?
All ROMs are separate, except /sdcard, which is shared between all Android ROMs.​

How many ROMs can I have?/Where are the ROMs stored?
You can have as many ROMs as you can fit in your /sdcard. All the ROMs are stored in /sdcard/multirom/roms or on an USB drive. This folder is unaccessible in Android, to prevent mediascanner from scanning it. You can either in recovery, or obtain root and go to /data/media/0/multirom/roms.
By default /external_sd is mounted and is used to store the ROMs.

The menu with all the ROMs won't show up during boot, how to fix it?
Either re-flash the MultiROM zip or go to recovery, Advanced -> MultiROM -> Inject curr. boot sector.

The reason for this is that something rewrote your boot.img, which happens for example when you flash a kernel. MultiROM's boot menu is part of the boot image, so it has to be added into it again.

Will Miui work as Primary or Secondary ROM?
Yes, MiUI Lollipop version works with Multirom as Primary ROM, once again reiterate, only as Primary ROM. You can then install other ROMs as secondaries.

How do I flash Gapps in Secondary ROMs?
After AddRom and is done, go back and Click on the installed Secondary ROM, you will see one of the option to 'Flash Zip', click and install Gapps. Then you can reboot into secondary ROMs, do gapps installation before rebooting otherwise as usual need to deal with SetupWizard FC, at least thats what I observe in my device.
 
Last edited:

premaca

Inactive Recognized Developer
Jan 22, 2012
1,029
3,623
0
Bangalore
I meant do we have to press volume up button as shown in the video???? Or u have solved the glitch
Yes that is too fixed, follow the installation steps as told. Flash recovery, flash mrom-zip followed by kernel-zip.
Nothing is gonna happen to your current primary rom or any adverse affects. Go try it when you get time.
 

RieTech

Member
Mar 7, 2014
44
10
0
Still confusing little bit
Can we boot different based rom? Last time i see ashish94 make video multi rom, but all rom based on aosp (tipsy & validus), so can us boot rom based cm13 & aosp, or maybe cm13 & miui too, or just same based rom?
 

premaca

Inactive Recognized Developer
Jan 22, 2012
1,029
3,623
0
Bangalore
Still confusing little bit
Can we boot different based rom? Last time i see ashish94 make video multi rom, but all rom based on aosp (tipsy & validus), so can us boot rom based cm13 & aosp, or maybe cm13 & miui too, or just same based rom?
You can boot any custom rom, except MiUI (which i have never tried). I tried GZRoms, Temasek, RR as primary and vice versa (only those zip files are there in my scared :laugh::laugh:).

Btw, that video is made by me :silly::silly: and Ashish shared it in his thread :silly::silly:
 

saurabh1234

Senior Member
Oct 12, 2012
1,053
581
143
delhi
You can boot any custom rom, except MiUI (which i have never tried). I tried GZRoms, Temasek, RR as primary and vice versa (only those zip files are there in my scared :laugh::laugh:).

Btw, that video is made by me :silly::silly: and Ashish shared it in his thread :silly::silly:
i want to know....is vFat is external storage...???
 

premaca

Inactive Recognized Developer
Jan 22, 2012
1,029
3,623
0
Bangalore
i want to know....is vFat is external storage...
Okay, currently the way it works is, which ever the partition is mounted, (default /external_sd) it is Internal, vFat is just a duplicate of it, never used it yet.
If you want to use actual Internal Storage, go to main 'Install' and use Select Storage. Then you come back here and 'Internal' becomes of that.
May be you can identify with 'XXXXX bytes' besides Internal (the size of the memory of that partition), i can at least because i use 32GB sdcard and real internal is 16GB.
 

RieTech

Member
Mar 7, 2014
44
10
0
You can boot any custom rom, except MiUI (which i have never tried). I tried GZRoms, Temasek, RR as primary and vice versa (only those zip files are there in my scared :laugh::laugh:).

Btw, that video is made by me :silly::silly: and Ashish shared it in his thread :silly::silly:
Maybe u must tried with miui now haha (so i can follow u without getting any error :p )
Thanks for clearing my mind, maybe i need to try boot cm13 and aosp now~

*note: sry, i didnt if that video made by you lol