-
Notifications
You must be signed in to change notification settings - Fork 3
/
9810-building-aosp
66 lines (53 loc) · 3.71 KB
/
9810-building-aosp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
## Welcome to 9810 AOSP Building guide!
## All of below lines are my experience while building AOSP for 9810 devices. If I wrong something below, please send me a message for me to fix.
1. Requirements
To build AOSP on 9810 devices, you must prepare:
+ A Linux environment (Ubuntu 18.04 upper is recommended!).
+ A 6-cores CPU and 16GB RAM or higher.
+ A good network! (Because you will need to sync 100GB+ of sources)
+ 300GB or upper storage.
+ Basic knowledge about git.
+ Command Line: via CodeAcademy.
*Notes: /// is a command line in linux.
2.Steps
+ Setting up building environment:
- First, you will need the building environment before building. Luckily, we have Akhilnarang's scripts, which is more easier for us to setting up.
- We need to clone his scripts on Github by doing this:
/// git clone https://github.com/akhilnarang/scripts
- This should copy all the scripts into /home/username/scripts
- Then we need to navigate into that folder by doing this:
/// cd scripts/setup
- Then we need to lists out the directory:
/// ls
- Find the file that corresponds to our Linux build. Since we are using Ubuntu it will be android_build_env.sh. For other Distros refer to the readme that has also been cloned.
-Run the scripts:
/// . android_build_env.sh
+ After all of the scripts are synced, we will need to setup Github by doing this:
/// git config --global user.name "your name"
/// git config --global user.email "youremail@example"
+ Syncing the sources
- This is one of the worse step, you have to wait for a long time, depends on your network xD
- Check the ROM you want to build, then we will make a directory for the sources (at here, I'll take LineageOS for an example, you can change the name of the directory as you like):
/// mkdir "ROMNAME" (example: mkdir lineage)
- Then we will navigate that directory:
/// cd "ROMNAME" (example: cd lineage)
- You will have to check the command line to sync all the sources by looking on their Github. Usually, The repository initiation command can be found on the GitHub page under “manifest” then scroll down to repo initialisation and copy command.
- It should look like this:
/// repo init -u git://github.com/LineageOS/android.git -b lineage-19.1
- Then download all the sources:
/// repo sync -f --force-sync --no-clone-bundle --no-tags -j$(nproc --all)
- Let everything download!
+ Getting devices trees:
- For 9810: you may have a look into our organization for all trees at here: https://github.com/universal9810
- Tip: https://github.com/universal9810/local_manifests (All trees that we used to build is at here)
+ Modifying the trees for ROMs:
- There are 3 things that you need to notice at here: romname_device.mk, romname.dependencies, AndroidProducts.mk.
- So how to modify it to build the ROM you want?
- Easy, let's take Lineage 19.1 as an Example:
+ Now you can look into any official Lineage(or the ROM you want to build) device: at here we use beyond1lte as an example. (https://github.com/LineageOS/android_device_samsung_beyond1lte/tree/lineage-19.1)
+ In AndroidProducts.mk, you can see all has been changed into lineage_device.mk, so do the same for our device.
+ lineage.dependencies, just rename the file and don't touch anything in it.
+ lineage_beyond1lte.mk: you will need to change (necessary) PRODUCT_NAME into our 9810 devices (Example: PRODUCT_NAME := lineage_crownlte) and also the name of the file into lineage_crownlte and this line: $(call inherit-product, vendor/lineage/config/common_full_phone.mk)
- Now return to your rom repo, resync.
3. Build
+ Just . build/envsetup.sh in your repo and lunch romname_device.mk-userdebug and use the build command following ROM's specific and all should be done!