Join GitHub today
Add MultiROM (or other method for dual boot) support #421
This issue is still under construction.
This is draft from my memory, I need to do fact cheking.
I will try to reconstruct MultiROM, so, we can implement it easier.
MultiROM is dualboot script that runs after kernel and before init scripts.
It lets users pick different ROM (that are installed by TWRP fork).
Before running another kernel, it mounts paths to proper locations, for that different ROM,
Here, you can find list of modified kernels, to work with it.
Just for the record, EFIDroid is a similar project.
Some quick notes about EFIDroid:
There are lots of technical information here: https://forum.xda-developers.com/showthread.php?t=1266827 I've summarized it so that it is easier to follow for someone who wants to implement support for pmOS.
As I understand it, in order to support MultiROM we need to achieve the following points:
Once patched, enable the following options:
Steps to boot to another kernel:
Now the phone will reboot, the device will show the logo, and eventually Linux will boot the kexec'd staged kernel.
The hardboot patch is required because many built-in drivers do not support proper unloading, reloading, and reinitializing the associated hardware without a hardware-reboot. So the hardware is often left in an unexpected or unknown state on unload, and thus the kexec'd kernel hangs on boot. Hardboot fixes this issue by writing some info to memory, forcing a reboot and then reading that information from memory.
Once it is working, these two patches improve the usability:
The author talks about the Epic kernel which is unknown to me.
@PabloCastellano Just want to correct you quickly
EFIDroid does NOT use the Android build system, it uses similar syntax and targets and uses the repo tool from Google but the rest are his own Python scripts etc.
But Multirom does use the Android tree for building
Safestrap is more about working around a bootloader you can't control than anything.
Then EFIDroid certainly looks the neater thingy imo, but it won't be available on all devices.
So imo, to avoid this kind of discussion x1000 there should be a list of "practices preferences", from those requiring the less burden/effort/changes/hassle/time-to-boot, to maybe having a third kernel to manage boot selection, to overcomplicated (yet, necessary) ones like hooking into safestrap or kexecboot.