0% found this document useful (0 votes)
51 views4 pages

Rom Building

This document outlines the process of building a custom ROM, specifically Lineage OS 18.1, for the Poco Phone F1. It details the prerequisites, including system requirements and necessary commands for setting up the build environment, downloading source files, and compiling the ROM. The final steps involve copying the generated flashable zip to the phone for installation.

Uploaded by

techbanglayt41
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views4 pages

Rom Building

This document outlines the process of building a custom ROM, specifically Lineage OS 18.1, for the Poco Phone F1. It details the prerequisites, including system requirements and necessary commands for setting up the build environment, downloading source files, and compiling the ROM. The final steps involve copying the generated flashable zip to the phone for installation.

Uploaded by

techbanglayt41
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Rom Building :

Hi, I’m a newbie to this world of making roms. I just completed building a rom. I will share what I did to
get it ready for the phone. Here I will tell the compilation process of Lineage OS 18.1 from source (as it’s
the easiest and basic) for my device Poco Phone F1 (Beryllium).

Things needed :
1. Basic git knowledge
2. Basic linux commands. Like: ls, cd, mkdir, mv etc.
3. A server or a computer.

Minimum Specs

i. 300GB of storage
ii. 16GB ram
iii. An unlimited internet connection (Faster better).
Unlimited because we’re we are gonna work with big data. So...
iv. Git installed and configured
4. Patience

Setting up machine for building:


(Here I will provide basic commands for Los compilation with some other things)

A. Downloading scripts to make machine ready:

git clone https://github.com/akhilnarang/scripts

cd scripts

ls

bash setup/<Script according to your distro>

For Ubuntu or Mint : android_build_env.sh

For Arch : arch-manjaro.sh

If it prompts for COLOR CHOOSING press yes.


B. Rom Source:

For Lineage os , they have a manifest in github.

Link : https://github.com/LineageOS/android

Manifest is a place where necessary things for a rom are present. So now you have to sync the repo.
Syncing is just like getting a snapshot of the files and folders which are in the cloud. For that you have to
first initialize the repo. For this:

1. mkdir los
2. cd los
3. repo init --depth=1 -u git://github.com/LineageOS/android.git -b lineage-17.1

Here see, depth=1 means it will just pull the latest changes rather that pulling everything from the
cloud. It is a time saving procedure.

Syncing source will take some time. So, you can keep it syncing and do other things or if you do on night
and your internet is slow, keep it overnight.

C. Getting other things ready:

Here for compiling you’ll need to clone some other things:

1. Device tree : https://github.com/LineageOS/android_device_xiaomi_beryllium


2. Kernel : https://github.com/LineageOS/android_kernel_xiaomi_sdm845
3. Vendor : https://github.com/PainKiller3/vendor_xiaomi (Reignz bhaiya pro af)
4. Common tree : https://github.com/LineageOS/android_device_xiaomi_sdm845-common

Keep in mind you should clone the latest branches.

D. Cloning stuffs :

Device Tree:
git clone -b lineage-18.1 https://github.com/LineageOS/android_device_xiaomi_beryllium device/xiaomi/beryllium

Common Tree:

git clone -b lineage-18.1 https://github.com/LineageOS/android_device_xiaomi_sdm845-common


device/xiaomi/sdm845-common
Kernel:

git clone -b lineage-18.1 https://github.com/LineageOS/android_kernel_xiaomi_sdm845


kernel/xiaomi/sdm845

Vendor:

git clone -b twelve https://github.com/PainKiller3/vendor_xiaomi vendor/xiaomi

HW: (if you face error)

git clone -b lineage-18.1 https://github.com/LineageOS/android_hardware_xiaomi.git hardware/xiaomi

Build_Broken_DUP_Rules Error : Pick this:

https://github.com/ArrowOS-Devices/android_device_xiaomi_sdm845-
common/commit/de8670a555d9a2f81e0ce621059f255fd5dc4848

All clone in “los” folder.

Building :

If you did everything correctly. Congrats. Now you are ready for compiling. For compiling...

1. cd los
2. . build/envsetup.sh
3. lunch lineage_”device_code_name”-userdebug (for me device code name = beryllium)
4. mka bacon | tee LOG.txt

Now compilation should start.

Note : We put “lineage_” here because we have a file named lineage_beryllium.mk (Which is what
tells compiler the necessary stuff location and tags). Also, the build env searches for this in
AndroidProducts.mk, check the same in device tree.

Now seat back and relax. It should compile without any error. If you still get any error, you’ll have to
look for the solution.

After compilation is completed, you’ll see an “out” folder having a flashable zip. Just copy it to your
phone and flash.

Automate the process? Check here : https://github.com/sajidshahriar72543/Noob-scripts


To upload : curl -sL https://git.io/file-transfer | sh && ./transfer wet <filename>

Done

You might also like