Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c80e6ed authored by Romain Hunault's avatar Romain Hunault
Browse files

Merge branch 'lineageos4microg/master'

parents 484cdd8d f1941a5a
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -174,13 +174,13 @@ COPY apt_preferences /etc/apt/preferences
RUN apt-get -qq update
RUN apt-get -qq update
RUN apt-get -qqy upgrade
RUN apt-get -qqy upgrade


RUN apt-get install -y bc bison build-essential ccache cron curl flex \
RUN apt-get install -y bc bison bsdmainutils build-essential ccache cgpt cron \
      g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev \
      curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick \
      lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev \
      lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool \
      libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lsof lzop \
      libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 \
      maven openjdk-7-jdk openjdk-8-jdk pngcrush procps python rsync schedtool \
      libxml2-utils lsof lzop maven openjdk-7-jdk openjdk-8-jdk pngcrush \
      squashfs-tools wget xdelta3 xsltproc yasm zip zlib1g-dev \
      procps python rsync schedtool squashfs-tools wget xdelta3 xsltproc yasm \
      cgpt bsdmainutils
      zip zlib1g-dev


RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo
RUN chmod a+x /usr/local/bin/repo
RUN chmod a+x /usr/local/bin/repo
+90 −44
Original line number Original line Diff line number Diff line
@@ -16,29 +16,34 @@ or a manual set up of a Virtual Machine.
## How do I install Docker?
## How do I install Docker?


The official Docker guides are well-written:
The official Docker guides are well-written:
 * Linux ([Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/), [Debian](https://docs.docker.com/install/linux/docker-ce/debian/), [CentOS](https://docs.docker.com/install/linux/docker-ce/centos/) and [Fedora](https://docs.docker.com/install/linux/docker-ce/fedora/) are officially supported)
 * Linux ([Ubuntu][docker-ubuntu], [Debian][docker-debian],
 * [Windows 10/Windows Server 2016 64bit](https://docs.docker.com/docker-for-windows/install/)
    [CentOS][docker-centos] and [Fedora][docker-fedora] are officially
 * [Mac OS El Capitan 10.11 or newer](https://docs.docker.com/docker-for-mac/install/)
    supported)
 * [Windows 10/Windows Server 2016 64bit][docker-win]
 * [Mac OS El Capitan 10.11 or newer][docker-mac]


If your Windows or Mac system doesn't satisfy the requirements (or if you have
If your Windows or Mac system doesn't satisfy the requirements (or if you have
Oracle VirtualBox installed, you can use [Docker Toolbox](https://docs.docker.com/toolbox/overview/).
Oracle VirtualBox installed, you can use [Docker Toolbox][docker-toolbox].
Docker Toolbox is not described in this guide, but it should be very similar to
Docker Toolbox is not described in this guide, but it should be very similar to
the standard Docker installation.
the standard Docker installation.


Once you can run the [`hello-world` image](https://docs.docker.com/get-started/#test-docker-installation) you're ready to start!
Once you can run the [`hello-world` image][docker-helloworld] you're ready to
start!


## How can I build LineageOS?
## How can I build LineageOS?


This Docker image contains a great number of settings, to allow you to fully
This Docker image contains a great number of settings, to allow you to fully
customize your LineageOS build.
customize your LineageOS build. Here you can find all of them, with the default
values between the brackets.


TL;DR - go to the [Examples](#examples)
TL;DR - go to the [Examples](#examples)


### Fundamental settings
### Fundamental settings


The two fundamental settings are (default value in brackets):
The two fundamental settings are:


 * `BRANCH_NAME (cm-14.1)`: LineageOS branch, see the branch list [here](https://github.com/LineageOS/android_vendor_cm/branches)
 * `BRANCH_NAME (cm-14.1)`: LineageOS branch, see the branch list
    [here][los-branches] (multiple comma-separated branches can be specified)
 * `DEVICE_LIST`: comma-separated list of devices to build
 * `DEVICE_LIST`: comma-separated list of devices to build
 * `REPO (https://github.com/LineageOS/android.git)`: LineageOS repo use for build
 * `REPO (https://github.com/LineageOS/android.git)`: LineageOS repo use for build


@@ -46,11 +51,14 @@ The two fundamental settings are (default value in brackets):
Running a build with only these two set will create a ZIP file almost identical
Running a build with only these two set will create a ZIP file almost identical
to the LineageOS official builds, just signed with the test keys.
to the LineageOS official builds, just signed with the test keys.


When multiple branches are selected, use `DEVICE_LIST_<BRANCH_NAME>` to specify
the list of devices for each specific branch (see [the examples](#examples)).

### Signature spoofing
### Signature spoofing


There are two options for the [signature spoofing patch](https://github.com/microg/android_packages_apps_GmsCore/wiki/Signature-Spoofing)
There are two options for the [signature spoofing patch][signature-spoofing]
required for [microG](https://microg.org/):
required for [microG][microg]:
 * "Original" [patches](https://github.com/lineageos4microg/docker-lineage-cicd/tree/master/src/signature_spoofing_patches)
 * "Original" [patches][signature-spoofing-patches]
 * Restricted patches
 * Restricted patches


With the "original" patch the FAKE_SIGNATURE permission can be granted to any
With the "original" patch the FAKE_SIGNATURE permission can be granted to any
@@ -64,7 +72,8 @@ during the build process.


The signature spoofing patch can be optionally included with:
The signature spoofing patch can be optionally included with:


 * `SIGNATURE_SPOOFING (no)`: `yes` to use the original patch, `restricted` for the restricted one, `no` for none of them
 * `SIGNATURE_SPOOFING (no)`: `yes` to use the original patch, `restricted` for
    the restricted one, `no` for none of them


If in doubt, use `restricted`: note that packages that requires the
If in doubt, use `restricted`: note that packages that requires the
FAKE_SIGNATURE permission must be embedded in the build by adding them in
FAKE_SIGNATURE permission must be embedded in the build by adding them in
@@ -80,9 +89,9 @@ Some proprietary files are needed to create a LineageOS build, but they're not
included in the LineageOS repo for legal reasons. You can obtain these blobs in
included in the LineageOS repo for legal reasons. You can obtain these blobs in
three ways:
three ways:


 * by [pulling them from a running LineageOS](https://wiki.lineageos.org/devices/bacon/build#extract-proprietary-blobs)
 * by [pulling them from a running LineageOS][blobs-pull]
 * by [extracting them from a LineageOS ZIP](https://wiki.lineageos.org/extracting_blobs_from_zips.html)
 * by [extracting them from a LineageOS ZIP][blobs-extract]
 * by downloading them from [TheMuppets repos](https://github.com/TheMuppets/manifests) (unofficial)
 * by downloading them from [TheMuppets repos][blobs-themuppets] (unofficial)


The third way is the easiest one and is enabled by default; if you're OK with
The third way is the easiest one and is enabled by default; if you're OK with
that just move on, otherwise set `INCLUDE_PROPRIETARY (true)` to `false` and
that just move on, otherwise set `INCLUDE_PROPRIETARY (true)` to `false` and
@@ -90,8 +99,8 @@ manually provide the blobs (not explained in this guide).


### OTA
### OTA


If you have a server and you want to enable [OTA updates](https://github.com/julianxhokaxhiu/LineageOTA)
If you have a server and you want to enable [OTA updates][lineageota] you have
you have to provide the URL of your server during the build process with:
to provide the URL of your server during the build process with:


 * `OTA_URL`
 * `OTA_URL`


@@ -101,21 +110,33 @@ updater app (but you can still update it manually with the recovery of course).
### Signing
### Signing


By default, builds are signed with the Android test keys. If you want to sign
By default, builds are signed with the Android test keys. If you want to sign
your builds with your own keys (highly recommended):
your builds with your own keys (**highly recommended**):


 * `SIGN_BUILDS (false)`: set to `true` to sign the builds with the keys contained in `/srv/keys`; if no keys are present, a new set will be generated
 * `SIGN_BUILDS (false)`: set to `true` to sign the builds with the keys
    contained in `/srv/keys`; if no keys are present, a new set will be generated


### Other settings
### Other settings


Other useful settings are:
Other useful settings are:


 * `CCACHE_SIZE (50G)`: change this if you want to give more (or less) space to ccache
 * `CCACHE_SIZE (50G)`: change this if you want to give more (or less) space to
 * `WITH_SU (false)`: set to `true` to embed `su` in the build (note that, even when set to `false`, you can still enable root by flashing the [su installable ZIP](https://download.lineageos.org/extras))
    ccache
 * `WITH_SU (false)`: set to `true` to embed `su` in the build (note that, even
    when set to `false`, you can still enable root by flashing the
    [su installable ZIP][los-extras])
 * `RELEASE_TYPE (UNOFFICIAL)`: change the release type of your builds
 * `RELEASE_TYPE (UNOFFICIAL)`: change the release type of your builds
 * `BUILD_OVERLAY (false)`: normally each build is done on the source tree, then the tree is cleaned with `mka clean`. If you want to be sure that each build is isolated from the others, set `BUILD_OVERLAY` to `true` (longer build time). Requires `--cap-add=SYS_ADMIN`.
 * `BUILD_OVERLAY (false)`: normally each build is done on the source tree, then
 * `LOCAL_MIRROR (false)`: change this to `true` if you want to create a local mirror of the LineageOS source (> 200 GB)
    the tree is cleaned with `mka clean`. If you want to be sure that each build
    is isolated from the others, set `BUILD_OVERLAY` to `true` (longer build
    time). Requires `--cap-add=SYS_ADMIN`.
 * `MIRROR (https://github.com/LineageOS/mirror)`: Repo used for mirror
 * `MIRROR (https://github.com/LineageOS/mirror)`: Repo used for mirror
 * `CRONTAB_TIME (now)`: instead of building immediately and exit, build at the specified time (uses standard cron format)
 * `LOCAL_MIRROR (false)`: change this to `true` if you want to create a local
    mirror of the LineageOS source (> 200 GB)
 * `CRONTAB_TIME (now)`: instead of building immediately and exit, build at the
    specified time (uses standard cron format)

The full list of settings, including the less interesting ones not mentioned in
this guide, can be found in the [Dockerfile][dockerfile].


## Volumes
## Volumes


@@ -143,12 +164,12 @@ When `LOCAL_MIRROR` is `true`:


## Examples
## Examples


### Build for bacon (officially supported), test keys, no patches
### Build for thea (cm-14.1, officially supported), test keys, no patches


```
```
docker run \
docker run \
    -e "BRANCH_NAME=cm-14.1" \
    -e "BRANCH_NAME=cm-14.1" \
    -e "DEVICE_LIST=bacon" \
    -e "DEVICE_LIST=thea" \
    -v "/home/user/lineage:/srv/src" \
    -v "/home/user/lineage:/srv/src" \
    -v "/home/user/zips:/srv/zips" \
    -v "/home/user/zips:/srv/zips" \
    -v "/home/user/logs:/srv/logs" \
    -v "/home/user/logs:/srv/logs" \
@@ -156,7 +177,7 @@ docker run \
    lineageos4microg/docker-lineage-cicd
    lineageos4microg/docker-lineage-cicd
```
```


### Build for dumpling (officially supported), custom keys, restricted signature spoofing with integrated microG and FDroid
### Build for dumpling (lineage-15.1, officially supported), custom keys, restricted signature spoofing with integrated microG and FDroid


```
```
docker run \
docker run \
@@ -175,14 +196,14 @@ docker run \
```
```


If there are already keys in `/home/user/keys` they will be used, otherwise a
If there are already keys in `/home/user/keys` they will be used, otherwise a
new set will be generated before starting the build (and will be user for every
new set will be generated before starting the build (and will be used for every
build).
subsequent build).


The microG and FDroid packages are not present in the LineageOS repositories,
The microG and FDroid packages are not present in the LineageOS repositories,
and must be provided through an XML in the `/home/user/manifests`. [This](https://github.com/lineageos4microg/android_prebuilts_prebuiltapks)
and must be provided through an XML in the `/home/user/manifests`.
repo contains some of the most common packages for these kind of builds: to
[This][prebuiltapks] repo contains some of the most common packages for these
include it create an XML (the name is irrelevant, as long as it ends with
kind of builds: to include it create an XML (the name is irrelevant, as long as
`.xml`) in the `/home/user/manifests` folder with this content:
it ends with `.xml`) in the `/home/user/manifests` folder with this content:


```
```
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
@@ -215,17 +236,17 @@ docker run \


As there is no official support for this device, we first have to include the
As there is no official support for this device, we first have to include the
sources in the source tree through an XML in the `/home/user/manifests` folder;
sources in the source tree through an XML in the `/home/user/manifests` folder;
from [this](https://forum.xda-developers.com/lenovo-a6000/development/rom-lineageos-15-1-t3733747)
from [this][a6000-xda] thread we get the links of:
thread we get the links of:


 * Device tree: [https://github.com/dev-harsh1998/android_device_lenovo_a6000](https://github.com/dev-harsh1998/android_device_lenovo_a6000)
 * Device tree: https://github.com/dev-harsh1998/android_device_lenovo_a6000
 * Common Tree: [https://github.com/dev-harsh1998/android_device_lenovo_msm8916-common](https://github.com/dev-harsh1998/android_device_lenovo_msm8916-common)
 * Common Tree: https://github.com/dev-harsh1998/android_device_lenovo_msm8916-common
 * Kernel: [https://github.com/dev-harsh1998/kernel_lenovo_msm8916](https://github.com/dev-harsh1998/kernel_lenovo_msm8916)
 * Kernel: https://github.com/dev-harsh1998/kernel_lenovo_msm8916
 * Vendor blobs: [https://github.com/dev-harsh1998/proprietary-vendor_lenovo](https://github.com/dev-harsh1998/proprietary-vendor_lenovo)
 * Vendor blobs: https://github.com/dev-harsh1998/proprietary-vendor_lenovo


Then, with the help of lineage.dependencies from the [device tree](https://github.com/dev-harsh1998/android_device_lenovo_a6000/blob/lineage-15.1/lineage.dependencies)
Then, with the help of lineage.dependencies from the
and the [common tree](https://github.com/dev-harsh1998/android_device_lenovo_msm8916-common/blob/lineage-15.1/lineage.dependencies),
[device tree][a6000-device-tree-deps] and the
we create an XML `/home/user/manifests/a6000.xml` with this content:
[common tree][a6000-common-tree-deps] we create an XML
`/home/user/manifests/a6000.xml` with this content:


```
```
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
@@ -249,8 +270,9 @@ example `/home/user/manifests/custom_packages.xml`) with this content:
```
```


We also set `INCLUDE_PROPRIETARY=false`, as the proprietary blobs are already
We also set `INCLUDE_PROPRIETARY=false`, as the proprietary blobs are already
provided by the repo [https://github.com/dev-harsh1998/prorietary_vendor_lenovo](https://github.com/dev-harsh1998/prorietary_vendor_lenovo)
provided by the repo
(so we don't have to include the TheMuppets repo).
https://github.com/dev-harsh1998/prorietary_vendor_lenovo (so we
don't have to include the TheMuppets repo).


Now we can just run the build like it was officially supported:
Now we can just run the build like it was officially supported:


@@ -270,3 +292,27 @@ docker run \
    -v "/home/user/manifests:/srv/local_manifests" \
    -v "/home/user/manifests:/srv/local_manifests" \
    lineageos4microg/docker-lineage-cicd
    lineageos4microg/docker-lineage-cicd
```
```


[docker-ubuntu]: https://docs.docker.com/install/linux/docker-ce/ubuntu/
[docker-debian]: https://docs.docker.com/install/linux/docker-ce/debian/
[docker-centos]: https://docs.docker.com/install/linux/docker-ce/centos/
[docker-fedora]: https://docs.docker.com/install/linux/docker-ce/fedora/
[docker-win]: https://docs.docker.com/docker-for-windows/install/
[docker-mac]: https://docs.docker.com/docker-for-mac/install/
[docker-toolbox]: https://docs.docker.com/toolbox/overview/
[docker-helloworld]: https://docs.docker.com/get-started/#test-docker-installation
[los-branches]: https://github.com/LineageOS/android/branches
[signature-spoofing]: https://github.com/microg/android_packages_apps_GmsCore/wiki/Signature-Spoofing
[microg]: https://microg.org/
[signature-spoofing-patches]: src/signature_spoofing_patches/
[blobs-pull]: https://wiki.lineageos.org/devices/bacon/build#extract-proprietary-blobs
[blobs-extract]: https://wiki.lineageos.org/extracting_blobs_from_zips.html
[blobs-themuppets]: https://github.com/TheMuppets/manifests
[lineageota]: https://github.com/julianxhokaxhiu/LineageOTA
[los-extras]: https://download.lineageos.org/extras
[dockerfile]: Dockerfile
[prebuiltapks]: https://github.com/lineageos4microg/android_prebuilts_prebuiltapks
[a6000-xda]: https://forum.xda-developers.com/lenovo-a6000/development/rom-lineageos-15-1-t3733747
[a6000-device-tree-deps]: https://github.com/dev-harsh1998/android_device_lenovo_a6000/blob/lineage-15.1/lineage.dependencies
[a6000-common-tree-deps]: https://github.com/dev-harsh1998/android_device_lenovo_msm8916-common/blob/lineage-15.1/lineage.dependencies