Skip to content

Instantly share code, notes, and snippets.

@philippelatulippe
Last active March 17, 2024 02:32
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save philippelatulippe/73ebc9997247c0ca456c to your computer and use it in GitHub Desktop.
Save philippelatulippe/73ebc9997247c0ca456c to your computer and use it in GitHub Desktop.
Android dual-boot / multi-boot

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.

MultiRom

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment