Post Reply

Custom partition layouts, ZERO brick risk!

OP lbcoder

17th June 2010, 05:51 PM   |  #1  
OP Account currently disabled
Thanks Meter: 96
 
2,645 posts
Join Date:Joined: Jan 2009
This is about the coolest thing you can imagine.
DEATHSPL is OBSOLETE.
We can repartition these things -- to ANY layout we like -- withOUT changing or modifying the SPL!

This is even compatible with a STOCK SPL! I.e. 0.95.0000.

This is something I discovered while looking at the MTD drivers.

The mtd drivers accept partition table specified on the KERNEL COMMAND LINE! And this SUPERSEDES the automatic table discovery method.

This is the command line argument for STOCK partition layout:
Code:
mtdparts=msm_nand:256k@0x24c0000(misc),5120k@0x26c0000(recovery),2560k@0x2bc0000(boot),69120k@0x2e40000(system),69120k@0x71c0000(cache),76544k@0xb540000(userdata)
You can boot a kernel with a modified partition table using one of two methods;
the "-c" parameter to fastboot allows you to add kernel parameters. This is good for booting RECOVERY images and applying custom layouts.

The second method is to build the custom layout into your boot.img or recovery.img.
This can be done using the "--cmdline" parameter to mkbootimg.

Notes: The smallest possible partition is 128k.
The partition sizes must be MULTIPLES of 128k and must start on an offset that is a multiple of 128k. The memory size is 256MB precisely.

Note: DO NOT modify ANYTHING before the START of the boot partition, i.e. offset 0x2bc0000. If you do, it won't boot!


***** EDIT:
We now have a BETA implementation of this concept: http://forum.xda-developers.com/show...1&postcount=39

Thanks go to Firerat, who did the actual implementation work in converting CM 5.0.8 to this process.
Also thanks to skraw at CM forums who asked a silly question that started the gears a crankin and ended up getting this as an answer.
** just goes to show that there is no such thing as a stupid question.
Last edited by lbcoder; 23rd June 2010 at 07:10 PM.
The Following 4 Users Say Thank You to lbcoder For This Useful Post: [ View ]
17th June 2010, 07:35 PM   |  #2  
xaueious's Avatar
Senior Member
Flag Toronto
Thanks Meter: 145
 
949 posts
Join Date:Joined: Dec 2009
Donate to Me
More
Sweet stuff!

Now we can finally reduce the size of that useless cache partition. And ROM devs can actually fit anything they want without a headache.

This should be leaps and bounds more useful on the phones with more ROMs space like the 32A Magic, where the cache is absurdly large.
Last edited by xaueious; 17th June 2010 at 07:40 PM.
17th June 2010, 08:15 PM   |  #3  
Senior Member
Flag NC
Thanks Meter: 44
 
682 posts
Join Date:Joined: Feb 2007
More
Quote:
Originally Posted by xaueious

Sweet stuff!

Now we can finally reduce the size of that useless cache partition. And ROM devs can actually fit anything they want without a headache.

This should be leaps and bounds more useful on the phones with more ROMs space like the 32A Magic, where the cache is absurdly large.

I'll ask a silly question, and full intent not to derail the thread.. why have partitions at all? (do they accomplish some level of protection that simple unix privs do not if /system, /data, /cache, etc were all on the same partition?) Hopefully not a super stupid question (I understand their use on my home linux box, but fail to see what value they add here)
17th June 2010, 08:23 PM   |  #4  
maxisma's Avatar
Senior Member
Flag Dorsten, Germany
Thanks Meter: 43
 
1,205 posts
Join Date:Joined: May 2009
More
I already pointed this out months ago.. but no one ever tried to make a use out of it.
17th June 2010, 10:54 PM   |  #5  
defconoi's Avatar
Senior Member
Flag SCHUYLKILL HAVEN
Thanks Meter: 4,416
 
2,744 posts
Join Date:Joined: Oct 2008
Donate to Me
More
sweeeeeet! good ****, someone make sure cyanogen knows about this.
17th June 2010, 10:58 PM   |  #6  
Senior Member
Thanks Meter: 0
 
104 posts
Join Date:Joined: Aug 2009
More
mhmm... this is awesome! But for all those who already have Death SPL, could this increase the amount of space even further?
18th June 2010, 12:19 AM   |  #7  
Macrophage001's Avatar
Senior Member
Thanks Meter: 0
 
608 posts
Join Date:Joined: Jan 2010
More
Quote:
Originally Posted by mattv888

mhmm... this is awesome! But for all those who already have Death SPL, could this increase the amount of space even further?

Yeah Im curious about that too
18th June 2010, 08:21 AM   |  #8  
goldenarmZ's Avatar
Senior Member
Flag Sheffield
Thanks Meter: 1
 
711 posts
Join Date:Joined: Oct 2008
Donate to Me
More
Quote:
Originally Posted by mattv888

mhmm... this is awesome! But for all those who already have Death SPL, could this increase the amount of space even further?

Yes, in theory.. I'm not sure how usable it would be, but purely theoretically you should be able to drop cache and userdata to 128k, mount them both on the sdcard instead and flash a 200mb+ system image.

With a bit of modification to the way we flash images at the moment, there's no reason devs can't include a custom partition layout to fit the requirements of every release.

This is an awesome find by both lbcoder and maxisma, who seem to have discovered it independently.. I totally missed maxisma's annoucement though

Whoever found it first, this rules.
18th June 2010, 07:30 PM   |  #9  
Macrophage001's Avatar
Senior Member
Thanks Meter: 0
 
608 posts
Join Date:Joined: Jan 2010
More
This would be really awesome to see can't wait
18th June 2010, 07:49 PM   |  #10  
OP Account currently disabled
Thanks Meter: 96
 
2,645 posts
Join Date:Joined: Jan 2009
Quote:
Originally Posted by Macrophage001

This would be really awesome to see can't wait

Wait for what?
This is something that everyone can do for themselves!
All you need is a calculator (to calculate memory offsets and sizes), the first post of this thread, and this:
http://android-dls.com/wiki/index.ph...ck_Boot_Images

unpack your boot.img, mkbootimg it back with the specified kernel command line, shove it into your update.zip (or fastboot it into the phone), and you're done-ish.

Take the most recent CM for example:

1) extract boot.img, unpack it, repack it with the kernel command line specified (modified to your specifications), put it back in the update.zip, resign, and put it on your sdcard.

2) Phone in fastboot mode, fastboot -c "same kernel command line as boot.img is packed with" boot recovery.img, flash your update.zip, done.

And then every time the phone boots up, it'll have the customized partition table since it is built into the boot.img.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes