Tuesday, May 3, 2016

[MOD][STOCK] Int2Ext.mikewse for Xperia 2011 Stock ICS firmware

ABOUT
This is a solution for the dreaded warning about running low on internal memory on 2011 Xperia phones. My own Xperia Mini Pro has only 420MB of internal storage and this fills up quickly when installing apps. In this post I provide instructions and scripts to use the external SD card to extend the available internal storage, a so called "int2ext" solution which there are many flavours of.
The goal has been to solve the storage problem while at the same doing as small changes as possible to the system as possible (not unlocking bootloader, not installing custom recovery, etc).
Note that when the SD card is used to extend internal storage you should never power on the phone without the SD card inserted. Failing that you will probbaly need to factory reset and start over with the installation.
The whole 2011 Xperia range should be compatible, maybe other devices too.

BACKGROUND
After trying (and failing) with a number of the other solutions for enlarging internal storage with the external SD card, I've made my own solution that works on the Xperia Mini Pro (XMP) stock ICS ROM. In the second post I describe some properties of my implementation that may count as advantages for some, YMMV though.

COMPARED TO OTHER SOLUTIONS
See second post for technical description.

PREREQUISITES
  1. Sony-Ericsson stock ICS ROM installed on your phone (you don't need unlocked bootloader, recovery or any other mods)
  2. Remove any other similar apps or tweaks (Link2SD, Apps2SD, INT2EXT etc) as they may interfere with this implementation. The installation script will abort if any of these are found.
  3. USB Debugging enabled in your phone's Developer settings.
  4. Micro-SD card to install in the phone's SD slot.
  5. Cydia Impactor (optional)
    Download from http://ift.tt/IcNgB9.
  6. Flashtool (optional)
    Download from http://ift.tt/1hUPR2z. I have used version 0.9.18.6 which worked fine for the XMP while 0.9.20.0 had some problems. I have been told this has been fixed in 0.9.21.0 but have not verified it myself.

DOWNLOAD SCRIPTS
You find zip files as attachments at the bottom of this post.

INSTALLING
Check current firmware CDA (optional)
It is good to have a record of the exact firmware variant and version currently installed in case you need to flash back the stock ROM.
Go to the right place in the phone's service menu:
  • open Phone Dialer
  • dial the secret code appropriate for your phone (for XMP it is *#*#7378423#*#*)
  • go into Service Info
  • go into Software Info
Note down the CDA number shown under the Customization Number heading
(see also http://ift.tt/1Ux3uaK)

Partition your SD card
Your SD card should be partitioned as an MBR disk with (at least) two primary partitions:
  1. The first partition should be formated as FAT32 and will become your new (and smaller) SD card storage that you seen when connecting the phone to a computer.
  2. The second partition should be formated as Linux Ext2 and will become your extended internal storage.
You can have more partitions after these but these scripts will only care about the first two. I use a 16GB SD card and split even with 8GB to each partition.
There are many ways to perform the partitioning; I put the card in the SD slot on my computer and use the Minitool Partition Wizard Free Edition (http://ift.tt/1Ux3uaM) under Windows. For kicks you can install it using the Chocolatey auto-installer (http://ift.tt/21uAr8H) if you like. You have more info about Minitool and other tools here:
http://ift.tt/1ltrr1E
Note 1: Remember to set that partitions should be primary as some tools may default to logical and not primary partitions.
Note 2: You probably want to copy all your SD card files to your computer while partitioning and formating, and copy them back after, as all data will be erased on the SD card.

Prepare your phone
Insert the partitioned SD card.
Enable USB debugging in Developer settings.
Have a USB cable ready for connecting between your phone and computer.

Root
If you have already rooted you can skip this step. All you need is the su binary on the system - you don't need the SuperSU app installed.
I use Cydia Impactor to root:
  • connect phone
  • select "# drop SuperSU su to /system/xbin/su"
  • click Start
(see also http://ift.tt/21uAr8L)

You can verify that it worked by opening a root shell.
I do this from Cydia Impactor:
  • menu Device > Open Shell…
  • type "su" at the prompt
  • type "id"
"uid=0(root)" should be shown

Update Busybox
The existing Busybox on the XMP is too old and will not support the way directories are mounted here. I have used Busybox 1.22.1 so I highly recommend that you install this version using the procedure below. If you already have this or a higher version installed you can skip this step but please verify that you have all the needed applets in your Busybox binary by checking against all the busybox aliases at the top of my scripts.
I use Flashtool to upgrade Busybox:
  • connect phone
  • Device menu > Install busybox
  • choose version 1.22.1

Install init.d support
The stock ROM does not have init.d support so we need to add it. If you have already added init.d support using some other software then you can skip this step.
Unpack the init.d.mikewse-<nn>.zip file to a directory (f ex init.d.mikewse) on your SD card.
Open a root shell on the phone using Cydia Impactor:
  • menu Device > Open Shell…
  • su
Install by running the install script:
Code:

sh /sdcard/init.d.mikewse/install.sh
You can verify the installation by checking the existence of the init.d directory:
Code:

ls -d /system/etc/init.d
The init.d function will be active after the next reboot and you can see messages from it in the kernel log:
Code:

dmesg | grep init.d
Install int2ext support
Unpack the int2ext.mikewse-<nn>.zip file to a directory (f ex int2ext.mikewse) on your SD card.
Open a root shell on the phone using Cydia Impactor:
  • menu Device > Open Shell…
  • su
Install by running the install script:
Code:

sh /sdcard/int2ext.mikewse/install.sh
You can verify the installation by checking the existence of the int2ext boot file:
Code:

ls /system/etc/init.d/40int2ext
The int2ext function will be active after the next reboot and you can see messages from it in the kernel log:
Code:

dmesg | grep int2ext
You should also be able to see the new larger size of your storage in the Storage menu of system settings.

Tweak what's put on the SD card
The default int2ext script is set up with a good compromise between what files are delegated to the SD card vs are kept in the original location in internal storage. Apk files and app data are delegated to the SD card while unpacked app code (dalvik-cache) is kept on internal storage for speed and availability.
If you are installing a large number of apps your dalvik-cache may grow too large for internal storage. You can check how much it has filled up from a root shell:
Code:

df /mnt/int-stor
and also see how much of this is due to files in dalvik-cache:
Code:

du -s /mnt/int-stor/dalvik-cache
If you are hitting the limit then you can configure delegation of dalvik-cache to the SD card:
  • open a text editor with the 40int2ext file that you unzipped to the SD card in the int2ext.mikewse directory
  • edit the line
    Code:

    EXTDIRS="app app-private data"
    so it becomes
    Code:

    EXTDIRS="app app-private data dalvik-cache"
  • then reinstall int2ext by running the install script again

REFLASH STOCK ROM
If you want to start from fresh or need to recover from some failure in the installation then you can flash back the stock ROM using Flashtool.
First let Flashtool download and assemble the appropriate stock ROM for you:
  • click XperiFirm icon in toolbar (furthest to right)
  • select your phone model
  • select the appropriate CDA (collected at the beginning of this post)
  • click the release info in the right pane to start download
Then flash it to the phone:
  • click Flash icon in toolbar (furthest to left)
  • choose Flashmode
  • follow instructions (for XMP press Volume Down)
If you have any questions or problems regarding Flashtool there are lots of threads on XDA were you can find solutions about drivers etc.

CREDIT / INSPIRATION / OTHER ALTERNATIVES
Extend internal storage
CronMod-INT2EXT http://ift.tt/13H5tPE
Int2ext fixed for Xperia mini http://ift.tt/21uAoKd
Link2SD http://ift.tt/1qvn0TO
Apps2SD http://ift.tt/1PBDeb9
Mounts2SD http://ift.tt/1bFjAZv
init.d support
init.d Terminit http://ift.tt/YBWnyU
init.d for stock ROM http://ift.tt/1Ux3uaT

Bye now and hope it works well for you.



from xda-developers http://ift.tt/21uAp0z
via IFTTT

No comments:

Post a Comment