[Samsung Galaxy Ace 3] kotzir:
#include

/*
* Your warranty is now void.
*
* I'm not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*
*/

Introduction

MultiROM is one-of-a-kind multi-boot mod for Galaxy ACE 3 LTE. 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 external SD card. 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 image above. 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 Internal memory and MicroSD Card (non tested)

Warning!

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 (even if never happened until now) and you will have to flash stock firmware with Odin. Make backups. Always.

Installation, Note: Only manual installation is supported, because this mod is not officially supported.

MultiROM has 3 parts you need to install:

MultiROM

Modified recovery

Patched kernel

Now let's head to the installation. Note: Your primary ROM is recommended to be lollipop, because it doesn't act well as a secondary, due to enforcing selinux. Although you can use it as secondary, but change it's selinux status. My setup is Lollipop as primary, and KitKat as secondary. Stock ROM was not tested, because I hate it :p

I spent about 5 days working on this. My head will explode :p There is a tiny issue. MultiROM boot menu does not show up as it should. That's why we should use the MultiROM manager apk. and switch ROMs from the app.

Attention: The steps are if you use CM-12.1 as primary ROM

Kernel for Stock ROM with kexec-hardboot patch here

Step 1: Install this patched kernel over CM12.1. Or this, if you want OC.

Step 2: Install the modified Multirom Manager apk, I added support for our device

Step 3: Install Multirom

Step 4: Install MultiROM TWRP, via previous TWRP recovery, it can flash images

Step 5: Reboot into new recovery

Step 6: Install CM11, as secondary ROM!!

Step 7: Go to recovery-->Advanced-->MultiRom-->List ROM-->Choose CM11-->Flash Zip. Flash either stock kernel, or oc_kernel. Both include the necessary kexec-hardboot patch. Usually Multirom requires only primary ROM to have the kexec-hardboot patch, but in our case it does not work this way.

Now you are ready to switch ROMs. Ooh, almost forgot. MultiROM boot manager will show up if you connect the phone for offline charging, you will find out what happens on each case. This is the only bug that I can't resolve yet. Although multirom can be used, with this bug.

Update 20150829: Download everything from this [URL="https://androidfilehost.com/?w=files&flid=37974"]folder[/URL]
Kernel will be updated when ROM is built
Changelog: Re-implemented kexec hardboot and fixe last_kmsg creation

Video on how to install

Video on how to flash updates

*Thanks Tech Tutorials channel for the videos

Switch ROMs from the MultiRom manager app

NOTICE: I can't guarantee it will work on other variants rather than "R"

To uninstall Multirom simply flash this

You current ROM will not be erased by the installation.

Adding ROMs

1. Android

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

Using MicroSD Card

During installation, recovery lets you select install location. 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 MicroSD Card takes a bit more, because the external memory is (usually) slower and it needs to create the images. Also boot process is longer, highly depends on card's class. You can find ROMs installed on SD card in the "External" tab in boot menu.

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.

Explanation of recovery menus

Main menu

- Add ROM - Add ROM to boot manager

- List ROMs - List installed ROMs and manage them

- 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 the ROM, this is more like developer option.

Source Code

MultiROM - https://github.com/Tasssadar/multirom/tree/master (branch master)

Modified TWRP - https://github.com/Tasssadar/Team-Win-Recovery-Project (branch master)

CM12.1 stock kernel w/ kexec-hardboot patch- https://github.com/kostoulhs/android_kernel_samsung_msm8930-common/tree/cm-12.1

CM11 stock kernel w/ kexec-hardboot patch- https://github.com/kostoulhs/android_kernel_samsung_msm8930-common/tree/cm-11.0

Stock kernel for stock rom w/ kexec-hardboot patch - https://github.com/kostoulhs/android_kernel_samsung_loganrelte/tree/master

MultiROM device tree - https://github.com/kostoulhs/android_device_samsung_loganreltexx/tree/multirom

Big thanks to Tasssadar for this awesome utility.

Also thanks [MENTION=4443334]Grarak[/MENTION] for the melius patch, i was based on it :)