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

Search This thread

[email protected]

Senior Member
Aug 17, 2013
595
2,190
Mumbai
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 :p

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 :cowboy:

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 )
 
Last edited:

contactwajeeh

Senior Member
Aug 29, 2008
674
338
33
Hyderabad
@[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

Senior Member
Aug 29, 2008
674
338
33
Hyderabad
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
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.
 

[email protected]

Senior Member
Aug 17, 2013
595
2,190
Mumbai
@[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...

edit keylayout's genric.kl etc
 
  • Like
Reactions: Sandeep5303

Traace

Senior Member
Mar 13, 2010
437
114
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 u:eek:bject_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...

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
 

[email protected]

Senior Member
Aug 17, 2013
595
2,190
Mumbai
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
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:
 
  • Like
Reactions: Sandeep5303

[email protected]

Senior Member
Aug 17, 2013
595
2,190
Mumbai
Thanks for guide.

My camera does not work and gallery does not see SD card.

How to fix it?

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 :)
 

XerusKunZE

Member
Jun 25, 2014
24
8
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.?
 

chanaka89

Member
Aug 16, 2012
27
7
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

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.

:(
 
  • Like
Reactions: Traace

Traace

Senior Member
Mar 13, 2010
437
114
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.

:(

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]

Senior Member
Aug 17, 2013
595
2,190
Mumbai
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
congo :)
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

1. But i did port for mtk6582 (camera unfortunelty has stop)
seems storage bug...u need to fix storage .............check guide and comments
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.

:(

i don't think so....again try and don't touch ramdisk :p
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 24
    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 :p

    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 :cowboy:

    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 )
    3
    Baseband issues
    If changing SELInux to Permissive didn't worked.

    Most likely, you'll need proper Kernel/ compile the rom.
    Only devices with similar kernel/ hw specs won't have major issues.
    There's no magic wan that can fix it.

    Porting CM's is not the best thing, im surprised that some phones got an "decent" port, from the original roms (6592 / 6582)

    reply #61, is the perfect example of NVRAM and sys** kernel (at user level )issues

    cheers
    3
    Hello!

    Just wanted to share with you my progress. ;)

    Bugs I had:

    - Baseband unknown (Lost IMEI's, Wi-Fi and BT MAC's)
    - HOME and MENU soft buttons didn't work
    - I had no access to internal storage (only external while using CM's File Manager)

    Bugs I have now:

    - Baseband unknown (Lost IMEI's)
    - MENU soft button doesn't work

    Solving steps:


    - WiFi and BT are able to work after changing SELinux to permissive (using SELinuxModeChanger apk)
    - HOME key works after deleting the file "mtk-tpd.kl" and editing the file "mk-kpd.kl" (removed the # in line 29)
    - I now have internal and external storage available. Many thanks to @carliv (I've checked THIS post and there I've found THIS official documentation about storage configuration)

    Storage solving steps explained in detail:

    init.mt6592.rc (kingzone's CM12 original kernel's ramdisk)

    Code:
    on init
        export LD_PRELOAD /system/lib/libxlog.so
        [COLOR="Red"]export EXTERNAL_STORAGE /storage/sdcard0
        export SECONDARY_STORAGE /storage/sdcard1
    
        mkdir /storage/sdcard0 0700 root root
        mkdir /storage/sdcard1 0700 root root
    
        symlink /storage/sdcard0 /sdcard
        symlink /storage/sdcard0 /mnt/sdcard
    
       mkdir /mnt/media_rw/sdcard0 0700 media_rw media_rw
       mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw[/COLOR]
    
    .....
    
    on fs
    
    .....
    
       [COLOR="Red"]#setprop ro.crypto.fuse_sdcard true[/COLOR]
    
    .....
    
    # virtual sdcard daemon running as media_rw (1023)
    [COLOR="red"]service fuse_sdcard0 /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/sdcard0 /storage/sdcard0
        class late_start
        disabled
    service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/sdcard1 /storage/sdcard1
        class late_start
        disabled[/COLOR]
    service fuse_usbotg /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/usbotg /storage/usbotg
        class late_start
        disabled

    After analyzing the official documentation, and also, after noticing that my stock kernel ramdisk had a file "init.ssd.rc", I've modified init.mt6592.rc to:

    Code:
    on init
    	
        [COLOR="Blue"]mkdir /mnt/shell/emulated 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 EMULATED_STORAGE_SOURCE /mnt/shell/emulated
        export EMULATED_STORAGE_TARGET /storage/emulated
        export SECONDARY_STORAGE /storage/sdcard1[/COLOR]
    	
        export LD_PRELOAD /system/lib/libxlog.so
    	
        [COLOR="blue"]mount tmpfs tmpfs /storage/emulated mode=0755,uid=1023,gid=1023
        
        # Support legacy paths
        symlink /storage/emulated/legacy /sdcard
        symlink /storage/emulated/legacy /mnt/sdcard
        symlink /storage/emulated/legacy /storage/sdcard0
        symlink /storage/sdcard1 /mnt/sdcard2[/COLOR]
    
    
    .....
    
    on fs
    
    .....
    
       [COLOR="blue"]setprop ro.crypto.fuse_sdcard true[/COLOR]
    
    .....
    
    # virtual sdcard daemon running as media_rw (1023)
    [COLOR="Blue"]service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
        class late_start
    service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
        class late_start
        disabled[/COLOR]
    service fuse_usbotg /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/usbotg /storage/usbotg
        class late_start
        disabled

    fstab.mt6592 (kingzone's CM12 original kernel's ramdisk)

    Code:
    # Android fstab file.
    #<src>           <mnt_point>         <type>    <mnt_flags and options>                 <fs_mgr_flags>
    # The filesystem that contains the filesystem checker binary (typically /system) cannot
    # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
    /[email protected]       /system         ext4    ro,commit=1,noauto_da_alloc				wait
    /[email protected]       /data           ext4    noatime,nosuid,nodev,noauto_da_alloc,discard	wait,check
    /[email protected]         /cache          ext4    noatime,nosuid,nodev,noauto_da_alloc,discard	wait,check
    /[email protected]_f     /protect_f      ext4    noatime,nosuid,nodev,noauto_da_alloc,discard	wait,check
    /[email protected]_s     /protect_s      ext4    noatime,nosuid,nodev,noauto_da_alloc,discard	wait,check
    /devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0	auto	[COLOR="Red"]auto	[/COLOR]defaults	voldmanaged=sdcard0:[COLOR="red"]8,nonremovable,noemulatedsd[/COLOR]
    /devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1	auto	[COLOR="red"]auto	[/COLOR]defaults        voldmanaged=sdcard1:auto
    /devices/platform/mt_usb		auto 	auto	defaults	voldmanaged=usbotg:auto

    Changed to:

    Code:
    # Android fstab file.
    #<src>           <mnt_point>         <type>    <mnt_flags and options>                 <fs_mgr_flags>
    # The filesystem that contains the filesystem checker binary (typically /system) cannot
    # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
    /[email protected]       /system         ext4    ro,commit=1,noauto_da_alloc				wait
    /[email protected]       /data           ext4    noatime,nosuid,nodev,noauto_da_alloc,discard	wait,check
    /[email protected]         /cache          ext4    noatime,nosuid,nodev,noauto_da_alloc,discard	wait,check
    /[email protected]_f     /protect_f      ext4    noatime,nosuid,nodev,noauto_da_alloc,discard	wait,check
    /[email protected]_s     /protect_s      ext4    noatime,nosuid,nodev,noauto_da_alloc,discard	wait,check
    /devices/platform/mtk-msdc.0/mmc_host/mmc0/mmc0	auto	[COLOR="Blue"]vfat[/COLOR]	defaults	voldmanaged=sdcard0:[COLOR="Blue"]auto[/COLOR]
    /devices/platform/mtk-msdc.1/mmc_host/mmc1/mmc1	auto	[COLOR="blue"]vfat[/COLOR]	defaults        voldmanaged=sdcard1:auto
    /devices/platform/mt_usb		auto 	auto	defaults	voldmanaged=usbotg:auto

    This was a mere guess. Don't know if this is the most accurate configuration but...well, it works.

    framework-res.apk (framework-res.apk\res\xml\storage_list.xml kingzone's CM12 original)

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <StorageList
      xmlns:android="http://schemas.android.com/apk/res/android">
        <storage android:mountPoint="/storage/sdcard0" android:storageDescription="@string/storage_internal" android:primary="true" [COLOR="Red"]android:removable="false"[/COLOR] android:allowMassStorage="true" />
        <storage android:mountPoint="/storage/sdcard1" android:storageDescription="@string/storage_sd_card" android:primary="false" android:removable="true" android:allowMassStorage="true" />
        <storage android:mountPoint="/storage/usbotg" android:storageDescription="@string/storage_usb" android:removable="true" />
    </StorageList>

    Changed to:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <StorageList
      xmlns:android="http://schemas.android.com/apk/res/android">
        <storage android:mountPoint="/storage/sdcard0" android:storageDescription="@string/storage_internal" android:primary="true" [COLOR="blue"]android:emulated="true"[/COLOR] android:allowMassStorage="true" />
        <storage android:mountPoint="/storage/sdcard1" android:storageDescription="@string/storage_sd_card" android:primary="false" android:removable="true" android:allowMassStorage="true" />
        <storage android:mountPoint="/storage/usbotg" android:storageDescription="@string/storage_usb" android:removable="true" />
    </StorageList>

    DONE! :victory:


    Currently I can't still understand why the HOME MENU key doesn't work...weird (I've tried the same solution used for HOME key and it didn't work).

    Now I'll try to find if I know how to fix Baseband unknown bug (the most awful one...).

    I hope that, with this, I may help anyone else trying to port this to their device.

    Cheers!
    2
    - Baseband unknown (Lost IMEI's, Wi-Fi and BT MAC's)
    - The HOME and MENU soft buttons don't work
    - I have no access to internal storage (only external while using CM's File Manager)

    for this issue you have to edit "mk-kpd.kl" and delete the # in line 29:
    Code:
    #key 102   HOME              WAKE
    and you have to delete the file "mtk-tpd.kl" in the same directory!

    about the internal storage I think if you opened the storage in the settings you'll see your internal storage but it all detected as "unreachable" and if I'm not wrong you only have EBR1 without EBR2!! and if so you have nothing to do bot editing your EBRs...

    about the IMEI I'm still working on it!
    2
    What necessary changes i must do in ramdisk?help

    like some some extra lines der in urs .
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone