[GUIDE] [PORT] [ROM] All About Mediatek ROM Porting

Search This thread

Xtreme.Ornob

Senior Member
Mar 13, 2013
218
578
Chittagong
HOW to Port ROMs...

For Begineers & Advanced Users

Almost Any Device to Any Device!


ONLY FOR MEDIATEK SoCs

In This Guide You'll Learn..

How to Port ROMs of the Same CPU

And Also..

HOW TO PORT ROM FROM A DIFFERENT SoC ;)


Works for-


MT6589 to MT6577

MT6582 to MT6572

MT6577 to MT6575


Only ICS to ICS & JB to JB

May also work with 4.1 to 4.2

No Need of Source Code

No Need of Kernel Source

No Need of **ANDROID KITCHEN

No Need of LINUX... :D


Requirements:

* A Brain
* Patience
* Windows XP/7/8
* 7-Zip
* Notepad++
* Bootimg Unpack/Repack Tools for Windows!
* Stock ROM
* And a Little Respect!!


So now Lets Begin...

PORTING For Same SoCs ( Ex: MT6572 to MT6572)

* Replace these from your Stock ROM to the ROM u want to PORT!! Lets Call it "PORT"

FILE LIST FOR REPLACING:

Code:
	*system/vendor
	*system/usr
	*system/lib/modules
	*system/lib/hw
	*system/lib/libncurses.so
	*system/etc/firmware
	*system/etc/vold.fstab
	*system/etc/vold.fstab.nand
	*system/etc/bluetooth

For Fixing Problems...

Code:
	*system/etc/permissions
	*system/etc/security
	*system/etc/audio
	*system/etc/wifi
	*system/lib/drm
	*system/lisystem/lib/soundfx

* Now Replace the Stock Boot.img to Port ROM!

* Now Open The Port ROM folder and go to META-INF/google/android and open updater-script in Notepad++

* Do the same for the Stock ROM

* Now In the Port ROM's Updater Script, find a line that starts with this...

format(".......

and only replace the mmcblk0p.. with the stock one!

* Do the same for this line...

mount("...

Example:

This is the PORT one!!!

Code:
	format("ext4", "EMMC", "/dev/block/mmcblk0p5", "0", "/system");
	mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/system");

This is the Stock one!!

Code:
	format("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");
	mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");

Now just Replace the "mmcblk0p3" from STOCK to PORT!!

It should look like this:

Code:
	format("ext4", "EMMC", "/dev/block/mmcblk0p3", "0", "/system");
	mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");

DO NOT REPLACE THE WHOLE LINE!

* Now go back to the Folder of Port ROM and You'll see 2 folders & 1 file named

-META-INF
-system
-boot.img


* Now Select these three and Click Right Mouse Button and Click on 7-Zip ->> Add to Archive

* Now a dialouge box should appear!

* Configure the Format like This:

Archive format: ZIP

Compression Level : Normal

Compression Method: Deflate

Dictoioany Size: 32k

Word Size 32


* Now Start Zipping and Push the ZIP to your Memory Card

* Go to Recovery >> Install ZIP & Wipe Data

Finished!!

Now was that so hard?? Its a Really Easy thing to d0!!

Now Come to the Hard Part!!

Porting From Different SoCs ( Ex: MT6582 to MT7572 )

Read this carefully & apply the way i say!

* Take the ROM u want to port & name it PORT!
* Take your Stock ROM & Name it Stock
* Now Replace These files from Stock to PORT--


Code:
	*system/vendor
	*system/usr
	*system/lib/modules
	*system/lib/hw
	*system/lib/libncurses.so
	*system/etc/firmware
	*system/etc/vold.fstab
	*system/etc/vold.fstab.nand
	*system/etc/bluetooth

* Now Open build.prop in notepad++ & Search for this line

Code:
ro.mediatek.platform=MT65xx

Now Replace this (MT65xx) with your CPU!!

For Example

Code:
ro.mediatek.platform=MT6572

* Now Go To META-INF/google/android and open updater-script in notepad++

* Add this line between the lines of "set_perm"

Code:
set_perm(0, 0, 0644, "/system/vendor/lib/hw/gralloc.mt65xx.so");

[Replace the mt65xx with your cpu]

Example:

Code:
set_perm(0, 0, 0644, "/system/vendor/lib/hw/gralloc.mt6572.so");

* Now Go back to the Rom folder and Take the boot.img and decompile it with any bootimg-unpack tool!

* Now delete the zimage and rename boot.img-ramdisk to PORT-Ramdisk

* Now Do the Same for Stock boot.img and open the folder named PORT-ramdisk and copy all the fil PORT-
ramdisk to boot.img-ramdisk of your Stock boot.img

* Now Go to boot.img-ramdisk and open init.rc

* Now find these lines and replace with your cpu
Code:
	#Create Chip Property
	on early_property:ro.hardware=mt6582
		setprop ro.mtk.hardware mt6589
		
	on early_property:ro.hardware=mt6589
		setprop ro.mtk.hardware mt6589


example :

Code:
	#Create Chip Property
	on early_property:ro.hardware=mt6582
		setprop ro.mtk.hardware mt6572
		
	on early_property:ro.hardware=mt6589
		setprop ro.mtk.hardware mt6572


* Now Compile your New boot.img and Pack your New ROM and Flash!!

Cheers!!!!

Porting Lewa OS5 ROM:

* Replace These files from Stock to LeWa OS5 ROM

Code:
	*system/vendor
	*system/usr
	*system/lib/modules
	*system/lib/hw
	*system/etc/firmware
	*system/etc/vold.fstab
	*system/etc/vold.fstab.nand
	*system/etc/bluetooth

* Replace Stock boot.img to Lewa OS5 ROM

* Unpack boot.img

* Open init.rc

* Find these lines

Code:
	on early_property:ro.build.type=user
		write /proc/bootprof "INIT: user build setting"
		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar

	on early_property:ro.build.type=userdebug
		write /proc/bootprof "INIT: userdebug build setting"
		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar


	on early_property:ro.build.type=eng
		write /proc/bootprof "INIT: eng build setting"
		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar:/system/framework/emma.jar


* Now Add this line in the end of 1t and 3rd line

:/system/framework/lewa-framework.jar

Example:

Code:
	on early_property:ro.build.type=user
		write /proc/bootprof "INIT: user build setting"
		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar:/system/framework/lewa-framework.jar

	on early_property:ro.build.type=userdebug
		write /proc/bootprof "INIT: userdebug build setting"
		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar


	on early_property:ro.build.type=eng
		write /proc/bootprof "INIT: eng build setting"
		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar:/system/framework/emma.jar:/system/framework/lewa-framework.jar

* Now Compile the new boot.img and Repack your New Lewa OS5 ROM

Porting MiUI ROM

Replace These files from Stock to MiUI ROM


Code:
	*system/vendor
	*system/usr
	*system/lib/modules
	*system/lib/hw
	*system/etc/firmware
	*system/etc/vold.fstab
	*system/etc/vold.fstab.nand
	*system/etc/bluetooth

* Replace Stock boot.img to Lewa OS5 ROM

* Unpack boot.img
* Open init.rc
* Find these lines

Code:
	on early_property:ro.build.type=user
		write /proc/bootprof "INIT: user build setting"
		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar

	on early_property:ro.build.type=userdebug
		write /proc/bootprof "INIT: userdebug build setting"
		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar


	on early_property:ro.build.type=eng
		write /proc/bootprof "INIT: eng build setting"
		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar:/system/framework/emma.jar


* Do the Same as Lewa and add this line in the end of 1st and 3rd line.

Code:
:/system/framework/miui-framework.jar

* Compile the New Boot.img and Repack your new ROM and FLash!!

Cheers!!

Enjoy your New ROM and Give Credits to me for if I Helped you! ;)

For Advanced Users:

PORTING FIX:

Framework:

* decompile framework.jar

* Go to

Code:
\smali\com\mediatek

* Replace All Files from STOCK to this Folder

* Now go to

Code:
\smali\com\android\server

* Replace All Files from STOCK to this Folder

* Compile framework.jar and Push to Device!

* This Should FIX Bootloop, Mms.apk, Phone.apk, Settings.apk, Contacts.apk Force Close

* Fixing Other Problems:

Files related to Specific hardware:

* Replace if Not Working!!

* Camrea:

Code:
\system\lib\libcamalgo.so
\system\lib\libmhaldrv.so
\system\lib\libcamera_client.so
\system\lib\libcameracustom.so
\system\lib\libcameraprofile.so
\system\lib\libcameraservice.so

* GPS:

Code:
/system/xbin/libmnlp

* Bluetooth & Wifi:

Code:
/system/lib/libbluetooth_mtk.so
/system/lib/libbluetoothem_mtk.so

* Radio:


Code:
\system\lib\libaudio.a2dp.default.so
\system\lib\libaudio.primary.default.so
\system\lib\libaudiocompensationfilter.so
\system\lib\libaudiocustparam.so
\system\lib\libaudioeffect_jni.so
\system\lib\libaudioflinger.so
\system\lib\libaudiosetting.so
\system\lib\libfmar1000.so
\system\lib\libfmcust.so
\system\lib\libfmjni.so
\system\lib\libfmmt6616.so
\system\lib\libfmmt6620.so
\system\lib\libfmmt6626.so
\system\lib\libfmmt6628.so


* For Fixing Wifi & FM-Radio do this!

(NOT NEEDED IN MT6572)

Code:
fmradio.driver.chip=1

(Change it to 3 if yours is MT6628)

Code:
mediatek.wlan.chip=MT6620

(Replace mediatek.wlan.chip=MT6620 to your WLAM Chip Type Ex: mediatek.wlan.chip=MT6628 for MT6628)

Code:
mediatek.wlan.module.postfix=_mt6620

(Replace mediatek.wlan.module.postfix=_mt6620 to your WLAM Chip Type Ex: mediatek.wlan.module.postfix=_mt6628 for MT6628)

* Now open updater-script and Find this line or ADD a New one(If Not Found)!!

symlink("wlan_mt6620.ko", "/system/lib/modules/wlan.ko")

(Replace wlan_mt6620.ko to your WLAM Chip Type Ex: wlan_mt6628.ko for MT6628)




It Took Me 2Days & 5 Hours to Collect Data & Write this Thing!
I didn't Eat or Drink Water Properly,I Didn't Sleep Properly,
I Created This just for you all!
So That No ONE Ever Says Modontek Again! Its Against Humanity!
Please Value my Work & Do Not Blame me if it Doesnt Work!
I Work Day & Night to Learn More & More!
I Respect All the Developers & Modders of Android
But Some Jerks Just Dont know How to Behave like a Human!
Some Developers Behave like they are the BEST! LOL!
But It's NOT TRUE!
We Can't Be the Best! We Are All the Same!
We all are the Students of XDA-University!
We all use Others Work!
Why Not Work together? Why Not Develop our Knowledge More & More!??
I Don't think I Own any Respect from anyone!
But I Think I Own Respect for my Works & Contributions to Andoid Open Source Project!
I Believe in Humanity! Please Do NOT Copy This and Take Credits!
If This Was Helpful to you in Any Way...
Just Mention my Name in your ROM and Give me Some Credits!


Written by Xtreme Ornob

Official Developer of XVipre™

Coming Soon: Creating Your Own ROMs, Integrating ROM Info & Developer Info into ROM

Sorry for my BAD ENGLISH!! :p :p

Like my Page: XVipre ROM

Join our Facebook Group

The Index Project

Thanks to @yuweng for The Tutorial on MTK ROM Porting

Some Points are copied from his post!


Sorry if i am wrong in any way!
 
Last edited:

DNRDustin

Member
Apr 27, 2011
38
9
Sonoma County, Ca
First of all, thanks for the great guide!

Im on an Alcatel One Touch Fierce OT-7024w MT6589 metropcs. Will this work across chip variations(6589m, 6589t)? Does this work from one phone with the same chipset as another(evolve to fierce)? Is a locked bootloader a problem for this process.
 
V

vneogi199

Guest
Great stuff. Very helpful.[emoji1]

Sent from my C2305 using Tapatalk
 

kuldeepraj

Senior Member
Mar 11, 2013
321
65
indore
Nice guide tried three roms for port all booted but u should add remedy for different problems like display upside down WiFi/blutooth not switching on audio not coming out network problem etc.

Sent from my A114 using Tapatalk
 
  • Like
Reactions: kolpomanob

kasuyin

Member
Nov 6, 2011
20
2
gracias
he portado Xolo a 600 - i9091 clon pero aparece el logo desaparece nada mas. : Crying:

perdon por mi ingles
 

Xtreme.Ornob

Senior Member
Mar 13, 2013
218
578
Chittagong
Yes it will work! but i dont know about alcatel as it has a "custpack" partition! well good luck! :)
First of all, thanks for the great guide!

Im on an Alcatel One Touch Fierce OT-7024w MT6589 metropcs. Will this work across chip variations(6589m, 6589t)? Does this work from one phone with the same chipset as another(evolve to fierce)? Is a locked bootloader a problem for this process.
 
  • Like
Reactions: AhmadLamela

Xtreme.Ornob

Senior Member
Mar 13, 2013
218
578
Chittagong
Well glad it worked! :) and i already added the fix problems section! and i dont think anyone will face the "upside down display" problem! :p well thanks for feedback! ;)
Nice guide tried three roms for port all booted but u should add remedy for different problems like display upside down WiFi/blutooth not switching on audio not coming out network problem etc.

Sent from my A114 using Tapatalk
 

Xtreme.Ornob

Senior Member
Mar 13, 2013
218
578
Chittagong
I find it really hard to post on xda! u know all the work on tags! :( i am not good at posting! do you know someway i can see what i do when posting? i actually write all these in notepad and then copy-paste here & edit the lines & make em big & etc etc... :p :p
but i cant do it right! :'( i dont know man! its all a big mess!
Thanks! You should re-arrange the OP so it is easier to read and follow.
 

iZLeeP

Senior Member
Jan 23, 2014
528
151
Manila
I find it really hard to post on xda! u know all the work on tags! :( i am not good at posting! do you know someway i can see what i do when posting? i actually write all these in notepad and then copy-paste here & edit the lines & make em big & etc etc... :p :p
but i cant do it right! :'( i dont know man! its all a big mess!

Better do it on word so you can preview changes you made on it.
 
  • Like
Reactions: illusion96

DGEEEK

Senior Member
Dec 14, 2013
100
50
bro i know how hard is to write a post.i really appreciate your work.u are best example for humanity..ya u are rigth no one is best/perferct. i truly motivated by u
 

DGEEEK

Senior Member
Dec 14, 2013
100
50
bro im porting mt6589soc to mt6577soc i do carefully all steps but stuck on logo then white screen again same happen.
and bro i copy and replace all ramdisk file of mt6589 to mt6577 ramdisk and compile boot.img with android kitchen
please please bro help
sorry for tag u @Xtreme.Ornob
i truly appreciate ur work... :good::good::good:

---------- Post added at 08:19 AM ---------- Previous post was at 07:56 AM ----------

sir my both stock and port rom not having such name file system/lib/libncurses.so

and sir in ramdisk int.rc i have only this line

on early_property:ro.hardware=mt6589
setprop ro.mtk.hardware mt6589

please help
 

Top Liked Posts

  • There are no posts matching your filters.
  • 298
    HOW to Port ROMs...

    For Begineers & Advanced Users

    Almost Any Device to Any Device!


    ONLY FOR MEDIATEK SoCs

    In This Guide You'll Learn..

    How to Port ROMs of the Same CPU

    And Also..

    HOW TO PORT ROM FROM A DIFFERENT SoC ;)


    Works for-


    MT6589 to MT6577

    MT6582 to MT6572

    MT6577 to MT6575


    Only ICS to ICS & JB to JB

    May also work with 4.1 to 4.2

    No Need of Source Code

    No Need of Kernel Source

    No Need of **ANDROID KITCHEN

    No Need of LINUX... :D


    Requirements:

    * A Brain
    * Patience
    * Windows XP/7/8
    * 7-Zip
    * Notepad++
    * Bootimg Unpack/Repack Tools for Windows!
    * Stock ROM
    * And a Little Respect!!


    So now Lets Begin...

    PORTING For Same SoCs ( Ex: MT6572 to MT6572)

    * Replace these from your Stock ROM to the ROM u want to PORT!! Lets Call it "PORT"

    FILE LIST FOR REPLACING:

    Code:
    	*system/vendor
    	*system/usr
    	*system/lib/modules
    	*system/lib/hw
    	*system/lib/libncurses.so
    	*system/etc/firmware
    	*system/etc/vold.fstab
    	*system/etc/vold.fstab.nand
    	*system/etc/bluetooth

    For Fixing Problems...

    Code:
    	*system/etc/permissions
    	*system/etc/security
    	*system/etc/audio
    	*system/etc/wifi
    	*system/lib/drm
    	*system/lisystem/lib/soundfx

    * Now Replace the Stock Boot.img to Port ROM!

    * Now Open The Port ROM folder and go to META-INF/google/android and open updater-script in Notepad++

    * Do the same for the Stock ROM

    * Now In the Port ROM's Updater Script, find a line that starts with this...

    format(".......

    and only replace the mmcblk0p.. with the stock one!

    * Do the same for this line...

    mount("...

    Example:

    This is the PORT one!!!

    Code:
    	format("ext4", "EMMC", "/dev/block/mmcblk0p5", "0", "/system");
    	mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/system");

    This is the Stock one!!

    Code:
    	format("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");
    	mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");

    Now just Replace the "mmcblk0p3" from STOCK to PORT!!

    It should look like this:

    Code:
    	format("ext4", "EMMC", "/dev/block/mmcblk0p3", "0", "/system");
    	mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");

    DO NOT REPLACE THE WHOLE LINE!

    * Now go back to the Folder of Port ROM and You'll see 2 folders & 1 file named

    -META-INF
    -system
    -boot.img


    * Now Select these three and Click Right Mouse Button and Click on 7-Zip ->> Add to Archive

    * Now a dialouge box should appear!

    * Configure the Format like This:

    Archive format: ZIP

    Compression Level : Normal

    Compression Method: Deflate

    Dictoioany Size: 32k

    Word Size 32


    * Now Start Zipping and Push the ZIP to your Memory Card

    * Go to Recovery >> Install ZIP & Wipe Data

    Finished!!

    Now was that so hard?? Its a Really Easy thing to d0!!

    Now Come to the Hard Part!!

    Porting From Different SoCs ( Ex: MT6582 to MT7572 )

    Read this carefully & apply the way i say!

    * Take the ROM u want to port & name it PORT!
    * Take your Stock ROM & Name it Stock
    * Now Replace These files from Stock to PORT--


    Code:
    	*system/vendor
    	*system/usr
    	*system/lib/modules
    	*system/lib/hw
    	*system/lib/libncurses.so
    	*system/etc/firmware
    	*system/etc/vold.fstab
    	*system/etc/vold.fstab.nand
    	*system/etc/bluetooth

    * Now Open build.prop in notepad++ & Search for this line

    Code:
    ro.mediatek.platform=MT65xx

    Now Replace this (MT65xx) with your CPU!!

    For Example

    Code:
    ro.mediatek.platform=MT6572

    * Now Go To META-INF/google/android and open updater-script in notepad++

    * Add this line between the lines of "set_perm"

    Code:
    set_perm(0, 0, 0644, "/system/vendor/lib/hw/gralloc.mt65xx.so");

    [Replace the mt65xx with your cpu]

    Example:

    Code:
    set_perm(0, 0, 0644, "/system/vendor/lib/hw/gralloc.mt6572.so");

    * Now Go back to the Rom folder and Take the boot.img and decompile it with any bootimg-unpack tool!

    * Now delete the zimage and rename boot.img-ramdisk to PORT-Ramdisk

    * Now Do the Same for Stock boot.img and open the folder named PORT-ramdisk and copy all the fil PORT-
    ramdisk to boot.img-ramdisk of your Stock boot.img

    * Now Go to boot.img-ramdisk and open init.rc

    * Now find these lines and replace with your cpu
    Code:
    	#Create Chip Property
    	on early_property:ro.hardware=mt6582
    		setprop ro.mtk.hardware mt6589
    		
    	on early_property:ro.hardware=mt6589
    		setprop ro.mtk.hardware mt6589


    example :

    Code:
    	#Create Chip Property
    	on early_property:ro.hardware=mt6582
    		setprop ro.mtk.hardware mt6572
    		
    	on early_property:ro.hardware=mt6589
    		setprop ro.mtk.hardware mt6572


    * Now Compile your New boot.img and Pack your New ROM and Flash!!

    Cheers!!!!

    Porting Lewa OS5 ROM:

    * Replace These files from Stock to LeWa OS5 ROM

    Code:
    	*system/vendor
    	*system/usr
    	*system/lib/modules
    	*system/lib/hw
    	*system/etc/firmware
    	*system/etc/vold.fstab
    	*system/etc/vold.fstab.nand
    	*system/etc/bluetooth

    * Replace Stock boot.img to Lewa OS5 ROM

    * Unpack boot.img

    * Open init.rc

    * Find these lines

    Code:
    	on early_property:ro.build.type=user
    		write /proc/bootprof "INIT: user build setting"
    		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar
    
    	on early_property:ro.build.type=userdebug
    		write /proc/bootprof "INIT: userdebug build setting"
    		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar
    
    
    	on early_property:ro.build.type=eng
    		write /proc/bootprof "INIT: eng build setting"
    		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar:/system/framework/emma.jar


    * Now Add this line in the end of 1t and 3rd line

    :/system/framework/lewa-framework.jar

    Example:

    Code:
    	on early_property:ro.build.type=user
    		write /proc/bootprof "INIT: user build setting"
    		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar:/system/framework/lewa-framework.jar
    
    	on early_property:ro.build.type=userdebug
    		write /proc/bootprof "INIT: userdebug build setting"
    		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar
    
    
    	on early_property:ro.build.type=eng
    		write /proc/bootprof "INIT: eng build setting"
    		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar:/system/framework/emma.jar:/system/framework/lewa-framework.jar

    * Now Compile the new boot.img and Repack your New Lewa OS5 ROM

    Porting MiUI ROM

    Replace These files from Stock to MiUI ROM


    Code:
    	*system/vendor
    	*system/usr
    	*system/lib/modules
    	*system/lib/hw
    	*system/etc/firmware
    	*system/etc/vold.fstab
    	*system/etc/vold.fstab.nand
    	*system/etc/bluetooth

    * Replace Stock boot.img to Lewa OS5 ROM

    * Unpack boot.img
    * Open init.rc
    * Find these lines

    Code:
    	on early_property:ro.build.type=user
    		write /proc/bootprof "INIT: user build setting"
    		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar
    
    	on early_property:ro.build.type=userdebug
    		write /proc/bootprof "INIT: userdebug build setting"
    		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar
    
    
    	on early_property:ro.build.type=eng
    		write /proc/bootprof "INIT: eng build setting"
    		export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/secondary-framework.jar:/system/framework/CustomProperties.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-op.jar:/system/framework/emma.jar


    * Do the Same as Lewa and add this line in the end of 1st and 3rd line.

    Code:
    :/system/framework/miui-framework.jar

    * Compile the New Boot.img and Repack your new ROM and FLash!!

    Cheers!!

    Enjoy your New ROM and Give Credits to me for if I Helped you! ;)

    For Advanced Users:

    PORTING FIX:

    Framework:

    * decompile framework.jar

    * Go to

    Code:
    \smali\com\mediatek

    * Replace All Files from STOCK to this Folder

    * Now go to

    Code:
    \smali\com\android\server

    * Replace All Files from STOCK to this Folder

    * Compile framework.jar and Push to Device!

    * This Should FIX Bootloop, Mms.apk, Phone.apk, Settings.apk, Contacts.apk Force Close

    * Fixing Other Problems:

    Files related to Specific hardware:

    * Replace if Not Working!!

    * Camrea:

    Code:
    \system\lib\libcamalgo.so
    \system\lib\libmhaldrv.so
    \system\lib\libcamera_client.so
    \system\lib\libcameracustom.so
    \system\lib\libcameraprofile.so
    \system\lib\libcameraservice.so

    * GPS:

    Code:
    /system/xbin/libmnlp

    * Bluetooth & Wifi:

    Code:
    /system/lib/libbluetooth_mtk.so
    /system/lib/libbluetoothem_mtk.so

    * Radio:


    Code:
    \system\lib\libaudio.a2dp.default.so
    \system\lib\libaudio.primary.default.so
    \system\lib\libaudiocompensationfilter.so
    \system\lib\libaudiocustparam.so
    \system\lib\libaudioeffect_jni.so
    \system\lib\libaudioflinger.so
    \system\lib\libaudiosetting.so
    \system\lib\libfmar1000.so
    \system\lib\libfmcust.so
    \system\lib\libfmjni.so
    \system\lib\libfmmt6616.so
    \system\lib\libfmmt6620.so
    \system\lib\libfmmt6626.so
    \system\lib\libfmmt6628.so


    * For Fixing Wifi & FM-Radio do this!

    (NOT NEEDED IN MT6572)

    Code:
    fmradio.driver.chip=1

    (Change it to 3 if yours is MT6628)

    Code:
    mediatek.wlan.chip=MT6620

    (Replace mediatek.wlan.chip=MT6620 to your WLAM Chip Type Ex: mediatek.wlan.chip=MT6628 for MT6628)

    Code:
    mediatek.wlan.module.postfix=_mt6620

    (Replace mediatek.wlan.module.postfix=_mt6620 to your WLAM Chip Type Ex: mediatek.wlan.module.postfix=_mt6628 for MT6628)

    * Now open updater-script and Find this line or ADD a New one(If Not Found)!!

    symlink("wlan_mt6620.ko", "/system/lib/modules/wlan.ko")

    (Replace wlan_mt6620.ko to your WLAM Chip Type Ex: wlan_mt6628.ko for MT6628)




    It Took Me 2Days & 5 Hours to Collect Data & Write this Thing!
    I didn't Eat or Drink Water Properly,I Didn't Sleep Properly,
    I Created This just for you all!
    So That No ONE Ever Says Modontek Again! Its Against Humanity!
    Please Value my Work & Do Not Blame me if it Doesnt Work!
    I Work Day & Night to Learn More & More!
    I Respect All the Developers & Modders of Android
    But Some Jerks Just Dont know How to Behave like a Human!
    Some Developers Behave like they are the BEST! LOL!
    But It's NOT TRUE!
    We Can't Be the Best! We Are All the Same!
    We all are the Students of XDA-University!
    We all use Others Work!
    Why Not Work together? Why Not Develop our Knowledge More & More!??
    I Don't think I Own any Respect from anyone!
    But I Think I Own Respect for my Works & Contributions to Andoid Open Source Project!
    I Believe in Humanity! Please Do NOT Copy This and Take Credits!
    If This Was Helpful to you in Any Way...
    Just Mention my Name in your ROM and Give me Some Credits!


    Written by Xtreme Ornob

    Official Developer of XVipre™

    Coming Soon: Creating Your Own ROMs, Integrating ROM Info & Developer Info into ROM

    Sorry for my BAD ENGLISH!! :p :p

    Like my Page: XVipre ROM

    Join our Facebook Group

    The Index Project

    Thanks to @yuweng for The Tutorial on MTK ROM Porting

    Some Points are copied from his post!


    Sorry if i am wrong in any way!
    3
    Dude internal storage shows 0kb.. Replaced storagelist from from stock framework to port framework.. Stil didnt work.. How do I fix it? Its KitKat BTW.. ?.
    2
    First of all, thanks for the great guide!

    Im on an Alcatel One Touch Fierce OT-7024w MT6589 metropcs. Will this work across chip variations(6589m, 6589t)? Does this work from one phone with the same chipset as another(evolve to fierce)? Is a locked bootloader a problem for this process.
    2
    Bro....i am from bangladesh! and i dont know what u r talking about! but if u could kindly speak english or something??? :(
    gracias
    he portado Xolo a 600 - i9091 clon pero aparece el logo desaparece nada mas. : Crying:

    perdon por mi ingles
    2
    Well glad it worked! :) and i already added the fix problems section! and i dont think anyone will face the "upside down display" problem! :p well thanks for feedback! ;)
    Nice guide tried three roms for port all booted but u should add remedy for different problems like display upside down WiFi/blutooth not switching on audio not coming out network problem etc.

    Sent from my A114 using Tapatalk