• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Cyanogenmod for mediatek devices

Search This thread

M.A.P

Senior Member
Nov 1, 2016
206
98
17
Vijayawada
Yeah... You're missing a commit.

https://github.com/LineageOS/android_bionic/commit/a3e230d1fa9a5ed773a029e2acc6eb4f3e849ea3

---------- Post added at 05:39 AM ---------- Previous post was at 04:42 AM ----------

Alright boys, I'm a little stuck... I've done device bring up before. But this is my first experience with a mediatek chipset. Its... Uh, "unique" I guess is a nice way of saying it. Anyway, to the meat and potatoes of my problem. After weeks of build, flashing, and booting straight to bootloader, I finally get boot animation. But adb is broken, even though I've added the props to the tree. And last_kmsg is not very much help.

last_kmsg="ram console header, hw_status: 0, fiq step 0. Not Clear, old status is 0".

I immediately went and scoured gh for mediatek patches in system_core and bionic. Found a few thanks to @Moyster, @fire855 and @Danielhk. This device shipped with 8.0 and ful treble. I'm currently trying to build lineage-15.1. TWRP is built and fully functional. This is a prebuilt kernel too btw. I'm trying to get Chuwi to release it to me. Here's my trees. If you want I can't link the list of commits I've applied.


Device tree := \ https://github.com/chuwi-hi9/android_device_chuwi_hi9pro/tree/lineage-15.1 -b lineage-15.1

Vendor tree := \
https://github.com/chuwi-hi9/proprietary_vendor_chuwi

Like I said, this is full treble. So I am not building a vendor.img. These blobs were pulled from the /system partition. I'm also dealing with legacy vndk... Any advice or help in any way would be awesome. Thanks for taking the time to read.

I fixed it on my device it booted. Mine is also mt6797 and also have oreo stock rom. The thing is force encryption of userdata is making los animation to loop. Starting from oreo for fixing force encryption you should not only edit fstab and /vendor/etc but also fstab in /nvdata/fstab
So change forceencrypt flash to encryptable in vendor/fstab.mt6797 and /nvdata/fstab.mt6797.
Hope you'll find it helpful
 
  • Like
Reactions: hyperion70

M.A.P

Senior Member
Nov 1, 2016
206
98
17
Vijayawada
Can you link your trees please

https://github.com/Maanush2004/android_device_lenovo_manning here is my device tree but the thing is I didn't really make a lineage 15.1 tree I use lineage 15.0 tree.
But the rom I make will be stuck at bootanimation loop only so no use. I made a flashable zip which actually was not for this purpose but for magisk and other /data issues but this helped me. don't forget flashing this also won't make it boot.
Add these lines to your system.prop
#ADB
ro.debuggable=1
persist.sys.usb.config=adb
ro.secure=0
ro.adb.secure=0

Otherwise keychord 1 service won't start or you can build a eng build which I think will eliminate the addition of these flags in build.prop. A commit in system/core of Lineageos says that adb is disabled in userdebug builds and is enabled in eng builds but I'm not sure though

And vndk 26 and vndk 26 sp folders are not required no issue if it is present but lineageos boots without it too. Just build vndk-sp like the one present in my tree.
 
Last edited:
  • Like
Reactions: hyperion70

M.A.P

Senior Member
Nov 1, 2016
206
98
17
Vijayawada
Hi everyone after making Lineage 15.1 and aex 5.8 I'm facing one problem. My phone is in reboot loop I mean phone phone gets stuck at google setup wizard and touch is also unresponsive only after 8-9 reboots my phones responds

Fix: Needed to disable SDCardFS
 
Last edited:

blakegriplingph

Senior Member
May 13, 2011
978
146
Amazon Fire
Realme C3
So uh I was mucking around with my first CM build for an MT8127 tablet, specifically the LeapFrog Epic. I'm trying out CM11 for this as a test prior to getting a source-built kernel to work so I could get newer Android versions to boot, but right now I am stuck with a few build errors, like this one for example:
Code:
Export includes file: frameworks/av/media/libnbaio/Android.mk -- /home/maryellen/android/out/target/product/narnia/obj/SHARED_LIBRARIES/libnbaio_intermediates/export_includes
make: *** No rule to make target '/home/maryellen/android/out/target/product/narnia/obj/SHARED_LIBRARIES/libblisrc_intermediates/export_includes', needed by '/home/maryellen/android/out/target/product/narnia/obj/SHARED_LIBRARIES/libaudioflinger_intermediates/import_includes'.  Stop.
The device tree for the Epic can be found here, if anyone is interested:
https://github.com/huckleberrypie/android_device_quanta_narnia

EDIT: libblisrc.so and libblisrc32.so is already present in the vendor tree. Is this of any issue to the build or something?
 
Last edited:

superdragonpt

Recognized Developer
Apr 27, 2013
4,923
19,266
Lisbon / Taiwan / USA
www.caixamagica.pt
Can anyone from team MAD or others please assist help out on the above device.
The phone's ril is almost working but rilproxy keeps crashing. :mad:
The radio connects long enough to get the date, time, country id, network id, and receive a "new voice mail" notification the SIM card phone number also appears briefly.
This loops over and over crashing connecting crashing connecting.
The imei's, baseband version, etc are all now showing up fine.
Note the ril does not get this far without the rilproxy running.
Please Help :crying:

I sent @DerTeufel1980 a Sony XA some time ago but I think he is too busy to help out so if one of the other MAD dev's would like to kindly assist I think he will forward the phone to one of you.
@fire855 @superdragonpt

Thread is HERE
Source is HERE

If you want anything that not already up in the main thread like certain logs etc just ask.


sorry mate
been extremely busy over the past months so are my team mates ...
 

superdragonpt

Recognized Developer
Apr 27, 2013
4,923
19,266
Lisbon / Taiwan / USA
www.caixamagica.pt
So uh I was mucking around with my first CM build for an MT8127 tablet, specifically the LeapFrog Epic. I'm trying out CM11 for this as a test prior to getting a source-built kernel to work so I could get newer Android versions to boot, but right now I am stuck with a few build errors, like this one for example:
Code:
Export includes file: frameworks/av/media/libnbaio/Android.mk -- /home/maryellen/android/out/target/product/narnia/obj/SHARED_LIBRARIES/libnbaio_intermediates/export_includes
make: *** No rule to make target '/home/maryellen/android/out/target/product/narnia/obj/SHARED_LIBRARIES/libblisrc_intermediates/export_includes', needed by '/home/maryellen/android/out/target/product/narnia/obj/SHARED_LIBRARIES/libaudioflinger_intermediates/import_includes'.  Stop.
The device tree for the Epic can be found here, if anyone is interested:
https://github.com/huckleberrypie/android_device_quanta_narnia

EDIT: libblisrc.so and libblisrc32.so is already present in the vendor tree. Is this of any issue to the build or something?
the libblisrc is for incall audio you should pick those 2 from your stock ( so it's prebuilt, place it on vendor)



If the compilation is failing on it, then you have one makefile trying to built it or something...


cheers
 

superdragonpt

Recognized Developer
Apr 27, 2013
4,923
19,266
Lisbon / Taiwan / USA
www.caixamagica.pt
Just some heads up, make sure your using the proper oracle / open jre Java version depending on the android version your building.. I see many compilation issues that are due to this and people tend to forget or not even knowing this


Pie : OpenJDK 1.9
Nougat/ Oreo OpenJDK 1.8
KitKat/lollipop / marshmallow OpenJDK 1.7

Note for mtk KitKat just use oracle java 1.6.x

Make sure to check the mtk build environment script, you may need to install some packages or lower your "x" system install package version ( ie: mediatek is very picky with the make version installed on your system)
i've had issues with mtk build environment over the years due to this.
Its very picky mainly on jellybean/ KitKat/lollipop

And make sure your using the right distro
I'm using Ubuntu (based) os 14.04 for kitkat, jellybean , ICS

Ubuntu (based) os 16.x for anything from lollipop to pie
Cheers
 
Last edited:

blakegriplingph

Senior Member
May 13, 2011
978
146
Amazon Fire
Realme C3
Just some heads up, make sure your using the proper oracle / open jre Java version depending on the android version your building.. I see many compilation issues that are due to this and people tend to forget or not even knowing this


Pie : OpenJDK 1.9
Nougat/ Oreo OpenJDK 1.8
KitKat/lollipop / marshmallow OpenJDK 1.7

Note for mtk KitKat just use oracle java 1.6.x

Make sure to check the mtk build environment script, you may need to install some packages or lower your "x" system install package version ( ie: mediatek is very picky with the make version installed on your system)
i've had issues with mtk build environment over the years due to this.
Its very picky mainly on jellybean/ KitKat/lollipop

And make sure your using the right distro
I'm using Ubuntu (based) os 14.04 for kitkat, jellybean , ICS

Ubuntu (based) os 16.x for anything from lollipop to pie
Cheers
Also, has anyone actually tried booting CM12.1 with a 3.4.67 kernel? I do have access to the kernel sources to my device but it's missing some things so I am currently unable to compile it at the very least. I did manage to build CM12.1 but I end up with a boot logo loop and upon poking around in TWRP it seems like not all proprietary libraries are copied and even if I do copy the missing libraries it still doesn't boot up.
 

bigrammy

Senior Member
Apr 8, 2011
2,939
2,549
huddersfield
sorry mate
been extremely busy over the past months so are my team mates ...
Does that mean no help at all then :confused:
Not been funny just need clarification as "been" and "are" contradict each other. :eek: :laugh:
If you "are" busy then I understand but if you have "been" busy does that mean you have a little spare time to have a glance through and see if you can spot anything obvious. ??
 

Matty1993

Senior Member
May 7, 2018
630
314
Also, has anyone actually tried booting CM12.1 with a 3.4.67 kernel? I do have access to the kernel sources to my device but it's missing some things so I am currently unable to compile it at the very least. I did manage to build CM12.1 but I end up with a boot logo loop and upon poking around in TWRP it seems like not all proprietary libraries are copied and even if I do copy the missing libraries it still doesn't boot up.


Ive built lineage os 13.0 & 14.1 using a stock pixi 3 (4.5) 4027A kernel which is 3.4.67 no modifications to it at all works fine with android 6 & 7 stock OS these phones come with is 4.4.4 so it can be done without modifying the kernel at all :)

Also no booters could be the fstab, ueventd or init.rc in the boot.img
 
Last edited:
  • Like
Reactions: blakegriplingph

blakegriplingph

Senior Member
May 13, 2011
978
146
Amazon Fire
Realme C3
Ive built lineage os 13.0 & 14.1 using a stock pixi 3 (4.5) 4027A kernel which is 3.4.67 no modifications to it at all works fine with android 6 & 7 stock OS these phones come with is 4.4.4 so it can be done without modifying the kernel at all :)

Also no booters could be the fstab, ueventd or init.rc in the boot.img
Nice nice. Though I've noticed in my tablet's stock boot.img fstab that there doesn't appear to be a line for mounting /system:
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]     /data               ext4      noatime,nosuid,nodev,noauto_da_alloc    wait,check,encryptable=footer
/[email protected]_f   /protect_f          ext4      noatime,nosuid,nodev,noauto_da_alloc    wait,check
/[email protected]_s   /protect_s          ext4      noatime,nosuid,nodev,noauto_da_alloc    wait,check
/devices/platform/mtk-msdc.0/mmc_host   auto      vfat      defaults        voldmanaged=sdcard0:[email protected],noemulatedsd
/devices/platform/mtk-msdc.1/mmc_host   auto      vfat      defaults        voldmanaged=sdcard1:auto
/devices/platform/mt_usb                auto      vfat      defaults        voldmanaged=usbotg:auto
Does this mean I have to manually add the appropriate line for /system?

EDIT: I got even further and managed to load up boot.img, well, sort of. Now the tablet just hangs up at the boot logo instead of power-cycling as before due to a missing MTK header. The device is detected by ADB but while I can successfully query it through 'adb devices', attempting to use any other command especially 'adb shell' results in the following error:
Code:
exec '/system/bin/sh' failed: No such file or directory (2)
 
Last edited:

Matty1993

Senior Member
May 7, 2018
630
314
Nice nice. Though I've noticed in my tablet's stock boot.img fstab that there doesn't appear to be a line for mounting /system:

Does this mean I have to manually add the appropriate line for /system?

EDIT: I got even further and managed to load up boot.img, well, sort of. Now the tablet just hangs up at the boot logo instead of power-cycling as before due to a missing MTK header. The device is detected by ADB but while I can successfully query it through 'adb devices', attempting to use any other command especially 'adb shell' results in the following error:


Haha thanks i spent roughly 3 weeks figuring out how to get android 7.1.2 to boot on it as the way storage is mounted on lineage 13.0 compared to 14.1 is very very diff,

Also with your fstab thats what your problem will be as your using the stock 4.4.4 fstab which dosent require system to be mounted on 4.4.4.

However android 6 & 7 require the /system to be mounted within the fstab

To modify properly you will need to add the following,

/[email protected] /system ext4 ro,commit=1, wait

It must also contain

/[email protected]
/[email protected]
/[email protected]_f
/[email protected]_s

Dont add any other partitions it will only lead to boot issues,

After the above you will find your voldmaged partitions for storage,

These to also must be set correctly or it will be stuck on infinite bootlogo in my case mine was set as /dev/platform/mtk_msdc.0/mmcblk

But it wouldnt go past the boot logo so i changed it as follows /dev/platform/mtk_msdc.0/mmcblk* which then allowed the system to boot, some roms though dont use mmcblk or mmcblk* they instead use mmc_host or mmc_host* but are also voldmaged aswell, to make sure your your vold managed mounts are set properly internal storage is always set as mtk_msdc.0 which should have the vold mount set as voldmanaged=sdcard:auto,[email protected],noemulatedsd


External SDcards should only use mtk_msdc.1 mounts and should be voldmanaged=sdcard1,auto,encryptable=userdata

Make sure you remove also fstab.fat & fstab.fat.nand from your stock boot.img also as the sdcard mount is already set in fstab so is not needed anywhere else or will cause issues this will be found in fstab.fat.nand, you will need to delete the fstab.nand also as it contains /dev/loop mount which old android 4 system were run from but android 6 and 7 arent run throgh loops for storage so this will also cause no boot errors,

If your also trying to boot CM im assuming you also made the correct adjustments to the init.environ.rc to add the cm files in /system/framework/ into the systemclass path & seapp_contexts for CM apps aswell as adding the cm init file if cm 12 has it and linking it in the import section in init.rc ??

You will also need to set your kernel to permissive its not completely needed but will help run the android 7 processes without problems

You can do this by editing selinux.reload_policy=1 to selinux.reload_policy=0 if that fails to work add

on property:/system/bin/setenforce 0
start ueventd
start installd

seclabel u:r:kernel:s0

Which should do the trick hope this info helps


Worse comes to worse you can just do it the easy way and find a CM12 boot img for your fs type being ext4 or nand from another CM12 rom witb the boot.img in the zip and just swap the kernel out, and recompile easiest way to do it really otherwise youll find it could be any number of things that are causing the issue of no booth
 
Last edited:
  • Like
Reactions: blakegriplingph

blakegriplingph

Senior Member
May 13, 2011
978
146
Amazon Fire
Realme C3
Haha thanks i spent roughly 3 weeks figuring out how to get android 7.1.2 to boot on it as the way storage is mounted on lineage 13.0 compared to 14.1 is very very diff,

Also with your fstab thats what your problem will be as your using the stock 4.4.4 fstab which dosent require system to be mounted on 4.4.4.

However android 6 & 7 require the /system to be mounted within the fstab

To modify properly you will need to add the following,

/[email protected] /system ext4 ro,commit=1, wait

It must also contain

/[email protected]
/[email protected]
/[email protected]_f
/[email protected]_s

Dont add any other partitions it will only lead to boot issues,

After the above you will find your voldmaged partitions for storage,

These to also must be set correctly or it will be stuck on infinite bootlogo in my case mine was set as /dev/platform/mtk_msdc.0/mmcblk

But it wouldnt go past the boot logo so i changed it as follows /dev/platform/mtk_msdc.0/mmcblk* which then allowed the system to boot, some roms though dont use mmcblk or mmcblk* they instead use mmc_host or mmc_host* but are also voldmaged aswell, to make sure your your vold managed mounts are set properly internal storage is always set as mtk_msdc.0 which should have the vold mount set as voldmanaged=sdcard:auto,[email protected],noemulatedsd


External SDcards should only use mtk_msdc.1 mounts and should be voldmanaged=sdcard1,auto,encryptable=userdata

Make sure you remove also fstab.fat & fstab.fat.nand from your stock boot.img also as the sdcard mount is already set in fstab so is not needed anywhere else or will cause issues this will be found in fstab.fat.nand, you will need to delete the fstab.nand also as it contains /dev/loop mount which old android 4 system were run from but android 6 and 7 arent run throgh loops for storage so this will also cause no boot errors,

If your also trying to boot CM im assuming you also made the correct adjustments to the init.environ.rc to add the cm files in /system/framework/ into the systemclass path & seapp_contexts for CM apps aswell as adding the cm init file if cm 12 has it and linking it in the import section in init.rc ??

You will also need to set your kernel to permissive its not completely needed but will help run the android 7 processes without problems

You can do this by editing selinux.reload_policy=1 to selinux.reload_policy=0 if that fails to work add

on property:/system/bin/setenforce 0
start ueventd
start installd

seclabel u:r:kernel:s0

Which should do the trick hope this info helps


Worse comes to worse you can just do it the easy way and find a CM12 boot img for your fs type being ext4 or nand from another CM12 rom witb the boot.img in the zip and just swap the kernel out, and recompile easiest way to do it really otherwise youll find it could be any number of things that are causing the issue of no booth

Android 6 and 7? I'm actually trying to boot Android 5.1 lol. Do you have a source tree so I can look into it for reference's sake? If there's any consolation, I am glad that the kernel loaded up somewhat, ADB and all.

Also, did you run into any issues such as with sensors, cameras and whatnot?
 

Matty1993

Senior Member
May 7, 2018
630
314
Android 6 and 7? I'm actually trying to boot Android 5.1 lol. Do you have a source tree so I can look into it for reference's sake? If there's any consolation, I am glad that the kernel loaded up somewhat, ADB and all.

Also, did you run into any issues such as with sensors, cameras and whatnot?


I used micromax A102 source trees to build it for the alcatel pixi though kernels are diff thats about it really everything else is compatible :)


Sensors all work fine camera works fine also and is great quality but video recording does not work for me on android 7.0 build 6.0 works fine everything else though works as it should so you should have no dramas on 5.1
 
  • Like
Reactions: blakegriplingph

Infect_Ed

Senior Member
Jan 10, 2017
215
166
https://github.com/Maanush2004/android_device_lenovo_manning here is my device tree but the thing is I didn't really make a lineage 15.1 tree I use lineage 15.0 tree.
But the rom I make will be stuck at bootanimation loop only so no use. I made a flashable zip which actually was not for this purpose but for magisk and other /data issues but this helped me. don't forget flashing this also won't make it boot.
Add these lines to your system.prop
#ADB
ro.debuggable=1
persist.sys.usb.config=adb
ro.secure=0
ro.adb.secure=0

Otherwise keychord 1 service won't start or you can build a eng build which I think will eliminate the addition of these flags in build.prop. A commit in system/core of Lineageos says that adb is disabled in userdebug builds and is enabled in eng builds but I'm not sure though

And vndk 26 and vndk 26 sp folders are not required no issue if it is present but lineageos boots without it too. Just build vndk-sp like the one present in my tree.


Thanks buddy. I'll take a look and see if anything from your tree will help. Much appreciated.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 79
    Hey guys, We are going to try something new for our china phones - cyanogenmod.

    But we need some more devs to get everything going.



    For now we have:

    -Github tree for Lenovo P700i(mediatek 6577, android 4.0.4, kernel 3.0.8)

    -Lens_flare - original port author(may work with system folder and configs)

    -some kernel source from other devices like liquid gallant



    The main problem is getting adb to work that could help a lot on remaining development. For now even zygote not starting, but all partitions seems mounted successfully.

    We need more devs (especially that could assemble working kernel for device), working with p700i may lead to following porting for other mtk devices, as sources are nearly the same.
    40
    Lollipop on MT6577

    Hi there .

    Just to let you know, that lollipop is now booting on ZTE v970 [MT6577- w/ ComBo-Chip MT6620]
    With my custom 3.4.67 KK Kernel + some cherry-picks from the new MTK 3.10.54 LL Kernel

    Still very early, baseband is recognized , but still needs a lot more work on Telephony, Platform, etc.


    ;)

    Regards
    39
    More progress on this one: http://forum.xda-developers.com/showthread.php?t=2467400

    I have 3G data and incoming voice calls working now.

    Next: kitkat.

    Chris

    Please hit the thx button. And please thank also dr shadow and xplodwild from omnirom.
    27
    KitKat Sources MT6582 / 6592

    Since my Cloud host, removed the sources,that i uploaded twice

    Using MEGA now, should be on for some days..


    Edit: no more source leaks, noobies will always be noobies
    I won't be sharing more source stuff

    Learn to comply with GPL and respect others



    Regards
    27
    I'm working now since 1 day on CM13 and here the first screenshot on mt6592 :).