الخميس، 16 نوفمبر 2017

PORTING AND FIXING GUIDE FOR DEVELOPERS [MT6582&MT6592]|stock rom go to rompure.com

​Porting Method MTK - Part One

by jonacxDGreat
1. Normal Porting - AOSP, Stock Based, Customed/Modded Stock, Customed/Modded AOSP

2. Cyanogenmod 12 - 5.0.2

3. Cyanogenmod 12.1 - 5.1.1

4. MIUI 7 - KK

5. Crossporting MT6582 - MT6592 (vice-versa) AOSP, Stock Based, AOSP, Stock Based, Customed/Modded Stock, Customed/Modded AOSP

Normal Porting - MT6582/MT6592

Stock - Port
system/etc:

                file: apns-conf.xml, custom.conf (port file - edit lines)

                folder: bluetooth, firmware, wifi, mddb (optional)

system/lib:

                file: libcamalgo.so, libcamdrv.so, libcameracustom.so, ,

                                  libEGL.so, libMali.so, libsensorservice.so, libsync.so, libvcodecdrv.so

                                  (note: all libaudio files only for fixing audio)
               

Cyanogenmod 12
Copy stock to port (boot.img)

stock/zImage and stock/ramdisk/ueventd.rc
system/etc:

                folder: firmware 

system/lib:

                file: libMali.so,libaudio.primary.default.so,libcamdrv.so,libcamalgo.so,libcameracustom.so.libmali.so,libEGL.so

               

Cyanogenmod 12.1
Copy stock to port (boot.img)

stock/zImage and stock/ramdisk/ueventd.rc
system/etc:

                folder: firmware     <storage android:storageDescription="@string/storage_internal" android:primary="true" android:emulated="true" android:mtpReserve="400" />

    <storage android:mountPoint="/storage/sdcard1" android:storageDescription="@string/storage_sd_card" android:removable="true" />

    <storage android:mountPoint="/storage/usbotg" android:storageDescription="@string/storage_usb" android:removable="true" />
To this:
    <storage android:storageDescription="@string/storage_internal" android:primary="false" android:removable="false" android:allowMassStorage="true" />

    <storage android:mountPoint="/storage/sdcard1" android:storageDescription="@string/storage_sd_card" android:primary="false" android:removable="true" />

    <storage android:mountPoint="/storage/usbotg" android:storageDescription="@string/storage_usb" android:removable="true" />

</StorageList>

Porting MIUI 7
System Files (Patch Files)
system/bin (mtkbt, vold, sdcard(optional))
system/etc

                folder: firmware and mddb
system/lib

                folder: hw

                files:

                                libcameracustom.so

                                libcameraservice.so

                                libfeatureio.so

                                libMali.so

                                libshowlogo.so

                                libaudio*.so (optional if bug on sound)
system/vendor: copy whole folder to port, replace if existing
system/xbin: libmnlp_mt6592, mnld

Boot.img porting
-copy stock kernel to port boot.img

-compare and edit port init.rc w/ stock init.rc

-copy sepolicy and ueventd.rc from stock to port

Crossporting MT6582 - MT6592 (vice-versa)
stock to port rom
boot.img:

copy ramdisk/init.rc and init.environ.rc bootclash lines from stock to port
system/bin

                copy all file and replace existing
system/etc

                delete bluetooth and mddb folder from port

                copy bluetooth and mddb folder from stock to port

                copy firmware folder from stock to port - replace existing files

                copy permissions folder (platform.xml, handheld_core_hardware.xml) optional/bug fix

                edit port custom.conf
system/lib

                must delete files from stock before copy paste to port

                libandroid.so,libandroid_runtime.so,libandroid_servers.so

                libandroidfw.so,libjavacore.so,libjavacrypto.so

                libwebrtc_audio_preprocessing.so,libwebviewchromium.so,libwebviewchromium_plat_support.so

                *now copy whole lib folder to port libfolder and replace existing file consider hw/modules
system/vendor

                copy stock vendor to port - replace existing
system/xbin

                delete libmnlp_mt6582 from port

                copy libmnlp_mt6592, mnld from stock to port

               

build.prop:

replace all mt6582 lines to mt6592 vice-versa

replace lines if xport mt6582 - mt6592

mediatek.wlan.chip=MTK_CONNSYS_MT6592
mediatek.wlan.module.postfix=_mtk_connsys_mt6592

Jonacx TheGreyt at 4:03 PM

Share
                hostapd folder, permissions (android.hardware.camera.xml, android.hardware.microphone.xml)

system/lib:

                hw folder: camera.default.so

                file: libfeatureio.so, libfeatureio.so, libimageio_plat_drv.so, libipod.so, libMali.so, libshowlogo.so

For emulated storage fix
Edit: init.mt65xx.rc

Replace:
on init

    export LD_PRELOAD /system/lib/libxlog.so
    export EXTERNAL_STORAGE /storage/emulated/legacy

    export SECONDARY_STORAGE /storage/sdcard1
    mkdir /mnt/shell 0700 shell shell

    chmod 0750 /mnt/shell

    chown shell sdcard_r /mnt/shell

    mkdir /mnt/shell/emulated 0700 shell shell

    mkdir /mnt/shell/emulated/0 0700 shell shell

    mkdir /storage/emulated 0555 root root
    mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw

    mkdir /storage/sdcard1 0700 root root
    export EXTERNAL_STORAGE /storage/emulated/legacy

    export SECONDARY_STORAGE /storage/sdcard1

    export EMULATED_STORAGE_SOURCE /mnt/shell/emulated

    export EMULATED_STORAGE_TARGET /storage/emulated
With this:

 

on init

    export LD_PRELOAD /system/lib/libxlog.so

    export EXTERNAL_STORAGE /storage/sdcard0

    export SECONDARY_STORAGE /storage/sdcard1
on init

    mkdir /mnt/media_rw/sdcard0 0700 media_rw media_rw

    mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw

    mkdir /storage/sdcard0 0700 root root

    mkdir /storage/sdcard1 0700 root root
    export EXTERNAL_STORAGE /storage/sdcard1
    # Support legacy paths

    symlink /storage/sdcard0 /sdcard

    symlink /storage/sdcard0 /mnt/sdcard

 symlink /storage/sdcard1 /mnt/sdcard2

    # USB OTG

    mkdir /storage/usbotg 0700 root root

    mkdir /mnt/media_rw/usbotg 0700 media_rw media_rw

 

And Edit: Framework-res.apk (storagelist.xml)
From this:

    <storage android:storageDescription="@string/storage_internal" android:primary="true" android:emulated="true" android:mtpReserve="400" />

    <storage android:mountPoint="/storage/sdcard1" android:storageDescription="@string/storage_sd_card" android:removable="true" />

    <storage android:mountPoint="/storage/usbotg" android:storageDescription="@string/storage_usb" android:removable="true" />
To this:
    <storage android:storageDescription="@string/storage_internal" android:primary="false" android:removable="false" android:allowMassStorage="true" />

    <storage android:mountPoint="/storage/sdcard1" android:storageDescription="@string/storage_sd_card" android:primary="false" android:removable="true" />

    <storage android:mountPoint="/storage/usbotg" android:storageDescription="@string/storage_usb" android:removable="true" />

</StorageList>

Porting MIUI 7
System Files (Patch Files)
system/bin (mtkbt, vold, sdcard(optional))
system/etc

                folder: firmware and mddb
system/lib

                folder: hw

                files:

                                libcameracustom.so

                                libcameraservice.so

                                libfeatureio.so

                                libMali.so

                                libshowlogo.so

                                libaudio*.so (optional if bug on sound)
system/vendor: copy whole folder to port, replace if existing
system/xbin: libmnlp_mt6592, mnld

Boot.img porting
-copy stock kernel to port boot.img

-compare and edit port init.rc w/ stock init.rc

-copy sepolicy and ueventd.rc from stock to port

Crossporting MT6582 - MT6592 (vice-versa)
stock to port rom
boot.img:

copy ramdisk/init.rc and init.environ.rc bootclash lines from stock to port
system/bin

                copy all file and replace existing
system/etc

                delete bluetooth and mddb folder from port

                copy bluetooth and mddb folder from stock to port

                copy firmware folder from stock to port - replace existing files

                copy permissions folder (platform.xml, handheld_core_hardware.xml) optional/bug fix

                edit port custom.conf
systems/lib

                must delete files from stock before copy paste to port

                libandroid.so,libandroid_runtime.so,libandroid_servers.so

                libandroidfw.so,libjavacore.so,libjavacrypto.so

                libwebrtc_audio_preprocessing.so,libwebviewchromium.so,libwebviewchromium_plat_support.so

                *now copy whole lib folder to port libfolder and replace existing file consider hw/modules
system/vendor

                copy stock vendor to port - replace existing
system/xbin

                delete libmnlp_mt6582 from port

                copy libmnlp_mt6592, mnld from stock to port

               

build.prop:

replace all mt6582 lines to mt6592 vice-versa

replace lines if xport mt6582 - mt6592

mediatek.wlan.chip=MTK_CONNSYS_MT6592
mediatek.wlan.module.postfix=_mtk_connsys_mt6592
Credit :- 

Jonacx TheGreyt

ليست هناك تعليقات:

إرسال تعليق