[Galaxy S II Android Development] jpeg725:
Why is flashing cm necessary? Apparently it is because ubuntu uses some of the files installed by cm.

BUT...

If I read the cwm install scripts right. The armel install script backs up some files, formats system, installs its stuff, and finally restores those files. However after a fresh install of cm the only file involved is /etc/hosts - and the armel zip contains an identical /etc/hosts file.

So you should be able to format system and then directly install the two ubuntu zips.

TESTED: It works.

---------- Post added at 05:20 PM ---------- Previous post was at 04:38 PM ----------

I have dualboot working using u-boot and Dorimanx' kernel, if you are smart you should be able to make it work with siyah too since the dualbooting functions are pretty nearly identical.

Here's how...

Preparation

1. Download u-boot: http://www.mediafire.com/?ovd6asa90de4ifn (link from here)

2. Install u-boot tools. In ubuntu run "sudo apt-get install u-boot-tools"

3. Open Dorimanx' kernel zip and extract boot/zImage from it

4. Run "mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n Dorimanx-kernel -d zImage Dorimanx.uimg"

5. Open saucy-preinstalled-touch-armel-i9100.zip and extract android-boot.img from it

6. Run "mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n Ubuntu-touch -d android-boot.img ubuntu.uimg"

7. Create a file called "boot.cmd" with the following contents...

setenv android_cmd loglevel=4 console=ram sec_debug.enable=0 sec_debug.enable_user=0 sec_log=0x100000@0x4d900000 s3cfb.bootloaderfb=0x5ec00000 ld9040.get_lcdtype=0x2 consoleblank=0 lpj=3981312 vmalloc=144m console=tty1;

if test $sgs2_bootmode_val -eq 1; then
setenv android_cmd ${android_cmd} bootmode=2;
fi
setenv bootargs ${android_cmd}

setenv devtype mmc
setenv devnum 0
setenv kernel_part 0xb
setenv kernel_name /boot/ubuntu.uimg
setenv loadaddr 0x4EF08000

echo Load Address:${loadaddr};
echo Cmdline:${bootargs};

if fatload ${devtype} ${devnum}:${kernel_part} ${loadaddr} ${kernel_name}; then
bootm ${loadaddr};
exit 0;
elif ext2load ${devtype} ${devnum}:${kernel_part} ${loadaddr} ${kernel_name}; then
bootm ${loadaddr};
exit 0;
else
echo failed to boot custom image;
fi

8. Run "mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "ubuntu" -d boot.cmd boot.scr.uimg"

Flashing

I assume you have your ROM installed as primary rom with Dorimanx' kernel (siyah should work too).

1. Make a directory on your internal sdcard called "boot" and put ubuntu.uimg and boot.scr.uimg in it.

2. Reboot into recovery, make a backup, and then Clone 1st Rom to 2nd.

3. Format /system and /data. Don't use the "wipe data/factory reset" function. It wipes 2ndRom/system too.

4. Install saucy-preinstalled-touch-armel-i9100.zip and saucy-preinstalled-touch-armhf.zip

5. Reboot into download mode and use heimdall to flash u-boot and dorimanx' kernel uimg as follows...

Run "sudo heimdall flash --KERNEL u-boot.bin" or "heimdall flash --kernel u-boot.bin" depending on the version of heimdall you have. Just try them both.

Run "sudo heimdall flash --RECOVERY Dorimanx.uimg" or "heimdall flash --recovery Dorimanx.uimg"

Booting

Don't ever let Dorimanx kernel try to boot the primary rom - ubuntu won't boot afterwards. EDIT: You can use STweaks to change the default and thus avoid most mistakes.

To boot your rom. Turn phone on and when Dorimanx asks, press Home to boot secondary rom.

To boot into recovery. Turn phone on and as soon as the yellow triangle appears, press and hold Vol-up.

To boot into ubuntu. Turn phone on and as soon as the yellow triangle appears, press and hold Home.

After letting Dorimanx try to boot primary rom I have tried just wiping /system and reinstalling the armel zip, but that wasn't enough. I'm not sure what happens there.

Sources

http://xdaforums.com/showthread.php?t=1680898

http://xdaforums.com/showthread.php?t=1896661