[GUIDE][MEDIATEK] How To Port 5.x.x LP and 6.x.x MM Based ROMs for MTK Kitkat Devices

ZonaRMR

Senior Member
Jan 27, 2014
260
454
103
Narnia


How To Port Lollipop and Marshmallow Based ROMs for MTK Kitkat Devices

Only For Mediatek SOCs

This guide applies to same chipsets:

Example:
MT6592 to MT6592
MT6572 to MT6572
MT6582 to MT6582


And works also for different SOC with same GPU


Before starting this tutorial, please make a backup of your ROM
I am not responsible for any damage to your device, this guide is for expert users.


You Need:

- Winrar, 7-Zip or similar
- Notepad++
- Tool for unpack/repack MTK boot.imgs
- Your Stock KitKat ROM
- One Lollipop/Marshmallow ROM for port
- Brain :p



Step 1.- Unzip the Lollipop or Marsmallow ROM you want to port and also the Stock ROM. Rename the Lollipop/Marshmallow ROM folder to Port ROM



Step 2.- Delete this files or folders in Port ROM folder and replace with your files from Stock ROM:



Code:
-[B][SIZE="2"]system/etc/firmware  <-- Folder
-system/usr/keylayout/Generic.kl  <-- File(if you  have issues with softkeys and power,volume keys after replacing this file, try don't touch the original [COLOR="Blue"]usr[/COLOR] folder in port ROM. [URL="https://forum.xda-developers.com/showpost.php?p=70381044&postcount=457"]See here[/URL][/SIZE][/B]
Step 3.-Open system/lib/hw folder in Stock ROM folder, then select & copy all files and paste to inside the system/lib/hw folder in Port ROM replacing files.

Note: if you porting a ROM from a different SOC, delete this files before in port rom, like this: audio.primary.mt65xx.so, audio_policy.mt65xx.so, gralloc.mt65xx.so, hwcomposer.mt65xx.so, ligths.mt65xx.so, sensors.mt65xx.so etc.



Step 4.-Rename your stock kitkat boot.img to stockboot.img and the boot.img from Port ROM folder to portboot.img. Now unpack the boot.imgs, use the kernel 3.4.67(zImage)from your decompiled stockboot.img and the ramdisk folder from decompiled portboot.img, recompile it and put this new boot.img in Port ROM folder. Read my post #144.





Step 5.- Open the updater-script in META-INF from port rom, open it with Netepad++. Edit the format &mount points(compare with your updater-script from stock META-INF)



Example:
Code:
format("ext4", "EMMC", "/dev/block/mmcblk0p[COLOR="Red"]5[/COLOR]", "0", "/system");
format("ext4", "EMMC", "/dev/block/mmcblk0p[COLOR="Red"]7[/COLOR]", "0", "/data");
mount("ext4", "EMMC", "/dev/block/mmcblk0p[COLOR="Red"]5[/COLOR]", "/system");


Step 6.- Zip the Port ROM folder and flash it in recovery mode and enjoy.:highfive:​

Press the "Thanks" button if this guide has been useful for you
 
Last edited:

ZonaRMR

Senior Member
Jan 27, 2014
260
454
103
Narnia
Fixing Bugs

No audio in loudspeaker?

Replace libaudio.primary.default.so from stock ROM to Port

Storage Bug

Decompile the framework-res.apk, go to res/xm/storage_list.xml and edit it like the storage_list.xml from framework-res.apk of your Kitkat ROM, also edit the fstab.mt65xx in boot.img(compare with the fstab.mt65xx of your kitkat boot.img)

Sdcard not work or internal storage?

Replace:

system/bin/sdcard and system/bin/vold

Bluetooth

Replace libbluetooth_mtk.so and libbluetoothem_mtk.so from stock ROM to port.

Sensors

Replace libsensors.so file from stock ROM to port.

Wifi

Replace libwifi-service.so from stock ROM to port


Camera

all files that start with libcam....so

For mt6572 replacing this:

system/lib/libimageio.so
system/lib/libcameradrv.so

coming soon more :p
 
Last edited:

vampirefo

Senior Member
Apr 3, 2010
3,241
1,631
243
Sounds interesting, what about Lollipop to Lollipop? example My device already is Lollipop 5, port to 5.1 or CM 12.1
 
Last edited:

ZonaRMR

Senior Member
Jan 27, 2014
260
454
103
Narnia
Can I with this instruction port from 5.0 to 6.0 for HelioX10 ?

You can't port a ROM from a phone with different processor, for example Android Marshmallow 6.0 from Nexus to Mediatek phone. This guide is only for porting ROMs from Mediatek to Meadiatek devices. About your Mediatek HelioX10 phone need another Mediatek HelioX10 phone running Android 6, the next mediatek Heliox10 running Android 6 will be the Elephone P9000
 

ZonaRMR

Senior Member
Jan 27, 2014
260
454
103
Narnia
Sounds interesting, what about Lollipop to Lollipop? example My device already is Lollipop 5, port to 5.1 or CM 12.1
If you want to port the same version of Lollipop you need to delete and replace
-system/etc/firmware
-system/lib/egl
-system/lib/hw
-system/usr/keylayout/Generic.kl
-system/vendor

and also the port boot.img with your stock lollipop boot.img and make changes in mount points of the updater-script. For porting Lollipop 5.1.1 or CM12.1 to your device running lollipop 5.0, you need decompile your boot.img and the boot.img from lollipop 5.1.1. Use the zImage from your stock boot.img and the ramdisk from the boot.img of lollipop 5.1.1 or CM12.1 ROM and follow the steps 2, 3 and 4 of this guide(not forgetting to make changes in mount points of the updater-script)
 
Last edited:

PraneethMv

Senior Member
May 30, 2015
476
121
43
19
Hyderabad
Bro, can i use this method to port rom from MT6752 to MT6589? For the kitkat stock rom i'm using CM11(mt6589) and for lollipop can i use stock rom of lenovo k3 note(mt6752)?
 
Last edited:

vickdu31

Senior Member
May 5, 2012
314
107
0
Thanks a lot for this :) Now the big question. Where do we find stable CM12.1 for MTK devices !! ?

You can't port a ROM from a phone with different processor, for example Android Marshmallow 6.0 from Nexus to Mediatek phone. This guide is only for porting ROMs from Mediatek to Meadiatek devices. About your Mediatek HelioX10 phone need another Mediatek HelioX10 phone running Android 6, the next mediatek Heliox10 running Android 6 will be the Elephone P9000
And what about Sprout ? (Android One) I see for example CM12.1 for WIko rainbow using sprout files. Any chances for 6.0 ?
 
Last edited:

MaxisMan

Senior Member
Dec 9, 2014
590
250
93
Awesome guide!

Currently porting Android 5.0 (mt6582). Hope it works! :fingers-crossed:

EDIT: Didn't work, :( stuck at boot logo.
 
Last edited:

neodarklink

Senior Member
Jan 10, 2012
57
16
0
Salta
Very useful guide, thanks so much, this will be aplicable for porting a ROM from Smartphone to tablet or do I need to find an Rom from tablet to tablet (obviously talking about MTK devices) I am very interested to have Lillipop in my Lenovo a10-70 (a7600-f), SoC MT8121, with 4.4.2 :'(

I have read that:

This guide applies to same chipsets:

Example:
MT6577 to MT6577
MT6589 to MT6589
MT6572 to MT6572
MT6582 to MT6582


And works also for:

MT6589 to MT6577
MT6582 to MT6572
MT6577 to MT6575
Thanks and sorry for my bad english
 

vampirefo

Senior Member
Apr 3, 2010
3,241
1,631
243
Thanks a lot for this :) Now the big question. Where do we find stable CM12.1 for MTK devices !! ?



And what about Sprout ? (Android One) I see for example CM12.1 for WIko rainbow using sprout files. Any chances for 6.0 ?
I don't know how stable it is, but blue studio energy has one, its mtk6582 I have a blu energy X plus, also mtk6582, stock lollipop.

Sent from my BLU ENERGY X PLUS using Tapatalk
 
  • Like
Reactions: ZonaRMR

sagar.singh

Senior Member
Sep 25, 2013
514
210
0
Fixing Bugs

No audio in loudspeaker?

Replace libaudio.primary.default.so from stock ROM to Port

Storage Bug

Edit the storage.xml in framework-res.apk and set sdcard1 as primary and edit the fstab.mt65xx.rc and init.mt65xx.rc in the ramdisk from port boot.img.

Bluetooth

Replace libbluetooth_mtk.so and libbluetoothem_mtk.so from stock ROM to port.

Sensors

Replace libsensors.so file from stock ROM to port.

Wifi

Replace libwifi-service.so from stock ROM to port


Camera

all files that start with libcam....so

coming soon more :p
Bro can u tell me complete guide for fixing storage bug its not clear from this guide storage is shown as emulated storage and only shows 3gb
 

Attachments

ZonaRMR

Senior Member
Jan 27, 2014
260
454
103
Narnia
Bro can u tell me complete guide for fixing storage bug its not clear from this guide storage is shown as emulated storage and only shows 3gb
Decompile the framework-res.apk, go to res/xm/storage_list.xml and edit it like the storage_list.xml from framework-res.apk of your Kitkat ROM, also edit the fstab.mt65xx in boot.img(compare with the fstab.mt65xx of your kitkat boot.img)
 
  • Like
Reactions: MaxisMan

ZonaRMR

Senior Member
Jan 27, 2014
260
454
103
Narnia
Is this also applicable for porting non lollipop based roms from other SOCs? (e.g. 6582, 6589 to 6572?)
Yeah, this is for poring Kitkat ROMs to kitkat also

Bro, can i use this method to port rom from MT6752 to MT6589? For the kitkat stock rom i'm using CM11(mt6589) and for lollipop can i use stock rom of lenovo k3 note(mt6752)?
No, for port to mt6589 need another ROM for mt6589
 
  • Like
Reactions: kirito9