[TUTORIAL] [arm-MTK-only] MT65xx Firmware Porting Thread | Guidelines | The Easy Way - Android General

Hello Viewers! I am Rohan Taneja, here with completely re-written guide to Port MTK65xx Roms.
I had left MTK development since a year and I finally got another MTK device to carry with it again.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
So, Many Of You May be MTK Device User than you are at right place to fill your device with many awesome roms!
Note: Android ONE devices (MT6582 SoC) use Google's device tree, meaning they differ on everything with all the other MediaTek devices (even the ones with the same SoC , MT6582), as per @superdragonpt told us
Requirements:
A MTK powered device
USB Cable
Usable Brains :cyclops:
Knowledge about Flashing & Taking Logs :angel:
Stock Firmware (from manufacturer) & Port Firmware (matching specification of your device)
Custom Recovery installed on device
Porting Tips
Choose Custom ROM from a device matching same resolution to reduce App Size related bugs
This Guide Applies to
MT6577 to MT6577, vice-versa
MT6589 to MT6589, vice-versa
MT6572 to MT6572, vice-versa
MT6582 to MT6582, vice-versa
Note: Try it at your own risk, and don't complaint any developer or XDA if any mishap takes place. :good:​
TUTORIAL:​Starting with the tutorial, I request you to follow every single step written below to prevent any kind of problem in flashing and causing bootloop. I also dare you to take a nandroid backup of your current rom you are using.​
Get. Set. Go.
Step 1 : Patching System Folder for the port patch.​First of all make a folder named "Port_Patch" and setup all the folder as shown in the images below.
Now, in Port_Patch make system folder in which make folders, "bin" "etc" "lib" "usr" "vendor" "xbin" (without ")
In folder "bin" copy pq & vold from your stock rom
In folder "etc" copy "bluetooth" "firmware" "wifi" "apns-conf.xml" "vold.fstab" "vold.fstab.nand"
In folder "lib" copy files as shown in the image
In folder "usr" copy usr/keylayout/Generic.kl
In folder "vendor" all the files
In folder "xbin" copy "libmnlp_mt662x" (x - '0' or '8') from stock
System has been patched, copy this /system to patch the /system of port ROM.​
Step 2: Patching the boot.img of the port rom.​This is bit tricky but can be done easily.
So, first of download this little tool, to unpack & repack your boot.img - MTKbootimg.zip - tested on Windows 7 & above platform
Extract the Tool and you will get two folders named "stock" & "port"
Copy boot.img's respectively from stock rom in "stock" folder & from port rom to "port"
Unpack both boot.img repectively and they may look like this.
From stock copy "kernel" to port folder and just replace it.
Now, repack it, new file named "boot-new.img" will be generated.
Copy "boot-new.img" to port Rom Folder.
Delete existing "boot.img" and rename "boot-new.img" to "boot.img"
Now, your boot.img is patched, proceed to last step.​
Step 3: Modifying updater-script to install ROM accordingly.​
So, it's the last step before flashing the rom. Now lets fix it.
First, you have to know your device mount points, that can be tracked using MTKDroid Tool or check them in stock rom updater-script.
I have my flashable stock rom so I will get mount points from it.
As show in the image, my stock updater have different mount point for system & data while port have different.
Now, replace "mmcblk0pX" (X - no. for the mount) from stock to port as designated for the partition.
Now Save the updater-script.
Finally, the ROM is ready to flashed.​
Step 4: Compressing & Flashing the ROM.​
Now, the rom is ready to be packed and flashed.
Simply get to the main directory with META-INF, system, boot.img, etc files.
Select all the files and compress them to zip. Select the compression ratio as you want.
After compressing copy the ROM into root of sdcard
Enter Custom Recovery, wipe data & Cache
Flash the ROM.zip wait till it completes.
Wait till it boots, or else take log using ADB logcat. (Hint: If LED light blinks, the rom is booting)
FOR Fixes Proceed to next post and find out the way to tackle and fix the bugs. ​

Fixing ROM issues
Finally Ported a Custom ROM. Now, time to kill out some bugs.
Its all about making the build stable for personal as well as others to use it.
Leave the files if not there in your System
Let's get started:
Bootloop? :crying:
Replace following files(from stock to port):
Code:
[LIST]
[*]libandroid_runtime.so
[*]libandroid_servers.so
[*]libmedia_jni.so
[*]libsync.so
[*]If possible try modifying framework.jar "\smali\com\android\server" (copy from stock)
[/LIST]
Camera Not Working?
Replace following files(from stock to port):
Code:
[HIDE][LIST]
[*]lib3a.so
[*]liba3m.so
[*]libacdk.so
[*]libaudioflinger.so
[*]libc.so
[*]libcam.camadapter.so
[*]libcam.campipe.so
[*]libcam.camshot.so
[*]libcam.client.so
[*]libcam.paramsmgr.so
[*]libcam.utils.so
[*]libcam_camera_exif.so
[*]libcamalgo.so
[*]libcamdrv.so
[*]libcamera_client.so
[*]libcamera_jni_eglfence.so
[*]libcamera_metadata.so
[*]libcameracustom.so
[*]libcameraservice.so
[*]libgn_camera_feature.so
[*]libexif
[*]libfeatureio.so
[*]libfrsdk.so
[*]libft.so
[*]libgcomm_jni.so
[*]libgoggles_clientvision.so
[*]libgui.so
[*]libimageio.so
[*]libja3m.so
[*]libjni_mosaic.so
[/LIST]
Thanks To [I]Shikar A[/I][/HIDE]
[B]Init.rc Fix:[/B]
[HIDE]Init.rc(present in the ramdisk of boot.img), find for code #Camera in stock boot.img. Copy it and replace from stock init.rc and replace in the port init.rc
[IMG]http://s27.postimg.org/4ucj34cwj/initrc_cam.png[/IMG][/HIDE]
Wlan not working properly?
Code:
Check wlan.chip in stock like:
[HIDE][IMG]http://s30.postimg.org/myaya0sxt/Untitled.png[/IMG]
fmradio.driver.chip=x (if mt6620 then x=1, if mt6628 then x=3)
Change the above codes accordingly in updater-script
Replace the version in port from the one in stock[/HIDE]
(Replace from stock to port)
libbluetooth_mtk.so
libbluetoothem_mtk.so
GPS, unstable or not working?
(Replace from stock to port)
Code:
xbin/libmnlp
Media Player problem?
(Replace from stock to port)
Code:
libdpframework.so
libcodecvdrv.so
Sensors not working properly?
(Replace from stock to port)
Code:
libsensorservice.so
SD Card not working or mounting?
Code:
In the framework-res.apk of your port, replace /res/xml/storage_list.xml from stock one.
USB not mounting your device?
Code:
Unpack your boot.img replace init.usb.rc from ramdisk by stock boot.img init.usb.rc
This tutorial worked for porting MIUI, Baidu, Vibe UI, LeWa OS, AOSP based rom from different device to my MT6589 of same hardware.
Credits:
Special Thanks to @yuweng (for starting his main MTK porting thread and his great works)
XDA-Developers being one of the best place for Android Development
Other Developers for helping in fixing most the issues.​

just wanna ask..is it ok if i dont copy the srec folder cause i cant find it..also yhe meta-inf folder as i only have the system.img of my base rom

iel0000 said:
just wanna ask..is it ok if i dont copy the srec folder cause i cant find it..also yhe meta-inf folder as i only have the system.img of my base rom
Click to expand...
Click to collapse
If You Don't Have "srec" folder no need to worry but for system.img you need to extract the img by ext4 method:
http://forum.xda-developers.com/showthread.php?t=2285831

A N D Y said:
If You Don't Have "srec" folder no need to worry but for system.img you need to extract the img by ext4 method:
http://forum.xda-developers.com/showthread.php?t=2285831
Click to expand...
Click to collapse
how about theses files?
CERT.RSA
CERT.SF
MANIFEST.MF
i dont have them cause i dont have a flashable stock rom..

iel0000 said:
how about theses files?
CERT.RSA
CERT.SF
MANIFEST.MF
i dont have them cause i dont have a flashable stock rom..
Click to expand...
Click to collapse
Don't Worry Try The one in the Ported Rom!

cant also find these
com.google.android.media.effects.jar
com.google.android.media.effects.xml
sorry for the noob questions..i just want to port a rom to my device as we dont have developers

it worked!
i ported an miui from newman n1, the ics 4.0.4 with no bugs to my cherry mobile blaze / Ming Ren A2 clone.
btw, this is not a dual sim display miui, i need to go to settings anytime i wan to use the other sim.
anyone who knows where to get a dual sim display miui?

xjammetx said:
it worked!
i ported an miui from newman n1, the ics 4.0.4 with no bugs to my cherry mobile blaze / Ming Ren A2 clone.
btw, this is not a dual sim display miui, i need to go to settings anytime i wan to use the other sim.
anyone who knows where to get a dual sim display miui?
Click to expand...
Click to collapse
what boot.img did you use? stock from cherry mobile?

iel0000 said:
what boot.img did you use? stock from cherry mobile?
Click to expand...
Click to collapse
Don't Try boot.img(Kernel) from the port rom or you'll brick your device!

iel0000 said:
cant also find these
com.google.android.media.effects.jar
com.google.android.media.effects.xml
sorry for the noob questions..i just want to port a rom to my device as we dont have developers
Click to expand...
Click to collapse
Those Files You Can't Find In port just leave that!

A N D Y said:
Don't Try boot.img(Kernel) from the port rom or you'll brick your device!
Click to expand...
Click to collapse
can i use stock boot.img from my phone?or do i have to modify it?

Very nice thread, for beginners that want to learn

tried porting miui v5 base on jb 4.1.2
always stock on boot animation

iel0000 said:
can i use stock boot.img from my phone?or do i have to modify it?
Click to expand...
Click to collapse
You Can Use Stock BOOT.IMG or try changing the ramdisk with stock from the port kernel!
Tool: http://d-h.st/BVz

A N D Y said:
You Can Use Stock BOOT.IMG or try changing the ramdisk with stock from the port kernel!
Tool: http://d-h.st/BVz
Click to expand...
Click to collapse
i give up porting miui to my phone and tried porting another rom from amoi n820..it boot but the home key is not working..i already used Generic.kl from my device stock rom but it still dont work can you help me plss?
edit : i finally got it working..thanks for the tut it really help me....

iel0000 said:
what boot.img did you use? stock from cherry mobile?
Click to expand...
Click to collapse
Yep. Dont worry, ill upload it sometime.

A N D Y said:
You Can Use Stock BOOT.IMG or try changing the ramdisk with stock from the port kernel!
Tool: http://d-h.st/BVz
Click to expand...
Click to collapse
how to use the tool?

How to from STOCK
iel0000 said:
how to use the tool?
Click to expand...
Click to collapse
Do you know procedure to Port a STOCK ROM(SP Flash tool format not a CWM) of X device to Y device?
Both are mostly same in specifications except the resolution.
I read in some threads that we can not port a rom from a device which has different resolution ?
Thanks in Advance

iel0000 said:
i give up porting miui to my phone and tried porting another rom from amoi n820..it boot but the home key is not working..i already used Generic.kl from my device stock rom but it still dont work can you help me plss?
edit : i finally got it working..thanks for the tut it really help me....
Click to expand...
Click to collapse
what phone do you have btw?
yo kumpare!

Related

[REF][DEV]How to unpack / repack normalboot.img

Hi all, like you know our phone is different from other cause - to flash the kernel - you need to pack it with the ramdisk files and flash it to the phone as normalboot.img.
Some people want try to build a custom kernel but after they obtain the zImage file they are not able to flash it to the phone.
So here is the "HOWTO" to explain what you have to do for unpack/repack normalboot.img.
You need Linux to do this (also a visrtualized distro).
1- download and unzip the attached file;
2- place the normalboot.img file into the tools folder;
3- go in the root folder and do:
Code:
./unpack-all.sh
4- now you have succesfull unpacked your file. You can find the zImage file in the "kernel" folder and the ramdisk files in the "ramdisk" folder.
Basically now you can do all that you want. If you have a custom kernel overwrite the zImage file with your. If you want edit the ramdisk go in the folder called "ramdisk" and mod what you want.
When you finished do:
Code:
./create_boot.img.sh
Now you will find the .tar file ready to be flashed on your phone with odin.
If you are asking yourself "where can i find normalboot.img file?" the answers are:
1- into the PDA.tar of your Firmware;
2- dump it from the phone with:
Code:
dd if=/dev/block/bml7 of=/sdcard/normalboot.img
Bye
Thanks Buddy..
BTW your posts are always very crisp and enlightening. I appreciate.
regards
I tried the script, and it seems to work. Seems, because it unpacked and repacked fine, and I replaced the kernel with a self compiled one. But, to make it short, the phone didn't boot. It was stuck on the "Galaxy S"-screen.
Any ideas, why a kernel which compiled without errors does not boot? Skin, did you change specific settings for compiling your OC-kernel, besides the overclocking adjustments?
XDA_Bam said:
I tried the script, and it seems to work. Seems, because it unpacked and repacked fine, and I replaced the kernel with a self compiled one. But, to make it short, the phone didn't boot. It was stuck on the "Galaxy S"-screen.
Any ideas, why a kernel which compiled without errors does not boot? Skin, did you change specific settings for compiling your OC-kernel, besides the overclocking adjustments?
Click to expand...
Click to collapse
I think that your kernel version doesn't match with the modules... so in your Makefile change the version name to match it with the stock.... so you have to change the version from 2.6.35.7 to 2.6.35.7-CL..... (don't remember if the number are correct)
Thanks, Skin! That did the trick. Now running self compiled vanilla kernel. Interestingly, it is about 200kb bigger than the stock kernel.
EDIT: Obviously, the repack-script is running fine.
other way to do dis is by using kitchen ..
js rename ur normalboot.img to boot.img den replace the boot.img in ur working directory ..
in the kitchen advanced options , unpack/repack boot.img ...
u ll get the same output
this one is easier as we dont need to remember the commands
XDA_Bam said:
Thanks, Skin! That did the trick. Now running self compiled vanilla kernel. Interestingly, it is about 200kb bigger than the stock kernel.
EDIT: Obviously, the repack-script is running fine.
Click to expand...
Click to collapse
To make it smaller you can use the Buildscript used in the froyo version of kernel source... Amit told me it this morning... and it worked greatly
bajju123 said:
other way to do dis is by using kitchen ..
js rename ur normalboot.img to boot.img den replace the boot.img in ur working directory ..
in the kitchen advanced options , unpack/repack boot.img ...
u ll get the same output
this one is easier as we dont need to remember the commands
Click to expand...
Click to collapse
Commands? You can do it with two mouse click!
Skin1980 said:
To make it smaller you can use the Buildscript used in the froyo version of kernel source... Amit told me it this morning... and it worked greatly
Click to expand...
Click to collapse
Yes, works. But my kernel stays at 3.3MB... still 0.2 larger than the stock one.
By the way: Had a SOD with the self-compiled kernel. Screen didn't wake up from standby, but soft buttons were lid. Guess the info from Samsung that closed source software is missing from the package is correct
i still have sod also with the new compilation mod.... by me sammy is missing something or simply the source are not updated like i supposed....
thanks....this rescued me
---------- Post added at 07:50 AM ---------- Previous post was at 07:20 AM ----------
i have a silly doubt
cud i download the linux kernel v3 from korg and compile it for i9003?or do i have to stick with 2.6.35?
Maybe it would be possible. The main problem are the drivers - they would most likely require major changes. But even CyanogenMod is running 2.6.37 and nothing more recent.
If you want to use a newer kernel, you could try that one, or - to minimize problems - use the 2.6.35.14 bugfix release. This seems most reasonable to me.
XDA_Bam said:
Maybe it would be possible. The main problem are the drivers - they would most likely require major changes. But even CyanogenMod is running 2.6.37 and nothing more recent.
If you want to use a newer kernel, you could try that one, or - to minimize problems - use the 2.6.35.14 bugfix release. This seems most reasonable to me.
Click to expand...
Click to collapse
shoot........404 not found
Those hackers...................
you are our phone's God!
Sent from my GT-I9003 using xda premium
i need help, i try to make stock normalboot.img tar with ur files.
but there is a big bug
phono booting but stay at "samsung" screen.
someone have this bug like me and u says that "chance ur kernel version in make boot file" but i cant find how chance kernel version in make boot file. how can i?
ROM: 2.3.6 JVKPB TUR ROM (galaxy sl i9003)
please help...
Skin1980 said:
Hi all, like you know our phone is different from other cause - to flash the kernel - you need to pack it with the ramdisk files and flash it to the phone as normalboot.img.
Some people want try to build a custom kernel but after they obtain the zImage file they are not able to flash it to the phone.
So here is the "HOWTO" to explain what you have to do for unpack/repack normalboot.img.
You need Linux to do this (also a visrtualized distro).
1- download and unzip the attached file;
2- place the normalboot.img file into the tools folder;
3- go in the root folder and do:
Code:
./unpack-all.sh
4- now you have succesfull unpacked your file. You can find the zImage file in the "kernel" folder and the ramdisk files in the "ramdisk" folder.
Basically now you can do all that you want. If you have a custom kernel overwrite the zImage file with your. If you want edit the ramdisk go in the folder called "ramdisk" and mod what you want.
When you finished do:
Code:
./create_boot.img.sh
Now you will find the .tar file ready to be flashed on your phone with odin.
If you are asking yourself "where can i find normalboot.img file?" the answers are:
1- into the PDA.tar of your Firmware;
2- dump it from the phone with:
Code:
dd if=/dev/block/bml7 of=/sdcard/normalboot.img
Bye
Click to expand...
Click to collapse
Wow you are great !!! Loved it .. so easy .... made my dead phone alive .. you are the best \m/

[Tool] Cwm nandbackup file Extractor ( .img/ .tar files )

CWM nandbackup files extractor ( .img/ .tar) ​
Here are the few things/ questions raised
The tool has been upgraded and you can get them here Utility tool
How do i extract the data.ext4.tar ?
How to combine all the *.ext4.tar *.ext4.tar.a , *.ext4.tar.b, *.ext4.tar.c ?
How to get my applications / data from the backup filesof CWM ?
Don't worry for the above question you are facing. This tool will help you out.
Requirements
Java JDK :good:
Need Patience :silly:
How to use
Extract the tool.zip and follow up the pics and your work is done
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hope this tool may help some one . and Don't Forget to hit thanks button. have fun
Download
You can also extract the data.img , system.img files on by placing the files to image files folder
Here is the download of the tool at bottom this post
Have fun
Perfect tool Thank you for your hard Word. Now everthing is very easy
The tool which I have been waiting for...works like charm!!
Thank for providing us this tool.
Gonna try to make GUI for this tool.
needed from ages
well first of all congrats for this wonderful tool it was much needed right from the beginning. plus i like your profile pic lol its my fav "KICK"...
will this work on twrp?
or it has different backup file type?
I just switched to twrp but not yet trying nandroid
Perfect tool!! This is really gonna help me with my custom rom instead of trying to copy the /system files one by one to my internal storage.
i'll be waiting for os x version as well (since i don't always run windows)
great tool btw
and congrats for making it to the portal
Error:'Tar' is not recognized as an internal or external command. And also 'cat'.
Where do these commands exist? are they exe files present somewhere in the java jdk folder?
Before you ask. Yes i have installed java jdk.
Do I have to setup the environment variables?
LastStandingDroid said:
i'll be waiting for os x version as well (since i don't always run windows)
great tool btw
and congrats for making it to the portal
Click to expand...
Click to collapse
sure i will do that when i am free..........
zamzameir said:
will this work on twrp?
or it has different backup file type?
I just switched to twrp but not yet trying nandroid
Click to expand...
Click to collapse
I haven't tested but there is nothing more difference between the files. hope it works
dattafilthyd said:
Error:'Tar' is not recognized as an internal or external command.
Before you ask. Yes i have installed java jdk.
Do I have to setup the environment variables?
Click to expand...
Click to collapse
the common softwares are 7z / winrar / winzip are minimum requirement ( i have not listed these because these are very commonly used by every user )
Only cwm or twrp too?
venkat kamesh said:
The common softwares are 7z / winrar / winzip are minimum requirement ( i have not listed these because these are very commonly used by every user )
Click to expand...
Click to collapse
All of them are installed bro. (i.e 7z winrar and winzip)
The bat file you've careated is unable to find 'tar' command. Is it necessary that i place it in a particular location like c drive as such.?
['tar' is not recognized as an internal or external command]
suggestions?
EDIT: I used the cygwin terminal to concatenate [cat] the tar files and i was able to open them combined file via 7z and winrar.
code: cat data.ext4.tar data.ext4.tar.a data.ext4.tar.b data.ext4.tar.c > datafull.tar
Thank you.
the_vanya1 said:
Only cwm or twrp too?
Click to expand...
Click to collapse
i havent tested but hope it works good
dattafilthyd said:
All of them are installed bro. (i.e 7z winrar and winzip)
The bat file you've careated is unable to find 'tar' command. Is it necessary that i place it in a particular location like c drive as such.?
['tar' is not recognized as an internal or external command]
suggestions?
Click to expand...
Click to collapse
there is no particular location to be place.... :good:
may be binaries get corrupted try to install this tool :- http://gnuwin32.sourceforge.net/packages/gtar.htm
it would help you out for using this tool
Error:'Tar' is not recognized as an internal or external command
venkat kamesh said:
You can also extract the data.img , system.img files on by placing the files to image files folder
Here is the download of the tool at bottom this post
Have fun
Click to expand...
Click to collapse
you know, this is an excellent utility, will come handy....what I always thought about is, converting andbackup files into flashable zip - say using your tool, you extracted, and then remove or add or made some changes on it, and then converting to flashable zip..., if you make an ultimate utility tool, imaging that you did nandroid backup of your stock ROM with custom recovery, having a tool to extract it (your utility), and then if you wish deodexed it, and then last step put all into CWM flashable zip....now if you combine all this steps, you will end up ultimate best utility tool ever... I f...king even pay or donate for it...
the_vanya1 said:
Error:'Tar' is not recognized as an internal or external command
Click to expand...
Click to collapse
you need to install 7zip/winzip ( any one of them ) read the previous post
please ready the posts so there you get a solution
jazzespresso said:
you know, this is an excellent utility, will come handy....what I always thought about is, converting andbackup files into flashable zip - say using your tool, you extracted, and then remove or add or made some changes on it, and then converting to flashable zip..., if you make an ultimate utility tool, imaging that you did nandroid backup of your stock ROM with custom recovery, having a tool to extract it (your utility), and then if you wish deodexed it, and then last step put all into CWM flashable zip....now if you combine all this steps, you will end up ultimate best utility tool ever... I f...king even pay or donate for it...
Click to expand...
Click to collapse
thank you for your great idea which is very worth
i had finally made that tool which has options like
1. extract data
2.extract system
3.deodex/ signed zip/zipalign
4.odexed /signed zip/zipalign
5.image file extraction
6. signer
7. odex/deodex invividual
the odex/deodex have different options like
if you extract the system file. it ask an option to odex/deodex . if you need to deodex that it will continue to deodex / zipalign/ signed which will be worked. and same as with odex..
if you dont have any imagefile extracted . there is an option that you can pull from the device and works as same above process
you can sign the zip/zipaline individually as per needed.
hopefully it works on all devices like ( sony, lg, samsung and almost all )
no specification of roms ( every rom is supported )
works for all version of android ( from 2.2 to 4.4.4)
thank you @jazzespresso for this idea
going to post as soon as possible
venkat kamesh said:
thank you for your great idea which is very worth
i had finally made that tool which has options like
1. extract data
2.extract system
3.deodex/ signed zip/zipalign
4.odexed /signed zip/zipalign
5.image file extraction
6. signer
7. odex/deodex invividual
the odex/deodex have different options like
if you extract the system file. it ask an option to odex/deodex . if you need to deodex that it will continue to deodex / zipalign/ signed which will be worked. and same as with odex..
if you dont have any imagefile extracted . there is an option that you can pull from the device and works as same above process
you can sign the zip/zipaline individually as per needed.
hopefully it works on all devices like ( sony, lg, samsung and almost all )
no specification of roms ( every rom is supported )
works for all version of android ( from 2.2 to 4.4.4)
thank you @jazzespresso for this idea
going to post as soon as possible
Click to expand...
Click to collapse
yeah making it work for all devices going to be quit challenging, there are, as you may know, too many odex/deodex tools here in XDA, but none are bug free. In fact, I always end up some kind of error during deodexing, so this part is always painful process no matter what devices you have, and you know people using Windows, Linux, Mac..etc, this puts more complexity to entire process.
but you have to start from somewhere, right?
hopefully, this process of yours grow into some nice utility that combines all other tools into one.:good:
Needless to say, good job and very much appreciated releasing it here in XDA community!
venkat kamesh said:
.....i had finally made that tool which has options........
......going to post as soon as possible.......
Click to expand...
Click to collapse
that's some spread - the menu :good: bring it on!
Already did it sir, and i use winrar
jazzespresso said:
yeah making it work for all devices going to be quit challenging, there are, as you may know, too many odex/deodex tools here in XDA, but none are bug free. In fact, I always end up some kind of error during deodexing, so this part is always painful process no matter what devices you have, and you know people using Windows, Linux, Mac..etc, this puts more complexity to entire process.
but you have to start from somewhere, right?
hopefully, this process of yours grow into some nice utility that combines all other tools into one.:good:
Needless to say, good job and very much appreciated releasing it here in XDA community!
Click to expand...
Click to collapse
m0han said:
that's some spread - the menu :good: bring it on!
Click to expand...
Click to collapse
thank you and here is a pic that i am testing all the things i found no errors and still testing
because it need to be perfect

(GUIDE)(PORT CM 12.1 ) MTK6592 CM 12.1 PORTING GUIDE (Only For Porters) :)

MT6592 CM 12.1 PORTING GUIDE
Lots of people asked me how i ported cm 12.1 from @fire855's compiled rom for kingzone k1 Turbo
First of all huge thanks to @fire855 and other Dev who helped him for bringing cm 12.1 on mt6592
Give support to him via pressing thanks or Donate , here is it's Link : http://forum.xda-developers.com/and...od-12-kingzone-k1-turbo-t3119908#post61000671
Requirements :
1. Stock Rom KK
2. Working Good Custom Recovery
3. Good Porter and Mind
Lets Start This Short Guide :
1. Download Latest Cm 12.1 from above link
2. Extract in a new folder
3. Use this tool LInk : http://forum.xda-developers.com/android/development/tool-convert-folder-to-ext4-format-t3099237
unpack .dat file and copy extracted system folder in new folder as stated in step 2.
4. Using @michfood's tool (link : http://forum.xda-developers.com/showthread.php?t=2036528)
change Kernel and Do necessary changes acc. to your stock's ramdisk
5. Copy new boot.img that created in step 4 and replace in new folder as stated in step 2.
6. From stock kk rom ...........extract libaudio.primary.default.so (system/lib) and modem.img (system/etc/firmware) nd replace in cm 12.1 's rom ................ in the same location
7. Delete meta-inf folder of cm 12.1's rom and extract this (link : https://www.sendspace.com/file/vnf0gi)
8. Open meta-inf's updater-script in notepad++ and change mountpoint of system acc. to your's phone
9. Pack the folder as in zip format and flash via recovery
( meta-inf, install ,system, boot.img, file context these files must there in zip )
10. Voila Rom booted .............if not comment
If Rom Booted ..............Follow this steps :
1. Download this apk (link : http://forum.xda-developers.com/showthread.php?t=2524485)
2. Go to Settings>developer>enable root and install apk from step 1
3. Open app and Set as permissive ,reboot Your device
4. Voila your wifi,bluetooth etc will start working, even Dual Sim
5. If you faced basedband unknown that mean restore your imei
6. For Home Key Bug , Edit generic.kl and mtk-kpd.kl (system/user/keylayout)
7. For Storage Bug, Edit Framework-res.apk and set sdcard1 as primary and edit boot's ramdisk MT6592.rc, fstab
8. For Other Bugs, Let Me Know
Notice : Always give thanks and link of @fire855's Rom Link
Credits : everyone (who's name i added in this guide and there's tools )
​
@[email protected] Thanks for a great guide, I was able to succesfully port the rom and it booted as well and after setting the selinux to permission my sims also started working but mic is not working, my device is MT6582 (Intex Aqua Speed). I have a working CM11 already ported for my device which is working perfectly fine. Also the soft keys (capacitive keys are not working nor even the power button). Please advise...
contactwajeeh said:
@[email protected]. . . . but mic is not working . . . .
Click to expand...
Click to collapse
The microphone is also not working in all apps (except Telephone where it work's fine) in the original CM12.1 by fire855 for the Kingzone K1. (The Rom this Porting Guide is based on).
That could be part of the problem.
Dominic
G-GFFD said:
The microphone is also not working in all apps (except Telephone where it work's fine) in the original CM12.1 by fire855 for the Kingzone K1. (The Rom this Porting Guide is based on).
That could be part of the problem.
Dominic
Click to expand...
Click to collapse
But its not working in calls as well. BTW I am using @moonrotation build as my base. I haven't asked for permissions to port it yet. But that should be fine as far as I dont do the public release of it.
What necessary changes i must do in ramdisk?help
contactwajeeh said:
But its not working in calls as well. BTW I am using @moonrotation build as my base. I haven't asked for permissions to port it yet. But that should be fine as far as I dont do the public release of it.
Click to expand...
Click to collapse
currently mic problem is there ....wait for fixes
contactwajeeh said:
@[email protected] Thanks for a great guide, I was able to succesfully port the rom and it booted as well and after setting the selinux to permission my sims also started working but mic is not working, my device is MT6582 (Intex Aqua Speed). I have a working CM11 already ported for my device which is working perfectly fine. Also the soft keys (capacitive keys are not working nor even the power button). Please advise...
Click to expand...
Click to collapse
edit keylayout's genric.kl etc
mirrr46 said:
What necessary changes i must do in ramdisk?help
Click to expand...
Click to collapse
like some some extra lines der in urs .
Tried to port this, Device reboots right after vendor logo
I compare stock Ramdisk with CM12. There are no diff. At end both have same values. I changed Kernel and Kernel Header
I changed the updater script so it fits to my partition. It gave me strange errors:
lsetfilecon of /system/lost+found to ubject_r:system_file:s0 failed: No such file or directory
m_file:s0 failed: Operation not supported on transport endpoint
Error flashing Zip : Failed
Updating partition details...
Click to expand...
Click to collapse
Also @michfood's tool just ain't work here, i took the v4 for my x64 win8.1. The Program is unable to extract the Ramdisk path, so i was forced to use "MTK Firmware Adapter Tool"
Recovery:TWRP 2.8.1.0
SoC:MT6592
Device: Doogee DG550
Traace said:
Tried to port this, Device reboots right after vendor logo
I compare stock Ramdisk with CM12. There are no diff. At end both have same values. I changed Kernel and Kernel Header
I changed the updater script so it fits to my partition. It gave me strange errors:
Also @michfood's tool just ain't work here, i took the v4 for my x64 win8.1. The Program is unable to extract the Ramdisk path, so i was forced to use "MTK Firmware Adapter Tool"
Recovery:TWRP 2.8.1.0
SoC:MT6592
Device: Doogee DG550
Click to expand...
Click to collapse
1. don't touch kernel header....change only kernel
2. u should try other recovery like philz
3. delete lost and found folder if present
4. use my meta-inf only....just change mountpoint of system........it seems u need good recovery with lp supported or philz recovery :fingers-crossed:
Thanks for guide.
My camera does not work and gallery does not see SD card.
How to fix it?
mirrr46 said:
Thanks for guide.
My camera does not work and gallery does not see SD card.
How to fix it?
Click to expand...
Click to collapse
1. camera icon in launcher is issue (for mt6592)
2. for storage...fixes r from mt6592.rc in this file read proper sysmlink and do changes acc. to it ,decompile framework-res.apk....set sdcard1 as primary ,fstab changes also needed
Enforcing to Permissive
Does anyone know how to make selinux permissive without any app,I tried to change ro.build.selinux and set it to 0 but it didn't work...does anyone know what to edit in ramdisk to make selinux permissive.?
Traace said:
Tried to port this, Device reboots right after vendor logo
I compare stock Ramdisk with CM12. There are no diff. At end both have same values. I changed Kernel and Kernel Header
I changed the updater script so it fits to my partition. It gave me strange errors:
Also @michfood's tool just ain't work here, i took the v4 for my x64 win8.1. The Program is unable to extract the Ramdisk path, so i was forced to use "MTK Firmware Adapter Tool"
Recovery:TWRP 2.8.1.0
SoC:MT6592
Device: Doogee DG550
Click to expand...
Click to collapse
I'm still struggling to port this rom to DG550.
1. The tool you used to extract the kernel does not work in Windows 8.1 and Windows 10 (I got empty RAMDISK folder). So I switched back to Windows 7 and it worked well.
2. Compared both Ramdisk folders in Stock DG550 Kitkat and Stock Kingzone K1 Kitkat boot.img's.
There is no difference except in ueventd.rc file. I tried to mix DG550 kernel and Kingzone Z1 stock Ramdisk with DG550 Kitkat rom. It didn't boot at first. The problem was in ueventd.rc file. See line 152 (Mali Node). After replacing ueventd.rc file from DG550 ramdisk it booted and worked well (stock kitkat rom). So both the stock ramdisks are identical if ueventd.rc file is replaced.
3. But it fails when porting the boot.img for CM12.1. Theoretically CM12.1 ramdisk should work with DG550 kernel for CM12.1 rom without any changes (except ueventd.mt6592.rc). It does not pass the boot logo.
4. Also I noticed that there's some issue in sbin folder in ramdisk.
ADev_28 said:
Does anyone know how to make selinux permissive without any app,I tried to change ro.build.selinux and set it to 0 but it didn't work...does anyone know what to edit in ramdisk to make selinux permissive.?
Click to expand...
Click to collapse
/system/bin/setenforce 0
From any root terminal.
Thanks,
1. But i did port for mtk6582 (camera unfortunelty has stop)
chanaka89 said:
I'm still struggling to port this rom to DG550.
1. The tool you used to extract the kernel does not work in Windows 8.1 and Windows 10 (I got empty RAMDISK folder). So I switched back to Windows 7 and it worked well.
2. Compared both Ramdisk folders in Stock DG550 Kitkat and Stock Kingzone K1 Kitkat boot.img's.
There is no difference except in ueventd.rc file. I tried to mix DG550 kernel and Kingzone Z1 stock Ramdisk with DG550 Kitkat rom. It didn't boot at first. The problem was in ueventd.rc file. See line 152 (Mali Node). After replacing ueventd.rc file from DG550 ramdisk it booted and worked well (stock kitkat rom). So both the stock ramdisks are identical if ueventd.rc file is replaced.
3. But it fails when porting the boot.img for CM12.1. Theoretically CM12.1 ramdisk should work with DG550 kernel for CM12.1 rom without any changes (except ueventd.mt6592.rc). It does not pass the boot logo.
4. Also I noticed that there's some issue in sbin folder in ramdisk.
Click to expand...
Click to collapse
Please let us know if u can let it boot
Ramdisk sBin shoudn't be a problem, if they really cause trouble, try copy the missing files from base dg550 kk to cm12
[email protected] said:
1.
Click to expand...
Click to collapse
Thank you very much... Your guide was very appreciated... Work like a charm..
I used the device MT6592 - BLU VIVO IV of the my friend for port CM12.1
Sent from my LIFE PLAY X KK using XDA Free mobile app
lopestom said:
Thank you very much... Your guide was very appreciated... Work like a charm..
I used the device MT6592 - BLU VIVO IV of the my friend for port CM12.1
Sent from my LIFE PLAY X KK using XDA Free mobile app
Click to expand...
Click to collapse
congo
Traace said:
Please let us know if u can let it boot
Ramdisk sBin shoudn't be a problem, if they really cause trouble, try copy the missing files from base dg550 kk to cm12
Click to expand...
Click to collapse
mirrr46 said:
1. But i did port for mtk6582 (camera unfortunelty has stop)
Click to expand...
Click to collapse
seems storage bug...u need to fix storage .............check guide and comments
chanaka89 said:
I'm still struggling to port this rom to DG550.
1. The tool you used to extract the kernel does not work in Windows 8.1 and Windows 10 (I got empty RAMDISK folder). So I switched back to Windows 7 and it worked well.
2. Compared both Ramdisk folders in Stock DG550 Kitkat and Stock Kingzone K1 Kitkat boot.img's.
There is no difference except in ueventd.rc file. I tried to mix DG550 kernel and Kingzone Z1 stock Ramdisk with DG550 Kitkat rom. It didn't boot at first. The problem was in ueventd.rc file. See line 152 (Mali Node). After replacing ueventd.rc file from DG550 ramdisk it booted and worked well (stock kitkat rom). So both the stock ramdisks are identical if ueventd.rc file is replaced.
3. But it fails when porting the boot.img for CM12.1. Theoretically CM12.1 ramdisk should work with DG550 kernel for CM12.1 rom without any changes (except ueventd.mt6592.rc). It does not pass the boot logo.
4. Also I noticed that there's some issue in sbin folder in ramdisk.
Click to expand...
Click to collapse
i don't think so....again try and don't touch ramdisk
[email protected] said:
congo
seems storage bug...u need to fix storage .............check guide and comments
i don't think so....again try and don't touch ramdisk
Click to expand...
Click to collapse
How to solve storage bug??
Device booted.Not able to mount/access storage. ??

[GUIDE]How To Port a Custom Rom (Noob Friendly)

Well lots of people asked me here and on facebook to expain how i port custom roms for my device so i decided to make a Noob friendly thread for those who want to learn how to port custom rom for their device i use this method for porting samsung roms for my device but it may also work on any other device as well
I will make myself as clear and as simple as possible so anyone can understand what actually is happening in each part of the guide
The method i use for porting roms is as following :
Things which you need are : Notepad++ , 7Zip a laptop and a brain
First of all you need to understand what really matters when porting a custom rom for you device and that is the compatibility of both the devices one which is yours and one from which you are trying to port the rom from in order to port a custom rom the specifications of both the devices should be similar i.e. they should be sharing the same Chipset ,same Internal memory , same Ram and Camera resolution
Terms used in the guide:
-Base rom(this is the rom which was made for your device which you would use as a base for porting the roms)
-Port rom(this is the rom which your are trying to port for your device)
Step 1
Make a folder at your desktop and name it port now take any custom rom you want to port for your device and put it into that folder now just like this make another folder on the desktop and name it base and put a rom made for your device into it but be careful if youre trying to port a cyanogenmod based rom or a AOSP based rom then your base rom should be a ASOP or a cyanogenmod rom and if youre trying to port a samsung rom then the base rom should be a samsung rom and same as for htc , xperia or any other device
Step 2
Now go to base folder and right click on the base rom and choose extract here using either winrar or 7zip ( i recommend 7zip) now go to port folder and right click on it and choose open archive option from 7zip( there will be two options for open archive one and two just chose the upper one because the lower one will extract the rom and we don't want that for this one )
Step 3
The port rom elements will be shown like meta inf and system and boot img ( absent in some cases) now go to port roms system folder then proceed as following system>etc>firmware and delete the firmware folder now go to base rom and copy the firmware folder from the same path by going from system>etc>firmware and paste it into the etc folder of the port rom
Step 4
Now go to the port rom proceed as following system>lib>modules and delete the module folder and just like how we did before copy the module folder from the base rom into the port roms lib folder
Step 5
Now go to port rom and proceed as following system>usr>keylayout>generic.kl and delete it and copy the generic.kl from the base rom into the port rom
Step 6
now copy and replace the boot.img from the base rom into the port rom
Step 7
No go to port folder and and proceed as following system>meta-imf>com>google>android>updater binary and updater script and delete these two and replace from the ones in the base folder
Step 8
Now put the port rom into your external-sd card and flash via recovery with a full data and cache wipe
Some fixes for bugs and issues:
Note: try replacing the files into the port rom and see if the problem solves or not
NFC
/system/app/Nfc.apk
/system/lib/libnfc*.so
/system/bin/pcscd
Radio
/system/bin/fmradio
Sensors
/system/bin/akmd*
/system/lib/libsensors.so
Bluetooth
/system/bin/bd_prov
/system/bin/uim*
/system/bin/hcid
/system/bin/bluetooth*
/system/bin/hciattach
/system/bin/sdptool
/system/xbin/hciconfig
Wifi
also copy and replace the wlan.ko file from system>libs>modules into the port rom from the base rom if the file name is pronto_wlan.ko then rename it to wlan.ko before replacing
/system/bin/netcfg
/system/bin/dhcpcd
/system/bin/ifconfig
/system/bin/hostap
/system/bin/hostapd
/system/bin/hostapd_bin
/system/bin/pcscd
/system/bin/wlan*
/system/bin/wpa*
RIL
/system/bin/stmd
/system/bin/rild*
/system/etc/rril
Camera
Copy libcamera*.so from base to port rom
If rom does not boot after that, replace file one by one and see which file is the problem.
If you have any questions or queries then feel free ask any things
for future
just in case

[guide][how to] port miui 7 to any mt6582 device

Many porters are not able to port MIUI Rom to MT6582.... I will give a guide to port MIUI 7 ROM to any MT6582 With Kitkat firmware... This guide is for porters only and works for MIUI 6 also...Noobs Try at ur own Risk...
REQUIREMENTS:
- Basic Knowledge about porting and boot.img editing using android kitchen.
- Use onli TWRP/CTR Recovery.
- YOUR STOCK MT6582 ROM(KK FIRMWARE ONLI)
- ANDROID KITCHEN
- PORT MT6582 MIUI 7 ROM ( use my rom for A104 or Gionee M2 Rom by ARGN Devs... We keep our roms updated)
Canvas A104 MIUI 7 ROM: DOWNLOAD
Gionee M2 MIUI 7 ROM: DOWNLOAD
STEPS:
1: PREPARING:
-Extract both roms to different folder... Setup Android Kitchen.
2: SYSTEM EDITING:
-Bin Folder: Replace vold,sdcard from stock to port.
-Libs Folder: Open port libs folder and delete /hw folder.... Now replace /hw folder libcameracustom.so, libcameraservice.so, libfeatureio.so, libMali.so and libshowlogo.so from stock to port.
-etc Folder: Open port etc folder and delete /firmware and /mddb folder... Replace /firmware & /mddb from port to stock... if u dont have mddb folder in stock leave it...
-Vendor Folder: Open port vendor folder and delete /lib and /media folder...replace /lib and /media folder from stock to port.
-Xbin Folder: Replace libmnlp_mt6582 and mnld from stock to port rom.
- Build.prop : Open build.prop and edit device name with urs .... Finding the correct lcd density is a big problem ... Try 210 first ... change it if u have dpi issues (Dont set below 210).
3: UPDATER-SCRIPT:
- Open updater script and change mountspace id (mmcblkpxx) as per ur device.. U can find it using MTK Droid Tool.
4: BOOT.IMG EDITING:
- Unpack boot.img of both stock and port rom using kitchen... We have to recombile port rom boot.img so unpack boot.img of port rom from working folder.
- Copy ZImage from Stock and replace in port.
- Copy sepolicy from stock ramdisk to port.
- Open uevent.rc of both roms in notepad+ and copy any additional lines from port to stock... use any text compare tool to find additional lines.. dont delete any lines onli add lines from port... Now replace uevent.rc from port with stock rom uevent.rc(The one u added lines from stock)
- Repack port rom boot.img and move it to port folder.
- Replace #camera lines of init.rc from stock to port if u get camera error/ green camera.
- If u Get Sdcard /Internal memory not mounting issue.... Rename init.no_ssd.rc of stock boot.img to init.ssd.rc and replace it in init.ssd.rc of port boot.img.j v
5: FINISHING UP:
- Now compress the port rom into .zip and flash on your device. Njoy!!!
BUG FIXING:
- Same as Other KK Roms... If u have any issues comment below...
CREDITS:
-Geo Baby for all his help.
[email protected] for his excellent Crossporting guide.
[email protected]
-Many xda MTK devs for their guides.
Please Hit Thanks if u find this post useful ...
Can this guide work for porting from mt6582 to mt6572 after porting to mt6582? Another crossport if you will
Please tell me how to fix camera error? i replaced #camera line in my stock rom but it can't slove
awesome
bro this gives me error seven even i change the products name......n also it failed to mount / system gives ivvalid argument

Categories

Resources