Untitled
raw download clone
TEXT
views 7
,
size 8007 b
---
layout: page
title: How to Build the /e/ ROM?
permalink: how-tos/build-e
---
## Definitions: Custom vs Unofficial vs Official
A **custom build** is a build that is using most of the /e/ source code to generate a new ROM. It can be modified in any manner by the developer, for any purpose.
An **unofficial /e/ build** is a build from the /e/ source code that is intended to generate the /e/ ROM for a new, not yet supported, device. It’s not been approved officially and is not included yet to the list of official /e/ ROMs. It can be published publicly tagged as "unofficial".
An **official /e/ build** is an unofficial build from /e/ source code that has reached a sufficient level of quality and has been validated. It has been published publicly as an official build on /e/ websites.
## Requirements for differents builds:
* **Custom builds**: if the source code has been modified and if the ROM is redistributed, we have several requirements:
 * any reference to /e/, including “/e/”, and our logo must be removed from the build
 * the redistribution must not let people think that it is /e/. **The name must be changed** and possibly say that it’s been forked from /e/
 * calls to our OTA server infrastructure should be removed
 * Custom ROMs can be built on /e/ servers only for exceptional reasons (special development…).
* **Unofficial /e/ builds**: source code can be modified only to reach full support on the target device. /e/ features, list of installed apps etc. shouldn’t be modified. Unofficial builds can be published on the /e/ website at a specific place with warnings and a list of what works/what doesn’t work. It doesn’t have nightly builds nor OTA updates.
* **Community builds**: the level of quality is considered high, security updates are applied if possible, but there is not yet or no more official maintainer. Community builds have nightly builds and can be updated OTA. Source code have to be hosted on our GitLab instance, or on trusted sources (LineageOS GitHub group, AOSP).
* **Official /e/ builds**: the level of quality must have reached our conditions. It must have an official maintainer. Official builds have nightly builds and can be updated OTA. Source code have to be hosted on our GitLab instance, or on trusted sources (LineageOS GitHub group, AOSP).
Any question about this? [contact us](https://e.foundation/contact/)
# How to build a ROM for an officially supported device?
> WARNING : This process will only work on **case-sensitive** filesystems!
> * Windows: will not work
> * macOS: doesn't work either for HPS+ filesystem - adfs not tried
> * Linux: work on Ubuntu and CentOS
> System requirement: Your computer needs to be 64-bit and running a 64-bit operating system with at least 250GB of spare hard drive space and 8GB of RAM (or 16GB in a virtual machine).
## 1. Install docker
If you have not already done so, [install docker](https://docs.docker.com/install/)
## 2. Get our docker image
> Please run this step before each build, to be sure to get the last docker image.
```shell
$ sudo docker pull registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community
```
## 3. Create directories
```shell
$ sudo mkdir -p \
/srv/e/src \
/srv/e/zips \
/srv/e/logs \
/srv/e/ccache \
```
## 4. Start build
Run the following command. Don't forget to replace `<my-device>` with your device code !
```shell
$ sudo docker run \
-v "/srv/e/src:/srv/src" \
-v "/srv/e/zips:/srv/zips" \
-v "/srv/e/logs:/srv/logs" \
-v "/srv/e/ccache:/srv/ccache" \
-e "BRANCH_NAME=<tag>" \
-e "DEVICE_LIST=<my-device>" \
-e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community
```
List of tags to use for `BRANCH_NAME` is available at https://gitlab.e.foundation/e/os/releases/-/tags.
The device code can be found on [/e/ devices list](https://doc.e.foundation/devices), [LineageOS wiki](https://wiki.lineageos.org/devices/) or with the following command: `$ adb shell getprop ro.product.device`
> We removed one line: (since these builds are unofficial, there is not OTA server)
```-e "OTA_URL=<ota-server-url>" \```

> We now use git tags in addition to a specific manifest for each release. It let us to know exactly what's inside each build.

> If you want to build a test version, you can use:
> - `BRANCH_NAME` set to v1-nougat, v1-oreo or v1-pie to get the last test build
> - `BRANCH_NAME` set to v1-nougat, v1-oreo or v1-pie & `REPO=https://gitlab.e.foundation/e/os/android.git`


---
Example for Google Pixel
```shell
$ sudo docker run \
-v "/srv/e/src:/srv/src" \
-v "/srv/e/zips:/srv/zips" \
-v "/srv/e/logs:/srv/logs" \
-v "/srv/e/ccache:/srv/ccache" \
-e "BRANCH_NAME=v0.9.0-pie" \
-e "DEVICE_LIST=sailfish" \
-e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community
```
## 5. Get your image!
When your build is finished, please find your images inside `/srv/e/zips/<my-device>` folder. To install, please refer to our [documentation](../../devices).
If you need help, please join us on our [community support Telegram channel](https://t.me/joinchat/Fzzi3kUbP-AcoQz3zYHl5A).
To find more information about our docker image and its environment variables [here](https://gitlab.e.foundation/e/os/docker-lineage-cicd).
To report an issue about a build, please refer to [issues documentation](report-an-issue)

# How to build a ROM for an unsupported device?

>Here, we explain how to build with docker, but there are several ways to do it without docker. See [here](https://community.e.foundation/t/howto-build-e-without-docker-for-non-lineageos-supported-devices/3991) for example

We take as example the HTC 10.
The HTC 10 if officially supported by /e/ but only in nougat version. If we wants to build it for Oreo or Pie, we have to go the unofficial way.
Follow steps 1 to 3 above.
You have to create one more directory as you did in step 3:
```shell
$ sudo mkdir /srv/e/local_manifests
```
You then have to come up with a manifest file for your device.
Example for HTC10 (pme)
```xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote name="zx2c4" fetch="https://git.zx2c4.com/" />
  <project remote="zx2c4" name="android_kernel_wireguard" path="kernel/wireguard" revision="master" sync-s="true" />
  <project name="Fagyi/android_device_htc_pme" path="device/htc/pme" remote="github" revision="lineage-16.0" />
  <project name="Fagyi/android_kernel_htc_msm8996" path="kernel/htc/msm8996" remote="github" revision="lineage-16.0" />
  <project name="Fagyi/proprietary_vendor_htc" path="vendor/htc" remote="github" revision="lineage-16.0" />
  <project name="LineageOS/android_packages_resources_devicesettings" path="packages/resources/devicesettings" remote="github" revision="lineage-16.0" />
</manifest>
```
Save this file in your newly created folder ```/srv/e/local_manifests```.
The name of the file can be whatever you want with the xml extention. For example ```pme.xml```
We can then proceed with the build, but we have to adapt slightly the build command compared to an officially supported device.
> Example for HTC 10
> ```shell
> $ sudo docker run \
> -v "/srv/e/src:/srv/src" \
> -v "/srv/e/zips:/srv/zips" \
> -v "/srv/e/logs:/srv/logs" \
> -v "/srv/e/ccache:/srv/ccache" \
> -v "/srv/e/local_manifests:/srv/local_manifests" \
> -e "BRANCH_NAME=v0.9.0-pie" \
> -e "DEVICE_LIST=pme" \
> -e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
> -e "INCLUDE_PROPRIETARY=false" \
> registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community
> ```
We added the following lines:
```-v "/srv/e/local_manifests:/srv/local_manifests" \```
```-e "INCLUDE_PROPRIETARY=false" \```
And of course we adapted the line to put the name of our device (pme)
```-e "DEVICE_LIST=pme" \```
You can go to step 5 above to get your build if successfull.
close fullscreen
Login or Register to edit or fork this paste. It's free.