[K3 Note General] sandeep.sethi:
Hi All,

This Guide is For Lenovo K3 Note Other devices can use it but some files may vary.

Here is a quick guide for getting the basics of the rom working.

Display, sound ,GSM (3g) and Wifi .

I used this for CyanogenMOD based ROMS and MIUI and it worked for me.

If anyone finds additional items or wants to complete this guide please feel free to add it in here.

Please remember, i am posting this so that people will try things and usually when they do, they end up finding something better and awesome than not trying.

I use this from stock and make it a zip file so it makes easy porting by just dragging the system folder with stock files to the rom to be ported and replace.

NOTE: ALWAYS REMOVE RECOVERY-FROM-BOOT.P before you do anything else.

FOR CROSS PORT

SO THE FILES NEEDED TO REPLACE FROM STOCK TO PORT:

BIN FOLDER:

afm_server
akmd09911
applysig
audiocmdservice_atci
climax
custom_sn
encfs
factory
factory_reset.sh
fusermount
gzip_static
ipod
kpoc_charger
mtkbt
nvram_proximity
seeder
updater
vold

IF YOU THINK SOME FILES ARE ABSENT, DONT WORRY JUST SKIP THEM

NOW MODEM FILES:

take the whole [COLOR="Red"]firmware[/COLOR] folder from system/etc/
take the whole [COLOR="Red"]mddb[/COLOR] folder from system/etc/

NOW THE MAIN THING OF K3 Note (Audio)

take the whole folder [COLOR="Red"]tfa98xx[/COLOR] from system/etc/

NOW LIBS Folder:

lib3a.so
libacdk.so
libbluetoothdrv.so
libbluetooth_mtk.so
libbypass.so
libcam.camadapter.so
libcam.camnode.so
libcam.camshot.so
libcam.client.so
libcam.device1.so
libcam.device3.so
libcam.exif.so
libcam.exif.v3.so
libcam.hal3a.v3.so
libcam.halsensor.so
libcam.iopipe.so
libcam.jni.lomohaljni.so
libcam.metadataprovider.so
libcam.paramsmgr.so
libcam.sdkclient.so
libcam.utils.so
libcam3_app.so
libcam3_hwnode.so
libcam3_hwpipeline.so
libcam3_pipeline.so
libcam3_utils.so
libcamalgo.so
libcamdrv.so
libcameracustom.so
libcamera_client_mtk.so
libcam_hwutils.so
libcam_platform.so
libcustom_nvram.so
libdpframework.so
libfeatureio.so
libfeatureiodrv.so
libhardware_legacy.so
libimageio.so
libimageio_plat_drv.so
libipod.so
libJpgDecPipe.so
libJpgEncPipe.so
liblocSDK5c.so
liblocSDK_2_5OEM.so
libm4u.so
libMA3-wavesfx-Coretex_A9.so
libmhalImageCodec.so
libMiraVision_jni.so
libmtkjpeg.so
libmtk_drvb.so
libnetworklocation.so
libnvram.so
libnvramagentclient.so
libnvram_platform.so
libnvram_sec.so
libshowlogo.so
libtfa9897_interface.so
libvc1dec_sa.ca7.so
libvcodecdrv.so
libvcodec_oal.so
libvcodec_utility.so
libweibosdkcore.so
mtk-ril.so [COLOR="Red"]<= IF U GET BOOT LOOP TRY WITHOUT REPLACING THIS FILE[/COLOR]
mtk-rilmd2.so [COLOR="Red"]<= IF U GET BOOT LOOP TRY WITHOUT REPLACING THIS FILE[/COLOR]

And this subfolder with these libs:

drm\libfwdlockengine.so
egl\egl.cfg
egl\libGLES_mali.so
hw\audio.primary.mt6752.so
hw\audio_policy.default.so
hw\bluetooth.default.so
hw\camera.mt6752.so
hw\gps.default.so
hw\gralloc.mt6752.so
hw\hwcomposer.mt6752.so
hw\lenovopower.default.so
hw\lights.default.so
hw\sensors.mt6752.so
soundfx\libdownmix.so
soundfx\libmaxxeffect-cembedded.so

NOW LIB64 Folder:

lib3a.so
libacdk.so
libbluetoothdrv.so
libbluetooth_mtk.so
libcam.camadapter.so
libcam.camnode.so
libcam.camshot.so
libcam.client.so
libcam.device1.so
libcam.device3.so
libcam.exif.so
libcam.exif.v3.so
libcam.hal3a.v3.so
libcam.halsensor.so
libcam.iopipe.so
libcam.jni.lomohaljni.so
libcam.metadata.so
libcam.metadataprovider.so
libcam.paramsmgr.so
libcam.sdkclient.so
libcam.utils.sensorlistener.so
libcam.utils.so
libcam1_utils.so
libcam3_app.so
libcam3_hwnode.so
libcam3_hwpipeline.so
libcam3_pipeline.so
libcam3_utils.so
libcamalgo.so
libcamdrv.so
libcameracustom.so
libcamera_client_mtk.so
libcamera_metadata.so
libcam_hwutils.so
libcam_mmp.so
libcam_platform.so
libcam_utils.so
libcustom_nvram.so
libdpframework.so
libfeatureio.so
libfeatureiodrv.so
libhardware_legacy.so
libimageio.so
libimageio_plat_drv.so
libJpgDecPipe.so
libJpgEncPipe.so
libm4u.so
libmhalImageCodec.so
libMiraVision_jni.so
libmtkjpeg.so
libmtk_drvb.so
libnvram.so
libnvramagentclient.so
libnvram_platform.so
libnvram_sec.so
libtfa9897_interface.so
libvcodecdrv.so
libvcodec_utility.so

And this subfolder with these libs:

drm\libfwdlockengine.so
egl\libGLES_mali.so
hw\audio.primary.mt6752.so
hw\audio_policy.default.so
hw\camera.mt6752.so
hw\gps.default.so
hw\gralloc.mt6752.so
hw\hwcomposer.mt6752.so
hw\lenovopower.default.so
hw\lights.default.so
hw\mmsdk.default.so
hw\sensors.mt6752.so
soundfx\libdownmix.so

NOW VENDOR FOLDER:

system\vendor\etc\audio_effects.conf
system\vendor\etc\default.mps

FOR DIFFERENT CHIPSET (i.e. 6795 to 6752)

Proceed as above THEN

open build.prop

EDIT THESE LINES

ro.mediatek.platform=[COLOR="Red"]MT6795[/COLOR] to [COLOR="Red"]MT6752[/COLOR]
mediatek.wlan.chip=[COLOR="Red"]MT6630[/COLOR]to [COLOR="Red"]CONSYS_MT6752[/COLOR]
mediatek.wlan.module.postfix=[COLOR="Red"]_mt6630[/COLOR]to [COLOR="Red"]_consys_mt6752[/COLOR]

And Now Boot.img

Unpack both stock and port boots from CarlivImageKitchen Tool

[IMG="http://postimg.org/image/el5idetzh"][/IMG]

Now

In port boot.img

replace the boot.img-kernel

[IMG="THIS FILE TO REPLACE"]http://postimg.org/image/bscatdtn1[/IMG]

and in ramdisk folder add these files:

[IMG="Like this"]http://postimg.org/image/yibfmdcul[/IMG]

fstab.mt6752

init.mt6752.rc

init.mt6752.usb.rc

AND DELETE THOSE with mt6795 and mt6595 words.

REPACK THE KERNEL

MAKE THE FLASHABLE ZIP

AND FLASH THE ROM

If u get WIFI AND BLUETOOTH NOT SWITCHING ON OR BATTERY PERCENTAGE WRONG THEN REPLACE init.project.rc

FOR SAME CHIPSET PORTING

Just replace

etc/firmware
etc/mddb

and from lib and lib64 hw folder replace all libs named like this camera.mt6752.so

and replace audio_policy.default.so from both hw folder

from lib and lib64

replace

libcameracustom.so
libaudiocomponentengine.so
libaudiocustparam.so
libnvram.so
libnvramagentclient.so
libnvram_platform.so
libnvram_sec.so
libcustom_nvram.so

UPDATE :

TIP:To BOOT a rom with minimal replacements

Replace the boot.img files as usual

in system:

ETC FOLDER

etc/firmware

etc/mddb (not needed tho)

etc/tfa**(if your device uses)

LIB & LIB64

lib/libjni_pq.so

lib/libmtk_drvb.so

lib/libtfa****.so

lib64/libjni_pq.so

lib64/libmtk_drvb.so

lib64/libtfa****.so

HW folder

All the 67xx files if crossporting

VIOLA UR A PORTER