[Q] Build a Custom ROM using only kernel source? - Android Q&A, Help & Troubleshooting

The HTC Desire 310 runs on a MediaTek SoC, and HTC only has the source code for the kernel. Is it possible to build a Custom ROM like CM for the device? And what are the drawbacks of doing this?

Lynuxen said:
The HTC Desire 310 runs on a MediaTek SoC, and HTC only has the source code for the kernel. Is it possible to build a Custom ROM like CM for the device? And what are the drawbacks of doing this?
Click to expand...
Click to collapse
Basically all a ROM development takes is a kernel source ,a device tree(how the source has to build your ROM {resolution,kernel source command lines....etc are set here}) , a vendor tree( usually proprietary shared libraries got from stock ROM ). Once you've got all these all you have to so is type make bacon. But since its mediatek its pretty hard to build anything since mediatek ril/libraries are not open source.

So doing this blindfolded won't work.

Lynuxen said:
So doing this blindfolded won't work.
Click to expand...
Click to collapse
Won't work, unless you set up a device tree for your SoC. MT6589 device tree may work for building only recovery but nothing further.

Yes, as @MasterAwesome said you need actually 3 components: Vendor tree, kernel source and device tree. Making vendor and device tree from scratch is hard.

GeekyDroid said:
Yes, as @MasterAwesome said you need actually 3 components: Vendor tree, kernel source and device tree. Making vendor and device tree from scratch is hard.
Click to expand...
Click to collapse
Hard, but not impossible? I really want to invest my time in something like this. Pretty long shot, will something like a method for reversed engineering the vendor and device tree work?

Lynuxen said:
Hard, but not impossible? I really want to invest my time in something like this. Pretty long shot, will something like a method for reversed engineering the vendor and device tree work?
Click to expand...
Click to collapse
Vendor tree is pretty easy to setup. You'd want to start with the CyanogenMod version which is similar your current android version. If your device has kitkat download cm11 sources. Read their docs about setting up a device tree(its not that hard). Vendor tree is basically just your stock ROM use it as a base to get your libs which are required for your ROM to start(logcats are helpful here). Since you have a similar SoC, you can use my device tree as a reference https://github.com/MasterAwesome/a210_device_tree/tree/master/micromax/a210. Initially just build a kernel and check if it works. And I have guides for kernel and ROM building,you could check it out.

MasterAwesome said:
Vendor tree is pretty easy to setup. You'd want to start with the CyanogenMod version which is similar your current android version. If your device has kitkat download cm11 sources. Read their docs about setting up a device tree(its not that hard). Vendor tree is basically just your stock ROM use it as a base to get your libs which are required for your ROM to start(logcats are helpful here). Since you have a similar SoC, you can use my device tree as a reference https://github.com/MasterAwesome/a210_device_tree/tree/master/micromax/a210. Initially just build a kernel and check if it works. And I have guides for kernel and ROM building,you could check it out.
Click to expand...
Click to collapse
Massive thanks MasterAwesome. :highfive:

Related

Kernel developers - are they nuts?

Hi!
I just want to vent my anger
Has anybody noticed that there are a minimum of four "parties" that work on an android kernel tree?
First there is the android open source project.
Then there is the CodeArora project.
There is also a kernel tree at Cyanogenmod.
And last but not least we have the "manufacturer" kernel tree.
AOSP has got a common tree and an individual tree for each architecture- just like Cyanogenmod.
CodeAurora has got multiple(!) trees for a single architecture.
The manufacturer seems to use some of CodeAurora's trees in the majority of cases.
Ah- I forgot the "original" linux kernel tree
This way we never get the most efficient and most stable kernel.
Just my two cents
you're right, but not only the kernel is used. LG takes code from codeaurora project - have seen this in code from the frameworks base tree^^
but on the other side: better they use community code as own code that didn't works perfect
WTF? LG really takes his sources from CodeAurora?!?!?
Well since code aurora is dedicated to qualcomm SoCs if i were a kernel developer i wud start with that tree..one question though does codeaurora contain gb kernel (.35) source for our msm7227 ??? u guys checked it out ???even if they theres a lot of other hardware that are going to need proprietary drivers i guess... THird world peripherals make porting tougher.. its just my take correct me if i m wrong
sarfaraz1989 said:
Well since code aurora is dedicated to qualcomm SoCs if i were a kernel developer i wud start with that tree..one question though does codeaurora contain gb kernel (.35) source for our msm7227 ??? u guys checked it out ???even if they theres a lot of other hardware that are going to need proprietary drivers i guess... THird world peripherals make porting tougher.. its just my take correct me if i m wrong
Click to expand...
Click to collapse
my kernel patches are taken from the codeaurora .35 source, but i can't adopt the complete kernel. there is a "must understand" and "must have many time" to do that
andy572 said:
my kernel patches are taken from the codeaurora .35 source, but i can't adopt the complete kernel. there is a "must understand" and "must have many time" to do that
Click to expand...
Click to collapse
That is exactly the problem!
I cannot really judge which patch from which tree is good- because I have not the time to read through Qualcomm's manuals (if they are public at all) and the kernel source.
If they would concentrate on one tree everything would be fine (ok- if you look at the "chaos commits" in the git repositories you become sick )
@caveman u working on a P500 kernel ??? how is porting so friggin easy for HTC devices..Do they have open source driver /generic hardware or what i mean a few of em even got a honeycomb partial port forget 2.3 ....
sarfaraz1989 said:
@caveman u working on a P500 kernel ??? how is porting so friggin easy for HTC devices..Do they have open source driver /generic hardware or what i mean a few of em even got a honeycomb partial port forget 2.3 ....
Click to expand...
Click to collapse
LG have some specific (old) hardware - they are using qualcomm hardware, but it's to old for newer kernel sources. the other problem is low cost hardware like the display - ms6000 is never used today, new devices are using samsung displays.
look at the wlan/smd chip - bcm4325 is never supported, bcm4329 is newer and is in kernel .38 too ... do you know, what i mean?
old hardware drivers are rare in kernels - never used drivers gets removed from tree, so there is no chance to bring it back.
ofcourse that's why it's called EVOLUTION
so it looks like u were right about getting a new phone
ciolnadu said:
ofcourse that's why it's called EVOLUTION
so it looks like u were right about getting a new phone
Click to expand...
Click to collapse
yes, it's marketing strategy and its ok - but why should i buy me a new device, when my is doing a good job?
andy572 said:
but why should i buy me a new device, when my is doing a good job?
Click to expand...
Click to collapse
+1 agreed 100% with andy.
andy572 said:
LG have some specific (old) hardware - they are using qualcomm hardware, but it's to old for newer kernel sources. the other problem is low cost hardware like the display - ms6000 is never used today, new devices are using samsung displays.
look at the wlan/smd chip - bcm4325 is never supported, bcm4329 is newer and is in kernel .38 too ... do you know, what i mean?
old hardware drivers are rare in kernels - never used drivers gets removed from tree, so there is no chance to bring it back.
Click to expand...
Click to collapse
Do you mean the drivers sources were in the old kernel and are removed in the new one? If so, I mean we have the old sources, why is it so difficult to port them to the new kernel sources? I am not a kernel developer so probably I am missing something
rivett said:
Do you mean the drivers sources were in the old kernel and are removed in the new one? If so, I mean we have the old sources, why is it so difficult to port them to the new kernel sources? I am not a kernel developer so probably I am missing something
Click to expand...
Click to collapse
code isn't moved but deleted.
Has anybody found out the CodeAurora git commit on which LG's V10r is based on?

[Q] How to add new device tree,new kernel source code to CM source & compile?

Hello everybody.
I have a noob question about compile cyanogenmod for my new device.
Now, i have: CMW recovery, Kernel source code on local computer, full repo cm source + toolchains.
How to add my device tree, kernel source code to CM source and compile CM7 ROm?
Thanks you, cheer
Anyone here?
Did you figure it out yet? I asked the same question and am waiting for an answer, tho I'm on CM 10, HTC Vivid. If I figure it out I'll post back and try and help.
nguyenhonganh said:
Hello everybody.
I have a noob question about compile cyanogenmod for my new device.
Now, i have: CMW recovery, Kernel source code on local computer, full repo cm source + toolchains.
How to add my device tree, kernel source code to CM source and compile CM7 ROm?
Thanks you, cheer
Click to expand...
Click to collapse
I met the same problem, does anyone can help?
Do you have a device tree? Or do you have an unsupported device? If you have an existing device tree from some other ROM, etc, then you just need to edit your .repo/local_manifest/roomservice.xml to pull in the trees that you need.
If you need to create a device tree, then it gets not complicated, as each device is different. The basic process is to create the necessary directories (device/manufacturer/model, kernel/manufacturer/model (may need to be kernel/manufacturer/device_family/model, for reference to that, see CM's repo for the LG G3) and finally vendor/manufacturer/device.
After you have the directories setup, you will need to actually start building the tree. The easiest way is to copy another devices files into your devices tree, and then edit the files. The closer the device you copy in is, the less work you will need to do to the files. Refer to sites like gsmarena.com, PhoneArena.com, etc for phone specs.
That's about as far as I can take you without dealing with a specific device. If you need more info, post back here with your questions, and post your device specs, or at least the model number,and I'll see if I can help.
rassawyer said:
Do you have a device tree? Or do you have an unsupported device? If you have an existing device tree from some other ROM, etc, then you just need to edit your .repo/local_manifest/roomservice.xml to pull in the trees that you need.
If you need to create a device tree, then it gets not complicated, as each device is different. The basic process is to create the necessary directories (device/manufacturer/model, kernel/manufacturer/model (may need to be kernel/manufacturer/device_family/model, for reference to that, see CM's repo for the LG G3) and finally vendor/manufacturer/device.
After you have the directories setup, you will need to actually start building the tree. The easiest way is to copy another devices files into your devices tree, and then edit the files. The closer the device you copy in is, the less work you will need to do to the files. Refer to sites like gsmarena.com, PhoneArena.com, etc for phone specs.
That's about as far as I can take you without dealing with a specific device. If you need more info, post back here with your questions, and post your device specs, or at least the model number,and I'll see if I can help.
Click to expand...
Click to collapse
I have a mt6750 devices... And there is a device from my company manufacturer.. Its a mt6750 device, it have cm device tree.. Both device working on same rom.. I can port that device rom but it always give me bugs.. So my question is how to use it?

[Q] Github help!! Vendor and device tree...

Hello, i am just a begineer, i want to compile a rom from official cyanogen...
The doubt i hav..
What are device trees and vendor trees in detail???
Vendor trees are made for specific devices like device trees?
parth.bhatia said:
Hello, i am just a begineer, i want to compile a rom from official cyanogen...
The doubt i hav..
What are device trees and vendor trees in detail???
Vendor trees are made for specific devices like device trees?
Click to expand...
Click to collapse
Device tree's contain the configuration files and settings files for your device, while vendor tree's contain proprietary binary blobs such as graphics, and other sensors. Vendor tree's are usually made for specific devices but there are some additional vendor tree's that are common to certain devices that share the same chipset and other features. The best way to learn about vendor and device tree's is to take a look at a good example of a device tree and a good example of a vendor tree, as well as a good example of a vendor wide common tree. Let me know if you still have questions I'll be happy to help you out.
Can i use vendor tree of my device made for ics in jb too??
parth.bhatia said:
Can i use vendor tree of my device made for ics in jb too??
Click to expand...
Click to collapse
You can try using that tree for compiling JB, you may get a compile error which you may have to fix but test it and it find out. Overall it should work for you, somethings may break but it should work.

Want to build ROM for Lenovo B6000-F, can't get Device Tree

Since I have nothing to do, I want to get into this ROM development stuff with my older device, hopefully I will learn something.
My trouble is that I can't build any ROM for that device(Lenovo Yoga B6000-F), because I can't find the device tree for it or anything related...
How can I get it/make it by myself?
BTW, this is a Tablet - Lenovo Yoga 8; B6000-F (WiFi version, there is a 3G one)
DarkAlpha.Sete said:
Since I have nothing to do, I want to get into this ROM development stuff with my older device, hopefully I will learn something.
My trouble is that I can't build any ROM for that device(Lenovo Yoga B6000-F), because I can't find the device tree for it or anything related...
How can I get it/make it by myself?
Click to expand...
Click to collapse
You can make it yourself, but you won't find any tutorial how to make device tree, trust me I've been there. Also I see that you have device with mediatek chipset so I doubt you will succed because well "mediatek" however you can build device tree if there is device tree for device with same chipset and there is common tree for mt8125 chipset and then you edit just some part of tree to suit your phone, I've done same thing but never get to bulding rom because anything can be flashed on phone because of some "protection" so I didn't bother.
Professor Woland said:
You can make it yourself, but you won't find any tutorial how to make device tree, trust me I've been there. Also I see that you have device with mediatek chipset so I doubt you will succed because well "mediatek" however you can build device tree if there is device tree for device with same chipset and there is common tree for mt8125 chipset and then you edit just some part of tree to suit your phone, I've done same thing but never get to bulding rom because anything can be flashed on phone because of some "protection" so I didn't bother.
Click to expand...
Click to collapse
Uh ok I will do some searches, probably ending by giving up ... Probably all my next devices won't be this MediaTek stuff...(still don't know why it heats so much)
Btw, where do you find those trees? I can't find any for this chipset...
DarkAlpha.Sete said:
Uh ok I will do some searches, probably ending by giving up ... Probably all my next devices won't be this MediaTek stuff...(still don't know why it heats so much)
Btw, where do you find those trees? I can't find any for this chipset...
Click to expand...
Click to collapse
On github. Device tree's are named "android_device_*manufacturer*_*model*"
Well first look for list of devices using that chipset, and try finding trees for that models, I don't say you will find any but you can try.

Making own rom for Mediatek device

Hello!
I'd like to build my own rom from AOSP 8.0 official branch. I'm looking for some kind of guide but couldn't find any So, let's say I've got android source code and files from other custom rom that makes camera work. What have I to do to make my rom now? How can I build it and be sure that everything will work. Generally my target is to install android 8 on my Leeco le 2 x620 device with Mediatek chip
Any help is appreciated ^v^
LEGOL2 said:
Hello!
I'd like to build my own rom from AOSP 8.0 official branch. I'm looking for some kind of guide but couldn't find any So, let's say I've got android source code and files from other custom rom that makes camera work. What have I to do to make my rom now? How can I build it and be sure that everything will work. Generally my target is to install android 8 on my Leeco le 2 x620 device with Mediatek chip
Any help is appreciated ^v^
Click to expand...
Click to collapse
"I'd like to build my own rom from AOSP"
So you mean an aftermarket os like lineageos or carbonrom or do you mean that you take the aosp repo and compile aosp for your device? You can look in source.android.com
"source code and files from other custom rom that makes camera work"
Is that an already compiled rom? Because you won't get source code out of that
"How can I build it and be sure that everything will work"
Ya don't. Nothing can ever be 100% bugfree, it can either be from your device tree's source code, or the aosp code itself.
Generally, if there is a caf tree for your device, it's going to be 3x as hard to create an aosp tree.
It is going to be 100000x as hard to create an aosp tree that is for a newly released, new hardware requirement operating system.
Wanna know the topping of the cake? Mediatek is notorious when it comes to releasing the source (in fact, it has become a meme in the Mediatek users world) but don't let that stop you son.
You can try, but don't give up just because it won't compile the first couple of hundred times. The errors when compiling should give you a great start
Good luck.
ramiabouzahra said:
"I'd like to build my own rom from AOSP"
So you mean an aftermarket os like lineageos or carbonrom or do you mean that you take the aosp repo and compile aosp for your device? You can look in source.android.com
"source code and files from other custom rom that makes camera work"
Is that an already compiled rom? Because you won't get source code out of that
"How can I build it and be sure that everything will work"
Ya don't. Nothing can ever be 100% bugfree, it can either be from your device tree's source code, or the aosp code itself.
Generally, if there is a caf tree for your device, it's going to be 3x as hard to create an aosp tree.
It is going to be 100000x as hard to create an aosp tree that is for a newly released, new hardware requirement operating system.
Wanna know the topping of the cake? Mediatek is notorious when it comes to releasing the source (in fact, it has become a meme in the Mediatek users world) but don't let that stop you son.
You can try, but don't give up just because it won't compile the first couple of hundred times. The errors when compiling should give you a great start
Good luck.
Click to expand...
Click to collapse
Oh God, how am I meant to do this ;0 There is Lineage 14.1 project on my device. I really want to have android 8 on my phone. Thank you for all the advice.
Yes im trying the same andere without any succes so far.
Im also trying to port from a different device ROM to the stock ROM what im running now.
The chip sets are the same but the Android versions not.
It would be really Nice if some mtk ROM developer find some time in his busy life to create a ROM for our phone.
Or a guide to compile/port Android o tot oud phone.

Categories

Resources