Sei sulla pagina 1di 21

[Tools, Tips & Tutorials]

(TUTORIAL) HOW TO PORT MTK


ROM (NORMAL)
#1

23145 29 |
19:55, Feb-19-2015 | From PC
|
|
Go to reply no.

Choose Custom ROM from a device matching same resolution to reduce App
Sizerelated bugs
Get. Set. Go.
Step 1 : PatchingSystem Folder for the port patch.
First of all make a folder named "Port_Patch" andsetup all the folder as shown in
the images below.

1. Now,in Port_Patch make system folder in which make folders, "bin""etc"


"lib" "usr" "vendor""xbin" (without ")
2. Infolder "bin" copy pq & vold from your stock rom
3. Infolder "etc" copy "bluetooth" "firmware""wifi" "apns-conf.xml"
"vold.fstab" "vold.fstab.nand"

1. Infolder "lib" copy files as shown inthe image

2. Infolder "usr" copy usr/keylayout/Generic.kl

3. Infolder "vendor" all the files

4. Infolder "xbin" copy "libmnlp_mt662x" (x - '0' or '8')from stock

System has been patched, copy this /system to patch the /system of port ROM.
Step2: Patching the boot.img of the port rom.
This is bittricky but can be done easily.
1 So,first of download this little tool, to unpack & repack your boot.img-
MTKbootimg.zip- tested on Windows 7 & aboveplatform
2 Extractthe Tool and you will get two folders named "stock"& "port"
3 Copyboot.img's respectively from stock rom in"stock" folder & from port
romto "port"
4 Unpackboth boot.img repectively and they may look like this.

1 Fromstock copy "kernel" to port folderand just replace it.


2 Now,repack it, new file named "boot-new.img" will be generated.
3 Copy"boot-new.img" to port Rom Folder.
4 Deleteexisting "boot.img" and rename "boot-new.img" to "boot.img"

Now, your boot.img is patched, proceed to last step.


Step3: Modifying updater-script to install ROM accordingly.
1 So,it's the last step before flashing the rom. Now lets fix it.
2 First,you have to know your device mount points, that can be trackedusing
MTKDroid Tool or check them in stockrom updater-script.
3 Ihave my flashable stock rom so I willget mount points from it.
4 Asshow in the image, my stock updater havedifferent mount point for system
& data while port havedifferent.

In updater-script
Openupdater-script using notepad++ from "port ROM\META-
INF\com\google\android"
Remove wholelines contain assert word at the beginning of the file like this line
assert(getprop("ro.product.device")== "cancro" || getprop("ro.build.product")
=="cancro");
Verify/system should be mounted in "/dev/block/mmcblk0pS" & /datashould be
mounted in "/dev/block/mmcblk0pD"

What is S andD?
S SystemMount Point
D DataMount Point
To know thesemount point values
- Open MTKDroid Tool after connecting your phone to PC.
- Open BlockMaps.
- Check theselines.

1 Now,replace "mmcblk0pX" (X - no. for the mount) from stock to port as


designated for the partition.
2 NowSave the updater-script.

Finally, the ROM is ready toflashed.


Step4: Compressing & Flashing the ROM.
1 Now,the rom is ready to be packed and flashed.
2 Simplyget to the main directory with META-INF, system, boot.img, etc files.
3 Selectall the files and compress them to zip. Select the compression ratio as
youwant.
4 Aftercompressing copy the ROM into root of sdcard
5 EnterCustom Recovery, wipe data & Cache
6 Flashthe ROM.zip wait till it completes.
7 Waittill it boots, or else take log using ADB logcat. (Hint: If LED light
blinks,the rom is booting)
FOR Fixes Proceed to nextpost and find out the way to tackle and
fix the bugs.
Let'sget started:
Bootloop?
Replace following files(from stock to port):

libandroid_runtime.so
libandroid_servers.so
libmedia_jni.so
libsync.so
If possible try modifying framework.jar "\smali\com\android\server" (copy from
stock)

Camera Not Working?


Replace following files(from stock to port):
Code:
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
Init.rc Fix:
Copy this code and paste in Init.rc
#Camera
chmod 0660 /dev/camera-sysram
chmod 0660 /dev/camera-isp
chmod 0660 /dev/camera-eis
chmod 0660 /dev/camera-fdvt
chmod 0660 /dev/camera-resmgr
chmod 0660 /dev/kd_camera_hw
chmod 0660 /dev/kd_camera_flashlight
chmod 0660 /dev/FM50AF
chmod 0660 /dev/MT9P017AF
chmod 0660 /dev/OV8825AF
chmod 0660 /dev/A8141AF

chown system camera /dev/camera-sysram


chown system camera /dev/camera-isp
chown system camera /dev/camera-eis
chown system camera /dev/camera-fdvt
chown system camera /dev/camera-resmgr
chown system camera /dev/kd_camera_hw
chown system camera /dev/kd_camera_flashlight
chown system camera /dev/FM50AF
chown system camera /dev/MT9P017AF
chown system camera /dev/OV8825AF
chown system camera /dev/A8141AF

Wlan not working properly?

fmradio.driver.chip=x(if mt6620 then x=1, if mt6628 then x=3)


Change the abovecodes accordingly in updater-script
Replace theversion in port from the one in stock

GPS, unstable or not working?


(Replace from stock to port)
xbin/libmnlp
Replace from/lib/module folder mtk_stp_gps.ko
Media Player problem?
(Replace from stock to port)
Code:
libdpframework.so
libcodecvdrv.so

Sensors not working properly?


(Replace from stock to port)
libsensorservice.so

SD Card not working or mounting?

In the framework-res.apk of your port, replace /res/xml/storage_list.xml from stock


one.Replace vold.fstab from /etc folder
USB not mounting your device?

Unpack your boot.img replace init.usb.rc from ramdisk by stock boot.img


init.usb.rc

Networkrelated issuea? (3G)


Replace from /etc folder, mddb then replace agps_profiles_conf, apns-
conf,epo_conf, spn-conf, virtual-spn-conf-by-efpnn, virtual-spn-conf-by-efspn,
virtual-spn-conf-by-imsi

For high audio volumeissue


Replace libcustom_nvram.sofrom /lib

For flash light notcoming from camera


Replace libfeatureio.so from /lib

To fix compass
Replace libsensorservice.so from /lib

To fix video showing pixels andglitches


Replace libvcodecdrv.so from /lib

Showing wrong ram info in task manager


Don't change ro.product.device value in the build.prop.

For green camera/ lag / no wallpaper /no status bar (important file for
mt6582)
Replace libdpframework.so from lib folder
Any resolution problem
Add this line to build.prop
ro.sf.lcd_density=your phone screen dpi
ex- ro.sf.lcd_density=480 for FHD devices

Touch screen problem


(Sometimes screen behaves weird ..means for example if you touch bottom left
effect on top right ...almost opposite response)
Replace libinput.so from /system/lib folder.

Wifi tethering problem


Replace dnsmasq from /bin folder

Screen is upside down


In build.prop find this line
ro.sf.hwrotation=0
change the value 0 to 180.
ro.sf.hwrotation=180

Problem with Proximity Sensor


Replace nvram.so, nvram_platform.so, nvram_daemon_callback.so

BASIC METHOD FOR ROM PORTING


FILE LIST FOR REPLACING:

*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...
*system/etc/permissions
*system/etc/security
*system/etc/audio
*system/etc/wifi
*system/lib/drm
*system/lisystem/lib/soundfx

HAPPY
PORTING :D
10
Favorite9 Share

Rated by 4 people Experience Reason

+1 Fantastic!
dendie701

+1 Fantastic!
PraveenKumara

+1 Thanks!
Sajalsh_25

+5 Awesome!
scherzy

Experience +8 View Rating Log


Reply

Report
10#
18:13, Jul-05-2015 | From PC
|
GRATE TUTORIAL
amshpitz

Senior Member

Credits
36
Online time
23 Hours
Send PM
Reply Support 1 Object 0

Report
#2

22:02, Feb-21-2015 | From PC


|
thanks

scherzy

MIUI Porting
Team

Credits
2684
Device
Others
MIUI Version
5.7.10
Online time
168 Hours
Send PM

Reply

Report
#3

17:53, Mar-02-2015 | From PC


|
Hi and thanks for your tutorial.
I have a problem with vibrate mode who doesn't work. Could you
help me to fix this, please ?
samclement
Junior Member

Credits
22
Online time
3 Hours
Send PM
Reply Support Object

Report
#4

22:04, Mar-04-2015 | From PC


|
I think it's in the latest versions of MIUI. I'm having
problems with vibrations too. It's not working on my ported
jhommark MIUI 6 v5.3.3 for Redmi Note 3g. I can't fix it. Tried
replacing whole usr.
Senior Member

Credits
28
MIUI Version
V8.1.4.0.MBFMIDI
Online time
23 Hours
Send PM
Reply Support Object

Report
5#
12:42, Mar-30-2015 | From PC
|
thanks

manyol82

Senior Member

Credits
194
Device
Mi 4c
MIUI Version
7.3.30
Online time
35 Hours
Send PM
Reply

Report
6#
00:28, May-02-2015 | From PC
|
jhommark replied at 2015-3-4 16:04
I think it's in the latest versions of MIUI. I'm having problems
with vibrations too. It's not worki ...
batsilos2
Replace libhardware_legacy.so from your original phone to your
MIUI Porting Team miui port.

Credits
93
Device Bilias aka Fazer-1000
Others
MIUI Version
6.7.14
Online time
24 Hours
Send PM
Reply Support Object

Report
7#
17:06, May-11-2015 | From PC
|
Can We Port The Redmi Note 4g Cyanogenmod 12 To our
Redmi Note 3g By This Method?
Sajalsh_25 Please Reply!
CM 12 IS AMAZING!
Senior Member

Credits
56
Device
Mi 3
MIUI Version
JHDMIBL42.0
Online time
23 Hours
Send PM
Reply Support Object

Report
8#
20:35, Jun-24-2015 | From PC
|
wow good job

amshpitz

Senior Member

Credits
36
Online time
23 Hours
Send PM
Reply Support Object

Report
9#
16:54, Jun-25-2015 | Via mobile
|
Thanks

rajy

Gold Member

Credits
228
Device
Redmi Note 3G
MIUI Version
V8.0.1.0.KHDMIDG
Online time
75 Hours
Send PM
Reply

Report
123>
Return to forum
Advanced Mode
B Color Image Link Quote Code Smilies
Please sign in to reply. Sign In | Register

Credits Management
To last page

MIUI Official Site |Mi Official Site |User Agreement |Privacy Policy |Mobile

RECOPILATORIO: HOW TO PORT


ROM's FOR MT67XX DEVICES
3.10.XX 64bit Kernel
[Copy link]
Go to Page No.
1#
Post time 2017-4-16 19:16:47 | Show the author posts only
Llopbal Edited by Llopbal at 2017-4-16 12:35 PM

17 139 1010

Threa Pos Cred


ds ts its

Senior Member

This guide is for MT67XX devices (AOSP BASED ROMS)


Credits
1010 This guide will work for normal and cross porting from
MT6735=>MT6753
Send MT67XX=>MT67XX
PM ETC...

Now let's begin

Copy this files from stock to port


System/etc/firmware
System/etc/mddb
System/etc/apgs_profiles_conf2.xml
System/etc/apns_conf.xml
System/etc/custom.conf
System/etc/spn-conf.xml
System/etc/recovery.fstab
System/etc/trustzone.bin

System/lib/libcamalgo.so
System/lib/libcamdrv.so
System/lib/libcameracustom.so
System/lib/libfeautureio.so
System/lib/libvcodecdrv.so

System/lib-lib64/hw/audio.primary.default.so
System/lib-lib64/hw/gps.default.so
System/lib-lib64/hw/gralloc.default.so
System/lib-lib64/hw/ any file starting with mt67xx.so

EDITING BOOT IMAGE

Unpack boot image using the tool I gave in first giude


Replace kernel folder
Replace fstab.mt67xx
Compare all init.***.rc file and edit appropriately as stock
init.***.rc
BUILD.PROP

Find this lines


ro.mediatek.platform=MT67XX
Edit the MT67XX like stock

If phone doesn't boot follow the Method in this Guide 2

GUIDE 2 :

Guide 2 on how to port ROM for MT67XX device

Continue from previous guide Now replace Entire folder

System/lib/hw
System/lib/egl

If it didn't boot

From system/bin replace

System/bin/bbc
System/bin/linker
System/bin/linker64
System/bin/mdnsd
System/bin/ndc
System/bin/netd

(NOTE REPLACE THESE CAMERA LIBS FROM system/lib)

Libcamalgo.so
Libfeatureio.so
Libcam.camparamsmgr.so
Libjpeg.so
Libdpframework.so
Libcamdrv.so
Libcameracustom.so

IF NOT WORK TRY GUIDELINE BELOW)

Replace from system/lib and system/lib64

Lib3a.so
Lib3a_sample.so
Liba3m.so
Libcam.camadapter.so
Libcam.camnode.so
Libcam.client.so
Libcam.halsensor.so
Libcam.iopipe.so
Libcam.metadataprovider.so
Libcam.camparamsmgr.so
Libcam.sdkclient.so
Libdpframework.so
Libexif.so
Libfeatureiodrv.so
Lib.j3am.so
LibmtkOmxAdpcmDec.so
LibmtkOmxAdpcmEnc.so
LibmtkOmxAlacDec.so
LibmtkOmxApeDec.so
LibmtkOmxCore.so
LibmtkOmxFlacDec.so
LibmtkOmxG711Dec.so
LibmtkOmxGsm.dec.so
LibmtkOmxMp3Dec.so
LibmtkOmxRawDec.so
LibmtkOmxvDec.so
LibmtkOmxvEnc.so
LibmtkOmxVorbisEnc.so

GUIDE COMING SOON FOR CM BASED ROMS!

Credits:
Mad Skill Skill
MT6735/MT6753 X64 group
Swiss Carter
LINK's :
http://www.techubng.com/2016/08/mtk-rom-porting-guide-
mt67xx.html
http://www.techubng.com/2016/08/mtk-porting-guide-mt67xx.html

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

How to port Cyanogen based ROMs for MT67XX (3.10.XX kernel)

If you followed my earlier post on how to port ROMs for MT67XX


I stated that the guide was for AOSP based ROMs.

Now this guide is for CM Based ROMs for MT67XX


Copy these files from /System in stock ROM to /System in port

/System/bin/bcc
/System/bin/install-recovery.sh
/System/bin/linker
/System/bin/linker64
/System/bin/mdnsd
/System/bin/ndc
/System/bin/netd
/System/etc/firmware folder
/System/etc/mddb folder
/System/etc/agps_profiles_conf2.xml
/System/etc/apns_conf.xml
/System/etc/custom.conf
/System/etc/recovery.fstab
/System/etc/recovery.sig
/System/etc/spn_conf.xml
/System/etc/trustzone.bin

Copy these files from /System/lib and /System/lib64

Lib3a.so
Lib3a_sample.so
Liba3m.so
Libcamalgo.so
Libcamdrv.so
Libcameracustom.so
Libcam.camadapter.so
Libcam.camnode.so
Libcam.client.so
Libcam.halsensor.so
Libcam.iopipe.so
Libcam.metadataprovider.so
Libcam.paramsmgr.so
Libcam.sdkclient.so
Libdpframework.so
Libexif.so
Libfeatureio.so
Libja3m.so
LibMtkOmxAdpcmDec.so
LibMtkOmxAdpcmEnc.so
LibMtkOmxAlacDec.so
LibMtkOmxApeDec.so
LibMtkOmxCore.so
LibMtkOmxFlacDec.so
LibMtkOmxG711Dec.so
LibMtkOmxGsmDec.so
LibMtkOmxMp3Dec.so
LibMtkOmxRawDec.so
LibMtkOmxvDec.so
LibMtkOmxVenc.so
LibMtkOmxVorbisEnc.so
LibVcodecdrv.so

Also copy this files from

/System/lib/hw and lib64/hw


Audio.primary.default.so
Audio.primary.mt67xx.so
Camera.mt67xx.so
Gps.default.so
Gralloc.default.so
Gralloc.mt67xx.so
Hwcomposer.mt67xx.so
Memtrack.mt67xx.so
Sensors.mt67xx.so

Copy whole folder from /System/lib/Egl and /System/lib64/Egl

Edit boot image (kernel/zimage) from stock to port

Edit Mount points


Zip and flash!

Credits:
Mad Skill Skill
Mt67xx 64 group
Swiss Carter (it wasn't easy to carefully scrutinize this)

LINK :
http://www.techubng.com/2016/08/cyanogen-porting-guide-mtk-
mt67xx.html
Bug Fixes For Any MTK CM Based
ROM
Dumnoi Ikechukwu August 14, 2016 ROM fixes

This topic is about fixing bugs after porting a CM Based ROM. You can learn how to port A CM
Based ROM with this guide here

So let's begin

FOR NO RADIO SIGNAL:


Replace from stock to port ROM

System/etc/firmware/mt6620_patch_e3_hdr.bin
Systemetc/firmware/mt66320_patch_e6_hdr.bin
Systemetc/firmware/WMT.CFG
System/lib/modules/mtk_fm_drv.ko
System/lib/libfmcust.so

COMPASS PROBLEM:

System/lib/libsensorservice.so

GPS:

System/xbin/ibmnlp
System/etc/gps.conf
System/lib/module/mtk_stp_gps.ko

TOUCHSCREEN:

System/lib/libinput.so
System/usr
System/usr/keylayout/generic.kl (fix home button or capacitive)
FOR SOUND/AUDIO:

System/lib/libaudio.primary.default.so
(If above doesn't work replace all files starting with libaudio.xxxx in System/lib/)

STORAGE PROBLEM:

System/bin/vold
System/bin/pq
Edit storage_list.xml in framework-res.apk

BOOTLOOP ISSUE:

System/lib/libandroid_runtime.so
System/lib/libandroid_servers.so
System/lib/media_jni.so
Re-edit boot image

SENSOR FIX:

System/bin/akmdxxxx
System/lib/libsensorservice.so
System/bin/servicemanager

CAMERA FC OR NOT CONNECTING:

System/lib/libcameracustom.so
System/lib/libcameraservice.so
System/lib/libfeatureio.so (don't use this for some mt6580, may lead to said problem if
it didn't persist before)
Unpack boot image and replace camera lines from init.rc (stock boot image) to
init.mt65xx.rc (custom ROM)
For mt6580 replace camera lines from init.mt6580.rc (stock) to init.mt6580.rc (custom)
CAMERA FOCUS:

System/lib/libcameraservice.so
System/lib/libfeatureio.so

FOR MT6580 GENERAL CAMERA FIX:

System/lib/libjpeg.so
System/lib/libdpframework.so
System/lib/featureio.so (for some mt6580)
System/lib/libcam.exif.so
System/lib/libcamdrv.so
System/lib/libcam.paramsmgr.so
System/lib/libcamalgo.so
System/lib/libcameracustom.so

OTHER CAMERA PROBLEMS:

System/lib/hw/camera.default.so
System/lib/libcamera_client.so
System/lib/libcameracustom.so
System/lib/libcameraprofile.so
System/lib/libcameraservice.so
System/lib/libmhal.so
System/lib/libmhalcontent.so
System/lib/libmhaldrv.so
System/lib/libmhalmdp.so
System/lib/libmhalpipe.so
System/lib/libmhalsenario.so
System/lib/libmhalutility.so
System/etc/permission/android.hardware.camera.front.xml
System/etc/permission/android.hardware.camera.xml

Potrebbero piacerti anche