[MOD][S-OFF] AOSP Based ROM Custom MTD Partitions Nexus One - Easy Flash/Patch

Search This thread

daedelus82

Senior Member
Sep 19, 2009
163
45
This recovery & patch allow installation of AOSP based ROM (CyanogenMod/OpenDesire/DeFrost) with partition sizes set to match that of Nexus One.

No more need for Apps2SD hacks!

It is very easy to install, however requires security to be disabled on your device (S-OFF in FASTBOOT).

Steps to install:
1. Download AOSP Based ROM to your SD card.
2. Download nexified-boot-patch-v1.0.0-bravo.zip to your SD card.
3. Reboot in Fastboot
4. Fastboot flash recovery nexified-recovery-clockwork-2.5.0.7-bravo.img
5. Reboot into recovery
6. Wipe data/factory reset
7. Flash ROM
8. Flash nexified-boot-patch-v1.0.0-bravo.zip
9. Reboot & Enjoy


Both the recovery, and the boot patch, have kernel cmdline:
Code:
mtdparts=msm_nand:640k@0x1FF60000(misc),4608k@0x4240000(recovery),3072k@0x46C0000(boot),148480k@0x49C0000(system),97280k@0xDAC0000(cache),202368k@0x139C0000(userdata)

Advantage is more space on DATA, whilst keeping phone as close to AOSP as possible. Nexus One is current developer phone, and it's partition sizes are 145MB for system, 197MB for data, 95MB for cache, same as what this patch achieves. Meaning your phone is as close to Android/AOSP as Google intended.

The patch also removes "dalvik.vm.dexopt-data-only=1" from build.prop which places dalvik-cache on the cache partition as per AOSP.

I have done this to my phone and am personally very happy with it, I have restored all my apps and still have 70MB free in data, and dalvik-cache resides in cache.

My current partitions are:
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   208092         0    208092   0% /dev
tmpfs                   208092         0    208092   0% /mnt/asec
/dev/block/mtdblock3    148480    118376     30104  80% /system
/dev/block/mtdblock5    202368    130124     72244  64% /data
/dev/block/mtdblock4     97280     46536     50744  48% /cache
/dev/block/vold/179:1
                       7431564   5484240   1947324  74% /mnt/sdcard
/dev/block/vold/179:1
                       7431564   5484240   1947324  74% /mnt/secure/asec
/dev/block/dm-0           3124      1504      1620  48% /mnt/asec/com.google.android.stardroid-1

Warnings:
Do not flash radio via recovery, only via fastboot. You should not be flashing radio via recovery anyway, it is strongly discouraged.

Credits:
  • AlphaRev - for bringing S-OFF to HTC Desire
  • Firerat - for the original mtd patch which I learned a lot from.
  • Lbcoder - for the initial information on how to modify partitions via kernel commands, i learned a lot from him as well.
  • Skraw ( CM forums ) - for getting lbcoder interested
  • Koush - for AnyKernel
  • Cyanogen & Co - for giving us all such great ROMs to play with
  • Amon_RA and Koush - for giving us something to patch
  • Kali- for porting CM6 to Desire thanks a bunch


I am doing this to try and spark further interest in this, in the hopes that other developers may improve on it, as the default partition sizes on the desire are crap.

How to uninstall / set partitions back to normal:
Boot into Fastboot
Fastboot flash standard/unmodified clockwork recovery or amon_ra
Reboot into recovery
Wipe data/factory reset
Flash ROM & Reboot


Downloads:
nexified-recovery-clockwork-2.5.0.7-bravo.img
nexified-boot-patch-v1.0.0-bravo.zip
 
Last edited:

cgrec92

Senior Member
Dec 29, 2009
912
27
London
so what are the advantages of this?
i see data is 197mb, does this mean that there is about 70mb+ storage space for apps?
thanks for your hard works
 

Rudolfje

Senior Member
Jun 9, 2008
214
10
Rotterdam
Well done!

Very brave of you to almost brick your device (twice?) and continue development nonetheless.

I don't need it, but many others will love this. Thanks a lot.
 

nbedford

Senior Member
Feb 12, 2007
117
1
If I follow your procedure am I stuck on nightly-132, or once i've got the resized partitions can I continue to flash CM6 nighlites?
 

marinierb

Senior Member
Mar 23, 2008
1,080
142
Hull, Québec
Google Pixel 7
These kernel parameters:
Code:
mtdparts=msm_nand:640k@0x1FF60000(misc),4608k@0x4240000(recovery),3072k@0x46C0000(boot),148480k@0x49C0000(system),97280k@0xDAC0000(cache),202368k@0x139C0000(userdata)

Where exactly are they set? I assume it's somewhere inside the boot.img?
 

djind

Senior Member
Jul 9, 2008
520
13
I am on CM602 with kernel update1 and psfmod unrevoked recovery. No chance of me getting the extra space for apps? :(
 

mon@diac

Senior Member
Jun 27, 2010
1,169
2,781
great works on my Desire..Thanks daedelus82 and other persons...I see 197 Mb on available space..
 

aleksei87

Member
Jul 16, 2010
44
7
Milan
Thank you very much daedelus, i was waiting for this since the day s-off was released :)

Could you upload a version of the stable CM6 too?
 

patp

Senior Member
Oct 27, 2006
703
42
Great Work! I hope this becomes the norm, we need that /system space for apps.
 

daedelus82

Senior Member
Sep 19, 2009
163
45
Thank you very much daedelus, i was waiting for this since the day s-off was released :)

Could you upload a version of the stable CM6 too?

Hello, yes I will patch CM6.0.2 stable as well. I have to go to work now but within a few hours. I will also try to answer other questions but have to run right now.
 

ieftm

Retired Recognized Developer
Apr 17, 2008
291
1,761
Please note, this WILL break 'fastboot flash' functionality.

But it's a nice intermediate way of doing things. There might be a HBOOT release with different partition tables (for example, one for Sense, one for AOSP roms).
That is currently under development.
 

daedelus82

Senior Member
Sep 19, 2009
163
45
These kernel parameters:
Code:
mtdparts=msm_nand:640k@0x1FF60000(misc),4608k@0x4240000(recovery),3072k@0x46C0000(boot),148480k@0x49C0000(system),97280k@0xDAC0000(cache),202368k@0x139C0000(userdata)

Where exactly are they set? I assume it's somewhere inside the boot.img?
Yes, boot.img for ROM, and recovery.img for recovery

I am on CM602 with kernel update1 and psfmod unrevoked recovery. No chance of me getting the extra space for apps? :(
Sorry I have patched CM and Clockwork Recovery only.

Please note, this WILL break 'fastboot flash' functionality.

But it's a nice intermediate way of doing things. There might be a HBOOT release with different partition tables (for example, one for Sense, one for AOSP roms).
That is currently under development.
Only breaks fastboot flashing of system and/or userdata, as fastboot will flash it to different blocks than the kernel is using. All other partition locations/blocks are unmodified meaning flashing of recovery, boot, and radio will be fine.. Also if you flash userdata, system, and boot all at same time it will also work, as overwriting boot will remove the kernel cmdline.

Would love to see a HBOOT implementation of this that does not require kernel modifications.

so what are the advantages of this?
i see data is 197mb, does this mean that there is about 70mb+ storage space for apps?
thanks for your hard works
Advantage is more space on DATA, whilst keeping phone as close to AOSP as possible. Nexus One is current developer phone, and it's partition sizes are 145MB for system, 197MB for data, 95MB for cache, same as what this patch achieves. Meaning your phone is as close to Android/AOSP as Google intended.

I have done this to my phone and am personally very happy with it, I have restored all my apps and still have 70MB free in data, and dalvik-cache resides in cache.

My current partitions are:
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   208092         0    208092   0% /dev
tmpfs                   208092         0    208092   0% /mnt/asec
/dev/block/mtdblock3    148480    118376     30104  80% /system
/dev/block/mtdblock5    202368    130124     72244  64% /data
/dev/block/mtdblock4     97280     46536     50744  48% /cache
/dev/block/vold/179:1
                       7431564   5484240   1947324  74% /mnt/sdcard
/dev/block/vold/179:1
                       7431564   5484240   1947324  74% /mnt/secure/asec
/dev/block/dm-0           3124      1504      1620  48% /mnt/asec/com.google.android.stardroid-1
 
Last edited:

nawoa

Senior Member
Aug 7, 2010
240
83
Thanks very much for this, I'll be flashing it shortly. I have two questions if you don't mind!

Why must radio be flashed using a different method?

Is there a way for me to further shrink the system partition? From what I can see, I should be able to do with 100mb for system and still have 30+ mb free. I use a modified version of CM + GApps and I remove a ton of stuff.

Maybe something like 96 System, 64 Cache, and the rest for data? (just for the love of god make it a multiple of 16 or my OCD will break the universe)
 
Last edited:

daedelus82

Senior Member
Sep 19, 2009
163
45
Updated OP. Added CM6 stable v6.0.2

Why must radio be flashed using a different method?

Is there a way for me to further shrink the system partition? From what I can see, I should be able to do with 100mb for system and still have 30+ mb free. I use a modified version of CM + GApps and I remove a ton of stuff.

Maybe something like 96 System, 64 Cache, and the rest for data?

You can patch system and cache to whatever sizes you want, it really depends on your ROM. If you have less than 96MB in your system partition then partitioning it to 96MB should be fine. I normally like to leave a few MB spare for good measure. See below for description on flashing radio from a re-partitioned recovery.

ezterry said:
Same steps as the rom, just ensure you *never* flash *any* spl or radio for any reason from a re-partitioned recovery with a cache partition that does not match the spl's actual cache start location. Or you will be in the market for a jtag adapter to fix your brick.
 

nawoa

Senior Member
Aug 7, 2010
240
83
Hmm... Because of the radio flashing issue and because I use DT-A2SD anyway, I think I'm going to hold off on using this until there's the HBOOT solution you guys are talking about.

Crossing my fingers that all I need to do is install standard clockwork recovery then go to a standard CM build.