[HTC ChaCha] spoutnik000:
Hi,

No answer yet on this subject...

So I investigated a bit more and here are the steps and results.

(I can tell you already that I did not succeed yet, but I'm sure I'm not far)

*** Which CustomMTD tools version I used ***

As seen in my previous post, with CustomMTD tools v1.5.9 (AutoPatch-v1.5.9-Beta2-CustomMTD_S.zip), the 'patchbootimg.sh' does some smart checking on system / cache / data being concecutive, which is not the case on ChaCha (I'll explain later).

For this reason, I reverted to CustomMTD tools v1.5.8 (recovery-v1.5.8-Beta-CustomMTD_S.zip).

This version improves the 'patchbootimg.sh' code over the 1.5.6, but remains more easily customizable.

*** Which re-partitionning is easier / better for ChaCha ***

The original partition table on ChaCha (official ChaCha_HTC_Europe_1.54.xxx ROM) is:

0x000002FC0000-0x0000034C0000 : "recovery"	--> size = 0x500000 = 5242880 Bytes = 5120 KB = 5 MB
0x0000034C0000-0x000003800000 : "boot"	--> size = 0x340000 = 3407872 Bytes = 3328 KB = 3,25 MB
0x000003800000-0x000013C00000 : "system"	--> size = 0x10400000= 272629760 Bytes = 266240 KB = 260 MB
0x000013C00000-0x000015F00000 : "cache"	--> size = 0x2300000 = 36700160 Bytes = 35840 KB = 35 MB
0x000015F00000-0x000016900000 : "devlog"	--> size = 0xA00000 = 10485760 Bytes = 10240 KB = 10 MB
0x000016900000-0x00001FF00000 : "userdata"	--> size = 0x9600000 = 157286400 Bytes = 153600 KB = 150 MB
0x00001FF00000-0x000020000000 : "misc"	--> size = 0x100000 = 1048576 Bytes = 1024 KB = 1 MB

As you can see, we have "system" / "cache" / "userdata" = 260 / 35 / 150

But they are not consecutive since the "devlog" partition is inbetween.

This means that it is not possible to repartition in a classic way the "system""cache""userdata" block (... I don't see how the original v1.5.6 and v1.5.8 'patchbootimg.sh' code could work for qtotter in this case ...).

It is as well difficult to switch a partition ("userdata" for instance) to put it "system" instead because 150 MB is too small (the official ROM system takes around 240 MB !!)

After searching, I've seen that firerat has helped on a similar case (LG Optimus S) where the partition table is not consecutive as well. see code modif here: Firerat / CustomMTD / quickly added support for LG Optimus S ( thunderc ) (h_t_t_p_s://github.com/Firerat/CustomMTD/commit/f3ec0fdcd6823e674cd3bc81267db6a482eaa39a)

So my idea about this was to modify the v1.5.8 'patchbootimg.sh' code in a similar way in order to obtain the following partition table:

- keep the "userdata" partition intact

- repartition the "system""cache" block to give more space to the "system" partition

- the 'mtdpartmap.txt' file allowing to specify the "system" partition size

The modified partition table would then be:

0x000002FC0000-0x0000034C0000 : "recovery"	--> size = 0x500000 = 5242880 Bytes = 5120 KB = 5 MB
0x0000034C0000-0x000003800000 : "boot"	--> size = 0x340000 = 3407872 Bytes = 3328 KB = 3,25 MB
0x000003800000-0x0000[B]XXX[/B]00000 : "system"	--> size = 295 MB - [I]<cache partition size>[/I] MB
0x0000[B]XXX[/B]00000-0x000015F00000 : "cache"	--> size = [I]<cache partition size>[/I] MB
0x000015F00000-0x000016900000 : "devlog"	--> size = 0xA00000 = 10485760 Bytes = 10240 KB = 10 MB
0x000016900000-0x00001FF00000 : "userdata"	--> size = 0x9600000 = 157286400 Bytes = 153600 KB = 150 MB
0x00001FF00000-0x000020000000 : "misc"	--> size = 0x100000 = 1048576 Bytes = 1024 KB = 1 MB

*** Modified 'patchbootimg.sh' code and resulting KCMDline ***

I modified then the 'patchbootimg.sh' source code to customize it specifically to the ChaCha and to the modified partition table to get (as explained before).

And I tested this new code on my ChaCha with the 'test-v1.5.8-Beta-CustomMTD_S.chacha.zip' package, built with my modified 'patchbootimg.chacha.sh'.

With 'mtdpartmap.txt' = mtd 290 5

(the 2nd parameter is not used anyway)

I should get:

[idem]	0x000002FC0000-0x0000034C0000 : "recovery"	--> size = 0x500000 = 5242880 Bytes = 5120 KB = 5 MB
[idem]	0x0000034C0000-0x000003800000 : "boot"	--> size = 0x340000 = 3407872 Bytes = 3328 KB = 3,25 MB
[changed]	0x000003800000-0x000015A00000 : "system"	--> size = 0x12200000= 304087040 Bytes = 296960 KB = 290 MB
[changed]	0x000015A00000-0x000015F00000 : "cache"	--> size = 0x500000 = 5242880 Bytes = 5120 KB = 5 MB
[idem]	0x000015F00000-0x000016900000 : "devlog"	--> size = 0xA00000 = 10485760 Bytes = 10240 KB = 10 MB
[idem]	0x000016900000-0x00001FF00000 : "userdata"	--> size = 0x9600000 = 157286400 Bytes = 153600 KB = 150 MB
[idem]	0x00001FF00000-0x000020000000 : "misc"	--> size = 0x100000 = 1048576 Bytes = 1024 KB = 1 MB

The test run returns the following command line:

+ KCMDline=mtdparts=msm_nand:1024K@0x00001FF00000(misc),5120K@0x000002FC0000(recovery),3328K@0x0000034C0000(boot),153600K@0x000016900000(userdata),10240K@0x000015F00000(devlog),296960K@0x0x000003800000(system),5120K@0x15A00000(cache)

This is GOOD :)

So now I can test the 'recovery-v1.5.8-Beta-CustomMTD_S.chacha.zip' package to see if my partition table gets properly modified.

At this point, I do think that my specific 'recovery-v1.5.8-Beta-CustomMTD_S.chacha' package is good to be run on the ChaCha.

So let's re-try.

*** Impossible to flash the "recovery" partition while in recovery mode?? ***

In my first post, I was getting lots of errors when updating my ChaCha in recovery mode with the "recovery-..." package:

[...]
mtd: erase failure at 0x004c0000 (I/O error)
mtd: skipping write block at 0x004c0000
failed with error: -1
flashing recovery from /tmp/recovery.img
error writing recovery

In fact I did some tests, and it looks like it is not possible to do such recovery flashing operations while in recovery mode.

These operations must be done in fastboot mode.

So what I'll do is:

- reboot in recovery mode and install the 'recovery-v1.5.8-Beta-CustomMTD_S.chacha.zip' package

--> this will fail in the end, but it will extract all the necessary files to do things by hand

- reboot in fastboot mode and do operations by hand

Check the next post for this part.

spoutnik