Jump to content

gen1 to gen2 and gen2 to gen1, windows flashing only


Guest hecatae

Recommended Posts

Guest kallt_kaffe
Here you go. Just the changed files. I'll make a more complete package when/if I get time.

The 2mb cache version is OK for CM7 or if you use the cache2tmpfs update. The no_oem version should be OK for anyone.

Here's the complete package: http://www.mediafire.com/?c7ccca95jf2huwr

gen2_org_partitions
-------------------
/dev/block/mtdblock4 37.5M /cache
/dev/block/mtdblock5 220.0M /system
/dev/block/mtdblock6 162.5M /data

gen2_128mb_system
-----------------
/dev/block/mtdblock4 37.5M /cache
/dev/block/mtdblock5 128.0M /system
/dev/block/mtdblock6 254.5M /data

gen2_128mb_system_no_oem
------------------------
/dev/block/mtdblock4 37.5M /cache
/dev/block/mtdblock5 128.0M /system
/dev/block/mtdblock6 275.4M /data

gen2_128mb_system_no_oem_2mb_cache
----------------------------------
/dev/block/mtdblock4 2.0M /cache
/dev/block/mtdblock5 128.0M /system
/dev/block/mtdblock6 310.9M /data[/code]

Edited by kallt_kaffe
Link to comment
Share on other sites

Guest hudasp

Thanks for your hard work. I´m using gen2_128mb_system_no_oem_2mb_cache, but cache2tmpfs update from this post doesn´t work. Is it possible share yours cache2tmpfs update, which works with CM7 on GEN2 phone?

Edited by hudasp
Link to comment
Share on other sites

Guest eaglepete

well ive given it a try on a osf b10 and unfortunately terrible reception is there no way of reverting to gen1 even with a tpt?

Link to comment
Share on other sites

Guest StevenHarperUK
Why windows only? Its not hard to write something for cross platform -.- Take the effort.

The software is just a Binary - it communicates with another Binary on the Devices Fastboot

Re-engineering something like that is close to impossible. [cue-music]

Link to comment
Share on other sites

The Japanese 2.2 used this to store camera photos if the SD-card was not present. I haven't seen any other 2.2 ROMs do that.

I'll have another go with the hexeditor to try to reduce it to a minimum.

EDIT: Correction. The new official 2.2 ROMs does mount the oem partition but the comviq rom has a prop in build.prop that I believe prevents it from using it. The TeliaSonera ROM on the other hand does not have this prop. Swedish Spring is based on the Comviq ROM and should not use, nor does it mount it as that wouldn't work on Gen1 phones anyway. Hexedited oem partition down to 128kb and I now have 275.4Mb on /data.

Nice work. I think the Chinese rom used the oem partition for usb drivers, but these swedish updates don't seem to include any oem.img or anything like that, so it must just be blank as standard. A 128kb partition is too small to be able to be mounted, it'll give an error if you try to mount it, the minimum size seems to be just under 1.5mb, but that shouldn't cause a problem if it's not used for anything.

For the person above asking about cache2tmpfs for cm7, you don't need it on cm7, cm7 already has an init script included to redirect the download cache to /data if /cache is too small.

Edited by wbaw
Link to comment
Share on other sites

Why windows only? Its not hard to write something for cross platform -.- Take the effort.

ZTE supplied it without source code, so ask them, or write something yourself if it's not hard - take the effort.

A normal TPT wont work because of the differences in the internal partitions.

Edited by wbaw
Link to comment
Share on other sites

Guest kallt_kaffe
Nice work. I think the Chinese rom used the oem partition for usb drivers, but these swedish updates don't seem to include any oem.img or anything like that, so it must just be blank as standard. A 128kb partition is too small to be able to be mounted, it'll give an error if you try to mount it, the minimum size seems to be just under 1.5mb, but that shouldn't cause a problem if it's not used for anything.

Only the stock 2.2 ROMs mounts the oem partition so I made it a minimum. I didn't dare to try to remove it completely so I decreased it to be the same size as the erase size. Seems to work fine.

There is still some mystery left about the partitioning. None of them starts at offset zero but the Gen2 have more space reserved before the recovery partition starts than Gen1 phones. Anyone know what the space before the first partition is used for?

Also boot and recovery are 0.5Mb larger on Gen2 so there goes 1Mb. The misc partition is 128kb larger. Btw, wtf is the misc partition, is it used?

Not sure if it's worth the trouble but there another 2.25Mb could be squeezed out by reducing recovery, boot, splash and also bringing cache down another 0.5mb.

Link to comment
Share on other sites

Only the stock 2.2 ROMs mounts the oem partition so I made it a minimum. I didn't dare to try to remove it completely so I decreased it to be the same size as the erase size. Seems to work fine.

There is still some mystery left about the partitioning. None of them starts at offset zero but the Gen2 have more space reserved before the recovery partition starts than Gen1 phones. Anyone know what the space before the first partition is used for?

Also boot and recovery are 0.5Mb larger on Gen2 so there goes 1Mb. The misc partition is 128kb larger. Btw, wtf is the misc partition, is it used?

Not sure if it's worth the trouble but there another 2.25Mb could be squeezed out by reducing recovery, boot, splash and also bringing cache down another 0.5mb.

The space before the first partition is for the hidden firmware partitions, it's where the .mbn files are written to. The details are in partition.mbn (I wouldn't try editing that file).

I don't think it' worth trying to get another couple of mb by squashing recovery, boot & splash, better to leave them at standard sizes, so we know that /cache starts at a certain offset, it makes my partitioning tool easier & it'll prevent any problems with people installing new roms, or backups. A nandroid backup dumps the whole splash, boot & recovery partitions, so they must be the same size to be able to restore them.

I think setting oem to a size of 0 should work, but I haven't tested it.

There is about a 1.2mb overhead for yaffs2 file systems, so with a 2mb cache partition we can only use about 800k. Clockworkmod writes it's recovery logs to the cache partition, with clockwork3 they can be bigger than you'd expect & it can run out of space with 1.5mb, that's why I went to 2mb /cache

No idea what the misc partition is. [added] - it might be used to store some important settings, found this thread at xda - http://forum.xda-developers.com/showthread.php?t=799015

128mb_system_no_oem_2mb_cache.zip seems fine, you aren't going to get much better. If you're bored you can tidy up my backup/partition tool & make it work for gen2

Edited by wbaw
Link to comment
Share on other sites

Guest hudasp
For the person above asking about cache2tmpfs for cm7, you don't need it on cm7, cm7 already has an init script included to redirect the download cache to /data if /cache is too small.

Thanks, after reinstall CM7 works.

Edited by hudasp
Link to comment
Share on other sites

Guest KonstaT

If I upgrade to Gen2 using gen2_org_partitions, is there any reason why I couldn't flash stock Gen2 after that. For example can I flash FRY_EFIN_P729BV1.0.0B04 (Saunalahti stock 2.2, from stock roms thread) instead of SS-RLS4b? Wil this result bricked blade or "official" saunalahti 2.2 phone?

Link to comment
Share on other sites

Guest kallt_kaffe
If I upgrade to Gen2 using gen2_org_partitions, is there any reason why I couldn't flash stock Gen2 after that. For example can I flash FRY_EFIN_P729BV1.0.0B04 (Saunalahti stock 2.2, from stock roms thread) instead of SS-RLS4b? Wil this result bricked blade or "official" saunalahti 2.2 phone?

That should work. But keep in mind that original partition layout for Gen2 sucks almost as bad as the default HTC Desire partition layout.

Link to comment
Share on other sites

Guest kallt_kaffe

Btw, has anyone with a Chinese V880 dared tried a Gen2 -> Gen2 conversion with these files? It may unlock 512Mb just like Gen1->Gen1 conversions did in Hungary and Greece. It may also lead to bricking.

Link to comment
Share on other sites

Guest KonstaT
That should work. But keep in mind that original partition layout for Gen2 sucks almost as bad as the default HTC Desire partition layout.

Thanks KK for the reply. It's just there has been lots of questions about "official" saunalahti 2.2 since sweden got their update and we haven't got ours. I guess new partition layout gen2_128mb_system should also work? If I understood it still has oem partition. I don't know if it is mounted/needed in stock saunalahti 2.2 though. I'm very happy gen1 SS-RLS4 user at the moment but I'll probably give this method a try at some point.

Link to comment
Share on other sites

Guest kallt_kaffe
Thanks KK for the reply. It's just there has been lots of questions about "official" saunalahti 2.2 since sweden got their update and we haven't got ours. I guess new partition layout gen2_128mb_system should also work? If I understood it still has oem partition. I don't know if it is mounted/needed in stock saunalahti 2.2 though. I'm very happy gen1 SS-RLS4 user at the moment but I'll probably give this method a try at some point.

Be careful if you repartition. The official ROM may need more than 128Mb for system. You can shave of some stuff like /system/app/Maps.apk before installing because it's old anyway so you'll end up with a newer version in /data/app anyway. Not sure but the same may apply for Gmail.apk and Youtube.apk.

Link to comment
Share on other sites

Guest css771

How do I edit the files so that I can keep my custom partition sizes? I had a look at the partition.mbn and partition_zte.mbn files in a hex editor. What exactly should be changed?

And also, Does fastboot work on gen2 devices? If not, Is there any way to make it work?

Edited by css771
Link to comment
Share on other sites

Guest kallt_kaffe
How do I edit the files so that I can keep my custom partition sizes? I had a look at the partition.mbn and partition_zte.mbn files in a hex editor. What exactly should be changed?

And also, Does fastboot work on gen2 devices? If not, Is there any way to make it work?

Look in the end of appsboot.mbn. You need to change it there and also partion_zte.mbn. Compare the different versions I've provided and you'll see how it works.

It seems to be an array with a string for the partition name, then comes the offset followed by the size. The numbers are 32bit but byte order is reversed.

So 00 04 00 00 in the hexeditor means 0x00000400. The number are the number of blocks where the block size is the "erase size". "cat /proc/mtd" will show the erase size and it is 0x20000 (128kb). So 00 04 00 00 in hexeditor is 0x400*0x20000=0x8000000=128Mb.

The array in appsboot.mbn and partition_zte.mbn should be identical. If you add the offset for a partition and add the size you'll see that it matches the offset for the next partition.

I think you'll figure out the rest from here.

Link to comment
Share on other sites

Guest steveuk1981

Is it as simple as following

1. Install stock recovery (if you are currently running clockwork) with the included recovery restorer.

2. Boot into FTM (volume-down)

3. Run the the installer you want to install, can choose 128mb system partition layout or original partition layout

(how do you run the installer? does it pop up?)

4. When done (if going from Gen1->Gen2) it is strongly recommended to copy Channel1.nvm and keep it safe.

(how do you copy channel1.nvm)

5. Install your favourite custom ROM and have fun.

or should i just leave it until theres a more in depth guide?

Link to comment
Share on other sites

Guest jayhix

Right there needs to be a big clean up here, as there are many unanswered questions..

FIRSTLY what the hell is gen 1 and gen 2?

who has gen 1?

is it default?

why do you need gen2?

why cant i go back to gen1 from gen2?

why has all this come about, as you never used to need a specific "gen" for certain roms...

what is FTM?

does changing the system partition layout require complete wipe?

etc all these questions should be answered in the first post and they arent. i cant think of any more off the top of my head but i think its important they are answered

Edited by jayhix
Link to comment
Share on other sites

Guest targetbsp

I expect at the point where the average person needs to know the above, they'll be answered. At the moment I think this is for the more obsessive rom fanatic who will have been following recent developments with enough interest to know the answers to most of the above. :)

The fact you have a UK flag means yours is gen1 cause we only have gen 1 phones here. Gen 1 means your phones official rom is eclair and gen 2 means your official rom is froyo.

Advantages of gen 2 are listed in post 1. It was originally expected to be painful to maintain seperate gen 1 and 2 roms so early plans I think were to bump everyone to 2 but KK and the gang seems to have mastered making the roms support both. :)

I understand the imei number gets messed up going from 2 back to 1

Basically custom roms for phones whose stock rom are eclair are not compatible with phones whose stock rom are froyo and vice versa.

I dunno what ftm is! But it tells you how to get to it in post 1 so I expect it doesn't much matter. :)

If the partition change is wbaw's or a variation thereof then it takes a backup of your rom before repartitioning and restores afterwards.

Edited by targetbsp
Link to comment
Share on other sites

Guest jayhix
I expect at the point where the average person needs to know the above, they'll be answered. At the moment I think this is for the more obsessive rom fanatic who will have been following recent developments with enough interest to know the answers to most of the above. :)

The fact you have a UK flag means yours is gen1 cause we only have gen 1 phones here. Gen 1 means your phones official rom is eclair and gen 2 means your official rom is froyo.

Advantages of gen 2 are listed in post 1. It was originally expected to be painful to maintain seperate gen 1 and 2 roms so early plans I think were to bump everyone to 2 but KK and the gang seems to have mastered making the roms support both. :)

I understand the imei number gets messed up going from 2 back to 1

Basically custom roms for phones whose stock rom are eclair are not compatible with phones whose stock rom are froyo and vice versa.

I dunno what ftm is! But it tells you how to get to it in post 1 so I expect it doesn't much matter. :P

If the partition change is wbaw's or a variation thereof then it takes a backup of your rom before repartitioning and restores afterwards.

awesome! cheers for clearing that up, i got a bit worried for a sec that id missed out on something big whilst being away! haha :)

Link to comment
Share on other sites

Guest Simon O

There are more reasons to update to Gen2 than there are to stay with Gen1. If Orange UK release an official 2.2 update then it will update the phone to Gen2 anyway so why not do it now?

Gen2 uses much newer radio libs which provide HSUPA support and much better signal strength.

CM7 will be moving to Gen2 only once final is released. I expect any future custom roms to do the same too.

Link to comment
Share on other sites

Guest kallt_kaffe
The space before the first partition is for the hidden firmware partitions, it's where the .mbn files are written to. The details are in partition.mbn (I wouldn't try editing that file).

You are 100% right. Found this in /proc/last_kmsg after a reboot with the cm7_kernel:

0: 0:MIBIB offs=0x00000000 size=0x0000000a attr: 0x00ffffff
1: 0:QCSBL offs=0x0000000a size=0x00000002 attr: 0x00ffffff
2: 0:OEMSBL1 offs=0x0000000c size=0x00000005 attr: 0x00ffffff
3: 0:OEMSBL2 offs=0x00000011 size=0x00000005 attr: 0x00ffffff
4: 0:AMSS offs=0x00000016 size=0x000000d4 attr: 0x00ffffff
5: 0:APPSBL offs=0x000000ea size=0x00000003 attr: 0x00ffffff
6: 0:FOTA offs=0x000000ed size=0x00000078 attr: 0x00ffffff
7: 0:EFS2 offs=0x00000165 size=0x00000060 attr: 0x00ffffff
8: 0:APPS offs=0x000001c5 size=0x00000002 attr: 0x00ffffff
9: 0:FTL offs=0x000001c7 size=0x00000005 attr: 0x00ff0101
10: 0:EFS2APPS offs=0x000001cc size=0xffffffff attr: 0x00ffffff[/code]

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.