How to create device tree? - Android Q&A, Help & Troubleshooting

How to create device tree for a phone from scratch?

Grab another device's tree (one that's similar to your device) and modify it to make your own....

I think you're already found how a device tree works. But here is a nice post with some good links in it. Just for others looking for the answar: http://forum.xda-developers.com/showthread.php?t=1906691

Related

Vendor Tree

So, I've looked at every vendor tree that I can find. Not all of them are set up the same, but that appears to be taken care of via the .mk files. I really want to help some folks with an Eris vendor tree. Is there anyone out there who can and will explain a few things to me?
1) What proprietary files can we leave in the repo, if any? I've seen at least one repo that seems to have some proprietary binaries in it, but then uses the extract-files.sh to pull the rest. I just don't get where the line is. Maybe they don't either?
2) Why can't we put all of the proprietary files in the repo? If we're building the ROM, and we're just going to put them on the ROM and post it anyway...
(I get copyright issues, but posting them in the ROM and posting them in the repo seem to be pretty much the same to me. )
Thanks!
I would like to know the same thing.
I would also like to see a detailed "map" of the files in a "generic" rom
I have tried making sense of them by looking inside, but I am having a hard time telling if the files I am seeing are generic Android, device specific, or extra files someone threw in to customize the rom
I think a good start would be a list of the minimum files required to get Android running on a device along with a description of what each file (or at least each group of files) does.
Then maybe later add a description of the optional packages.
ROM chefs could then use that list as a starting place and add the specific information for the device they are cooking for.
Anyone know of a list like this or maybe one that is at least partially complete so that we wouldn't have to start from scratch?

Starting a device specific repo, trimming the fat

I've got source for the JXD S7300, and will be monkeying around with it. The source JXD released contains a ton of stuff that isn't needed, since it seems like they just started from whatever Google released, and added their own stuff where necessary.
The built script uses lunch -7, if that matters. Has anyone figured out an easy way to clean up the source tree when building for a specific device, to exclude all hardware-specific files/directories that do not apply to the hardware being built for?

About QC table of device tree

Hi!
Now I have got the boot.img of my device from ZTE (my mobile is ZTE A460).
I undersand that it includes header, kernel, ramdisk, second, and device tree. In fact, I have written a script for getting the data (see: github: jbgg/xbootimg). That script works for my mobile phone at least.
With that data, I have extracted the device tree. But this device tree is not a dtb as is documented in Linux kernel: Documentation/devicetree/booting-without-of.txt, where the magic number is 0xd00dfeed. Instead I have found the magic number 'QCDT', searching in google, I only have found two (similar) documents about QC table of device tree (github: xiaolu/mkbootimg_tools and github: sonyxperiadev/mkqcdtbootimg). But I didn't found official documentation. Where is the official documentation about QC table of device tree?
Maybe the last question could be easily answered if more information about how the /boot partition is reading. The /boot partition is reading by bootloader, is the boot loader who read the QC table of device tree and choose one device tree blob for boot the kernel? Or what is design a table of device tree for?
Bosco.
Sorry, I can't post url because I don't have 10 post or more.
Maybe this is a wrong place to ask.
Where can I ask information about this?
Hey i have the same device and i try give support to this phone, at the day the A460 only have CM12.1 and CM13 stable, how i can comunicate in private?
zjbggz said:
Hi!
Now I have got the boot.img of my device from ZTE (my mobile is ZTE A460).
I undersand that it includes header, kernel, ramdisk, second, and device tree. In fact, I have written a script for getting the data (see: github: jbgg/xbootimg). That script works for my mobile phone at least.
With that data, I have extracted the device tree. But this device tree is not a dtb as is documented in Linux kernel: Documentation/devicetree/booting-without-of.txt, where the magic number is 0xd00dfeed. Instead I have found the magic number 'QCDT', searching in google, I only have found two (similar) documents about QC table of device tree (github: xiaolu/mkbootimg_tools and github: sonyxperiadev/mkqcdtbootimg). But I didn't found official documentation. Where is the official documentation about QC table of device tree?
Maybe the last question could be easily answered if more information about how the /boot partition is reading. The /boot partition is reading by bootloader, is the boot loader who read the QC table of device tree and choose one device tree blob for boot the kernel? Or what is design a table of device tree for?
Bosco.
Sorry, I can't post url because I don't have 10 post or more.
Click to expand...
Click to collapse
I have found the official documentation in LittleKernel source, sorry I can't write the url (because rules of this forum). If you want it, ask me.

Linux NOOB; Where to extract Device Tree, Vendor, Kernel?

I'm running Ubuntu 16.4 in VirtualBox and I'm trying to follow this guide for creating a custom ROM. Problem is, I am completely new to Linux and I'm literally copying and pasting command line. I don't understand what everything does. I'm just kind of doing it for now, learning as I go. So far, everything has worked fine. But now, I'm stuck at this part:
Now before starting with Building guide you have to Download your Device Identity That is has follows
1) Device Tree
2) Vendor
3) Kernel
The Above files are very Vital Parameters of building they specify your device and its Characteristics.
Now you might think from where you have to download those files?
Don't be confused its simple Search in our device forum for CM Tree and Kernel and Vendor. The Dev of CM for your Device forum will specify it in his ROM thread.
Click to expand...
Click to collapse
I found my device's device tree on github: https://github.com/j03lpr86/android_device_samsung_afyonltetmo
What do I do with it? Download the zip and put it somewhere and then extract it somewhere? If so, where? Or do I use the "Clone with HTTPS" link? If so, how do I execute it in the terminal?
Same questions with the vendor I found: https://github.com/j03lpr86/android_vendor_samsung_afyonltetmo
As for the kernel, what do I do for that? XDA doesn't have my device listed (Galaxy Avant). I downloaded the stock ROM from Sammobile. Do I extract kernel.img from that? If so, where do I place it?
There are just too many assumptions that the author of the guide makes and I don't understand what to do at this point.
have you looked on git hub for them?

Porting AOSP to custom-built device

Hi everyone,
as title suggests, I'd like to "port" clean AOSP to be able to install and run it on the custom device.
Basically, the situation is following: I got a custom device, based on rockchip rk3288 SoC. The device currently runs Android 5.1 successfully. I'd like to update Android to version 6 (got AOSP sources and AWS builder image up and running), but the company that created Android v5 for us no longer exists.
Thus I am here to ask for advice(s) on how to proceed (or whether it even is a good idea to do that myself, given the fact that I have zero experience with Android ROMs development), possibly a step-by-step guide on what to do.
The question is, do I just find drivers for hardware components present in the device (usb hub, ethernet, etc.) and just somehow "link" those to existing sources (of AOSP) and just run the build with different parameters? Or do I need to build a whole new kernel for the given device-OS combination?
Thank you for any advice or opinion!
Well this is an interesting one. There are several routes you can take here.
If you have the kernel source code, and the source code for the drivers, you could probably build the kernel from source and use it to boot Android, however, as that's unlikely, you're looking at a more regular porting process, which usually consists of pulling the vendor blobs from the existing Android system, building AOSP/Lineage with those blobs involved, and hacking together a new ramdisk that HOPEFULLY will be compatible. It's a very long and very tedious process, but it's certainly possible.
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
abtekk said:
Well this is an interesting one. There are several routes you can take here.
If you have the kernel source code, and the source code for the drivers, you could probably build the kernel from source and use it to boot Android, however, as that's unlikely, you're looking at a more regular porting process, which usually consists of pulling the vendor blobs from the existing Android system, building AOSP/Lineage with those blobs involved, and hacking together a new ramdisk that HOPEFULLY will be compatible. It's a very long and very tedious process, but it's certainly possible.
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
Click to expand...
Click to collapse
Thanks for pointing in the right (or at least some) direction! I found some guide on porting ROMs which I followed, basically like you said. So I just replaced some files in System image. Will flash later today, so maybe I will get some results!
abtekk said:
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
Click to expand...
Click to collapse
So I was following this tutorial, although found some irregularities, let's say: For example, none of those 2 folders contained init.d/ directory, thus I didn't update it. Also, I haven't found META-INF folder therefore haven't updated updater-script.
Basically, when I did (or at least what I think I was doing was that I took /system partition from our current ROM, that is working on that custom device and replaced stuff in there by stuff from the new system I wanted to port. My idea from what I've read was that i took kernel (and boot/recovery) from the original, working ROM and "injected" the new system onto it. Is that correct? Is that what I needed to do? Because the problem is, I cannot boot into the system (might as well be because of Kernel version, because I am trying to port Android 6 on Kernel 3.10. which was used in the current ROM running Android 5). It looks like the device is stuck in bootloader, or "somehow doesn't know what to start" (sorry, I can't put it better), displaying only my device's logo.
When I connect it to the computer via USB cable, running adb devices shows me that device, but when I try to access shell using adb shell I got error saying that /system/bin/sh wasn't found, which made me thinking that somehow the /system partition isn't "linked" properly, like I stated in the beginning.
Was I doing everything correctly? Do I need to do something above that? (maybe do you know about some tutorial). I am trying to port AOSP 6 Android.
Thank you!

Categories

Resources