Building (or trying to build) a ROM for a MediaTek device

Hello everybody!

CURRENT STATUS: Non-working ROM and fakeflash available for debugging.

I am in no way responsible for any bricks, device nuclear meltdowns, or toasters malfunctioning, as I have already stated that the builds here are all non-working. Flash at your own discretion. 

As you might know, I mirrored the Elephone P6000 source code a while back, and after doing that, I analyzed the structure of the MediaTek and Android source code a little, and decided to try to build CyanogenMod 11 for the P2000 (running 0409 build of the Elephone ROM). Why do I not build for the P6000, you say? Well, that is simply because I do not have the device. I do not have the funds to purchase a P6000 right now to test it, so I will not be trying to build ROMs for the device.

This post is more of a log than a blog post, really. That means what you see here will be a series of logs across several days, and not a one-time post, so here goes!

— Start of Captain’s log

23 Feb 2015

  • Set up building environment using multiple (and I mean multiple) tutorials found online. I probably have more than I need though, with both JDK6 and JDK7, and a couple of other packages which I may not even need.
  • Grabbed the MT6592 sources from a thread in MoDaCo, these sources are for a device codenamed ‘bird92_cwet’, so I’ll have to start thinking of ways to get the device configuration files for c101v92_jbaol, which is the codename for the P2000.
  • Grabbed the CM11 sources using repo and Ubuntu 14.10 (64 bit). The device I’m running on is a Samsung R430, with 6GB of RAM, while Ubuntu runs on an external hard disk (due to the lack of an internal one). The device was left for a prolonged period of time (approx. 4-5 hours download on a fibre broadband connection) to download sources.
  • While I’m at it, I also contacted iBerry to see if I can get any device configuration files, since their Auxus Note 5.5 has an almost identical hardware structure to the P2000 (so as to make my job of building the ROM easier).

24 Feb 2015

  • Built a fakeflash using the CM tools provided, but installing gave a blank screen. Didn’t fix the problem, but I did manage to mess up my sources.
  • Re-downloaded CM11 sources.
  • Used patched files and tutorial from this XDA thread.
  • Attempted build of CM11 using Zopo Z998 device trees, modified slightly. I doubt that this one will work though, as I simply dumped a couple files and sources together (kernel, Zopo Z998 modified device tree, patched files). During the build process I had to rename a lot of files too (rename, continue make, rename again), as I had modified a couple kernel configuration files.
  • Turns out the sources have a lot of scripts that are not marked as being allowed to run as programs, so I had to manually turn them on, then move files around (MediaTek’s kernel source structure is odd) to allow the compiler to read all the files in the right places (Yes, I don’t modify code, I just move stuff around. Maybe occasionally, but no, I usually don’t modify code).

25 Feb 2015

  • Fixed Kconfig problem by merging all Kconfig files from MediaTek with the default ARM Kconfig file. Not a good practice, but it had to be done because Kconfig ARM couldn’t read Kconfig MediaTek’s sources.
  • Merged all MediaTek configurations into default Kconfig file.

SECCAM_FOOTAGE_260215_23005426 Feb 2015

  • Cleaned up sources a little
  • Built non-working recovery using guide on this XDA thread. Recovery mode shows Elephone logo, then gets stuck there and reboots to system after a while.
  • Built clean ROM without any MediaTek binaries, going to test it on the 27 Feb 2015.

27 Feb 2015

  • Clean CM11 ROM did not install, going to tweak it a little to see if it’ll work that way.
  • Messed around with TWRP (’s settings and mounts, and clean CM11 ROM installed. Phone didn’t boot after that though. Download non-working build
  • Built a fakeflash package that froze TWRP and refused to boot (similar problem to last one), but this time the same configuration was used from the clean CM11 ROM. Also, MediaTek kernel source code was copied to the CM11 source directory before building. Download non-working build

28 Feb 2015

  • Got one build up and running (the build, not the ROM)
  • Deleted all the built files accidentally, I’ve started a new build, but this one will finish tomorrow if there are no errors.
  • cp: cannot stat ‘/home/justin/sources4/out/target/product/P2000/root/init.recovery.*.rc’: No such file or directory

2 Mar 2015

  • mediatek/factory/src/miniui/ *** commands commence before first target.  Stop. 


— End of Captain’s log