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

[GUIDE]Making a ROM from source{Mediatek}

Search This thread

matbo

Member
Jun 10, 2014
48
11
solvehi evrybody, i'm traing to compile cyano for my redmi note 3 mtk version (mt6795) (i have device tree, vendor an prebuilt kernel :( ).
i follow your guide but as soon as i start building i recive an error :
Code:
[email protected]:~/sorgenti/cyanogenmod$ make -j4 bacon
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
CM_VERSION=12.1-20160407-UNOFFICIAL-hennessy
TARGET_PRODUCT=cm_hennessy
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.2.0-35-generic-x86_64-with-Ubuntu-15.10-wily
HOST_BUILD_TYPE=release
BUILD_ID=LMY49J
OUT_DIR=/home/matbo/sorgenti/cyanogenmod/out
============================================
Checking build tools versions...
************************************************************
You asked for an OpenJDK 7 build but your version is
java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode).
************************************************************
build/core/main.mk:198: *** stop.  Arresto.

#### make failed to build some targets (2 seconds) ####
i can't understand what i'm doing wrong.
thanks for your time
edit:solved
 
Last edited:

lft

New member
Aug 31, 2016
1
0
I already have the AOSP and the Kernels sources for my smartphone
How can I find the device tree or extract from my stock firmware?
I haven't found the DT for my SoC mt6580 (Asus Live G500TG). I'm searching for but no results yet. Can any one help.
Sorry for my English, I'm from Brazil. Newbie here.
 
Aug 18, 2013
7
1
Building CM13 for MEDIATEK MT6582

Hi all
Im trying to make a CM 13 build for generic MT6582 chipset.
Anyone is still active on this argument?
I've got the device/ and vendor/ folder so we can try to make a build and help each other.
Till now, i've build the recovery but cannot flash using SP flash tool [BROM ERROR 4008]
Any idea?
If possible I want to create a group re-developing mediatek in open source mode ;)
Regards :)
 

Suvam Mondal

Senior Member
Jan 3, 2017
198
16
"could not load kernel" error

Can somebody please help me to solve this error ? (I have also attached the full log)

Code:
error: could not load kernel '/home/suvam/RRMM/out/target/product/m2note/kernel'
make: *** [/home/suvam/RRMM/out/target/product/m2note/boot.img] Error 1
make: *** Waiting for unfinished jobs....
 

Attachments

  • newbuild.txt
    481.6 KB · Views: 7
Jun 5, 2017
12
2
Thrissur-Kerala
Can any of you please help for making ROM for YU Yunicorn (YU5530)

Chipset
Mediatek MT6755 Helio P10

CPU
Octa-core (4x1.8 GHz Cortex-A53 & 4x1.0 GHz Cortex-A53)

GPU
Mali-T860MP2

Internal
32 GB, 4 GB RAM

#sources are not yet officially released...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 32
    Guide to Mediatek Building(Guide 3:=/system)

    Requisites
    A Linux machine
    The required packages(Look to the 2nd post)
    A source code(CyanogenMod,AOKP..)[Look at post 3 for more details]
    The Mediatek modified packaged, attached to post
    ]


    Lets get started!

    I'll reinstate the fact that mediatek is Anti GPL so doesnt release the source codes but some companies recently have started releasing the source and many of you guys asked me how to build a rom for a mediatek device. Here it goes



    There are three requirments for building a rom for a phone from source
    a)device tree
    b)kernel source
    c)vendor tree(usually made by the device/setup-makefiles.sh

    Step 1(Merging Mediatek files):First. you'd have to merge the package i gave in the post to your source tree.


    Step 2(Setting up the environment):(Assuming you have a kernel tree) Try to find a device tree for your phone this device tree can either be built from start or can be "forked" of a similar device. What i mean is, suppose you have a mt6589 chipset you can take the device tree from another mt6589 chipset. Here is a link to my device tree for Canvas 4 kitkat mt6589 device tree..kernel source for mt6589. If you are building for very similar devices of canvas 4 you could use my prebuilt kernel too.

    Step 3(Obtaining proprietory files):: For wifi,gps and radio to work we have to obtain some files which are "device-specific". We do this by executing the file in the device tree called the "extract-files.sh" or the "proprietory-files.sh". what these files do is they grep the contents from the proprietory-files.txt and pull it from your phone using adb.

    Step 4(Building):What we want to do first is setup the build environment. The script is located inside the build folder.This script describes how to set up your local work environment to build the Android source files. You will need to use Linux or Mac OS. Building under Windows is not currently supported.. to execute this script,
    Code:
    source build/envetup.sh
    . We have to now "lunch" the device. What this does is that it initializes the build environment for that particular device.
    we use this to tell linux to build it for your device this is done by
    Code:
    lunch cm_devicename-userdebug or lunch cm_devicename-eng
    A very good artical i came across for explaining the build-variants is here. Now is the easy part(Compiling). We now type
    Code:
    make -j# bacon
    what bacon does is create a .zip file which is flashable on your phone. #=no of processors+2. But if your processor is hyperthreaded, add 4 to the no of physical cores.

    Step 5(Errors):There is no one solution for all errors but general errors like "Term.apk not found" can be fixed by going to the vendor/cm(aokp..)/get-prebuilts. Other errors are welcome in the thread and I'll try my best to solve them :cool:

    Hope it helped you!, any feedback on the tutorial is welcome.
    Hit that thanks button if you think its worth it

    Regards and Good Luck
    My first tutorial:building a boot.img for mediatek


    Links to my next Guides
    Building the boot.img{MediaTek}
    Building the Kernel{MediaTek}

    Toolchain links are coming up.
    8
    Source code links

    you can get repo script by typing
    Code:
    curl $ http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    chmod a+x ~/bin/repo
    Code:
    repo init -u <URL to android manifest> -b <branch name>
    this is the generalized way to do this.

    For cyanogenmod:
    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
    For aokp
    Code:
    repo init -u https://github.com/AOKP/platform_manifest.git -b kitkat

    This is about 14GB and will take time to download. once its downloaded make sure you have the required packages from the second post. To start building follow the first post
    6
    Required packages before building



    Python 2.6 -- 2.7, which you can download from python.org.

    GNU Make 3.81 -- 3.82, which you can download from gnu.org,

    JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older. You can download both from java.sun.com.

    Git 1.7 or newer. You can find it at git-scm.com.



    #Required packages

    Code:
    sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 git-core lzop ccache gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python gcc g++ cpp gcc-4.8 g++-4.8 && sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

    Go to etc/udev/rules.d/51-android.rules

    Code:
    # adb protocol on passion (Nexus One)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
    # fastboot protocol on passion (Nexus One)
    SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
    # adb protocol on crespo/crespo4g (Nexus S)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
    # fastboot protocol on crespo/crespo4g (Nexus S)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
    # adb protocol on stingray/wingray (Xoom)
    SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="<username>"
    # fastboot protocol on stingray/wingray (Xoom)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="<username>"
    # adb protocol on maguro/toro (Galaxy Nexus)
    SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="<username>"
    # fastboot protocol on maguro/toro (Galaxy Nexus)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="<username>"
    # adb protocol on panda (PandaBoard)
    SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="<username>"
    # adb protocol on panda (PandaBoard ES)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0600", OWNER="<username>"
    # fastboot protocol on panda (PandaBoard)
    SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="<username>"
    # usbboot protocol on panda (PandaBoard)
    SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d00f", MODE="0600", OWNER="<username>"
    # usbboot protocol on panda (PandaBoard ES)
    SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d010", MODE="0600", OWNER="<username>"
    # adb protocol on grouper/tilapia (Nexus 7)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0600", OWNER="<username>"
    # fastboot protocol on grouper/tilapia (Nexus 7)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0600", OWNER="<username>"
    # adb protocol on manta (Nexus 10)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0600", OWNER="<username>"
    # fastboot protocol on manta (Nexus 10)
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee0", MODE="0600", OWNER="<username>"




    In bash.rc
    Code:
    export USE_CCACHE=1

    Beter way installing java
    Code:
    sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update && sudo apt-get install oracle-java6-installer

    Reuqired package check
    Code:
    sudo apt-get install git-core lzop ccache gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python gcc g++ cpp gcc-4.8 g++-4.8

    THIS
    Code:
    sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so




    You're done
    3
    Kernel Development guide coming today :)
    2
    Nice guide, will surely try it when i get some time... Subscribed (y)

    Have fun!

    Regards