[Q] How to add new device tree,new kernel source code to CM source & compile? - Android Q&A, Help & Troubleshooting

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?

Related

[Q] What are the steps to port a ROM to an unsupported device?

First a short question. What is the device configuration.(For example:https://github.com/TeamICS/android_device_htc_heroc) Which information does it contain? I don't think it's the whole Rom, but they update it, change stuff and so on?
Now my actual question:
I want to port a Kernel+System on an unsupported device.
Where do I have to start. Is there a difference between building it from source or port one from a similar device? Is one solution slower, more complicated or anything? There are many tutorials for porting, just bundle a system with a working kernel, but what to do if I want to have the Kernel also?
How do I extract the Device Proprietary Files without an github of the device?
Links, short explanation of the steps or anything else would be helpful.
I am sorry if this post seems to be ill informed, but I am searching and searching and can't find really helpful information..
chaoskoch said:
First a short question. What is the device configuration.(For example:https://github.com/TeamICS/android_device_htc_heroc) Which information does it contain? I don't think it's the whole Rom, but they update it, change stuff and so on?
Now my actual question:
I want to port a Kernel+System on an unsupported device.
Where do I have to start. Is there a difference between building it from source or port one from a similar device? Is one solution slower, more complicated or anything? There are many tutorials for porting, just bundle a system with a working kernel, but what to do if I want to have the Kernel also?
How do I extract the Device Proprietary Files without an github of the device?
Links, short explanation of the steps or anything else would be helpful.
I am sorry if this post seems to be ill informed, but I am searching and searching and can't find really helpful information..
Click to expand...
Click to collapse
First off what device do you have?
This link might be helpful
How to Port Android to Another Device
Now in regard to your questions i'll do my best to answer them best I can. The device configuration think of it as a fingerprint every fingerprint is unique (Although some a very similar), basically when building from source is tells the build what device you want the version of android your compiling to run on. They update and change the device configuration to reflect changes in the different versions of Android (Going from Gingerbread to ICS for example). Porting Kernels is not easy if you don't know C, things about embedded systems, basic Linux knowledge, among other skills but take a look at Guidance regarding Kernel porting, and what do you mean by port system? Here is a basic place to start for kernels AOSP Building Kernels and Building Your First Kernel. Yes their is a difference between porting a kernel and building from source, porting implies taking a kernel from device A and porting it to device B, while building from source means your building directly for device A. Porting in your case is probably going to be harder then building from source. If you want to have the kernel also again you have to modify it to run on the device you are porting it too. To extract proprietary files you have to hook your device up to your computer, turn on usb debugging, and using ADB run these commands:
Code:
cd ~/android/system/device/motorola/sholes/ # Replace Motorola and Sholes with your vendor such as HTC, Samsung, etc. and your device codename
Then run:
Code:
./extract-files.sh
Look at this guide for more info Compiling ICS from Source. Hope this helps you in some way :good:.

[Q] Build a Custom ROM using only kernel source?

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:

[Q][Help]Trying to Create Device Tree for ROM Building

Hello,
I'm trying to build a device tree for the Samsung Galaxy Tab A 9.7 (gt510wifi), by following CyanogenMod's porting guide here. I've managed to get a basic device tree going inside CM12.1's source tree, but I'm stuck at the part where I need to create the extract-files.shand the setup-makefiles.sh. The guide says to use other device trees as a reference for creating these scripts, but from what I can tell, each script is vastly different due to device discrepancies, and I'm unsure what to do at this point. I've searched everywhere online, but there doesn't seem to be any documentation whatsoever on how to create these files.
I'm no stranger to porting ROMs, as I've built SlimLP for my other devices, but I always had a pre-built tree created by another developer that I simply renamed files in to get it to work with SlimLP's sources.
Any help is greatly appreciated

Willing to build Lineage OS... But will require community help

As there is no interest nor popularity on this device to stimulate a healthy developer community, I have decided to look into ROM building and what is required. I have followed this three part video in explaining how to build Lineage OS from source to a device. I have made it to part two where I download the Lineage OS source code to my Linux work-space. Where I get stuck is adding the source to the ROM. The question now is How do I attach the Lineage OS source code to the kernel source code for this device?
Information sources...
Part 1 https://www.youtube.com/watch?v=iZmjOlUq_3c&t=1s
Part 2 https://www.youtube.com/watch?v=MGI3NSJFtKA
Part 3 https://www.youtube.com/watch?v=AJCgOHtli64&t=153s
Current Kernel source code from Asus https://www.asus.com/ca-en/Phone/ZenFone-4-ZE554KL/HelpDesk_Download/
Just ordered one. I've never built Lineage OS either, but maybe we can work together to figure it out.
I have the lineage OS sorce code ready to compile on my system. I just need to know how to add the nesary kernel with it. Any ideas?
Any progress?
Sent from my [device_name] using XDA-Developers Legacy app
Nope! Unless you have anything to contribute.
someaguy said:
As there is no interest nor popularity on this device to stimulate a healthy developer community, I have decided to look into ROM building and what is required. I have followed this three part video in explaining how to build Lineage OS from source to a device. I have made it to part two where I download the Lineage OS source code to my Linux work-space. Where I get stuck is adding the source to the ROM. The question now is How do I attach the Lineage OS source code to the kernel source code for this device?
Click to expand...
Click to collapse
I also looked into building Lineage, seems like it's going to be more than I'm willing to commit to, so I'll share what I found in hopes that it will help you or anyone else move forward with this.
I found this restored CM wiki page on the subject: fat-tire.github.io/porting-intro.html (Sorry, can't make it clickable since I'm new)
The gist seems to be that you need to make three directories in the lineage source (note z01kd appears to be the codename for the Zenfone 4 based on the build.prop file I pulled from my phone)
device/asus/z01kd - Device file tree
kernel/asus/z01kd - Kernel
vendor/asus/z01kd - Proprietary blobs
In the above CM guide, it says to use ./build/tools/device/mkvendor.sh to generate the Device file tree from a boot.img file extracted from an update.zip (from Asus) or extracted from the phone, but that didn't work with the version I was trying to do (15.1), mkvendor.sh wasn't there at all. So I explored option #2 which was to fork an existing device file tree repo from a similar device and tweak it for the device you want to port and I found that the Zenfone Max Pro M1 (X00TD) (github.com/LineageOS/android_device_asus_X00TD) is the closest lineage supported device that we could copy from (at least that I could find). It looks like you might even be able to use the same kernel as that device (github.com/LineageOS/android_kernel_asus_sdm660) because the SOCs are pretty close (Snapdragon 630 vs Snapdragon 636), but you may need to use the stock kernel that you linked to in your original post, not sure.
There's a part in the lineage docs about building from source (only for supported devices) (wiki.lineageos.org/devices/X00TD/build#extract-proprietary-blobs) about extracting proprietary blobs (wiki.lineageos.org/extracting_blobs_from_zips.html) for the vendor/asus/z01kd folder. It said that you could use a lineage update.zip, but I was able to do it with the Asus update.zip. Don't know if that will work or not, but it seems like the only option since the Zenfone 4 doesn't have a lineage update.zip to pull proprietary blobs from.
And that's about as far as I got
Once you have those three folders set up and properly configured you should in theory be able to build it.
Update 9/3/2018
I just found the device file tree and kernel for Zenfone 4 that @shakalaca used to build TWRP. Looks like there are some different naming conventions from what lineage would expect (omni_Z01K.mk vs lineage.mk), but a lot of the stuff looks to be the same (eg BoardConfig.mk) and the files that do have a different name look like they're roughly equivalent.
github.com/TeamWin/android_device_asus_Z01K - Zenfone 4 TWRP device file tree
github.com/shakalaca/android_kernel_asus_ze554kl - Zenfone 4 TWRP kernel
Between these and the above X00TD device file tree and kernel links, we should be able to get pretty close to a working config.
What if you compile what you have and see if it boots on your device?
someaguy said:
What if you compile what you have and see if it boots on your device?
Click to expand...
Click to collapse
Sorry...I already deleted the environment I had set up, to reclaim the 50+ GB of disk space.
If it's any consolation, I never made it far enough for it to build successfully.
I am trying to build Lineage OS too
In this guide(https://forum.xda-developers.com/chef-central/android/guide-android-rom-development-t2814763)
It says we need three files(device tree,kernel,vendor) to build it.
We have kernel and device tree from github(https://github.com/TeamWin/android_device_asus_Z01K)
but we still need vendor from our device,and the commend under this guide(https://www.isthnew.com/archives/build-lineageos.html) says that we can get vendor files by running "extract-files.sh".
But where can we find that?
(Sorry for my bad English
rol.
try to look here.https://forum.xda-developers.com/pr.../tool-capire-le-treble-terble-vendor-t3774629
I have tried that CLT project,but it didn't work
Maybe use this?
https://forum.xda-developers.com/axon-7/development/tool-party-v0-1-vendor-partition-t3831517

what software/packages do you need to get a specific device working from AOSP stock

hello again peeps,
ive been gently banging my head around these past few days because i keep walking into knowledge pockets and nothing i can find, in the form of help or internet information, is filling in these holes. i originally planned to take my oneplus device and obtain the source code for oxygenos so i could build and customise it. this seems to have become a dead end so now i just want to build stock android via AOSP, but i dont understand what software i need to get the AOSP working on any device, so far i understand that you need 3 components; 1) Kernel 2) Vendor files (if any) 3) "Proprietary binaries".
The problems are, i have no idea how to obtain these "proprietary binaries", i have no idea where to put any 3 of them in the downloaded android source tree (after repo sync), and i dont know if thats all the information i need to atleast build and flash a stock image onto any phone. i think i have the kernel files i need on OnePlusOSS github and there is a vendor.img in the OTA update files, and a directory in my phone. if anybody could please guide me in the right direction, it'd be very cool. i just want to get started and have some fun.
0
Seppppx said:
You can't customize Oxygen Os as the source code doesn't exist for that. (It's not required for companies to publish that.)
What phone do you have? You already might have the required trees to build AOSP (or at least LineageOS)
You need
1. A Device Tree
2. The kernel (you can use the prebuilt kernel if you really want)
3. The proprietary vendor blobs located in the vendor partition.
You will probably have to download the aosp-caf source code instead of aosp for it to be more easy.
https://www.youtube.com/channel/UCnGqG_jyyXmTzdamBpKfeHA
This is a great channel about Android building and has about everything you need to know.
Click to expand...
Click to collapse
thank you for every inch of text in your reply. I have a oneplus 8. Ah right, so the vendor folder CONTAINS the proprietary binaries/blobs.
it seems safest for me to use the kernel in the manufacturers github for the first flash as i want to be careful with making changes. may i ask what "aosp-caf" is? or can i find out using the resource you provided? thank you again.
my new understanding is, you need; 1) android source (e.g android-10-r5) 2) kernel 3) proprietary blobs. this helps a lot and is a lot clearer. the last issue i have is with knowing where to put the kernel and the blobs. i think if i am not mistaken you put the blobs in a vendor folder after the build? i am unsure with the kernel. i am going to definitely check this guy out. your time means a lot to me.

Categories

Resources