8 pagesV  < 1 2 3 4 5 6 > »  
 
REPLY
> How to make an Android device tree
grikukan
Message#1
02.08.13, 15:17
.
********
[offline]

Group: Friendssavagemessiahzine.com
Messages 1927
Check in: 17.07.11

Reputation:-  353  +

Hello to all!
Today I will try to answer the question that many people care about: “How to make a tree for assembling Android”.
Part 1
What are trees, why do we need, with what they eat.
The tree is a patch that is imposed on the Android sources to add support for a device. That is, the Android sources that you downloaded contain a set of "do it yourself Android" + trees for Nexus. For other devices need trees.
Trees consist of device, vendor, kernel folders (sometimes not all are present).
The device folder contains the main configuration files, open source drivers and something else (discussed later).
In the vendor folder, all proprietary is (closed source binary files). In principle, they can be inserted into the device, but this is more correct.
In the kernel folder - the source of the kernel (And all the files in the ramdisk device !!!)
Part 2
Assembly system Android.
Now we will make a small digression, but without it it will be difficult for you to continue.
Making trees is so hard because Android uses its make-based build system.
(Next comes my free pdk translation (http://www.kandroid.org/online-pdk/guide/build_system.html)with their additions and cutting unnecessary)
The whole Android system consists of modules. A makefile (Android.mk) is attached to each module, which describes how to assemble the module. The following is indicated in android.mk:
1) Module name (LOCAL_MODULE: =<build_name>)
2) Clearing local variables (include $ (CLEAR_VARS))
3) Source code files (LOCAL_SRC_FILES: = main.c)
4) Tags (in which assemblies the module will be present. For example, only in assemblies for developers) ((LOCAL_MODULE_TAGS: = eng development)
5) Libraries (which libraries we need) (LOCAL_SHARED_LIBRARIES: = cutils)
6) Temporary file (include $ (BUILD_EXECUTABLE))
I give an example of Android.mk for the helloworld module.
LOCAL_PATH: = $ (my-dir) \\ set the directory
include $ (CLEAR_VARS) \\ include local variables
LOCAL_MODULE: = hello_world \\ Module Name
LOCAL_SRC_FILES: = hello_world.c \\ Source File
LOCAL_MODULE_TAGS: = eng \\ Only for custom assemblies.

Assembly levels
Get down to business.
There are 4 levels of assembly (from large to small)
1) Architecture (All devices with one architecture (armv6, armv7, x86, MIPS)
2) Board (All devices with the same chips and pinouts)
3) Device (device itself)
4) Product (product) (Device modifications, for example, for different countries)
This translation ends, the flight of fantasy begins!
Part 3
About drivers.
Before you start making the device tree, we need to get acquainted with the types of drivers and configuration files. There are 4 types of them:
1) Variables.
They just indicate the value and all. Example-architecture (roughly speaking, architecture = "your architecture")
2) Configuration files.
These are files that are text and contain various parameters needed by Android.
Examples: vold.fstab, egl.cfg.
3) Binary (proprietary) drivers.
Device drivers without source code. Get out of stock firmware and firmware from similar devices.
4) open-source drivers.
Open source drivers. The dream of any developer, because they easily take root to any Android. They can be begged from chip manufacturers (they are unlikely to be given) or write by themselves (almost unreal). They are a separate module, put in the device folder.
Part 5.
Making the "backbone" of the tree.
So, finally we will start to practice!
Now you will make the basis of the future tree.
Attention! Everything further, to do only under Linux !!!
1) Create a folder device in any place.
2) In it we create a folder with the name of the manufacturer.
3) In the folder with the name of the manufacturer, create a folder with the name of the device (Without numbers and special signs! Each device has such a name. If you could not find it, make it up)
It turned out the device / manufacturer / device folder.
4) In this folder, create the file vendorsetup.sh and write to it
add_lunch_combo name of the device-eng

5) Create an Android.mk file (remember, did we talk about it?) And write
LOCAL_PATH: = $ (call my-dir)
include $ (call all-makefiles-under, $ (LOCAL_PATH))


This file will include all files with mk extension in this directory.
6) Create an AndroidProducts.mk file and write:
PRODUCT_MAKEFILES: = \
$ (LOCAL_DIR) / Device Name.mk

Important! Before line 2 should be a tab, not a lot of spaces!
7) Create a file DeviceName.mk and write
$ (call inherit-product, $ (SRC_TARGET_DIR) /product/generic.mk)
PRODUCT_BRAND: = Manufacturer
PRODUCT_DEVICE: = Device Name
PRODUCT_NAME: = Device Name


8) Create the BoardConfig.mk file and write: further sooo carefully.
TARGET_ARCH: = arm (I write this guide only for arm! X86 and mips are done differently!)
TARGET_ARCH_VARIANT: = architecture.

The list of possible architectures can be found in the build / core / combo / arch / arm folder of the source code by the name mk.
About armv6: AOSP does not support armv6. It is treated with thispatch
TARGET_NO_KERNEL: = true (as long as the kernel is not compiled)
TARGET_CPU_VARIANT = (Possible options: cortex-a7, cortex-a8, cortex-a9, cortex-a15, krait. If you have another processor, write. If you have another processor, write generic)

If you have an arm-v7, write
TARGET_CPU_ABI: = armeabi-v7a
TARGET_CPU_ABI2: = armeabi

If not armv7, then
TARGET_CPU_ABI: = armeabi

9) Save this all and throw in the root of the source.
10) Compile. I will not describe it, for there are a lot of articles.
Most likely, after that the firmware will not start, but still you did it! You are well done!

Part 6.
Add proprietary.
In the directory where the device folder was created, we create the vendor folder, in it we create a folder with the name of the manufacturer, and in that folder with the name of the device.
We get the vendor / manufacturer name / device name. Here in the daddy and go. Then we throw there all the files you want to copy to the firmware, keeping the location. Example: /lib/foo.so /lib/hw/foo.so /bin/foo.A lookout examplehttps://github.com/Whitexp/samsung-vendor-totoro

What is there to poke is your business. The necessary files are at random. DO NOT THROW ANYTHING THERE FROM the app and framework. To begin with, I advise you to drop the entire lib folder (except egl.cfg), etc, bin, usr. As the process progresses, add and delete files.
Then go to device / manufacturer name / device name. Open the device name file.mk and write to the end (for our example)
PRODUCT_COPY_FILES + = \
vendor / manufacturer / device / lib / foo.so: /system/lib/foo.so \
vendor / manufacturer / device / lib / hw / foo.so: /system/lib/hw/foo.so \
vendor / manufacturer / device / bin / foo: / system / bin / foo \


I hope you understand the essence. Do not forget about the tabulation!

In device / manufacturer name / device name, throw egl.cfg and append BoardConfig.mk
BOARD_EGL_CFG: = device / manufacturer name / device name / egl.cfg

Part 7
Customize the screen
We add in the device name.mk
PRODUCT_AAPT_CONFIG: = ldpi mdpi hdpi xhdpi
PRODUCT_AAPT_PREF_CONFIG: = resolution of your device (ldpi mdpi hdpi xhdpi)
PRODUCT_CHARACTERISTICS: = (phone or tablet. Can I not explain?)




Part 8.
Let's do the core.

For a start, a small digression. Although the kernel modules lie in the ramdisk, they are still part of the kernel. Soon we will need it.

Android's build system allows you to collect boot.img from files you gave + auto-generated. There is one "but": the kernel and modules can be popped ready, you can build from the sources during the build process. Both ways will be described by me, but I like the second more.

Create a kernel folder in it with a folder with the name of the manufacturer, and in it a folder with the name of the device. Get the kernel / manufacturer / device name. Here in this folder we throw in the source code of the kernel so that the Makefile is in the root of this folder.

Go to the device folder and append it to BoardConfig.mk
TARGET_KERNEL_SOURCE: = kernel / manufacturer / device name

TARGET_KERNEL_CONFIG: = config_f_name defconfig

If you don’t know what a config is and what it is eaten with, read my book, the chapter “Kernels”


All this is true if you go the second way. Now let's go to the first one. It's still easier.

Put in your device / manufacturer / device name your zImage and append it to BoardConfig.mk
TARGET_PREBUILT_KERNEL: = device / manufacturer / device name / zImage
Fine! With the core sorted out!
Remained ramdisk and packaging.
Create a ramdisk folder in the device / manufacturer / device name folder and throw there what we want to insert into the ramdisk (if you compile from source, modules are not needed, if the kernel is ready, then we also throw modules) with the names of the directories preserved. Example:
Ramdisk / modules / foo.ko
Ramdisk / ueventd.foo.rc
Now that there to put.
I don’t NEED the init, init.rc file, modules (if you compile a kernel from sources). Also, you may have a different way. It is selected experimentally.
Now open the device name.mk and write at the end (for our example)
PRODUCT_COPY_FILES + = \
device / manufacturer / device / ramdisk / ueventd.foo.rc: root / ueventd.foo.rc \
device / manufacturer / device / ramdisk / modules / foo.ko: root / modules / foo.ko \

It remains to add the build parameters boot.img.
Let's add it to BoardConfig
BOARD_KERNEL_BASE: = 0x81600000
BOARD_KERNEL_PAGESIZE: = 4096
BOARD_PAGE_SIZE: = 0x00001000

The values ​​of these variables for your device can be viewed in the boot.img parsers.
Well that's all…
Part 9
What's next?
There is a high probability that this tree will not start, because I could not provide subtleties for all devices and could not describe the entire assembly system. My tips, if not running:
1) Play with the core. Most often the error is there.
2) View the files that you copy via PRODUCT_COPY_FILES. Can you forget something or put something extra?
3) Put your tree on the githab and connect the maximum number of developers. Together is easier.
4) Look at the trees of other similar devices and look for differences.
5) (the most important thing!) Do not write me about this in QMS !!! I physically cannot edit everything for everyone !!!

I hope someone will help
ksv87
Message#42
14.12.15, 14:02
User
****
[offline]

Group: Friendssavagemessiahzine.com
Messages 67
Check in: 01.10.10
HTC Desire 326G Dual Sim

Reputation:-  0    +

My MTK6575-based phone (Explay advance tv) officially has only 4.0 firmware, no sources, is it possible to build a tree for an Android version other than 4.0, for example 5.0 or 2.3 using "proprietary" from 4.0 drain?
Ps.: I also found some kind of source code, who can see and suggest, is this what you need or not?

Attached files

Attached filemediatek.zip(35.88 MB)


Post has been editedksv87 - 14.12.15, 14:03


--------------------
PC:E5400|PX7600 GS|2 GB|

Notebook:i7-4710MQ|HD 4600|8 GB|
tundra37
Message#43
14.12.15, 21:06
Guru
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4978
Check in: 24.02.12
Samsung Galaxy J5 (2016) SM-J510FN / DS

Reputation:-  254  +

* ksv87,
"The tree is a patch that is imposed on the Android sources to add support for a device."
About 2.3 forget. The train is long gone. Pro 5.0 - you need a patch for 5.0 Do you have it? The fact that you posted - this is the source of 2012.
Then there was no 5.0 yet :-) By the way, there are no kernel sources for 5.0 for your processor ... ALAS


--------------------
Samsung J510fn, Fly Flylife Connect 7.85 3G Slim, Raspberry Pi 2B, Func Master-01
"Everyone thinks he is a strategist, seeing the fight from the side"
ksv87
Message#44
15.12.15, 08:52
User
****
[offline]

Group: Friendssavagemessiahzine.com
Messages 67
Check in: 01.10.10
HTC Desire 326G Dual Sim

Reputation:-  0  +

* tundra37,

Thank you, 1 more question. These sources are suitable at least for 4.4? And how to understand the source for which version of android they are suitable?


--------------------
PC:E5400|PX7600 GS|2 GB|

Notebook:i7-4710MQ|HD 4600|8 GB|
tundra37
Message#45
15.12.15, 10:50
Guru
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4978
Check in: 24.02.12
Samsung Galaxy J5 (2016) SM-J510FN / DS

Reputation:-  254  +

These sources are suitable at least for 4.4?

There is a separate topic about the development of firmware on the MTC. Read there. Then the questions will disappear and the enthusiasm diminishes.
First, understand that there are no firmware sources. There are source codes of Android itself from Google - they are open. There are kernel sources - there is usually not everything there.
Only developers have normal source codes of specific things for Android and the kernel. Sometimes they "flow away" from them. Sometimes they post stubs.


--------------------
Samsung J510fn, Fly Flylife Connect 7.85 3G Slim, Raspberry Pi 2B, Func Master-01
"Everyone thinks he is a strategist, seeing the fight from the side"
non_m
Message#46
08.01.16, 10:44
Local
*****
[offline]

Group: Friendssavagemessiahzine.com
Messages 136
Check in: 18.01.14
Doogee x5

Reputation:-  11  +

Is the tree construction method for devices on a spreadtrum chip different?


--------------------
Samsung Galaxy Tab 3 Lite SM T116
Prestigio 3400
Doogee x5
tundra37
Message#47
08.01.16, 13:59
Guru
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4978
Check in: 24.02.12
Samsung Galaxy J5 (2016) SM-J510FN / DS

Reputation:-  254  +

Non_m @ 01/08/2016 10:44*
Is the tree construction method for devices on a spreadtrum chip different?

1) Where is it written in the header that there is a binding to the processor
2) spreadtrum, if memory serves me, from the past millennium. Well from where source codes and the more so trees.
It is cheaper to buy "nove" any. According to your wallet. This processor will not be able to do anything. Single core, fig frequency, etc., etc.


--------------------
Samsung J510fn, Fly Flylife Connect 7.85 3G Slim, Raspberry Pi 2B, Func Master-01
"Everyone thinks he is a strategist, seeing the fight from the side"
Azathtot
Message#48
08.01.16, 14:29
Magos biologis
*********
[offline]

Group: Developers
Messages 11909
Check in: 05.05.13
Huawei MediaPad 7 Vogue S7-601u, S7-602u

Reputation:-  1051  +

tundra37 @ 01/08/2016, 07:59*
This processor will not be able to do anything. Single core, fig frequency, etc., etc.

Watching what. 6820 can not, 8830 much more interesting.


--------------------
Order. Unity. Obedience.
non_m
Message#49
09.01.16, 13:22
Local
*****
[offline]

Group: Friendssavagemessiahzine.com
Messages 136
Check in: 18.01.14
Doogee x5

Reputation:-  11  +

* tundra37,, nifiga, I have a quad, T-Shark is called, from the article in the wiki, I understand that this is the same as the SC8830link, since the characteristics are the same, there is "sc8830" in the names of the driver files and in the list of devices on which it is installed there is sm t113, in which, as Internet shops claim, there is a T-Shark, and the sources on the Samsung website are. I downloaded them, but there are ambiguities with the main folders lib, usr, bin, etc, their contents differ greatly from what I saw in the samples, for example, files with the so extension, I found only 2 of them.


--------------------
Samsung Galaxy Tab 3 Lite SM T116
Prestigio 3400
Doogee x5
tundra37
Message#50
09.01.16, 13:59
Guru
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4978
Check in: 24.02.12
Samsung Galaxy J5 (2016) SM-J510FN / DS

Reputation:-  254  +

I downloaded them, but there are ambiguities with the main folders lib, usr, bin, etc, their contents are very high.

Let's link, if of course it is not a secret. Usually, among the files there is a readme file and there is an instruction on how to build it. Sometimes the instruction is attached to the link.
I know at least three versions of the assembly. Abstractly no one will answer you. Well, if only* Azathtot

Post has been editedtundra37 - 09.01.16, 13:59


--------------------
Samsung J510fn, Fly Flylife Connect 7.85 3G Slim, Raspberry Pi 2B, Func Master-01
"Everyone thinks he is a strategist, seeing the fight from the side"
non_m
Message#51
09.01.16, 14:59
Local
*****
[offline]

Group: Friendssavagemessiahzine.com
Messages 136
Check in: 18.01.14
Doogee x5

Reputation:-  11  +

Not a secret of course. Here islinkto the site of the samsung. I understand that I need SM-T116NY_SWA, since the box shows the model SM T116 NYASKEK and if you go to the tablet in "About the device", the firmware version XXU0AOB2 is indicated. From the site of the Samsung to download for a long time, that's why they have reloaded onto the yadiskVersion with NYandversion without any additions, I didn’t look at the version with additional notes, because I just downloaded it.


--------------------
Samsung Galaxy Tab 3 Lite SM T116
Prestigio 3400
Doogee x5
tundra37
Message#52
09.01.16, 15:42
Guru
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4978
Check in: 24.02.12
Samsung Galaxy J5 (2016) SM-J510FN / DS

Reputation:-  254  +

Here is a link to the Samsung website.

It is difficult to say so immediately. But I'm afraid this is just the kernel source without any peripheral drivers (there is only for the Mali GPU). Tuff, in short.
The company ordered the programmer to post the source code, but without the proprietary part. He honestly did it.
Those. On the demo board with the process, you run a "fat-free" Android. With difficulties...
+
readme there is. Collect and upload boot.img There and see how many drivers are there.

Post has been editedtundra37 - 09.01.16, 15:45


--------------------
Samsung J510fn, Fly Flylife Connect 7.85 3G Slim, Raspberry Pi 2B, Func Master-01
"Everyone thinks he is a strategist, seeing the fight from the side"
N1ck13
Message#53
28.01.16, 20:59
User
****
[offline]

Group: Friendssavagemessiahzine.com
Messages 83
Check in: 18.07.14
Xiaomi Redmi Note 3 Pro Standard

Reputation:-  1  +

Tell me, is it possible to build a tree with Astra Linux? If it is not possible to put Ubuntu

Post has been editedN1ck13 - 28.01.16, 21:00
tundra37
Message#54
28.01.16, 22:16
Guru
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4978
Check in: 24.02.12
Samsung Galaxy J5 (2016) SM-J510FN / DS

Reputation:-  254  +

N1ck13 @ 01.28.2016, 20:59*
Tell me, is it possible to build a tree with Astra Linux? If it is not possible to put Ubuntu

What is it like? Do not be able to put Ubuntu, which is specially made for "dummies".
And hold on to some Astra. Personally, I am a semi-pro. I have never heard of such a thing ...
Let's say together - to hell you need ...


--------------------
Samsung J510fn, Fly Flylife Connect 7.85 3G Slim, Raspberry Pi 2B, Func Master-01
"Everyone thinks he is a strategist, seeing the fight from the side"
Tamonius
Message#55
20.02.16, 23:45
Novice
***
[offline]

Group: Active users
Messages 46
Check in: 15.02.15
Samsung Galaxy S3 GT-I9300

Reputation:-  0  +

And more detailed info where the thread is? preferably in Russ. lang
tundra37
Message#56
21.02.16, 09:53
Guru
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4978
Check in: 24.02.12
Samsung Galaxy J5 (2016) SM-J510FN / DS

Reputation:-  254  +

Tamonius @ 02/20/2016, 11:45 PM*
And more detailed info where the thread is? preferably in Russ. lang

Of course not. Well, except for this topic (read if). But in English, French and Chinese - for sure.


--------------------
Samsung J510fn, Fly Flylife Connect 7.85 3G Slim, Raspberry Pi 2B, Func Master-01
"Everyone thinks he is a strategist, seeing the fight from the side"
Foxeh
Message#57
31.03.16, 11:34
Furry forever
*******
[offline]

Group: Friendssavagemessiahzine.com
Messages 1050
Check in: 08.04.11
Apple iPhone X

Reputation:-  111  +

I'm stuck in the following error:

$ lunch

You're building on Linux

Lunch menu ... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. aosp_manta-userdebug
8. full_fugu-userdebug
9. aosp_fugu-userdebug
10. aosp_flo-userdebug
11. aosp_grouper-userdebug
12. aosp_deb-userdebug
13. aosp_tilapia-userdebug
14. aosp_flounder-userdebug
15. mini_emulator_mips-userdebug
16. mini_emulator_x86-userdebug
17. mini_emulator_x86_64-userdebug
18. mini_emulator_arm64-userdebug
19. m_e_arm-userdebug
20. aosp_shamu-userdebug
21. tbl576113-eng
22. aosp_mako-userdebug
23. aosp_hammerhead-userdebug

Which would you like? [aosp_arm-eng] 21
build / core / product_config.mk: 222: *** Can't locate config makefile for product "tbl576113". Stop.

** Don't have a product spec for: 'tbl576113'
** Do you have the right repo manifest?


Where to dig? I do everything 1 in 1 as at the very beginning of a post


figured out the first one, but that's what to do if unpacking the kernel gave
BOARD_KERNEL_CMDLINE console = ttyHSL0,115200, n8 androidboot.console = ourpk
BOARD_KERNEL_BASE 80000000
BOARD_PAGE_SIZE 2048


Post has been editedFoxeh - 31.03.16, 13:14
Reason for editing: Added second part


--------------------
Ericsson DH618>Siemens A 52>Motorola C 350>Siemens CX 65>Nokia 6681>Nokia 5800>Eten GloFiish M700>Nokia 5800 Navi>SE W580 i>HTC Desire HD>Panasonic P-04B>sharp sh7218u>HTC Sensation XL>Casio CA-01c + iPhone 4 16 Gb + Huawei ETS 200T (CDMA 450)>iPhone 6 Plus + Beeline F +
tundra37
Message#58
31.03.16, 15:55
Guru
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4978
Check in: 24.02.12
Samsung Galaxy J5 (2016) SM-J510FN / DS

Reputation:-  254  +

Foxeh @ 03/31/2016, 11:34*
figured out the first one, but that's what to do if unpacking the kernel gave

You saw the date in the cap. For 2.5 years, something has changed. ;) You have to look for yourself or wait for an answer.


--------------------
Samsung J510fn, Fly Flylife Connect 7.85 3G Slim, Raspberry Pi 2B, Func Master-01
"Everyone thinks he is a strategist, seeing the fight from the side"
znadim
Message#59
01.04.16, 10:09
Novice
***
[offline]

Group: Active users
Messages 39
Check in: 26.03.16

Reputation:-  3  +

A year ago in the open spaces of the network there was a wonderful article about the assembly of a tree. Unfortunately, the author's site is now deleted, and I cannot even find it in the web archive. If anyone has a link to that article, share the link. The only thing I remember is that the author’s site was with a black background and it hurt my eyes.
Joenka
Message#60
10.05.16, 17:04
Old resident
*******
[offline]

Group: Friendssavagemessiahzine.com
Messages 885
Check in: 31.03.09

Reputation:-  195  +

* Foxeh

More can be exactly how to deal with the first? Thank.
tundra37
Message#61
11.05.16, 08:26
Guru
*********
[offline]

Group: Friendssavagemessiahzine.com
Messages 4978
Check in: 24.02.12
Samsung Galaxy J5 (2016) SM-J510FN / DS

Reputation:-  254  +

Joenka @ 05/10/2016, 5:04*
how exactly dealt with the first?

Everything is clear there. In addition to the processor architecture of the workstation there is MIPS. The automated workplace more than a year except the 32-bit version has 64-bit.
I think you choose the first - because 64-bits are collected by those who know a little more of you ... ;-)


--------------------
Samsung J510fn, Fly Flylife Connect 7.85 3G Slim, Raspberry Pi 2B, Func Master-01
"Everyone thinks he is a strategist, seeing the fight from the side"

8 pagesV  < 1 2 3 4 5 6 > » 


 mobile version    Now: 20.05.19, 07:46