Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,768,220 Members 45,467 Now Online
XDA Developers Android and Mobile Development Forum

Custom partition layouts, ZERO brick risk!

Tip us?
 
lbcoder
Old
(Last edited by lbcoder; 23rd June 2010 at 07:10 PM.)
#1  
Account currently disabled - OP
Thanks Meter 95
Posts: 2,645
Join Date: Jan 2009
Default Custom partition layouts, ZERO brick risk!

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.
The Following 4 Users Say Thank You to lbcoder For This Useful Post: [ Click to Expand ]
 
xaueious
Old
(Last edited by xaueious; 17th June 2010 at 07:40 PM.)
#2  
xaueious's Avatar
Senior Member
Thanks Meter 142
Posts: 940
Join Date: Dec 2009
Location: Toronto

 
DONATE TO ME
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.
Past devices: HTC Dream (Rogers), Acer Liquid E, HTC EVO3D GSM, HTC Panache (international myTouch4G), Huawei Ideos U8150, Rogers HTC Magic (myTouch3G variant)

Current devices: Samsung Galaxy Nexus GSM (i9250), ASUS Transformer TF300, Samsung Galaxy S3 i747m (Telus), Huawei Ideos S7
 
zim2dive
Old
#3  
Senior Member
Thanks Meter 44
Posts: 680
Join Date: Feb 2007
Location: NC
Quote:
Originally Posted by xaueious View Post
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)
Device 1: Nexus 5 16GB (stock)
Device 2: Nexus7 (2013) 16GB (unlocked/rooted/TWRP/Stock ROM) (Poetic slimline case, Snugg on pre-order)
Device 3: Vizio Co-Star (stock)
Device 4: Logitech Revue (stock)
 
maxisma
Old
#4  
maxisma's Avatar
Senior Member
Thanks Meter 43
Posts: 1,205
Join Date: May 2009
Location: Dorsten, Germany
I already pointed this out months ago.. but no one ever tried to make a use out of it.
Acer Liquid Metal
LG Optimus 2x
Reading advice: http://forum.xda-developers.com/showthread.php?t=667298
Follow me on Twitter: www.twitter.com/maxisma
Donate to MoDaCos Cancer Research fund
 
defconoi
Old
#5  
defconoi's Avatar
Senior Member
Thanks Meter 1841
Posts: 2,109
Join Date: Oct 2008
Location: SCHUYLKILL HAVEN

 
DONATE TO ME
sweeeeeet! good ****, someone make sure cyanogen knows about this.
Like my work? Consider donating.
 
mattv888
Old
#6  
Senior Member
Thanks Meter 0
Posts: 104
Join Date: Aug 2009
mhmm... this is awesome! But for all those who already have Death SPL, could this increase the amount of space even further?
 
Macrophage001
Old
#7  
Macrophage001's Avatar
Senior Member
Thanks Meter 0
Posts: 605
Join Date: Jan 2010
Quote:
Originally Posted by mattv888 View Post
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

  • Phone
: HTC Dream Deceased
:Nexus One
  • Carrier
: T-Mobile USA
  • SPL
: Danger SPL
  • Radio
: Latest


__________________________________________________ ___________________
Best Fails In XDA:
http://forum.xda-developers.com/showthread.php?t=656499
http://forum.xda-developers.com/showthread.php?t=656290

Edit your Sig
 
goldenarmZ
Old
#8  
goldenarmZ's Avatar
Senior Member
Thanks Meter 1
Posts: 711
Join Date: Oct 2008
Location: Sheffield

 
DONATE TO ME
Quote:
Originally Posted by mattv888 View Post
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.
Samsung Galaxy S3 GT-I9300 | Stock 4.1.2
HTC Desire Z | SPL: 0.84.2000 S-OFF | Radio: 26.03.02.26_M | Recovery: Clockwork | OS: Stock WWE rooted *retired*
T-Mobile G1 UK (HTC Dream) | SPL: 1.33.0013d | Radio: 2.22.28.25 | Recovery: RA1.7.0 | OS: EzTerry's MT3G w/GDE Onyx theme *retired*
O2 Mini-S (HTC Wizard G4) | SPL: Hard | Radio: 2.71.11 | OS: Custom build from WizFlo 6.1.2.2 *retired*
 
Macrophage001
Old
#9  
Macrophage001's Avatar
Senior Member
Thanks Meter 0
Posts: 605
Join Date: Jan 2010
This would be really awesome to see can't wait

  • Phone
: HTC Dream Deceased
:Nexus One
  • Carrier
: T-Mobile USA
  • SPL
: Danger SPL
  • Radio
: Latest


__________________________________________________ ___________________
Best Fails In XDA:
http://forum.xda-developers.com/showthread.php?t=656499
http://forum.xda-developers.com/showthread.php?t=656290

Edit your Sig
 
lbcoder
Old
#10  
Account currently disabled - OP
Thanks Meter 95
Posts: 2,645
Join Date: Jan 2009
Quote:
Originally Posted by Macrophage001 View Post
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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Forums Added for the Nvidia Shield Tablet and Sharp Aquos Crystal

Just a few days ago, wetook an in depth look at theNvidia Shield Tabletand … more

[OTA Captured] Android 4.4.3 Lands on European HTC One M7

The secound release of the Android L Developer Previewmay be the new hotness for … more

Take a Perfectly Stable Shot with Open Camera

The camera app on our Android smartphones and tablets isn’t something we focus on all … more

Motorola Droid X Receives Almost Fully Functional KitKat Port

While we are all wondering when Google will decide to officially release … more