[GUIDE][CM Port][ MT6589 only] Port CyanogenMod 10.2/11 for all MT6589 devices

Search This thread

Nihal @A-JAX

Senior Member
Oct 18, 2013
291
224
Bangalore
@chrmhoffmann compiled first ever CyanogenMod for his Wiko Stairway which is a MT6589 device and made it possible for other MT6589 users to taste CM. Since then many are porting it to their MT6589 device and many are requesting to make a port for their device. So, I have made a guide here to make it easier for them to port themselves. You should give proper credits to respected developers and hit thanks before posting on XDA.


NOTE:I have made a list of already ported CM roms in #2 post below , if your device is not listed there download any of the ported CM rom and follow this guide to port it to your device


This is the guide to port CM 10.2/11 for all MT6589 devices.Read carefully and follow each step correctly otherwise CM won't boot

Tools Required:
1) Archive Manger (winrar,winzip,7zip)
2) boot.img Unpack Repack Tools

http://forum.xda-developers.com/showthread.php?t=1587411(For Linux)
http://forum.xda-developers.com/showthread.php?t=2036528(For Windows)


NOTE:
For CM 11 the same proceedure is followed but the stock boot.img must be having kernel with binder.c patched and SELinux enabled (This feature can be bypassed but binder.c patch is must otherwise CM 11 won't boot)


Guide:

1) First get your stock rom and download any ported CM 10.2/11 rom from #2 post below

2) Get boot.img from your phone(stock rom) and boot.img from downloaded CM-ROM.zip

3) Unpack both of them to get ramdisk and kernel of both.

4) Repack CM's ramdisk and stock kernel (your phone's) to get a new boot.img

5) Extract system folder from your phone(stock rom) and system folder from downloaded CM-ROM.zip

6) Copy and replace these files from stock to CM,

=> /lib/modules/ -> all files

=> /framework/ -> CustomProperties.jar
mediatek-common.jar
mediatek-framework.jar
mediatek-op.jar
secondary-framework.jar

=> Also all the files mentioned in the below link ( A great thanks to Kashifmin for providing this )
https://github.com/kashifmin/android_device_micromax_a116/blob/master/proprietary-files.txt

7) Now take the modified CM system folder and the new boot.img and make a zip archive with normal deflate compression ( are default in 7zip)

8) Open the newly created zip archive and downloaded CM-rom.zip .Now drag and drop the META-INF and file_contexts from downloaded CM-rom.zip to newly created zip archive.

9) Now flash the new zip using recovery (CWM/TWRP)

10) Enjoy !!




CREDITS:
@michfood for his Boot unpack/repack utils for WINDOWS.
@bgcngm for his Boot unpack/repack scripts for LINUX.
@kashifmin for his proprietary-files.txt
@kashifminfor guiding me.
@chrmhoffmann For bringing the first ever CM10.2 for an MT6589 device.
@XpLoDWilD
@Dr-Shadow
OmniROM project.
 
Last edited:

polfrank

Senior Member
Jul 5, 2012
718
335
Uhm.... I guess I can't port cm10.2 over stock jb4.2.1 rom, right?
I ask because I first looked for cm10.1 to port, but to my surprise, I didn't find any cm10.1 builds for any mt6589 on google.
 

Nihal @A-JAX

Senior Member
Oct 18, 2013
291
224
Bangalore
@polfrank you can port CM 10.2 using stock 4.2.1 rom. First you have to download any CM 10.2 Rom from above and follow guide to port. You can even port above CM 11 Roms if you have a working kernel source for your device

Sent from my iris458Q using XDA mobile app
 
Last edited:

Nihal @A-JAX

Senior Member
Oct 18, 2013
291
224
Bangalore
@limam27 boot loop occurs if 1) boot.IMG is badly repacked 2) any file is missing from your device stock rom which has to be copied to CM ROM as mentioned in the guide. Check them first . Also Check whether you are getting errors during unpack and repack of boot.IMG.

Sent from my iris458Q using XDA mobile app
 
Last edited:

polfrank

Senior Member
Jul 5, 2012
718
335
Hmm, I'm stuck on my brand's splash screen too. I don't get to see the boot animation, and as you mention I get errors during both unpacking and repacking. But it said that the file was copied though.... I 'll search for another way to upack and repack on Google and come back.

Edit: pfff, seems like the only way to do it on windows was the one you provided... :(
 
Last edited:

Nihal @A-JAX

Senior Member
Oct 18, 2013
291
224
Bangalore
Which CM version you are trying to port ?
If have Linux use unpack scripts to unpack/repack boot.img
Windows always gave me errors.
Sent from my iris458Q using XDA mobile app
 
Last edited:
  • Like
Reactions: polfrank

polfrank

Senior Member
Jul 5, 2012
718
335
Which CM version you are trying to port ?
If have Linux use unpack scripts to unpack/repack boot.img
Windows always gave me errors.
Sent from my iris458Q using XDA mobile app

I chose the CM10.2 from Wiko Stairway.

Yes, I'm now setting a Virtual Machine with Linux 14. And I'll try the unpack scripts from there. Let's see...


UPDATE:

OK, i ended up doing a clean install of ubuntu.
I upacked both images SUCCESS.
I repacked using stock kernel.img and CM ramdisk folder, SUCCESS.

I Install boot.img through CWMrecovery, it now gets past boot logo(Cubot white screen) but I think that before it would enter bootanimation the screen becomes a weird mass of colours, as if the screen was broken. It lasts for 1 second, then it restarts.

ps. I can successfully go to recovery with power+volUP If i like..
Any ideas?
 

Attachments

  • IMG_20140731_2059351.jpg
    IMG_20140731_2059351.jpg
    115.9 KB · Views: 422
  • IMG_20140731_2100341.jpg
    IMG_20140731_2100341.jpg
    198.5 KB · Views: 311
Last edited:

Nihal @A-JAX

Senior Member
Oct 18, 2013
291
224
Bangalore
You should get CM boot animation even if you use stock boot.img but won't boot. Did u correctly replace all required files in rom ? Do a clean one. Check if you can get logcat. Send me the logs

Sent from my iris458Q using XDA Premium 4 mobile app
 
  • Like
Reactions: polfrank

polfrank

Senior Member
Jul 5, 2012
718
335
You should get CM boot animation even if you use stock boot.img but won't boot. Did u correctly replace all required files in rom ? Do a clean one. Check if you can get logcat. Send me the logs

Sent from my iris458Q using XDA Premium 4 mobile app

I think I used wrong kernel.img. I repacked, will flash soon and come back to report.

EDIT: Are you sure that I have to use the META-INF folder from the CM rom? It gives me status 7 error.... (I also used the META-INF from a rom for my device, unfortunatelly it uses aroma, but it seems to install properly..)

EDIT2: I think that now I repacked the correct components of boot.img. It seems to get past the Cubot white splash screen, but after this, I get a black screen, but I can see that the screen is on, I can see the backlight. [I will try again with the CM META-INF-->still fails]

ps. Seems like I have to learn how to get a logcat if I wanna make use of your help... I'll be back in some hours.

----------------------------------------------------------------------
To sum up:
I have packed the new boot.img and replaced the needed files in the rom.

1) With the CM's META-INF folder I can't install, status 7 error.
Finding update package...
Opening update package...
Installing update...
assert failed: getprop("ro.product.device") == "stairway || getprop("ro.build.product") == "stairway"
E: Error in /sdcard/experiment/cm102last.zip
(Status 7)
Installation aborted.

2) With the stock rom's META-INF it seems to install propperly.

After reboot from recovery it goes to a black screen and stays there. I tried to logcat (adb logcat -v long > port.txt) but it just says:
[email protected]:/home/pol/Documents/sdk/platform-tools# adb logcat -v long > port.txt
- waiting for device -

If i write adb devices it says :
[email protected]:/home/pol/Documents/sdk/platform-tools# adb devices
List of devices attached
0123456789ABCDEF offline

When I am on recovery I get:
[email protected]:/home/pol/Documents/sdk/platform-tools# adb devices
List of devices attached
CWM-ZTE-V967S recovery
---------------------------------------------------------------------------------------------------------------

CONCLUSION: I managed to install the new boot.img and rom but it stops on a black screen, right after it passes from the white logo screen. And now, I need your ideas...

ps. I repeated the porting process from the beginning to make sure that I didn't make any mistakes... again, the same result.
--------------------------------------------------------------------------------------------------------------
NEW UPDATE: IT BOOTED!! but how....? Here it is........
I just replaced the boot.img from the wiko stairway flashable zip with the boot.img I created with repacking my phone's kernel and CM's ramdisk.

SO, I just changed the boot.img !!!! Testing.......
-------------------------------------------------------------------------------------------------------------
Testing results: buggy mobile network and sound not working. I guess this is why all those files are needed to be copied. I think I ll start copying..... But I wonder...what did I do wrong earlier while copying,,,?
 
Last edited:

Nihal @A-JAX

Senior Member
Oct 18, 2013
291
224
Bangalore
You will get status 7 error because it is a security feature which doesn't allow to flash one device's ROM to other. You have to edit using any text editor and remove first line in the update-script found in meta-inf/com/Google/android/

Also don't use other rom's meta-inf as they have different symbolic links which may not boot the device.

Your phone's modules will be different from wiko's. That's why you got buggy audio and network. Replace all the mentioned files.


sent from my iris458Q using XDA mobile app
 
Last edited:

polfrank

Senior Member
Jul 5, 2012
718
335
Okay, after some hours of trial and error I copied all the porting files provided in the op, except 2:

-libjpeg.so - When I port this from stock, Cm boots, but cannot show images, every single image, including the bootanimation is black.
-libmedia.so - When I port this from stock, Cm stays in the bootanimation forever. (No bootloop, just bootanimation forever)

-------------------------------------------------------------------------------------------------------------------------------------
The "extra" bugs that I have are:

1. No sound from the speaker (but yes in the headphone).

2. Weak signal. I don't know if this is normal. It has 1 bar and sometimes it has 0 and says no service. Also, the name of the tile in the QuickSettings is 20201 (weird...). I also get a message when the rom boots and it says: "Restricted Access changed. Data service is blocked." This appears sometimes at random too.

3. USB storage doesn't work through Android.... ( I don't know if this is normal too). When I plug it on PC it just charges. (Note: I now see that other devices have this problem too. I found a partial workaround in the MMX Canvas HD cm10.2 section)

PS. Would logcat help in any of these problems?

--------------------------------------------------------------------------------------------------------------------------------

I moved on, and took some adb logcats.
1. I took the audio.txt as follows: started logcat, pressed play on the apollo widget, pressed pause, stopped logcat
2. I took the signal.txt as follows: started logcat (while on Airplane mode), disable Airplane mode (from quickSettings tiles), enable mobile data, disable mobile data, enable Airplane mode, stop logcat
 

Attachments

  • Screenshot_2014-08-01-12-40-12.png
    Screenshot_2014-08-01-12-40-12.png
    79.9 KB · Views: 211
  • Screenshot_2014-08-01-12-41-04.png
    Screenshot_2014-08-01-12-41-04.png
    66.6 KB · Views: 210
  • signal.txt.zip
    61.4 KB · Views: 20
  • audio.txt.zip
    56.3 KB · Views: 16
Last edited:

Nihal @A-JAX

Senior Member
Oct 18, 2013
291
224
Bangalore
I'll look at logs meanwhile I never had problem with signal, speaker audio and images. To get USB storage working add these lines to build.prop and reboot

persist.sys.usb.config=mass_storage,adb
persist.sys.usb.config=mtp,adb

For signal issue , did u replace your modem.IMG in CM ROM ?
For image issue try those 2 files from wiko ROM.

Edit:
Try to freshly port CM once again as given in guide with some changes in meta-inf and build.prop as I gave. If you still have problems then report here.

I couldn't debug audio log but in signal log > network is disconnected as data is enabled and even it's saying messaging settings are false. There may be issue with modem.img


sent from my iris458Q using XDA mobile app
 
Last edited:
  • Like
Reactions: polfrank

Nihal @A-JAX

Senior Member
Oct 18, 2013
291
224
Bangalore
Cheers !! I'll add your device in the ported list. As I said previously all necessary files should be replaced in CM to be bug free except major BT,camera,hwcomposer,FM,GPS,2nd Sim bugs.

Also USB storage is buggy now as SD card is unmounted in mass storage mode but not mounted on PC and when disconnected from PC it doesn't get mounted and you have to reboot to get it working on android. Also mtp mode sometimes doesn't work

sent from my iris458Q using XDA mobile app
 
  • Like
Reactions: polfrank

polfrank

Senior Member
Jul 5, 2012
718
335
Nice!

The only file missing is /lib/libmedia.so and I 'm starting to think that this may be the cause of the sound bug. But when I copy it from the stock rom, I get boot problems...

Anyway, thanks for your help, and sorry that I messed up/spammed your thread. I think the most important part of the job is done..! Good job!

EDIT: I think I sort of fixed the mobile network issue. I used a modem.img from another version of stock rom and it seems to work. However I still get the error "Restricted Access changed. Data service is blocked." But I have full signal and 3G! It's something!
 
Last edited:

Nihal @A-JAX

Senior Member
Oct 18, 2013
291
224
Bangalore
Restricted access notification occurs if you enable or disable data and turn on/off airplane mode and phone and it is not a issue I think. It may be cyanogenMod's security message or something.

Also try libmedia.so from other
Stock rom which you said above.

sent from my iris458Q using XDA mobile app
 
Last edited:
  • Like
Reactions: polfrank

@Iimam27

New member
Jun 6, 2014
4
0
thanks for repley

@limam27 boot loop occurs if 1) boot.IMG is badly repacked 2) any file is missing from your device stock rom which has to be copied to CM ROM as mentioned in the guide. Check them first . Also Check whether you are getting errors during unpack and repack of boot.IMG.

Sent from my iris458Q using XDA mobile app

I want to port my device MT6589T JB 4.2 to cm11 kitkat but I do not know how to activate the binder c in the boot.img.

I've tried without a binder c install process always aborted status 7

please help thank you
 

Nihal @A-JAX

Senior Member
Oct 18, 2013
291
224
Bangalore
Hello @limam27

I want to port my device MT6589T JB 4.2 to cm11 kitkat but I do not know how to activate the binder c in the boot.img.

I've tried without a binder c install process always aborted status 7

please help thank you


You can't patch binder.c from boot.IMG. You must be having kernel source for your device and you must patch binder.c in kernel. If you don't have kernel source then its almost impossible to get KitKat. See if your device clones have kernel source for their device. Else look for almost similar specs device with same processor. My device has mt6589m but no source from vendor. I used similar mt6589m device's source to build kernel. Now CM 11 is booting but no display due to different GPU config. So it's really hard if you don't have source. Try with CM 10.2 first .

EDIT- Previously I have told why you get status 7 error. So read whole thread before posting here. Good luck

Sent from my iris458Q using XDA Premium 4 mobile app
 
Last edited:
  • Like
Reactions: @Iimam27

Top Liked Posts