Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
azunino
Old
(Last edited by azunino; 31st August 2012 at 10:43 AM.) Reason: CM9.1
#1  
azunino's Avatar
Senior Member - OP
Thanks Meter 176
Posts: 216
Join Date: Feb 2012
Default [ROM][4.0.4][STABLE][MOD] CM9 with /data on the external SD (avoid EU bug)

*** This MOD only works with phones with working internal SD ***

*** DO NOT FLASH THIS IF YOU ARE AFRAID OF EXPERIENCING BOOTLOOPS ***


To those of you who have not been following the Encryption Unsuccessful thread: http://forum.xda-developers.com/show....php?t=1447303, Several weeks ago I proposed a workaround to reduce the possibility of crippling our phones with the infamous EU bug of ICS: http://forum.xda-developers.com/show...&postcount=632

In short, the idea is to force ICS to use /data on the external micro SD instead of the internal. In this way I hope the EU bug will corrupt the external SD (fixable by reformatting it using a card reader on a PC) instead of the internal. In addition, we may be able to reproduce the EU bug and obtain some nice logcats for helping our great devs at finding and hopefully fixing the bug. Besides, I'd rather break a 10USD micro SD card than a 300USD captivate.

The idea is simple so is the "solution". I've developed some scripts that take as input any ICS ROM (tested with CM9, AOKP and MIUIv4) and modify it to use /data on the external SD. I've installed my modified CM9 running with /data on a partitioned 8GB SanDisk class 4 SD card with good performance. BTW, a faster SD does not imply faster performance in this setup, because the way Android uses /data: http://forum.xda-developers.com/show....php?t=1005633

Considering that the modified ICS does not mount /data on the internal SD and mounts the external SD FAT partition as /sdcard, it does not even require the internal 16GB FAT partition... in theory it is less likely that the EU bug will kill the internal SD, but no one knows for a fact. Moreover, the internal SD card FAT partition gets mounted as /emmc, but you can unmount it from Settings>Storage just to be on the safe side.

I've been using the modified CM9 for some time and it works great. Some testers have also helped. Off course YMMV. Please do not report bugs to the developers of CM9 (AOKP or MIUI) if you use this mod because this is not official.

Read carefully before proceeding:

*** Disclaimer: Usual disclaimer applies here as well... you use this at your own risk, I am not responsible for anything that happens to any of your devices. You assume all responsibility when using this ROM. ***

To install this you need a micro SD card with enough space for two partitions (1GB for /data + all the space you need for music, photos, videos, games, etc. on /sdcard)

First, partition a micro SD card using a PC. Create two primary partitions (not logical) in this exact order:
  1. a FAT32 partition that will be mounted as /sdcard: the SD card capacity - 1GB (or more if you have many apps)
  2. an EXT4 partition that will be mounted as /data: 1GB (or more if you have many apps)

There are many programs to partition SD cards. I have used the Disk Utility included with Ubuntu 12.04. I don't have Windows, but some people reported that this may help: http://forum.xda-developers.com/wiki...d_partitioning

Optional Insert the partitioned SD card in your phone and boot whatever Android you have to check if it works. On CM7 the external FAT32 partition should be mounted as /emmc and the EXT4 as /sd-ext

*** Disclaimer: I've flashed the modified CM9 from CM7.2, CM9 and MIUIv4, so I have no idea if other combinations will work ***


Now follow these steps:
1) Ensure you are on GB Bootloaders and you have a recent CWM recovery (tested with CM7)
2) Verify that the 3 button combo works for booting in CWM. Otherwise STOP here and read more about flashing ROMs.
3) Download the modified ICS: CM9.1 or AOKP b40
4) Download Gapps for ICS: http://goo.im/gapps/
5) Copy the two files to the FAT partition of the partitioned micro SD card using your PC and insert it into your phone.
6) Boot your phone to CWM
7) Wipe data/factory reset, wipe cache, wipe dalvik cache under advanced
8) Flash Rom (install zip from sdcard->choose zip from internal card), it will bootloop because of the new mount points.
9) Remove the battery and reboot into recovery using the 3 button combo
10) Flash Rom again. Note that now the internal SD and external SD are reversed. (install zip from sdcard->choose zip from SD card)
11) Flash Gapps: http://goo.im/gapps/
12) After some minutes (2 to 5) ICS will be ready


This is the output of the mount command after booting:




*** Please DO NOT report bugs to the developers of CM9, AOKP, Devil or Semaphore kernels if you use this mod because this is not official. ***

All credits to:
- the CyanogenMod team
- the AOKP team
- DerTeufel1980 (for the Devil kernel and his detailed instructions about how to modify the kernel)
- stratosk (for the Semaphore kernel and his instructions about how to compile the kernel)
- all the people who have tested this mod



---
Changelog:

8/29/2012:
CM9.1

8/11/2021:
CM9 stable!!!!

7/19/2012:
CM9 RC2. I will update only when RC/stable versions are released.

7/18/2012:
Kernels removed.

7/17/2012:
Updated Semaphore Kernel (1.2.6)

7/16/2012:
Updated Devil Kernel (1.0.0-rc3)

7/11/2012:
Updated Devil Kernel (0.98.3)

7/3/2012:
Added link to the most recent CM9 nightly (automatically patched and uploaded)

7/1/2012:
Updated Devil Kernel (0.92)
Updated CM9

6/29/2012:
Added Semaphore Kernel. Thanks stratosk!
Added AOKP b40
Updated CM9

6/20/2012:
Added Devil3 Kernel. Thanks DerTeufel1980!

6/19/2012:
Updated CM9

6/16/2012:
New script for modifying any CM9 ROM. Updates are easy!

6/14/2012:
Initial release based on a recompiled CM9

--
IF I HAVE HELPED YOU IN ANY WAY, PLEASE THANK ME or DONATE: https://www.paypal.com/cgi-bin/websc...=AQF82UCZ9AF6L
The Following 18 Users Say Thank You to azunino For This Useful Post: [ Click to Expand ]
 
azunino
Old
#2  
azunino's Avatar
Senior Member - OP
Thanks Meter 176
Posts: 216
Join Date: Feb 2012
* reserved *
The Following User Says Thank You to azunino For This Useful Post: [ Click to Expand ]
 
azunino
Old
#3  
azunino's Avatar
Senior Member - OP
Thanks Meter 176
Posts: 216
Join Date: Feb 2012
* reserved *
The Following 2 Users Say Thank You to azunino For This Useful Post: [ Click to Expand ]
 
JKelley103
Old
#4  
JKelley103's Avatar
Member
Thanks Meter 9
Posts: 58
Join Date: Aug 2009
Thank you!!

Sent from my SGH-I897 using xda premium
 
visionlogic
Old
#5  
Senior Member
Thanks Meter 37
Posts: 105
Join Date: Dec 2008
Location: Dixie
Quote:
Originally Posted by azunino View Post
... In theory it is possible to extract from a boot.img file the init.rc file with the mappings and modify it, but I have not idea how (some help please reversing https://github.com/CyanogenMod/andro...mkshbootimg.py ?). Well, if we can solve that, I can write a shell script to convert any(?) ICS based ROM/kernel and modify it to use /data on the external SD.
Perhaps this would be of some help?:

HOWTO: Unpack, Edit, and Re-Pack Boot Images
Device: SGH-i897 (Captivate)
Phone Build: 1012
The Following User Says Thank You to visionlogic For This Useful Post: [ Click to Expand ]
 
azunino
Old
#6  
azunino's Avatar
Senior Member - OP
Thanks Meter 176
Posts: 216
Join Date: Feb 2012
Quote:
Originally Posted by visionlogic View Post
Perhaps this would be of some help?:

HOWTO: Unpack, Edit, and Re-Pack Boot Images
Thanks, but I've tried that. It seems SGS devices use a slightly different format. I'll keep reading about it until I find a way to unpack/repack the images.
The Following User Says Thank You to azunino For This Useful Post: [ Click to Expand ]
 
Fishmanzero
Old
#7  
Member
Thanks Meter 9
Posts: 69
Join Date: Sep 2010
I saw "Other kernel will not work" so it seems that you have compiled a modified kernel to change the mount points ? If so I think it's also very promising to be a solution to build a CM to use with broken internal storage...
I'm using stock-based roms with modified kernels but I couldn't manage to repack a working CM compatible kernel...
 
azunino
Old
#8  
azunino's Avatar
Senior Member - OP
Thanks Meter 176
Posts: 216
Join Date: Feb 2012
Quote:
Originally Posted by Fishmanzero View Post
I saw "Other kernel will not work" so it seems that you have compiled a modified kernel to change the mount points ? If so I think it's also very promising to be a solution to build a CM to use with broken internal storage...
I'm using stock-based roms with modified kernels but I couldn't manage to repack a working CM compatible kernel...
That is correct. I modified the files that contain the mount points and the updater.sh. The problem with these files is that they are packed together in a ramdisk (ext2 filesystem image), recovery and with the kernel in a boot.img file. Therefore, it is not trivial to modify them to work with any kernel/ICS ROM.

Yesterday, after hours of reading hexadecimal boot.img files... I wrote a python script to unpack a boot.img file and extract from it the kernel, ramdisk and recovery ramdisk. These ramdisks are easy to modify (cpio format), so right now I'm testing a shell script that takes as input any ICS based ROM (or kernel) and modifies it to use /data as my modded CM9. In other words, things are getting interesting ;)

Once I finish the script It would be very easy to change mount points as you wish because they will be no longer hardwired in each ROM/kernel. So... let your imagination fly.
The Following 4 Users Say Thank You to azunino For This Useful Post: [ Click to Expand ]
 
azunino
Old
#9  
azunino's Avatar
Senior Member - OP
Thanks Meter 176
Posts: 216
Join Date: Feb 2012
Updated OP. Now I can automatically convert CM9 and AOKP to use /data on the external SD.

I'm extending the script to handle kernel updates. BTW, some of them seem to use a different boot.img format.
The Following User Says Thank You to azunino For This Useful Post: [ Click to Expand ]
 
manolis
Old
#10  
Member
Thanks Meter 3
Posts: 38
Join Date: Jun 2007
but we can not automatically convert CM9 and AOP to use / data on the external SD. instruction will be for us?

 
Post Reply+
Tags
captivate, cm9, encryption, ics
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...