Very good stuff here. This u-boot actually works in the GN? I have some experience with u-boot for the imx53 reference board. Using KEXEC like Tassadar does on the Nexus 7 and the old Optimus P500 works pretty well. Did anyone here tried something similar? Might involve some hacks though.
I've played with it a little bit and yes, it does work, but I needed the right toolchain (CodeSourcery 2010q1-188), else this little f*cker would throw nasty errors at runtime.
Much thanks to sp3dev for helping me out on this and releasing a usable U-Boot implementation!
The nice thing about this is that it works by just raw-flashing the uboot binary to the boot partition.
My idea of how multiboot and flashing ROMs should work includes:
* A custom recovery
* U-Boot flashed to the boot partition
When entering the recovery, you are presented with 2 options: Flash an Android ROM or flash Ubuntu (because I wanted to have a way to dualboot those instead of 2 Android ROMs)
Executing recovery commands from /cache should be done after selecting the respective mode, for example when updating CM from within its updater app.
1) Choosing Android as an option: Symlink ..../by-name/boot to /cache/boot1.img
2) Choosing Ubuntu as an option: Symlink ..../by-name/boot to /cache/boot2.img, ..../by-name/system to /cache/system2, ..../by-name/data to /data/data2
As those ..../by-name/* files are just basically symlinks to the right block device partitions anyway, it would work seamlessly with the current way of unpacking ROM files to the respective partitions.
Just formatting would have to be blocked/changed to a simple rm -rf in Ubuntu mode.
Also, when a kernel is being "flashed" (or moved to the right place thanks to the symlink), we would have to repackage it with the correct fstab for (probably bind?) mounting the right folders.
THEN you can choose whatever ROM you would want to flash and the files would get unpacked in the right places.
In U-Boot you can either wait a second or two to boot into your Android ROM or keep VolDown pressed to boot into Ubuntu.
Sadly, I just don't have enough time doing this project, as it's a pretty sophisticated project and very hacky (but still much prefered to special dual-boot-kernels+modifying zip files by hand).
This ROM mode setting idea can surely accomplished with easy flashable zip files which just set up the symlinks followed by a zip which repackages the Ubuntu kernel.
This however would be reeeaally cumbersome for mere mortals, so why not just do everything in recovery without any manual interaction whatsoever?
I hope someone might pick up this design choice so that this specific-dual-boot-kernel-madness finally takes an end.
EDIT: I've just noticed that dlhxr started a thread which basically covers the same basic principle of how this should work.
Is someone working on a custom recovery similar to the idea that I had?