Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2/13/2017
ROM
Porting
Guide
For Mediatek and
Qualcomm, with bug-fix;
and Recovery porting, plus
cross-porting-mtk
/*
* Your warranty is now void.
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed.
* Please do some research if you have any concerns about features
* included in this ROM before flashing it! YOU are choosing to make
* these modifications, and if you point the finger at me for messing up
* your device, I will laugh at you.
*/
Update
* Updated Bug Fix Guide for MTK
* Added SNAPDRAGON Bug fix guide.
* Guide to port TWRP also updated.
* Improved the thread.
* Added more fixes.
* Qualcomm porting guide added.
Base Rom
Base Rom is referred to the Stock rom or the Default Rom of your device
or sometimes the rom from which you will take base files (libs, apns,
modem etc.).
Port Rom
Port Rom is the rom which you will port for your device.
Like if you are working a rom of another device having similar
specifications and porting it for your device then it is called Port Rom.
Kernel
The kernel is a computer program that is the core of a computer's
operating system, with complete control over everything in the system.
The central or most important part of something.
In easy words kernel acts as the middle man between the Software and
the Hardware.
When porting a rom, you should check the Kernel version of the
Port Rom and the Base Rom.
Author’s Note:
Thanks.
NOW, FINALLY. LET'S TALK ABOUT THE PORTING GUIDE
WHICH YOU ALL ARE WAITING FOR.
BOOT.IMG
BOOT.IMG contains all the magic, it has the KERNEL
inside which is one of the main thing.
libcameracustom.lib etc.
libcamalgo.lib
fstab.mt6735
init.mt6735.rc
init.mt6735.usb.rc
If you face "This rom is for Coolpad Note 3 Lite and your device
is "K4Note" or something like that, delete the assert lines in
Updater-script
Radio FM
/system/bin/fmradio
/system/etc/firmware/mt6620_patch_e3_hdr.bin
/system/etc/firmware/mt6620_patch_e6_hdr.bin
/system/etc/firmware/WMT*.CFG
/system/lib(/64)/libfmcust.so
/system/lib(/64)/libfmjni.so
Sensors
/system/bin/akmd*
/system/lib/libsensors.so
/system/lib/libms*.so (according to device)
/system/etc/firmware (folder)
/system/bin/servicemanager
/system/bin/sensorservice
/system/bin/msensord
/system/etc/permissions/android.hardware.sensor.xxxx.xml
Wi-Fi
/system/etc/wifi (folder)
/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*
/system/lib(/64)/libhardwarelegacy.so
Bluetooth or Wi-Fi not turning On\Off (old)
/system/lib/module/mtk_stp_wmt
Hotspot
/system/bin/netd
* follow Wi-Fi fix also
Camera
** Try one by one
/system/lib(/64)/libcameracustom.so
/system/lib(/64)/libcameraservice.so
/system/lib(/64)/camalgo
/system/etc/media_profiles.xml
/system/lib(/64)/libcamera.so
/system/lib(/64)/liboemcamera.so
/system/lib(/64)/hw/camera.default.so
/system/lib(/64)/libcamera_client.so
/system/lib(/64)/libcameraprofile.so
/system/lib(/64)/libmhal.so
/system/lib(/64)/libmhalcontent.so
/system/lib(/64)/libmhaldrv.so
/system/lib(/64)/libmhalmdp.so
/system/lib(/64)/libmhalpipe.so
/system/lib(/64)/libmhalscenario.so
/system/lib(/64)/libmhalutility.so
/system/etc/permission/android.hardware.camera*.xml
SD card/Memory
In boot.img => mt67**.fstab
/system/bin/vold
/system/bin/pq
/system/bin/sdcard
GPS
/system/xbin/libmnlp
/system/etc/gps.conf
/system/bin/mtkrild
/system/bin/mtkrildm1
/system/bin/stmd
/system/bin/Gsm***
/system/etc/trustzone.bin
/system/lib(/64)/Libril
/system/lib(/64)/Libc2k***
/system/lib(/64)/Librilmtk
Audio/Sound
/system/lib\libaudio*.so
/system/lib(/64)/libaudiocustomparam
/system/lib(/64)/libaudiopolicymanager
/system/lib(/64)/libaudiopolicyservice
/system/etc/audio_effects.conf
/system/etc/audio_policy**.xml
/system/lib(/64)/soundfx
Bluetooth
/system/etc/Bluetooth (Folder)
/system/etc/permissions/android.hardware.bluetooth.xml
/system/bin/uim*
/system/bin/bluetooth*
/system/lib(/64)/libbluetooth_mtk.so
/system/lib(/64)/libbluetoothem_mtk.so
Ads
/system/etc/hosts --> replace with new files or use tweak.
===>> ADVANCE BUG FIXING
Volte Fixing
Will only work if your Base Rom, Port Rom & Kernel supports
VoLTE
In Boot.img:-
Zimage ( kernel - volte supported )
init.volte.rc
/system/lib(/64)/volte_imsm
Fingerprint
[Try one by one] [If any file missing leave it]
Usual way to fix:
/system/etc/permissions/android.hardware.fingerprint.xml
/system/lib(/64)/libgatekeeper.so
/system/lib(/64)/hw/gatekeeper.mt6735.so
/system/lib(/64)/hw/libmcgatekeeper.so
/system/lib(/64)/hw/fingerprint.default.so (can break FP in some devices)
Advanced (if usual doesn't work) (if any missing, leave that):
/system/bin/fingerprintd
/system/bin/Gx_fpd
/system/bin/tee_deamon
/system/lib(/64)/Fpclient
/system/lib(/64)/Fpalgorithm
/system/lib(/64)/Fphal
/system/lib(/64)/FPservice
REPACK BOOT.IMG
Replace this Boot.img in port.
Copy and replace the following files from Base to Port to solve the
given issues:
No sound bug
/system/lib(/64)/hw/audio.primary.msm****.so
/system/lib(/64)/hw/audio.primary.default.so
FM not working
/system/lib(/64)/qcomfm_jni.so
/system/lib(/64)/:
libmm-qcamera.so
libmmcamera_interface.co
/system/lib(64)/hw/:
camera.msm****.so
STEP 1
Inside Ramdisk Folder
1. meta_init.modem.rc
2. meta_init.project.rc
3. meta_init.rc
STEP 2
Now replace your Kernel usually named as zimage-kernel
STEP3
Inside Ramdisk Folder(boot.img)
1. fstab
2. ueventd.rc
3. ueventd.goldfish.rc
STEP 4
INSIDE RAMDISK/ETC
recovery.fstab
STEP 5
Open Default.prop
And Compare it with stock Default.prop or your Build.prop (add values
from build.prop)
Meta-INF Info
http://www.mtkroms.com/2015/06/make-...-easy.html?m=1