I'm experimenting with sharing my notes for dead-end projects like these. Maybe they'll be useful for someone who stumbles on them.
I have a Nexus 4, I'm hoping to run CM and Firefox OS. I want CM auto-updates to work, I'd rather not build my own kernel. It needs to be completely open source, with no dubious binaries to download.
- Ubuntu Phone has a tool for dual-booting with android. The details make it sound quite simple.
- The state of the art seems to be MultiRom which uses kexec.
Interrupts boot process with an OS picker, then uses kexec to run the other OS.
XDA thread - manual install guide on Linux Journal - repo for front-end - repo for back-end
It stores the second OS on the data partition.
There's one major issue. It requires a kernel patch (but only for the host). kexec doesn't work very well on Nexus 4, the new kernel crashes. the "kexec-hardboot" patch stores the new kernel in a safe area of the RAM and does a full reset of the device! This solves all issues of devices (um.. peripherals? how do you call sub-devices on an embedded device?) being in an inconsistent state after a kexec and crashing the phone.
CyanogenMod didn't accept the patch though, believing it would be too much work to maintain.
So the solution would be.. to get this accepted upstream? I wonder if it's general enough and useful enough for linux. The patch needs review and cleanup too.
The other pipe-dream solution is package management on android, so that one could package this patched kernel and put it in a repo.