Thursday, October 18, 2012

Porting CWM recovery for MT65xx phones


Credits to yuweng

bgcngm - unpack/ repack script 
CLShortFuse - SuperOneClick Root & BusyBox
DooMLoRD - Root & Busybox
Koush Dutta - Developer of ClockworkMod recovery
linerty - MT65xx ROM Backup


For creating or porting custom rom we need CWM without it is not possible.

So let us see the steps and process involved in porting ClockWorkMod recovery in MT65XX phones


1. Rooting and busybox
2. Backup of your current rom
3. Installing cygwin and porting CWM recovery
4. For something wrong goes for MT6573 phones

Step 1.

First we need to root the phone and make sure sure busybox is installed..


There are many rooting steps


1. Using the modified boot.img as shown in this tutorial (But make sure you the specific boot.img for your phone before flashing)


2. Using MTKDroidTools to root the phone


3. Or using Doomla script or similar script to root the phone (Most of the scripts are GENERIC means it will work on any android device of any brand).



Step 2.

So make sure you have rooted the mobile and busybox installed...


Now important step is to backup the rom of the phone.


There are many ways to do it.


1. Using SP Flash tool


and following these simple steps



Start the flash-tool -> load the scatter-file -> click on 'Read back' -> click on 'Add' -> double click the new entry -> give a name for your backup -> enter start-address and length -> click OK -> click on readback button -> connect your phone.

2. Using the MTKDroidTools and selecting the backup button

3. Using the Gsctipt method credits to 

Download link :

http://www.mediafire.com/download.php?3q94h5ktnsosqy5



Extract directly to your SdCard & install GscriptLite.apk







Press Menu & Add script










Step 3.

Now Installing Cygwin for windows


Cygwin Off-Line Installer


These recoveries will work on ICS MT6575/MT6577 you may also try for GB for Not working recovery on MT6573 see below after this tutorial.

Download link
http://www.mediafire.com/?5xux4adbam20tfh
MT65xx Unpack/ Repack
Download link
http://www.mediafire.com/download.php?i6g8r6ynjtcgoiy
Mobileuncle Tools
Download link
http://www.mediafire.com/download.php?ia9tsadkle8jmxc
CWMR 6.0.0.3 recovery.img-ramdisk
Download link
http://www.mediafire.com/download.php?gpoamhgw224m0n5
CWMR 6.0.1.1 recovery.img-ramdisk
Download link
http://www.mediafire.com/download.php?0hte0etq9dv8yab
CWMR 6.0.1.1 Touch Screen recovery.img-ramdisk
Download link
http://www.mediafire.com/download.php?0l2vxvs4sqwgck6
Optional – dsixda Android kitchen v0.199
Download link
http://www.mediafire.com/download.php?7zfck33vaxiwbq6






Browse to wherever you have extracted cygwin & look for cygwin_packages












Extract bm-mt65xx-unpack-repack.7z to c:\cygwin\bm




Copy your recovery.img backup from
Gscript or similar backup to c:\cygwin\bm






Starting cygwin for the first time

cd c:/cygwin/bm





To unpack use command ./unpack-mt65xx.pl recovery.img


For linux users you can try this : 

sudo perl ./unpack-MT65xx.pl recovery.img



below are the files  extracted out from recovery.img

Delete the RED circle files




Remaining only recovery.img-kernel.img




Extract whichever CWMR version your prefer to c:\cygwin\bm




Re-packing:
For Linux users :
sudo perl ./repack-MT65xx.pl -recovery ./recovery.img-kernel.img ./recovery.img-ramdisk ./recovery.img

For Windows :

Use command
./repack-mt65xx.pl -recovery ./recovery.img-kernel.img ./recovery.img-ramdisk ./recovery.img




Turn on your phone USB Storage & copy newly created recovery.img to your SdCard




Copy mobileuncle tools ( m44tools.apk ) to SdCard








After phone reboot & you shall have your CWMR
Special Note : CWMR 6.0.1.1, enter command is camera not the usual power button !




Adb shell can be access via CWMR on all three version





=============================================

All three recovery.img-ramdisk doesn't work on my mt6573. What now ? No worries, you still
have a last resort to port a complete working CWMR to your MT6573...
Koush Dutta, the developer for ClockworkMod is so kind that he created
http://builder.clockworkmod.com to let people build their own CWMR !







You will need below script too unpack the recovery.img created by
http://builder.clockworkmod.com
unpack-bootimg
Download link
http://www.mediafire.com/?ke9zz09wgk72fuw





Create a new folder named bt, copy & paste unpack-bootimg.pl







Go to http://builder.clockworkmod.com





Select your backup recovery.img from Gscript or similar backup





Scroll down to the bottom, either you put a check mark on Touch Recovery to build CWMR
with Touch Screen support or just leave it to build CWMR standard version





It is best that you bookmark the page as not to mix up with other people's build





Remember you build number. The RED icon indicate build fail while the BLUE indicate build
success. You need to check your build number whether it is a success. Then you can
download the recovery.img if the build is successful.






Copy downloaded recovery.img from http://builder.clockworkmod.com & start cygwin & go to
bt folder




Use the command ./unpack-bootimg.pl recovery.img







You will get a new folder named recovery-img-ramdisk folder







Go back to bm folder, copy your stock recovery, unpack it & delete recovery.img &
recovery.img-ramdisk.cpio.gz as not to confuse yourself







On your stock recovery.img-ramdisk, delete etc, res & sbin & replace it with the one from
http://builder.clockworkmod.com





Deleted etc, res, sbin                                                   Three files copy & paste from c:\cygwin\bt







Go to recovery.img-ramdisk\etc & open recovery.fstab







Change fstype to ext2 & save it









Open either one of the three recovery.img-ramdisk & copy the content of system






Copy & paste it to c:\cygwin\bm\recovery.img-ramdisk\system
If you intent to use adb shell at CWMR then you have to change your stock recovery
default.prop
ro.secure=1 → 0
ro.allow.mock.location=0 → 1
ro.debuggable=0 → 1
persist.service.adb.enable=0 → 1
Use below command to repack
./repack-mt65xx.pl -recovery ./recovery.img-kernel.img ./recovery.img-ramdisk ./recovery.img
Keep your finger cross, flash it with mobileuncle tools & it should work on your MT6573 !



14 comments:

  1. will this work on goophone y5? mt6575? thanks for your response

    ReplyDelete
  2. catastrophe man .
    its giving errors

    i tried it in both cygwin (installed on xp sp3) and in ubuntu 10.04 lts (running in vmware( vmware is installed in xp sp3 and ubuntu is running from it) .

    all goes well until in enter the following command in cygwin in xp..

    BaldEagle@warsi-274efca85 /bm
    $ ./repack-mt65xx.pl -recovery ./recovery.img-kernel.img ./recovery.img-ramdisk ./recovery.img
    Can't locate Switch.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int /usr/lib/perl5/site_perl/5.14 /usr/lib/perl5/vendor_perl/5.14/i686-cygwin-threads-64int /usr/lib/perl5/vendor_perl/5.14 /usr/lib/perl5/5.14/i686-cygwin-threads-64int /usr/lib/perl5/5.14 /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 .) at ./repack-mt65xx.pl line 16.
    BEGIN failed--compilation aborted at ./repack-mt65xx.pl line 16.

    BaldEagle@warsi-274efca85 /bm



    if i try under ubuntu i get the following error

    L@L-desktop:~/Desktop/bm$ sudo perl ./repack-MT65xx.pl -recovery ./recovery.img-kernel.img ./recovery.img-ramdisk ./recovery.img
    [sudo] password for L:
    MTK-Tools by Bruno Martins
    MT65xx repack script (last update: 31-07-2012)

    Repacking recovery image...
    Ramdisk size: 7528 blocks
    Can't exec "mkbootimg": No such file or directory at ./repack-MT65xx.pl line 82.

    Repacked recovery image into ./recovery.img
    L@L-desktop:~/Desktop/bm$

    ReplyDelete
  3. Thank you so much !!! I was using an MTK6573 and followed your guide throughout and guess what, i installed CWM recovery on it !!! But i have to admit, it was a tiresome one, i almost felt like giving up at some point.

    Advice to other MTK6573 readers, make sure you first read the steps for creating the bm folder in the above MTK65XX guide for other MTKS since you'll need it.

    Have fun!

    Thank you once again genius !!

    ReplyDelete
  4. Okay, CWM wont let me wipe data/ factory reset.

    It just doesnt give me the options of ' No ' or Yes - wipe data.

    Its just tells me that 'this process can't be undone .. something like that, and thats all.

    I've tried both images except the touch one after building my custom one from the website.

    Anyway, i learnt a few things here and there, so, i guess thats it. caio

    ReplyDelete
  5. will this work on mtk6577 ?

    ReplyDelete
  6. I have not worked in the model ZhouXing i9300 mtk6577...¿any help?

    ReplyDelete
  7. esèctacular recomendasicimooo sin dudar al pie de la letra amigos

    ReplyDelete
  8. GscriptLite can't find the file back23.sh. Where should I relocate the file for GscriptLite to find it? I have already rooted my phone (using bin4ry restore method for ICS/JB) and installed busybox on it. GscriptLite is also showing other info using superuser access.

    ReplyDelete
    Replies
    1. back23.sh needs to be in the GScriptLite folder directly and not inside any other folder.

      Delete
  9. link are dead, can someone reupload files please?

    ReplyDelete
  10. http://www.mediafire.com/download.php?i6g8r6ynjtcgoiy
    link invalid
    http://www.mediafire.com/download.php?ia9tsadkle8jmxc
    link invalid
    and also rest recovries links invalid too, plz help make these available.

    ReplyDelete
  11. will this work on my MTK6577. Plz..
    Actually I found a Recovery.img file in google for my other MTK6575 phone and using Mobile Uncle CWM Recovery is working like charm. Just so simple. Root and Mobile Uncle and Recovery img in SD card...that's it.
    Wondering any one could copy link to such kind of Recovery.img for MTK6577...please.

    ReplyDelete
  12. plz make the links available, the recovery links are all dead

    ReplyDelete