[HTC Wildfire S] izi501:
Hello all,

I recently joined the Marvellous Team, and we started working on a Sense 5 port.

The problem was that Sense 5 is a little bit huge. I mean, about 886 MB. So we would have to reduce a lot the size and nearly de-sense the ROM, which is absolutely pointless as we want Sense 5 :P

So we thought we could try to link some system folders to /sd-ext. I already tried, but never with succes, because of many things like permissions, mounting, etc.

Now, I thought about one thing that would be great : mounting the whole /sd-ext partition to /system ! [MENTION=4960614]thehacka1[/MENTION] and I worked a lot on the kernel, and finally it works ! You can see in the screenshot posted, I have 530 MB of system partition :P

HOW TO DO IT

We have to mod the kernel. I used to do everything myself (with a lot of commands and scripts) but then I found out that it absolutely didn't work because the kernel wasn't repacked correctly :P So I advice you to use [MENTION=673068]dsixda[/MENTION] 's Android kitchen that you can found here.

Step 1

Install the latest version of the kitchen

Create a working folder with the ROM zip you want to patch

Go to advanced (0) then boot image options (12)

Uncompile the kernel

Step 2

Here we do the most important thing... Editing init.rc.

Open init.rc with your favourite editor and look for the lines

mount yaffs2 mtd@system /system
mount yaffs2 mtd@system /system ro remount

.

Delete them and replace them by

mount ext4 /dev/block/mmcblk0p2 /system

.

Save and voila ! You have done the most difficult part of the job :P

Step 3

Create a folder BOOT-EXTRACTED in the folder of the kitchen

Put the extracted and modded boot.img in it

Go back to the kitchen's boot image tools

Repack the kernel

Step 4

Here your are ! You have the kernel. Let's edit the ROM zip now.

Open your updater-script, and replace

format("yaffs2", "MTD", "system", "0", "/system");
mount("yaffs2", "MTD", "system", "/system");
package_extract_dir("system", "/system");

by

run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/system");
run_program("/sbin/busybox", "rm", "-rf", "/system/*");
package_extract_dir("system", "/system");

If I were you, I would also remove all the lines with tmpbackuptool. INFO by thehacka1 : do this only if you are porting a rom

Replace the boot.img in the zip by your new boot.img and you're done ;)

I forgot to say : with this mod, the system is mounted as writable :) If you want to mount it read-only, add

mount ext4 /dev/block/mmcblk0p2 /system ro remount

after

mount ext4 /dev/block/mmcblk0p2 /system

DEVICE COMPATIBILITY

This mod should work for every device. If you use it for your ROM, please just give a link to this thread ;)

What you need to know is that, for non-MTD based devices, there will be no line like

mount yaffs2 mtd@system

but lines like

mount yaffs2 emmc@system

or something like that.

Maybe, if your device isn't the WildFire S (poor you :P), your sd-ext is not /dev/block/mmcblk0p2. I let you modify as you want and you can post here the path for other devs !

BE CAREFUL

I didn't test all the cases. Maybe there will be bugs if everything is not unmounted or wiped.

After modding your rom like that, you won't be able to use any something2sd tweak. I shal certainly mod one to work with a third sd partition, but not now. You won't be able to flash any scripts that install things in /system without modding them. It is easy : replace

mount("yaffs2", "MTD", "system", "/system");

by

run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/system");

in the updater-script.

This mod is for developers and advanced users ! Here is not a place for asking questions about how to decompile a kernel :P

CREDITS

dsixda for his amazing kitchen

thehacka1

thehacka1

thehacka1

thehacka1 who took all the risks for testing this mod, including bricking his own phone !

thehacka1, whom I told that he would be named 5 times in credits if this mod worked :P

All the Marvellous team people (you're so great guys :D)