[Samsung Galaxy SL i9003] loSconosciuto:
UPDATE: This can't be used with CM10 Alpha 4 (or later) as it is due to the new partitioning system.

____

I made this thing time ago and I thought to share.

What it does is to boot a stock ROM from the external SD card. It's nothing special, I simply changed few things here and there. I did it because I needed a stock ROM for a couple of minutes and this was the faster way to get it.

I'm using CM and I made this with that in mind, so, don't use while using a stock ROM. It won't mess your current setup, but it won't work.

You need to change kernel to boot the stock ROM (reboot recovery > flash zip. Simple and fast). That's because, as you probably now, kernels made for stock ROMs are not compatible with CM.

Prepare you SD card

You need first to repartition your

external

SD like this:

1° partition (mmcblk1p1): FAT - it will be the usual external SD
2° partition (mmcblk1p2): ext4 - /system (make it around 300MB big, 254MB will be more or less the space used)
3° partition (mmcblk1p3): ext4 - /data

I can't help you with this, I did it with adb and parted (the command is available in CWM). Look for instructions on the web, it's full of guides out there. Your external SD card is /dev/block/mmcblk1 (mmcblk0 is the internal one).

If you'll use the zip linked to flash the ROM, the two partitions (mmcblk1p2 and mmcblk1p3) will be automatically converted, unless they are already two ext4/ext3/ext2 partitions.

It shouldn't matter which kernel you are currently using and it should be safe flashing it, the only important thing is to have three partitions. If mmcblk1p2 or mmcblk1p3 are not detected, the installation will be aborted (it means that your SD card is not partitioned). Nothing else will be touched.

If you don't want to use the zip, mount mmbclk1p2 and copy the ROM there.

/dbdata will be the usual one (it's not used in CM. This will also makes Samsung apps a lot faster when using a slow SD card), same for /cache.

The flashable ROM is a stock XXLE4 + su/Superuser.apk.

How to use the additional ROM

To use the ROM on your SD, flash kernel-stock-SD.zip (see below) from recovery.

To go back to the real ROM you have to flash its kernel. Here below you can find

CM10 Alpha 2

kernel, flashable from recovery. If you have doubts, reflash the entire ROM, it won't wipe your data.

I only mentioned CM10 because it's what I'm using, but this thing should work with CM9 too.

Things to know

I built the kernel using the latest Samsung sources with inbuilt ext4 support (and ext3/ext2 compatibility). Nothing else was changes, so I think there's no need to publish the sources, they are available here.

I attached the tools I use to unpack/repack boot images (they are a modified version of skin1980's tools):

./unpack.pl boot.img
./repack.sh [gz|lzma|bzip2|xz]

To see the changes I made, compare "out/android" with the stock XXLE4 ramdisk and the other two directories with CM10 boot.img ramdisk.

I changed recovery.fstab accordingly, but I can't tell you if flashing stuff from CWM while using the additional ROM will work as expected. You should read the updater-script to know it for sure.

I can only tell you that dhiru's builds will be flashed into the real /system partition and not your SD card.

Backups should work too, but I didn't try.

Of course, performances depends on your SD card. Mine is not that good I think, I took it from an old phone and I really don't know anything about it. The ROM is still usable, but apps that intensely use databases are slow (not Samsung apps, those will use /dbdata). Maybe disabling journaling will help (search for more info).

The Galaxy SL screen will last more than usual because I intentionally added a delay (3 seconds, SD cards are detected after a while) and of course because of the slower load.

Please, use this if you have some experience.

Note: dual booting two ROMs with a single kernel is possible, but only if they use the same kernel image. See this and this.

Downloads

XXLE4-CWM.zip: CWM flashable ROM

kernel-stock-SD.zip: kernel to boot the ROM from the external SD, flashable from recovery

kernel-CM10-Alpha2.zip: CM10 Alpha 2 kernel, flashable from recovery